/* Game specific styles for Reflex Test */

/* Base overrides if needed to match theme */
:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --primary-shadow: #E65100;
    --text-main: #333;
    --bg-card: #FFFFFF;
}

/* Spacing logic for cleaner layout */
.game-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.game-description {
    margin-bottom: 3rem;
    /* Generous space before game area */
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

/* Button Styles - Meeting Guidelines */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s cubic-bezier(0.2, 0, 0.4, 1);
    -webkit-tap-highlight-color: transparent;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    /* > 1.1rem guideline */
    font-weight: bold;
    padding: 1rem 2rem;
    min-width: 200px;
    min-height: 56px;
    /* > 48px guideline */
    border-radius: 50px;
    /* Rounded pill shape */
    box-shadow: 0 4px 0 var(--primary-shadow);
    /* Tactile shadow */
    margin: 1rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.primary-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--primary-shadow);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #666;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-btn:active {
    transform: translateY(2px);
    background-color: #e0e0e0;
}

.controls {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* Content Sections - Card Style */
.instructions,
.seo-content {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    /* Increased inner padding */
    margin-top: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Gentle shadow */
    line-height: 1.8;
    /* Readable line height */
    color: #444;
}

/* Ensure nice gap for footer */
.seo-content {
    margin-bottom: 5rem;
    /* Large gap before footer */
}

.instructions h3,
.seo-content h2,
.seo-content h3 {
    color: var(--primary-color);
    /* Orange accents */
    margin-top: 3rem;
    /* "nice feel" - ample space above */
    margin-bottom: 0.8rem;
    /* "nice feel" - tight space below */
    line-height: 1.4;
}

/* First headers should not have huge top margin inside the card */
.instructions h3:first-child,
.seo-content h2:first-child {
    margin-top: 0.5rem;
}

.instructions ul {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
}

/* Game Area Components */
.game-area {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #eee;
    border-radius: 24px;
    /* More rounded */
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 4px solid #fff;
    /* White border frame */
}

/* States */
.game-area.waiting {
    background-color: #FF5252;
    /* Vivid Red */
}

.game-area.ready {
    background-color: #4CAF50;
    /* Vivid Green */
}

.game-area.too-early {
    background-color: #FF9800;
    /* Orange Warning */
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    /* Slightly more opaque */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #333;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.score-text {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 1rem 0;
    font-feature-settings: "tnum";
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.rank-text {
    font-size: 1.3rem;
    color: #555;
    font-weight: bold;
    margin-bottom: 2rem;
}

/* Message Overlay Text */
#messageText {
    font-size: 3.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 900;
    pointer-events: none;
    letter-spacing: 0.1em;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .game-area {
        height: 60vh;
        border-radius: 16px;
    }

    .overlay h2 {
        font-size: 1.8rem;
    }

    .score-text {
        font-size: 3rem;
    }

    .instructions,
    .seo-content {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .primary-btn {
        width: 80%;
        min-width: unset;
        font-size: 1.1rem;
    }
}