* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.header h2 {
    font-size: 1.2em;
    color: #6c757d;
    font-weight: normal;
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: #495057;
    font-size: 1.1em;
    line-height: 1.6;
}

.challenge-selection h3 {
    text-align: center;
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.challenge-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1em;
}

.challenge-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.challenge-card h4 {
    color: #495057;
    font-size: 1.2em;
    margin-bottom: 8px;
}

.challenge-card p {
    color: #6c757d;
    font-size: 1em;
}

/* Game Page Styles */
.game-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.game-header h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: 600;
    color: #6c757d;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.combo-stat {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

.combo-icon {
    font-size: 1.2em;
}

.combo-label {
    font-size: 0.9em;
    opacity: 0.9;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

.current-idea-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.current-idea-section h3 {
    color: #495057;
    margin-bottom: 15px;
}

.idea-display {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.idea-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.idea-type-badge.human {
    background: #d1ecf1;
    color: #0c5460;
}

.idea-type-badge.ai {
    background: #d4edda;
    color: #155724;
}

.idea-text {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 10px;
}

.build-on-hint {
    background: #e7f3ff;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.95em;
}

.no-idea-hint {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Evolution Timeline */
.evolution-timeline {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-header h4 {
    color: #495057;
    font-size: 1.2em;
    margin: 0;
}

.progress-ring-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 4;
}

.progress-ring-circle {
    fill: none;
    stroke: #667eea;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
    font-weight: bold;
    color: #667eea;
}

.timeline-track {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    padding: 15px 0;
    scrollbar-width: thin;
}

.timeline-track::-webkit-scrollbar {
    height: 6px;
}

.timeline-track::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.timeline-node {
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.node-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin: 0 auto 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.node-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.node-icon.human {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.node-icon.ai {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.node-label {
    font-size: 0.75em;
    color: #6c757d;
    font-weight: 600;
}

.timeline-arrow {
    color: #667eea;
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 5px;
    animation: slide 1s ease-in-out infinite;
}

@keyframes slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Achievements */
.achievements-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.achievements-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.achievement {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement.unlocked {
    border-color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    animation: unlock 0.5s ease;
}

@keyframes unlock {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.achievement-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 0.75em;
    color: #6c757d;
}

/* Combo Notification */
.combo-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.combo-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.combo-notification-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    gap: 20px;
    animation: comboPulse 0.5s ease;
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.combo-icon-large {
    font-size: 3em;
    animation: rotate 1s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.combo-text {
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.combo-bonus {
    font-size: 1.2em;
    opacity: 0.9;
    margin-top: 5px;
}

.idea-category {
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.action-prompt {
    text-align: center;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.action-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-main {
    background: #3b82f6;
    color: white;
}

.btn-main:hover:not(:disabled) {
    background: #2563eb;
}

.btn-ai {
    background: #10b981;
    color: white;
}

.btn-ai:hover:not(:disabled) {
    background: #059669;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-summary {
    background: #8b5cf6;
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

.btn-summary:hover:not(:disabled) {
    background: #7c3aed;
}

.idea-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.idea-panel h3 {
    color: #495057;
    margin-bottom: 15px;
}

.panel-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

/* Reward Widget */
.reward-widget {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.reward-widget-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
}

.reward-widget-content h3 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 30px;
}

.reward-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.reward-label {
    color: #6c757d;
    font-weight: 600;
    font-size: 1.1em;
}

.reward-value {
    font-size: 1.5em;
    font-weight: bold;
}

.reward-value.positive {
    color: #10b981;
}

.reward-value.negative {
    color: #ef4444;
}

.reward-value:not(.positive):not(.negative) {
    color: #667eea;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cost-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.cost-buttons button {
    padding: 20px;
    text-align: center;
}

.cost-buttons button small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    opacity: 0.9;
}

.notification {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    display: none;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.end-game-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* Summary Page Styles */
.summary-section {
    margin-bottom: 40px;
}

.summary-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-stat {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.summary-stat .stat-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-stat .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.score-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
}

.score-section h2 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.score-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #dee2e6;
}

.score-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.score-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.score-max {
    color: #adb5bd;
    font-size: 0.9em;
}

.total-score {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border: 3px solid #667eea;
    margin-bottom: 20px;
}

.total-score-label {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-score-value {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
}

.total-score-max {
    color: #adb5bd;
    font-size: 1.2em;
}

.rank-display {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.rank-label {
    color: #6c757d;
    font-size: 1em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rank-value {
    font-size: 2em;
    font-weight: bold;
    color: #8b5cf6;
}

.ideas-list-section {
    margin-bottom: 40px;
}

.ideas-list-section h2 {
    color: #495057;
    margin-bottom: 20px;
}

#ideas-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.idea-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.idea-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.idea-category-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.perspective-icon {
    font-size: 1.2em;
}

.idea-item-text {
    color: #495057;
    line-height: 1.6;
    margin-top: 10px;
}

.play-again-section {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    .cost-buttons {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .summary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-grid {
        grid-template-columns: 1fr;
    }
}

