/* Two Truths, One Model — FunSlop.com
   Spot the confident hallucination among three statements. Tap the lie. */

:root {
    --bg-dark: #090b10;
    --neon-green: #39ff14;
    --neon-purple: #bd00ff;
    --cyan: #05d9e8;
    --pink: #ff2a6d;
    --gold: #ffd54a;
    --text-primary: #f0f4f8;
    --text-muted: #8b9bb4;
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
}

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

html, body {
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Ambient neon glow, matching FunSlop's house style */
.glow-bg {
    position: fixed;
    top: -80px;
    right: -80px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    opacity: 0.13;
    z-index: -1;
    filter: blur(60px);
    pointer-events: none;
    animation: float 13s infinite alternate;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-120px, 80px); }
}

.game-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    user-select: none;
    -webkit-user-select: none;
}

.content {
    text-align: center;
    padding: 2.25rem 1.1rem 6rem;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.title {
    font-family: var(--font-display);
    font-size: 2.15rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--pink), var(--cyan), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- HUD row --- */
.hud {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    min-height: 1.6rem;
}

.hud-item {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    letter-spacing: 0.3px;
}

.hud-item.score { color: var(--cyan); }
.hud-item.round { color: var(--text-muted); }

.hud-item.lives {
    letter-spacing: 2px;
    padding: 0.3rem 0.7rem;
}

.life {
    color: var(--pink);
    text-shadow: 0 0 8px rgba(255, 42, 109, 0.6);
    transition: color 0.3s, transform 0.3s, opacity 0.3s;
    display: inline-block;
}

.life.lost {
    color: rgba(255, 255, 255, 0.12);
    text-shadow: none;
    transform: scale(0.8);
    opacity: 0.6;
}

/* Hide the HUD details until a run is active */
.state-idle .hud-item.score,
.state-idle .hud-item.round,
.state-idle .hud-item.lives { display: none; }

/* --- Timer bar --- */
.timer-wrap {
    width: 100%;
    max-width: 520px;
    height: 8px;
    margin: 0 auto 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.timer-fill {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    background: linear-gradient(90deg, var(--neon-green), var(--cyan));
    box-shadow: 0 0 12px rgba(5, 217, 232, 0.5);
    transition: background 0.3s;
}

.timer-wrap.low .timer-fill {
    background: linear-gradient(90deg, var(--gold), var(--pink));
    box-shadow: 0 0 14px rgba(255, 42, 109, 0.6);
    animation: pulse-low 0.6s infinite alternate;
}

@keyframes pulse-low {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.state-idle .timer-wrap,
.state-gameover .timer-wrap { opacity: 0.25; }

/* --- Combo + prompt copy --- */
.combo {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    min-height: 1.3em;
    margin-bottom: 0.15rem;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.combo.active {
    opacity: 1;
    text-shadow: 0 0 12px rgba(255, 213, 74, 0.5);
    animation: combo-pop 0.25s ease-out;
}

@keyframes combo-pop {
    0% { transform: scale(0.7); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.prompt {
    font-size: 1.08rem;
    line-height: 1.45;
    color: var(--text-primary);
    margin: 0 auto 1.1rem;
    max-width: 560px;
    min-height: 2.6em;
}

.state-gameover .prompt {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--cyan);
}

.state-gameover.new-best .prompt {
    color: var(--gold);
    text-shadow: 0 0 14px rgba(255, 213, 74, 0.5);
    animation: score-pop 0.4s ease-out;
}

@keyframes score-pop {
    0% { transform: scale(0.85); opacity: 0; }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- The three statement cards --- */
.cards {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0 auto 1rem;
    max-width: 560px;
}

.statement-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-align: left;
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.05rem 1.15rem;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.18s, background 0.18s, box-shadow 0.18s, opacity 0.25s;
}

.statement-card .card-tag {
    flex: 0 0 auto;
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bg-dark);
    background: var(--text-muted);
    transition: background 0.18s;
}

.statement-card .statement-text {
    flex: 1 1 auto;
}

/* Hide empty cards entirely when idle / gameover */
.state-idle .cards,
.state-gameover .cards { display: none; }

/* Hover / focus — only meaningful while playing */
.state-playing .statement-card:hover {
    border-color: var(--cyan);
    background: rgba(5, 217, 232, 0.07);
    box-shadow: 0 0 18px rgba(5, 217, 232, 0.18);
}

.state-playing .statement-card:hover .card-tag {
    background: var(--cyan);
}

.state-playing .statement-card:active {
    transform: scale(0.985);
}

.statement-card:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
}

/* Reveal-state card paints */
.statement-card.was-lie {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.1);
    box-shadow: 0 0 22px rgba(57, 255, 20, 0.28);
    color: #fff;
}

.statement-card.was-lie .card-tag {
    background: var(--neon-green);
}

.statement-card.was-wrong {
    border-color: var(--pink);
    background: rgba(255, 42, 109, 0.1);
    box-shadow: 0 0 22px rgba(255, 42, 109, 0.28);
    animation: shake 0.25s ease-in-out;
}

.statement-card.was-wrong .card-tag {
    background: var(--pink);
}

.statement-card.dimmed {
    opacity: 0.4;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* --- Reveal explanation line --- */
.reveal {
    font-size: 0.97rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 auto 1.2rem;
    max-width: 560px;
    min-height: 1.2em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s, transform 0.25s;
    border-left: 3px solid transparent;
    padding: 0 0.2rem;
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
    padding: 0.7rem 0.9rem;
    border-radius: 0 10px 10px 0;
}

.reveal.show.good {
    border-left-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.06);
    color: var(--text-primary);
}

.reveal.show.bad {
    border-left-color: var(--pink);
    background: rgba(255, 42, 109, 0.06);
    color: var(--text-primary);
}

/* --- Start / restart button --- */
.game-btn {
    font-family: var(--font-body);
    padding: 0.9rem 2rem;
    font-size: 1.12rem;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
    min-width: 180px;
    color: var(--bg-dark);
    background: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.32);
}

.game-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 28px rgba(57, 255, 20, 0.5);
}

.game-btn:active { transform: scale(0.96); }

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

/* While actively playing or revealing, the start button becomes a quiet
   "Restart" — de-emphasize it so it doesn't steal focus from the cards. */
.state-playing .start-btn,
.state-reveal .start-btn {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--glass-border);
    box-shadow: none;
    font-size: 0.9rem;
    padding: 0.55rem 1.2rem;
    min-width: 0;
}

.state-playing .start-btn:hover,
.state-reveal .start-btn:hover {
    filter: none;
    color: var(--pink);
    border-color: var(--pink);
    box-shadow: none;
}

.best-score {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.9rem;
    min-height: 1.2em;
}

.state-playing .best-score,
.state-reveal .best-score { display: none; }

/* --- SEO / how-to content --- */
.how-to-play {
    text-align: left;
    margin: 3rem auto 0;
    max-width: 560px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
}

.how-to-play h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.how-to-play h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--cyan);
}

.how-to-play p {
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.how-to-play strong { color: var(--text-primary); font-weight: 500; }
.how-to-play em { color: var(--gold); font-style: normal; }

.how-to-play ol {
    margin: 0.5rem 0 0.75rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.fun-fact {
    margin-top: 1.25rem;
    padding: 1rem;
    border-left: 3px solid var(--neon-purple);
    background: rgba(189, 0, 255, 0.06);
    border-radius: 0 10px 10px 0;
}

.fun-fact p { margin: 0; }

.related-games {
    margin: 2rem auto 0;
    max-width: 560px;
    text-align: center;
}

.related-games h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.related-games-list {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.related-game-link {
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, color 0.2s;
}

.related-game-link:hover {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

/* --- Home link --- */
.home-link {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, color 0.2s;
    z-index: 10;
}

.home-link:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
}

.home-link:active { transform: translateX(-50%) scale(0.95); }

.home-link:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .title { font-size: 1.7rem; }
    .prompt { font-size: 0.98rem; }
    .statement-card {
        font-size: 0.97rem;
        padding: 0.9rem 0.95rem;
        gap: 0.7rem;
    }
    .statement-card .card-tag {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.85rem;
    }
    .reveal { font-size: 0.9rem; }
    .hud-item { font-size: 0.85rem; padding: 0.28rem 0.7rem; }
    .game-btn { font-size: 1rem; min-width: 160px; }
}

@media (max-width: 360px) {
    .statement-card { font-size: 0.92rem; }
    .title { font-size: 1.5rem; }
}
