/* Split Second Game Styles */

:root {
    /* Game state colors */
    --color-idle: #FFD93D;
    --color-playing: #45B7D1;
    --color-result: #FFD93D;

    /* Text colors */
    --color-text: #333;
    --color-text-light: rgba(0, 0, 0, 0.6);

    /* Feedback colors */
    --color-success: #4CAF50;
    --color-error: #FF6B6B;

    /* Typography */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: var(--color-idle);
    color: var(--color-text);
}

.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.content {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
    width: 100%;
    max-width: 500px;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.controls-inline {
    margin-bottom: 1rem;
}

.control-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

.instruction {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--color-text-light);
}

.timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.timer-fill {
    display: block;
    height: 100%;
    background: var(--color-success);
    width: 100%;
    transition: width 0.1s linear;
}

.timer-fill.warning {
    background: #F39C12;
}

.timer-fill.danger {
    background: var(--color-error);
}

.prompt {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
    min-height: 2em;
}

.choices {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.choice {
    flex: 1;
    max-width: 150px;
    aspect-ratio: 1;
    font-size: 3rem;
    border: none;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice:active {
    transform: scale(0.95);
}

.choice.correct {
    background: var(--color-success);
    color: white;
}

.choice.incorrect {
    background: var(--color-error);
    color: white;
}

.feedback {
    font-size: 1.25rem;
    min-height: 1.5rem;
    margin: 0.5rem 0;
}

.score {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.best-score {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.hint {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-top: 1rem;
}

.home-link {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    transition: background 0.2s;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* State: Idle */
.state-idle .timer-bar,
.state-idle .prompt,
.state-idle .choices,
.state-idle .feedback,
.state-idle .score,
.state-idle .share-container {
    display: none;
}

/* State: Playing */
.state-playing {
    background-color: var(--color-playing);
}

.state-playing .controls-inline,
.state-playing .instruction,
.state-playing .score,
.state-playing .best-score,
.state-playing .hint,
.state-playing .share-container {
    display: none;
}

.state-playing .title {
    color: white;
    font-size: 1.5rem;
}

.state-playing .prompt {
    color: white;
}

/* State: Result */
.state-result {
    background-color: var(--color-result);
}

.state-result .controls-inline,
.state-result .timer-bar,
.state-result .prompt,
.state-result .choices {
    display: none;
}

.state-result.new-best .title {
    color: #E6A700;
    animation: celebrate 0.6s ease-out;
}

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

/* Responsive */
@media (max-width: 600px) {
    .title {
        font-size: 1.75rem;
    }

    .choice {
        font-size: 2.5rem;
        max-width: 120px;
    }

    .prompt {
        font-size: 1.25rem;
    }
}
