/* Anti-Turing — FunSlop.com
   Prove you're a machine. A transparent regex judge scores your slop. */

: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 */
.glow-bg {
    position: fixed;
    top: -80px;
    left: -80px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    opacity: 0.14;
    z-index: -1;
    filter: blur(60px);
    pointer-events: none;
    animation: float 12s infinite alternate;
}

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

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

.content {
    text-align: center;
    padding: 2.5rem 1.25rem 6rem;
    max-width: 660px;
    width: 100%;
    margin: 0 auto;
}

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

/* Control hints */
.controls-inline {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
}

.control-pill .key {
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 0.1rem 0.45rem;
    font-size: 0.8rem;
}

.control-pill.action .key { color: var(--cyan); }
.control-pill.special .key { color: var(--neon-purple); }

.instruction {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    min-height: 1.4em;
    line-height: 1.4;
}

/* HUD: progress + running slop score */
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    max-width: 540px;
    margin: 0 auto 1rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    min-height: 1.4em;
}

.hud-progress { color: var(--text-muted); text-align: left; flex: 1; }
.hud-score {
    color: var(--cyan);
    font-weight: 700;
    text-align: right;
    flex: 1;
    text-shadow: 0 0 12px rgba(5, 217, 232, 0.4);
}

/* The judge's prompt card */
.prompt-card {
    max-width: 540px;
    margin: 0 auto 1.25rem;
    padding: 1.5rem 1.5rem;
    background: rgba(189, 0, 255, 0.06);
    border: 1px solid rgba(189, 0, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(189, 0, 255, 0.12);
    transition: box-shadow 0.2s;
}

.prompt-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--neon-purple);
    margin-bottom: 0.5rem;
}

.prompt-text {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
}

.state-gameover .prompt-card {
    border-color: rgba(255, 213, 74, 0.4);
    background: rgba(255, 213, 74, 0.06);
    box-shadow: 0 0 24px rgba(255, 213, 74, 0.15);
}

.state-gameover .prompt-label { display: none; }
.state-gameover .prompt-text { color: var(--gold); }

/* Answer area — shown only while playing */
.answer-area {
    display: none;
    max-width: 540px;
    margin: 0 auto 1.25rem;
}

.state-playing .answer-area { display: block; }

.answer-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    resize: vertical;
    min-height: 5.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.answer-input::placeholder { color: var(--text-muted); opacity: 0.7; }

.answer-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(5, 217, 232, 0.15), 0 0 20px rgba(5, 217, 232, 0.2);
}

.answer-input:disabled { opacity: 0.4; }

.answer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: left;
}

/* Buttons */
.game-btn {
    font-family: var(--font-body);
    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;
    color: var(--bg-dark);
}

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

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

.game-btn:disabled { opacity: 0.4; cursor: default; }

.btn-submit {
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    background: var(--cyan);
    box-shadow: 0 0 18px rgba(5, 217, 232, 0.35);
    white-space: nowrap;
}

.btn-submit:not(:disabled):hover {
    filter: brightness(1.1);
    box-shadow: 0 0 26px rgba(5, 217, 232, 0.5);
}

.btn-start {
    padding: 0.95rem 2.2rem;
    font-size: 1.15rem;
    background: var(--neon-green);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
    margin: 0.5rem auto 1rem;
}

.btn-start:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 26px rgba(57, 255, 20, 0.5);
}

/* The Boot Up / Re-Run button shows in idle + gameover, hides during play */
.state-playing .btn-start { display: none; }

/* Verdict feed — the judge's running scorecard */
.verdict-feed {
    max-width: 540px;
    margin: 0.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-align: left;
}

.verdict-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--text-muted);
    border-radius: 0 12px 12px 0;
    padding: 0.85rem 1rem;
    animation: card-in 0.3s ease-out;
}

.verdict-card.good { border-left-color: var(--neon-green); }
.verdict-card.meh { border-left-color: var(--gold); }
.verdict-card.bad { border-left-color: var(--pink); }

@keyframes card-in {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.verdict-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.verdict-q {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.verdict-points {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.verdict-card.good .verdict-points { color: var(--neon-green); }
.verdict-card.meh .verdict-points { color: var(--gold); }
.verdict-card.bad .verdict-points { color: var(--pink); }

.verdict-summary {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.verdict-tells {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.verdict-tells li {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
    padding-left: 0.25rem;
}

.verdict-tells .tell-good { color: #b8ffa8; }
.verdict-tells .tell-bad { color: #ff9bb6; }

/* Best + hint */
.best-score {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.state-gameover.new-best .best-score,
.state-gameover.new-best .prompt-text {
    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; }
}

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

/* Hide control hints once a run is underway or finished */
.state-playing .controls-inline,
.state-gameover .controls-inline { 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(--text-primary); font-style: italic; }

.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.75rem; }
    .instruction { font-size: 1rem; }
    .prompt-text { font-size: 1.2rem; }
    .prompt-card { padding: 1.25rem 1.1rem; }
    .btn-start { padding: 0.85rem 1.8rem; font-size: 1.05rem; }
    .answer-row { flex-direction: column; align-items: stretch; }
    .btn-submit { width: 100%; }
    .char-count { text-align: center; }
}
