/* Chain of Thought — FunSlop.com
   Step-by-step reasoning as a stepping-stone walk across the latent void.
   Pick the valid inference; one non-sequitur and you fall. */

: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 — FunSlop house style */
.glow-bg {
    position: fixed;
    top: -80px;
    left: -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 14s infinite alternate;
}

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

.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: 2rem 1.1rem 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.85rem;
    background: linear-gradient(45deg, var(--cyan), var(--neon-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- HUD ---- */
.hud {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.hud-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.32rem 0.85rem;
    min-height: 1.9rem;
    letter-spacing: 0.3px;
}

.hud-item.lives { color: var(--pink); }
.hud-item.chains { color: var(--cyan); }
.hud-item.combo {
    color: var(--gold);
    font-weight: 700;
}
.hud-item.combo:empty {
    display: none;
}

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

/* ---- The reasoning path (stepping stones across the void) ---- */
.path {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 38vh;
    overflow-y: auto;
    margin: 0.25rem auto 1.25rem;
    padding: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    transition: transform 0.2s, opacity 0.2s;
}

.path::-webkit-scrollbar { width: 6px; }
.path::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
}

/* A stone in the chain */
.stone {
    position: relative;
    font-size: 0.98rem;
    line-height: 1.4;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
}

.stone.premise {
    border-color: rgba(5, 217, 232, 0.5);
    background: rgba(5, 217, 232, 0.08);
    box-shadow: 0 0 16px rgba(5, 217, 232, 0.18);
}

.stone.step {
    border-color: rgba(57, 255, 20, 0.45);
    background: rgba(57, 255, 20, 0.07);
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.15);
}

.stone.goal {
    color: var(--text-muted);
    border-style: dashed;
    border-color: rgba(189, 0, 255, 0.4);
    background: rgba(189, 0, 255, 0.05);
}

.stone.goal.reached {
    color: var(--text-primary);
    border-style: solid;
    border-color: var(--neon-purple);
    background: rgba(189, 0, 255, 0.16);
    box-shadow: 0 0 22px rgba(189, 0, 255, 0.4);
}

/* The void gap between the last placed stone and the conclusion */
.gap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: 2px 0;
}

.gap .dots {
    font-family: var(--font-display);
    letter-spacing: 6px;
    font-size: 1.1rem;
    color: var(--text-muted);
    opacity: 0.6;
    animation: void-pulse 2.2s ease-in-out infinite;
}

@keyframes void-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.8; }
}

/* Stone placement pop */
.stone.pop {
    animation: stone-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes stone-pop {
    0% { transform: scale(0.7) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Falling into the void on a hallucination */
.path.falling {
    animation: fall 0.7s ease-in forwards;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    30% { transform: translateY(6px) rotate(-1.5deg); }
    100% { transform: translateY(60px) rotate(3deg); opacity: 0.25; }
}

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

/* ---- option buttons ---- */
.options {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 560px;
    margin: 0 auto;
}

.options:empty {
    margin: 0;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.option:hover {
    border-color: var(--cyan);
    background: rgba(5, 217, 232, 0.07);
}

.option:active {
    transform: scale(0.98);
}

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

.opt-key {
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cyan);
    background: rgba(5, 217, 232, 0.12);
    border-radius: 8px;
}

.opt-text { flex: 1 1 auto; }

/* Reveal state after a pick */
.option.revealed {
    cursor: default;
    pointer-events: none;
}

.option.revealed:not(.is-correct):not(.is-wrong) {
    opacity: 0.4;
}

.option.is-correct {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.12);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.3);
    opacity: 1;
}
.option.is-correct .opt-key {
    color: var(--neon-green);
    background: rgba(57, 255, 20, 0.18);
}

.option.is-wrong {
    border-color: var(--pink);
    background: rgba(255, 42, 109, 0.12);
    box-shadow: 0 0 18px rgba(255, 42, 109, 0.3);
    animation: shake 0.25s ease-in-out;
    opacity: 1;
}
.option.is-wrong .opt-key {
    color: var(--pink);
    background: rgba(255, 42, 109, 0.18);
}

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

/* ---- verdict line ---- */
.verdict {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 1rem auto 0;
    min-height: 1.4em;
    color: var(--text-muted);
}

.verdict.good { color: var(--neon-green); text-shadow: 0 0 12px rgba(57, 255, 20, 0.4); }
.verdict.bad  { color: var(--pink);      text-shadow: 0 0 12px rgba(255, 42, 109, 0.4); }
.verdict.win  { color: var(--gold);      text-shadow: 0 0 14px rgba(255, 213, 74, 0.5); }

/* ---- action button (start / restart) ---- */
.game-btn {
    font-family: var(--font-body);
    margin-top: 1.5rem;
    padding: 0.95rem 2.1rem;
    font-size: 1.15rem;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    cursor: pointer;
    color: var(--bg-dark);
    background: var(--neon-green);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

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

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

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

/* Hide the action button mid-play; the JS also toggles display. */
.state-playing .game-btn,
.state-chaindone .game-btn {
    display: none;
}

/* New best celebration */
.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; }
}

/* ---- 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; }
    .prompt { font-size: 1rem; }
    .stone { font-size: 0.92rem; padding: 0.6rem 0.8rem; }
    .option { font-size: 0.95rem; padding: 0.75rem 0.85rem; }
    .opt-key { width: 1.5rem; height: 1.5rem; font-size: 0.85rem; }
    .hud-item { font-size: 0.82rem; padding: 0.28rem 0.7rem; }
    .game-btn { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
    .path { max-height: 34vh; }
    .verdict { font-size: 0.98rem; }
}

@media (max-width: 360px) {
    .stone { font-size: 0.86rem; }
    .option { font-size: 0.9rem; gap: 0.55rem; }
}
