/* =====================================================
   Rate My Crème Brûlée — Game Stylesheet
   ===================================================== */

/* WIP banner */
.wip-banner {
    background: repeating-linear-gradient(
        -45deg,
        #1a0a00,
        #1a0a00 10px,
        #C27A2B 10px,
        #C27A2B 20px
    );
    color: #fff;
    text-align: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Page layout */
body.game-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.game-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
}

.game-container {
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Instructions */
.game-instructions {
    text-align: center;
}

.game-instructions h2 {
    font-family: var(--font-head);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.game-instructions p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Canvas wrapper */
.game-canvas-wrap {
    position: relative;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px var(--shadow-hover);
    overflow: hidden;
    background: #D4B896;
    cursor: none;
    touch-action: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: none;
}

/* Flame cursor */
.flame-cursor {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    user-select: none;
    transform-origin: center bottom;
    animation: flame-pulse 0.38s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.1s;
    will-change: transform, left, top;
    line-height: 1;
}

.flame-cursor.active {
    opacity: 1;
}

@keyframes flame-pulse {
    0%, 100% { transform: scale(1)   rotate(-6deg); }
    50%       { transform: scale(1.2) rotate(6deg);  }
}

/* HUD */
.game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 1rem;
}

.hud-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.1rem;
}

.hud-value {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 600;
    line-height: 1;
}

.game-timer.timer-urgent .hud-value {
    color: #c0392b;
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.game-status {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    flex: 1;
    text-align: right;
}

/* Submit button */
.game-submit-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-style: italic;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.game-submit-btn:hover:not(:disabled) {
    background: #B8621F;
    transform: translateY(-2px);
}

.game-submit-btn:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.game-submit-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Result overlay */
.game-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 12, 3, 0.72);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-result-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.game-result-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 64px rgba(28, 12, 3, 0.45);
    max-width: 420px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.result-heading {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.result-score {
    font-family: var(--font-head);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    margin: 0;
}

.result-message {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.7;
    font-style: italic;
    margin: 0;
}

.result-breakdown {
    display: flex;
    justify-content: space-around;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
}

.result-breakdown span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.result-breakdown strong {
    font-size: 1.1rem;
    color: var(--text);
    font-family: var(--font-head);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0.25rem;
}

.result-actions .history-btn {
    display: flex;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 480px) {
    .game-main {
        padding: 1rem 0.75rem 2rem;
    }

    .game-instructions h2 {
        font-size: 1.4rem;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .result-score {
        font-size: 2.75rem;
    }
}
