﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.game-title {
    color: white;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.stats-display {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-label {
    display: block;
    color: #ff6b6b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.stat-value {
    display: block;
    color: #c92a2a;
    font-size: 2rem;
    font-weight: 700;
}

.reaction-area {
    width: 100%;
    max-width: 500px;
    height: 350px;
    margin: 0 auto 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.reaction-area.waiting {
    background: #4dabf7;
}

.reaction-area.ready {
    background: #ff6b6b;
}

.reaction-area.go {
    background: #51cf66;
}

.reaction-area.too-soon {
    background: #fab005;
}

.message {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

.result {
    color: white;
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.attempts {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    color: #ff8787;
    font-size: 3rem;
    margin-bottom: 2rem;
}

.overlay p {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.game-btn {
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    margin-top: 1rem;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.instructions {
    color: white;
    font-size: 1rem;
    opacity: 0.9;
}

.instructions p {
    margin: 0.5rem 0;
}

@media (max-width: 600px) {
    .game-title {
        font-size: 2.2rem;
    }

    .reaction-area {
        height: 280px;
    }

    .message {
        font-size: 2rem;
    }

    .result {
        font-size: 3rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE ADDITIONS
   ======================================== */

/* ========================================
   Universal Responsive Game Styles
   Add this to all game style.css files
   ======================================== */

/* Canvas Auto-Resize */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    /* Maintains square aspect ratio */
}

#game-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border-radius: 15px;
    touch-action: none;
    /* Prevents scrolling while playing */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .canvas-container {
        max-width: 100%;
        padding: 0 !important;
    }

    .game-title {
        font-size: 1.8rem !important;
        text-align: center;
    }

    .score-display {
        flex-wrap: wrap;
        gap: 0.5rem !important;
        justify-content: center;
    }

    .score-item {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.9rem;
    }

    .score-value {
        font-size: 1.5rem !important;
    }

    /* Make social buttons stack vertically on mobile */
    .social-section {
        margin-top: 1rem;
    }

    .social-buttons {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .social-btn {
        width: 100% !important;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px !important;
    }

    .game-container {
        padding: 1rem 0.5rem !important;
        gap: 1rem;
    }

    .game-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .score-display {
        gap: 0.4rem !important;
        margin-bottom: 1rem !important;
        flex-direction: column;
        align-items: stretch;
    }

    .score-item {
        padding: 0.6rem 1rem !important;
        flex: 1;
        min-width: auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .score-label {
        font-size: 0.75rem !important;
    }

    .score-value {
        font-size: 1.3rem !important;
    }

    .canvas-container {
        padding: 0 !important;
        border-radius: 12px !important;
        margin: 0 auto;
    }

    .instructions {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
        text-align: center;
    }

    .overlay {
        padding: 1.5rem !important;
    }

    .overlay h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .overlay p {
        font-size: 0.9rem !important;
        margin: 0.5rem 0 !important;
    }

    .game-btn {
        padding: 0.8rem 2rem !important;
        font-size: 1rem !important;
        width: 100%;
        max-width: 200px;
    }

    /* Mobile hint for touch controls */
    .canvas-container::after {
        content: "ðŸ’¡ Swipe to move";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 0.5rem;
        font-style: italic;
    }
}

/* Touch Controls Enhancement */
@media (hover: none) and (pointer: coarse) {

    /* Touch device detected */
    .game-btn {
        min-height: 44px;
        min-width: 120px;
    }

    button,
    .social-btn {
        min-height: 44px;
        padding: 0.7rem 1.2rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .game-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr auto;
        gap: 0.5rem;
        max-width: 100%;
    }

    .game-title {
        grid-column: 1 / -1;
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem !important;
    }

    .score-display {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem !important;
    }

    .canvas-container {
        grid-column: 1;
        grid-row: 3;
        max-width: 400px;
        justify-self: center;
    }

    .instructions {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 0.5rem;
    }

    .social-section {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
    }
}