/* Auto-Debate — FunSlop.com
   Deckbuilding meets rhetoric. Two LLMs argue your drafted case to a biased judge. */

: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;

    /* card-type accents */
    --t-data: var(--cyan);
    --t-logic: var(--neon-green);
    --t-emotion: var(--pink);
    --t-authority: var(--gold);
}

* {
    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);
}

.glow-bg {
    position: fixed;
    top: -80px;
    left: -80px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, var(--neon-purple) 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;
    user-select: none;
    -webkit-user-select: none;
}

.content {
    text-align: center;
    padding: 2rem 1rem 6rem;
    max-width: 720px;
    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(--neon-purple), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* control hint pills */
.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); }

.state-drafting .controls-inline,
.state-resolving .controls-inline,
.state-gameover .controls-inline { display: none; }

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

/* status bar */
.status-bar {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    min-height: 1.6rem;
}

.status-pill {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
}

.status-pill:empty { display: none; }
.status-pill.score { color: var(--cyan); }

/* judge dossier card */
.judge-card {
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.2rem;
}
.judge-card:empty { display: none; }

.judge-card .topic {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
    line-height: 1.35;
}

.judge-card .stances {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}
.judge-card .stance.you strong { color: var(--neon-green); }
.judge-card .stance.them strong { color: var(--pink); }

.judge-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.judge-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--neon-purple);
    font-size: 1rem;
}
.judge-blurb {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.45;
}

/* type badges (shared) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.badge.t-Data { color: var(--t-data); }
.badge.t-Logic { color: var(--t-logic); }
.badge.t-Emotion { color: var(--t-emotion); }
.badge.t-Authority { color: var(--t-authority); }

/* deck slots — your drafted three */
.deck {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}
.deck:empty { display: none; }

.deck-slot {
    border-radius: 12px;
    padding: 0.7rem 0.6rem;
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    border: 1px dashed var(--glass-border);
    transition: transform 0.12s, border-color 0.2s;
}
.deck-slot.empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.015);
}
.deck-slot .slot-label { opacity: 0.6; font-family: var(--font-display); }

.deck-slot.filled {
    cursor: pointer;
    border-style: solid;
    background: rgba(255, 255, 255, 0.04);
    animation: slot-in 0.18s ease-out;
}
.deck-slot.filled:active { transform: scale(0.96); }
.deck-slot.filled.t-Data { border-color: var(--t-data); box-shadow: 0 0 14px rgba(5, 217, 232, 0.18); }
.deck-slot.filled.t-Logic { border-color: var(--t-logic); box-shadow: 0 0 14px rgba(57, 255, 20, 0.18); }
.deck-slot.filled.t-Emotion { border-color: var(--t-emotion); box-shadow: 0 0 14px rgba(255, 42, 109, 0.18); }
.deck-slot.filled.t-Authority { border-color: var(--t-authority); box-shadow: 0 0 14px rgba(255, 213, 74, 0.18); }

.slot-type {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.deck-slot.t-Data .slot-type { color: var(--t-data); }
.deck-slot.t-Logic .slot-type { color: var(--t-logic); }
.deck-slot.t-Emotion .slot-type { color: var(--t-emotion); }
.deck-slot.t-Authority .slot-type { color: var(--t-authority); }

.slot-name {
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-primary);
}
.slot-x {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
}

@keyframes slot-in {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* the hand of draftable cards */
.hand {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.hand:empty { display: none; }
.state-resolving .hand,
.state-gameover .hand { display: none; }

.card {
    position: relative;
    font-family: var(--font-body);
    text-align: left;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.12s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 92px;
}
.card:active { transform: scale(0.97); }
.card:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}
.card-type {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card.t-Data .card-type { color: var(--t-data); }
.card.t-Logic .card-type { color: var(--t-logic); }
.card.t-Emotion .card-type { color: var(--t-emotion); }
.card.t-Authority .card-type { color: var(--t-authority); }

.card-str {
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--gold);
    white-space: nowrap;
}
.card-name {
    font-size: 0.85rem;
    line-height: 1.25;
    font-weight: 500;
}
.card-fav {
    font-size: 0.68rem;
    color: var(--neon-purple);
    font-weight: 700;
}
.card-num {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    font-size: 0.62rem;
    color: var(--text-muted);
    opacity: 0.45;
    font-family: var(--font-display);
}

.card:hover { border-color: rgba(255, 255, 255, 0.25); }
.card.t-Data:hover { border-color: var(--t-data); box-shadow: 0 0 16px rgba(5, 217, 232, 0.22); }
.card.t-Logic:hover { border-color: var(--t-logic); box-shadow: 0 0 16px rgba(57, 255, 20, 0.22); }
.card.t-Emotion:hover { border-color: var(--t-emotion); box-shadow: 0 0 16px rgba(255, 42, 109, 0.22); }
.card.t-Authority:hover { border-color: var(--t-authority); box-shadow: 0 0 16px rgba(255, 213, 74, 0.22); }

.card.favored {
    border-color: rgba(189, 0, 255, 0.5);
}

.card.drafted {
    opacity: 0.4;
    pointer-events: none;
}
.card.drafted::after {
    content: 'DRAFTED';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--cyan);
    background: rgba(9, 11, 16, 0.55);
    border-radius: 12px;
}

/* the debate transcript */
.transcript {
    text-align: left;
    margin-bottom: 1.2rem;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.transcript:empty { display: none; }

.tline {
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font-size: 0.88rem;
    line-height: 1.4;
    animation: line-in 0.3s ease-out;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}
.tline .who {
    font-family: var(--font-display);
    font-weight: 700;
    margin-right: 0.35rem;
}
.tline.you { border-left: 3px solid var(--neon-green); }
.tline.you .who { color: var(--neon-green); }
.tline.them { border-left: 3px solid var(--pink); }
.tline.them .who { color: var(--pink); }
.tline.sys { color: var(--text-muted); font-weight: 300; }
.tline.judge { color: var(--text-muted); background: rgba(189, 0, 255, 0.05); }
.tline.coherence { color: var(--text-primary); }

.tline .hit { font-weight: 500; }
.tline .hit.good { color: var(--neon-green); }
.tline .hit.bad { color: var(--pink); }
.tline .hit.neutral { color: var(--text-muted); }
.tline .pts {
    display: inline-block;
    margin-left: 0.4rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--cyan);
}
.tline.tally {
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
}
.tline.verdict {
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid currentColor;
}
.tline.verdict.won { color: var(--neon-green); background: rgba(57, 255, 20, 0.07); }
.tline.verdict.lost { color: var(--pink); background: rgba(255, 42, 109, 0.07); }

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

/* primary button */
.buttons {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 0;
}

.game-btn {
    font-family: var(--font-body);
    padding: 0.95rem 2rem;
    font-size: 1.1rem;
    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, opacity 0.2s;
    min-width: 200px;
    color: var(--bg-dark);
    background: var(--cyan);
    box-shadow: 0 0 18px rgba(5, 217, 232, 0.35);
}
.game-btn:hover { filter: brightness(1.1); box-shadow: 0 0 26px rgba(5, 217, 232, 0.5); }
.game-btn:active { transform: scale(0.96); }
.game-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.game-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

/* button recolors per resolution */
.state-resolving.won .game-btn {
    background: var(--neon-green);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.4);
}
.state-resolving.lost .game-btn {
    background: var(--pink);
    box-shadow: 0 0 18px rgba(255, 42, 109, 0.4);
}

.hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
    min-height: 1.2em;
    line-height: 1.4;
}

/* new-best celebration */
.state-gameover.new-best .instruction {
    color: var(--gold);
    text-shadow: 0 0 14px rgba(255, 213, 74, 0.4);
}
.state-gameover.new-best .status-pill.score {
    color: var(--gold);
}

/* idle / gameover are tappable surfaces (the button handles it though) */
.state-idle, .state-gameover { cursor: default; }

/* SEO / how-to content */
.how-to-play {
    text-align: left;
    margin: 3rem auto 0;
    max-width: 600px;
    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(--neon-purple); font-style: normal; font-weight: 500; }
.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: 600px;
    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(9, 11, 16, 0.7);
    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; }
    .judge-card .topic { font-size: 1rem; }
    .deck { gap: 0.4rem; }
    .deck-slot { min-height: 70px; padding: 0.5rem 0.4rem; }
    .slot-name { font-size: 0.72rem; }
    .hand { gap: 0.45rem; }
    .card { min-height: 86px; padding: 0.6rem; }
    .card-name { font-size: 0.8rem; }
    .game-btn { min-width: 160px; padding: 0.85rem 1.4rem; font-size: 1rem; }
}

@media (max-width: 360px) {
    .deck { grid-template-columns: 1fr; }
    .deck-slot { min-height: 56px; }
}
