/* GAME SELECTOR: 85px margins, 38px gaps, 65px top */
#game-selector {
    padding: 65px 85px 2rem 85px;
    height: 840px;
    position: relative;
}

/* Background animated shapes */
#game-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(245, 161, 66, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(52, 152, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 70%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(46, 204, 113, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(231, 76, 60, 0.15) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -10px); }
    50% { transform: translate(-10px, 15px); }
    75% { transform: translate(15px, 10px); }
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(3, 250px);
    gap: 38px;
    position: relative;
    z-index: 1;
}

.game-card {
    width: 250px;
    height: 650px;
    border-radius: 12px;
    border: 2px solid;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-blue {
    background: #d4ebf2;
    border-color: #b0d4e1;
}

.card-yellow {
    background: #fef9d4;
    border-color: #e8dda0;
}

.card-green {
    background: #dff2e1;
    border-color: #b8d9bb;
}

.game-card h3 {
    color: #4aabcc;
    font-size: 1.8rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.game-card p {
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    min-height: 72px;
}

.game-instructions {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 1rem;
    margin: 0 0 auto 0;
    text-align: left;
    width: 100%;
}

.game-instructions h4 {
    color: #4aabcc;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.game-instructions ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.game-instructions li {
    color: #333;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.3rem;
}

.game-instructions li::marker {
    color: #4aabcc;
}

.preview-circles {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.preview-circle {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    animation: colorCycle 3s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.preview-circle:nth-child(1) {
    animation-delay: 0s;
}

.preview-circle:nth-child(2) {
    animation-delay: 1s;
}

.preview-circle:nth-child(3) {
    animation-delay: 2s;
}

@keyframes colorCycle {
    0% { background: #f5a142; transform: scale(1); }
    14% { background: #e74c3c; transform: scale(1.1); }
    28% { background: #2ecc71; transform: scale(1); }
    42% { background: #3498db; transform: scale(1.1); }
    57% { background: #9b59b6; transform: scale(1); }
    71% { background: #e91e63; transform: scale(1.1); }
    85% { background: #f1c40f; transform: scale(1); }
    100% { background: #f5a142; transform: scale(1.1); }
}

.preview-rectangles {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    height: 60px;
}

.preview-rect {
    width: 35px;
    height: 50px;
    border-radius: 4px;
    animation: rectMove 2s ease-in-out infinite, colorCycleRect 3s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.preview-rect:nth-child(1) {
    animation-delay: 0s;
}

.preview-rect:nth-child(2) {
    animation-delay: 1s;
}

@keyframes rectMove {
    0%, 100% { transform: translateY(-10px); }
    50% { transform: translateY(10px); }
}

@keyframes colorCycleRect {
    0% { background: #f5a142; }
    14% { background: #e74c3c; }
    28% { background: #2ecc71; }
    42% { background: #3498db; }
    57% { background: #9b59b6; }
    71% { background: #e91e63; }
    85% { background: #f1c40f; }
    100% { background: #f5a142; }
}

.preview-shapes {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    height: 60px;
}

.preview-shape {
    width: 30px;
    height: 30px;
    animation: colorCycleShape 3s ease-in-out infinite, shapeFloat 2s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.preview-shape:nth-child(1) {
    animation-delay: 0s;
}

.preview-shape:nth-child(2) {
    animation-delay: 1s;
}

.preview-shape:nth-child(3) {
    animation-delay: 2s;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #f5a142;
    background: transparent !important;
}

.shape-circle {
    border-radius: 50%;
}

.shape-square {
    border-radius: 3px;
}

@keyframes colorCycleShape {
    0% { background: #f5a142; }
    14% { background: #e74c3c; }
    28% { background: #2ecc71; }
    42% { background: #3498db; }
    57% { background: #9b59b6; }
    71% { background: #e91e63; }
    85% { background: #f1c40f; }
    100% { background: #f5a142; }
}

@keyframes shapeFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.start-btn {
    background: #d04350;
    color: white;
    border: none;
    padding: 12px 50px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
}

.start-btn:hover:not(:disabled) {
    background: #b83844;
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* GAME SCREEN: fills the content area without fixed height */
#game-screen {
    width: 1000px;
    background: #f8f9fa;
    position: relative;
    min-height: 600px;
}

/* GAME OVERLAY: positioned absolutely over the game area */
#game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#game-overlay > * {
    pointer-events: auto;
}

/* Progress Bar: FIXED position at exact pixels from top */
.progress-bar {
    position: fixed;
    top: 980px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Instructions: FIXED position at exact pixels from top */
.instructions {
    position: fixed;
    top: 960px;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    font-size: 1rem;
    animation: fadeOut 6s forwards;
    white-space: nowrap;
}

.disk-grid {
    position: absolute;
    top: 60px;
    left: 180px;
    display: grid;
    grid-template-columns: repeat(3, 180px);
    grid-template-rows: repeat(3, 180px);
    gap: 50px;
}

/* Game TWO: Lanes Grid */
.lanes-grid {
    position: absolute;
    top: 60px;
    left: 50px;
    display: flex;
    gap: 40px;
    width: 900px;
    height: 600px;
    pointer-events: none; /* Allow clicks to pass through to rectangles */
}

.lane {
    flex: 1;
    background: transparent;
    position: relative;
    pointer-events: none;
}

.moving-rect {
    position: absolute;
    width: 100px;
    height: 80px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
    cursor: grab;
    user-select: none;
    pointer-events: auto; /* Rectangles are clickable */
}

.moving-rect.dragging {
    cursor: grabbing;
    z-index: 100;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
}

.moving-rect.flash-success {
    animation: successFlash 0.2s;
}

.moving-rect.clicked-flash {
    animation: clickedFlash 0.2s;
}

.moving-rect.collision-shake {
    animation: collisionShake 0.5s;
}

.moving-rect.rescue-success {
    animation: rescueSuccess 0.3s;
}

.moving-rect.matched {
    opacity: 0.5;
    pointer-events: none;
}

.moving-rect.match-celebrate {
    animation: matchCelebrate 0.5s ease-out;
}

@keyframes matchCelebrate {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); box-shadow: 0 0 30px rgba(46, 204, 113, 1); }
    100% { transform: scale(0.5); opacity: 0; }
}

/* Match celebration enhancements */
.match-popup {
    font-size: 3rem;
    font-weight: 900;
    color: #2ecc71;
    text-shadow: 
        0 0 10px rgba(46, 204, 113, 0.8),
        0 0 20px rgba(46, 204, 113, 0.6),
        0 0 30px rgba(46, 204, 113, 0.4);
    animation: matchPopup 0.8s ease-out;
    pointer-events: none;
    z-index: 200;
}

@keyframes matchPopup {
    0% { 
        transform: scale(0.5) translateY(0);
        opacity: 0;
    }
    30% { 
        transform: scale(1.5) translateY(-20px);
        opacity: 1;
    }
    70% {
        transform: scale(1.3) translateY(-30px);
        opacity: 1;
    }
    100% { 
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
}

.match-flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.4) 0%, transparent 70%);
    animation: matchFlash 0.3s ease-out;
    pointer-events: none;
    z-index: 150;
}

@keyframes matchFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== MOBILE RESPONSIVE ===== */

/* Tablets and smaller */
@media (max-width: 1024px) {
    #brain-games-app {
        width: 100%;
        height: auto;
        min-height: 100vh;
    }
    
    #game-selector {
        padding: 40px 20px;
        height: auto;
    }
    
    .game-cards {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .game-card {
        width: 100%;
        max-width: 400px;
        height: auto;
        min-height: 600px;
    }
    
    /* Fix progress bar for tablet */
    #game-overlay {
        transform: scale(0.85);
        transform-origin: bottom center;
    }
    
    .progress-bar {
        position: fixed !important;
        bottom: 20px !important;
        top: auto !important;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .instructions {
        position: fixed !important;
        bottom: 60px !important;
        top: auto !important;
    }
    
    #game-screen {
        width: 100% !important;
        height: auto;
        min-height: calc(100vh - 60px);
    }
}

/* Mobile phones */
@media (max-width: 580px) {
    .tabs {
        height: 50px;
    }
    
    .tab {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }
    
    #game-selector {
        padding: 30px 15px;
    }
    
    .game-cards {
        gap: 25px;
    }
    
    .game-card {
        min-height: 550px;
        padding: 1.5rem 1rem;
    }
    
    .game-card h3 {
        font-size: 1.5rem;
    }
    
    .game-card p {
        font-size: 0.9rem;
        min-height: 60px;
    }
    
    .game-instructions h4 {
        font-size: 0.9rem;
    }
    
    .game-instructions li {
        font-size: 0.8rem;
    }
    
    .start-btn {
        font-size: 1.1rem;
        padding: 10px 40px;
    }
    
    /* Game screen adjustments */
    #game-screen {
        width: 100%;
        height: auto;
        min-height: calc(100vh - 50px);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Game ONE - circles */
    .disk-grid {
        position: absolute;
        left: 50%;
        top: 30px;
        transform: translateX(-50%) scale(0.5);
        transform-origin: top center;
    }
    
    /* Game TWO - lanes */
    .lanes-grid {
        position: absolute;
        left: 50%;
        top: 30px;
        transform: translateX(-50%) scale(0.45);
        transform-origin: top center;
        width: 900px;
    }
    
    /* Progress bar mobile */
    #game-overlay {
        transform: scale(0.7);
        transform-origin: bottom center;
    }
    
    .progress-bar {
        position: fixed !important;
        bottom: 15px !important;
        top: auto !important;
        left: 50%;
        transform: translateX(-50%);
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 15px;
        justify-content: center;
    }
    
    .instructions {
        position: fixed !important;
        bottom: 55px !important;
        top: auto !important;
        font-size: 0.9rem;
        text-align: center;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .pie-timer {
        width: 35px;
        height: 35px;
    }
    
    /* Overlays mobile */
    #difficulty-overlay,
    #countdown-overlay {
        width: 85%;
        max-width: 350px;
        height: auto;
        min-height: 350px;
        padding: 2rem 1.5rem;
    }
    
    .difficulty-content h3 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .difficulty-btn {
        font-size: 1.2rem;
        padding: 1.2rem 2rem;
        margin: 1rem 0;
    }
    
    .countdown-number {
        font-size: 6rem;
    }
    
    #results-overlay {
        width: 90%;
        max-width: 400px;
        height: auto;
        padding: 1.5rem;
    }
    
    .results-content h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .stat-row {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .brain-rating {
        font-size: 1rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .brain-rating strong {
        font-size: 1.8rem;
    }
    
    .learn-more {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .results-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .play-again-btn,
    .back-btn {
        max-width: 100%;
        width: 100%;
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

@keyframes successFlash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

@keyframes clickedFlash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(74, 171, 204, 0.8); }
}

@keyframes collisionShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-5px) rotate(-3deg); }
    20% { transform: translateX(5px) rotate(3deg); }
    30% { transform: translateX(-5px) rotate(-3deg); }
    40% { transform: translateX(5px) rotate(3deg); }
    50% { transform: translateX(-3px) rotate(-2deg); }
    60% { transform: translateX(3px) rotate(2deg); }
    70% { transform: translateX(-2px) rotate(-1deg); }
    80% { transform: translateX(2px) rotate(1deg); }
    90% { transform: translateX(-1px) rotate(-0.5deg); }
}

@keyframes rescueSuccess {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(46, 204, 113, 0.8); }
}

.disk {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s;
    position: relative;
}

.disk:active {
    transform: scale(0.95);
}

/* Flash overlay - white circle in centre */
.flash-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 60%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    animation: flashPulse 1s ease-in-out;
    z-index: 2;
}

@keyframes flashPulse {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Quiver animation - subtle movement clue */
.disk.quiver {
    animation: quiverBreath 0.3s ease-in-out;
}

@keyframes quiverBreath {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(-2deg);
    }
    50% {
        transform: scale(1.08) rotate(2deg);
    }
    75% {
        transform: scale(1.05) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Progress dots */
.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ddd;
    border: 2px solid #ccc;
    transition: all 0.2s;
}

.dot.hit {
    background: #2ecc71;
    border-color: #27ae60;
}

.dot.miss {
    background: #e74c3c;
    border-color: #c0392b;
}

.pie-timer {
    width: 50px;
    height: 50px;
    margin-left: 12px;
}

/* Countdown Overlay - Zen-like soft white, 500x500px */
#countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.countdown-number {
    color: #666;
    font-size: 10rem;
    font-weight: 700;
}

.countdown-number.breathe {
    animation: countdownBreathe 1s ease-in-out;
}

/* Difficulty Selection Overlay - Zen-like soft white, 500x500px */
#difficulty-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.difficulty-content {
    text-align: center;
    padding: 2rem;
}

.difficulty-content h3 {
    color: #666;
    font-size: 2rem;
    margin-bottom: 3rem;
    font-weight: 600;
}

.difficulty-btn {
    display: block;
    width: 100%;
    margin: 1.5rem 0;
    padding: 1.5rem 3rem;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: white !important;
}

.average-btn {
    background: #4aabcc;
    color: white !important;
}

.average-btn:hover {
    background: #3a93ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 171, 204, 0.3);
}

.superior-btn {
    background: #d04350;
    color: white !important;
}

.superior-btn:hover {
    background: #b83844;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(208, 67, 80, 0.3);
}

@keyframes countdownBreathe {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Results Overlay - Zen-like soft white, 600x600px to prevent overflow */
#results-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 750px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px;
    padding: 2.5rem 3rem;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.5s;
    color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.results-content {
    text-align: center;
}

.results-content h2 {
    margin: 0 0 0.8rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.results-line {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 0.8rem;
}

.results-stats {
    margin-bottom: 1.2rem;
    text-align: left;
}

.stat-row {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
    color: #555;
    line-height: 1.2;
}

.stat-row.total-row {
    font-size: 1.5rem;
    color: #34a853;
    margin-top: 0.2rem;
    margin-bottom: 0.4rem;
    padding-top: 0.2rem;
}

.stat-row.total-row strong {
    color: #34a853;
    font-size: 1.8rem;
}

.stat-row.score-row {
    font-size: 1.6rem;
    color: #1a73e8;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.stat-row.score-row strong {
    color: #1a73e8;
    font-size: 2rem;
}

.stat-row strong {
    color: #333;
    font-weight: 700;
}

.misses-text {
    color: #777;
    font-size: 1.1rem;
}

.brain-rating {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    padding: 1rem 1.5rem;
    background: rgba(74, 171, 204, 0.15);
    border-radius: 8px;
    color: #555;
    line-height: 1.3;
}

.brain-rating strong {
    color: #4aabcc;
    font-size: 2.5rem;
    display: block;
    margin-top: 0.3rem;
}

.learn-more {
    display: inline-block;
    color: #4aabcc;
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    transition: color 0.2s;
    line-height: 1.3;
}

.learn-more:hover {
    color: #5bbfe0;
    text-decoration: underline;
}

.results-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.play-again-btn,
.back-btn {
    background: #d04350;
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex: 1;
    max-width: 200px;
}

.play-again-btn:hover,
.back-btn:hover {
    background: #b83844;
}

.back-btn {
    background: #666;
}

.back-btn:hover {
    background: #555;
}

@keyframes fadeOut {
    0%, 90% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==========================================
   GAME THREE: Quick Colour and Shape
   ========================================== */

/* Large display shape at top */
.shape-display-container {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    background: #f8f9fa;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.shape-display {
    transition: background 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.shape-display.shape-triangle {
    width: 0;
    height: 0;
    border-left: 90px solid transparent;
    border-right: 90px solid transparent;
    border-bottom: 160px solid;
    background: transparent !important;
}

.shape-display.shape-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
}

.shape-display.shape-square {
    width: 180px;
    height: 180px;
    border-radius: 12px;
}

/* Scrolling shapes container - TWO ROWS */
/* ADD THIS TO THE END OF play.css */
/* ==========================================
   GAME THREE: Quick Colour and Shape (Updated)
   ========================================== */

/* Large display shape at top */
.shape-display-container {
    position: absolute;
    top: 25px;  /* Moved up another 25px from 50px */
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    background: #f8f9fa;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.shape-display {
    transition: background 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.shape-display.shape-triangle {
    width: 0;
    height: 0;
    border-left: 90px solid transparent;
    border-right: 90px solid transparent;
    border-bottom: 160px solid;
    background: transparent !important;
}

.shape-display.shape-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
}

.shape-display.shape-square {
    width: 180px;
    height: 180px;
    border-radius: 12px;
}

/* Scrolling shapes container - TWO ROWS */
.shape-options-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 200px;
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    overflow: visible !important;
    padding: 10px 0;
    z-index: 10;
}

.shape-row {
    position: relative;
    width: 100%;
    height: 85px;
    overflow: hidden;
}

.shape-row-top {
    background: rgba(66, 133, 244, 0.03);
}

.shape-row-bottom {
    background: rgba(234, 67, 53, 0.03);
}

.shape-options-track {
    position: absolute;
    display: flex;
    gap: 30px;
    align-items: center;
    height: 100%;
    will-change: transform;
    left: 0;
}

.shape-option {
    width: 80px;
    height: 80px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.shape-option:hover {
    transform: scale(1.15);
    border-color: #4285f4;
    box-shadow: 0 4px 14px rgba(66, 133, 244, 0.2);
}

.shape-option:active {
    transform: scale(0.95);
}

.shape-option-inner {
    transition: none;
    pointer-events: none; /* Allow clicks to pass through to parent .shape-option */
}

.shape-option-inner.shape-triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid;
    background: transparent !important;
}

.shape-option-inner.shape-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.shape-option-inner.shape-square {
    width: 45px;
    height: 45px;
    border-radius: 4px;
}

/* Feedback animations */
.shape-option.correct-flash {
    animation: correctPulse 0.4s ease;
}

.shape-option.incorrect-shake {
    animation: incorrectShake 0.4s ease;
}

@keyframes correctPulse {
    0% {
        border-color: #e0e0e0;
        background: #f8f9fa;
    }
    50% {
        border-color: #34a853;
        background: rgba(52, 168, 83, 0.15);
        transform: scale(1.2);
    }
    100% {
        border-color: #e0e0e0;
        background: #f8f9fa;
        transform: scale(1);
    }
}

@keyframes incorrectShake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-8px);
        border-color: #ea4335;
    }
    40%, 80% {
        transform: translateX(8px);
        border-color: #ea4335;
    }
}

/* Floating points animation */
@keyframes floatUp {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
    }
}

/* Instructions for Game THREE */
#scoreboard-three {
    position: absolute;
    top: 580px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.score-label {
    color: #5f6368;
    font-weight: 500;
}

.score-value {
    color: #1a73e8;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.score-separator {
    color: #dadce0;
    font-weight: 300;
    margin: 0 4px;
}

.total-label {
    color: #202124;
    font-weight: 700;
    margin-left: 4px;
}

.total-value {
    color: #34a853;
    font-size: 1.3rem;
    font-weight: 900;
}

/* Fade out animation for instructions */
@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
