/* BotSitting. Dark, a bit arcade, readable at a glance from across a desk. */
:root {
  --bg: #0b0f1a; --bg2: #121829; --bg3: #1a2238; --line: rgba(255,255,255,0.08);
  --fg: #e8ecf5; --muted: #8b95ad; --accent: #7cf0ff; --accent2: #ff6ad5; --gold: #ffd75a;
  --good: #4cd964; --bad: #ff5a5a; --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; background-image: radial-gradient(1200px 600px at 10% -10%, rgba(124,240,255,0.08), transparent), radial-gradient(900px 500px at 100% 0%, rgba(255,106,213,0.07), transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.05rem; }
p { margin: .3em 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .accent { color: var(--accent); } .mono { font-family: var(--mono); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Header / footer */
.top { display: flex; align-items: center; gap: 1.2rem; padding: .8rem 1.4rem; border-bottom: 1px solid var(--line); background: rgba(11,15,26,0.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.logo { font-size: 1.25rem; color: var(--fg); display: flex; gap: .4rem; align-items: center; }
.logo span { letter-spacing: -0.02em; } .logo b { color: var(--accent); }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: .2rem; }
nav a { color: var(--muted); padding: .35rem .7rem; border-radius: 999px; }
nav a.active, nav a:hover { color: var(--fg); background: var(--bg3); text-decoration: none; }
.spacer { flex: 1; }
.chip { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; }
.chip.empty { border-color: var(--accent2); color: var(--accent2); animation: pulse 1.6s infinite; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: .3rem; }
main { flex: 1; width: min(1200px, 100% - 2.8rem); margin: 0 auto; padding: 1.6rem 0 3rem; }
.foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; text-align: center; }

/* Buttons */
.btn { display: inline-block; background: var(--bg3); border: 1px solid var(--line); color: var(--fg); padding: .6rem 1.1rem; border-radius: 10px; cursor: pointer; transition: transform .08s, background .15s; text-decoration: none; }
.btn:hover { background: #222c48; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--accent); color: #062026; border-color: transparent; font-weight: 700; }
.btn.primary:hover { background: #a3f5ff; }
.btn.hold { padding: 1.4rem 3rem; font-size: 1.3rem; border-radius: 999px; user-select: none; touch-action: none; }
.btn.hold.active { background: var(--accent2); color: #2b0a22; transform: scale(.96); }
.btn.key { font-weight: 700; background: transparent; border-width: 2px; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }

/* Hero + hub */
.hero { padding: 1rem 0 1.6rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.hub-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.6rem; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card-game { display: flex; gap: .9rem; padding: 1rem; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); transition: transform .12s, border-color .12s, background .12s; }
.card-game:hover { text-decoration: none; transform: translateY(-2px); border-color: rgba(124,240,255,0.4); background: var(--bg3); }
.card-game .icon { font-size: 2.2rem; line-height: 1; padding-top: .2rem; }
.card-game .body { flex: 1; min-width: 0; }
.card-game p { color: var(--muted); font-size: .92rem; min-height: 3.9em; }
.title-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.title-row h3 { margin: 0; }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; background: rgba(124,240,255,0.12); color: var(--accent); padding: .15rem .5rem; border-radius: 999px; }
.tag.dim { background: var(--bg3); color: var(--muted); }
.king { font-size: .9rem; margin-top: .5rem; color: var(--gold); }
.side { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; position: sticky; top: 4.6rem; }
.side h3 { margin-top: .8rem; display: flex; justify-content: space-between; align-items: baseline; } .side h3:first-child { margin-top: 0; }
.mini-board { list-style: none; margin: 0; padding: 0; }
.mini-board li { display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: 8px; }
.mini-board li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board li.me { background: rgba(124,240,255,0.08); }
.mini-board li.new { outline: 1px solid var(--accent2); }
.mini-board .rank { width: 2.2rem; text-align: center; font-variant-numeric: tabular-nums; }
.mini-board .pts { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-item { padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; } .feed-item:last-child { border-bottom: none; }
.shame { color: var(--bad); }

/* Game page */
.game-head { margin-bottom: 1rem; } .back { display: inline-block; margin-bottom: .4rem; color: var(--muted); }
.play-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.6rem; align-items: start; }
.stage-wrap { position: relative; }
.stage { position: relative; min-height: 440px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.4rem; outline: none; user-select: none; overflow: hidden; }
.stage.tappable { cursor: pointer; }
.stage.wide { min-height: 520px; }
.big { font-size: clamp(3rem, 9vw, 6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.big.dim { opacity: .35; }
.hint { color: var(--muted); text-align: center; }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.pill { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--bg3); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.live { color: var(--accent); border: 1px solid rgba(124,240,255,0.4); }
.pill.done { color: var(--fg); } .pill.bad { color: var(--bad); }
.hud { display: flex; gap: 1.4rem; align-self: stretch; justify-content: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud b { color: var(--fg); font-size: 1.15rem; }
.overlay-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; font-size: 1.2rem; padding: .9rem 2rem; }
.shake { animation: shake .25s; }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,106,213,0.4);} 50% { box-shadow: 0 0 0 6px rgba(255,106,213,0);} }

/* Reaction */
.stage.react { transition: background .1s; }
.stage.react.wait, .stage.react.early { background: #4a1420; } .stage.react.go { background: #0f5a2b; } .stage.react.hit { background: #14304a; }

/* Aim */
.arena { position: relative; align-self: stretch; flex: 1; min-height: 420px; background: var(--bg); border-radius: 10px; cursor: crosshair; overflow: hidden; }
.target { position: absolute; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, var(--accent2) 19% 45%, #fff 46% 60%, var(--accent2) 61%); box-shadow: 0 0 18px rgba(255,106,213,0.5); cursor: crosshair; }

/* Circle */
canvas.draw { align-self: stretch; flex: 1; min-height: 440px; width: 100%; background: var(--bg); border-radius: 10px; cursor: crosshair; touch-action: none; }

/* Typing */
.passage { font-size: 1.35rem; line-height: 1.7; max-width: 60ch; font-family: var(--mono); }
.ch { color: var(--muted); border-radius: 3px; }
.ch.ok { color: var(--fg); } .ch.bad { color: #fff; background: var(--bad); }
.ch.cur { box-shadow: inset 0 -3px 0 var(--accent); }

/* Stroop */
.stroop-word { font-size: clamp(3rem, 10vw, 6.5rem); text-shadow: 0 2px 30px rgba(0,0,0,0.5); }
.keys { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

/* Odd one out */
.tiles { display: grid; gap: 6px; width: min(100%, 460px); aspect-ratio: 1; }
.tile { border-radius: 8px; cursor: pointer; transition: transform .06s; } .tile:hover { transform: scale(1.03); }

/* Sequence */
.pads { display: grid; grid-template-columns: repeat(3, 96px); gap: 10px; }
.pads.locked { pointer-events: none; }
.pad { width: 96px; height: 96px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; transition: background .08s, transform .08s; }
.pad:hover { background: #222c48; }
.pad.lit { background: var(--accent); box-shadow: 0 0 24px var(--accent); transform: scale(1.04); }
.pad.wrong { background: var(--bad); }

/* Memory */
.cards { display: grid; grid-template-columns: repeat(5, 84px); gap: 10px; }
.card { position: relative; width: 84px; height: 104px; border: none; background: transparent; cursor: pointer; perspective: 600px; padding: 0; }
.card .face, .card .back { position: absolute; inset: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; transition: transform .35s; backface-visibility: hidden; }
.card .back { background: linear-gradient(135deg, #2a3560, #1a2238); border: 1px solid var(--line); color: var(--muted); font-weight: 800; }
.card .face { background: #e8ecf5; transform: rotateY(180deg); }
.card.up .back { transform: rotateY(180deg); } .card.up .face { transform: rotateY(0); }
.card.won .face { background: #b8ffd0; box-shadow: 0 0 0 2px var(--good); }

/* Blocks */
.blocks-wrap { display: flex; gap: 1.2rem; align-items: flex-start; }
canvas.blocks { border-radius: 8px; border: 1px solid var(--line); max-width: 100%; }
.blocks-panel { display: flex; flex-direction: column; gap: .8rem; min-width: 120px; }
.blocks-side .stat { display: flex; flex-direction: column; color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.blocks-side .stat b { color: var(--fg); font-size: 1.3rem; font-variant-numeric: tabular-nums; }

/* Result overlay */
.result { position: absolute; inset: 0; background: rgba(11,15,26,0.92); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; animation: fade .25s; z-index: 3; }
@keyframes fade { from { opacity: 0; transform: scale(.98);} to { opacity: 1; transform: none;} }
.result-score { font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--accent); }
.result-rank { font-size: 1.2rem; margin-top: .6rem; }
.roast { font-size: 1.15rem; max-width: 46ch; color: var(--accent2); margin-top: 1rem; font-style: italic; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 20; backdrop-filter: blur(4px); }
.modal-card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; width: min(420px, 92vw); }
.modal-card form { display: flex; gap: .6rem; margin-top: 1rem; }
.name-input { flex: 1; font: inherit; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.name-input:focus { outline: 2px solid var(--accent); }

/* Hall */
.table-wrap { overflow-x: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.num { text-align: right; } .game-col { text-align: center; color: var(--muted); } td.gold { color: var(--gold); font-weight: 700; }
tr.me td { background: rgba(124,240,255,0.06); }
.shame-head { margin-top: 2rem; }
.shame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-top: .8rem; }
.shame-card { display: flex; gap: .8rem; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.shame-card .icon { font-size: 1.8rem; } .shame-name { color: var(--bad); }
.wide-board { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }

@media (max-width: 900px) {
  .hub-layout, .play-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .cards { grid-template-columns: repeat(4, 72px); } .card { width: 72px; height: 90px; }
  .pads { grid-template-columns: repeat(3, 80px); } .pad { width: 80px; height: 80px; }
  .blocks-wrap { flex-direction: column; align-items: center; }
}

/* BotSitting (the game) */
.botsit .term { align-self: stretch; flex: 1; display: flex; flex-direction: column; background: #070a12; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-height: 420px; font-family: var(--mono); }
.term-bar { display: flex; align-items: center; gap: .8rem; padding: .45rem .8rem; background: #141a2b; color: var(--muted); font-size: .8rem; }
.dots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.tabs { display: flex; gap: 2px; padding: 4px 6px 0; background: #0e1322; overflow-x: auto; min-height: 38px; }
.tab { position: relative; display: flex; align-items: center; gap: .45rem; padding: .45rem .8rem; background: #141a2b; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: .85rem; white-space: nowrap; overflow: hidden; }
.tab.sel { background: #070a12; color: var(--fg); border-color: var(--line); }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tab.working .dot { background: var(--accent); animation: blink 1s infinite; }
.tab.deciding { color: var(--gold); } .tab.deciding .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.tab.deciding:not(.sel) { animation: nudge .6s infinite alternate; }
.tab .patience { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.08); }
.tab .patience i { display: block; height: 100%; background: var(--gold); }
@keyframes blink { 50% { opacity: .3; } }
@keyframes nudge { to { background: #26200f; } }
.term-body { flex: 1; padding: .9rem 1rem; font-size: .92rem; line-height: 1.5; overflow: auto; position: relative; }
.term-empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.tline { white-space: pre-wrap; } .tline.dim { color: var(--muted); } .prompt { color: var(--accent); }
.spin::after { content: '▋'; animation: blink .8s infinite; }
.decision { margin-top: .8rem; padding: .8rem; border: 1px solid rgba(255,215,90,0.4); border-radius: 8px; background: rgba(255,215,90,0.06); }
.decision .q { color: var(--gold); font-weight: 700; margin-bottom: .6rem; }
.opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn.opt { font-family: var(--mono); padding: .5rem .9rem; }
kbd { display: inline-block; font: .7rem var(--mono); background: rgba(255,255,255,0.1); border-radius: 4px; padding: 0 .35rem; color: var(--muted); }
.toast { position: absolute; left: 1rem; right: 1rem; bottom: .8rem; padding: .5rem .8rem; background: #141a2b; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; animation: fade .2s; }
.lives b { letter-spacing: .1em; }

/* Kitchen */
.kitchen .floor { position: relative; align-self: stretch; flex: 1; min-height: 340px; border-radius: 10px; background: linear-gradient(#1b2340 0 58%, #3a2a1e 58% 64%, #262019 64%); border: 1px solid var(--line); overflow: hidden; }
.counter { position: absolute; inset: 0; }
.customer { position: absolute; top: 26%; transform: translateX(-50%); width: 90px; text-align: center; cursor: pointer; transition: opacity .4s, transform .4s; user-select: none; }
.customer .face { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.customer .bubble { display: inline-block; background: #fff; color: #000; font-size: 1.8rem; line-height: 1; padding: .35rem .6rem; border-radius: 14px; margin-bottom: .3rem; position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.customer .bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: none; }
.customer .patience { height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; margin: .4rem 12px 0; overflow: hidden; }
.customer .patience i { display: block; height: 100%; width: 100%; background: var(--good); transition: width .1s linear; }
.customer.urgent .patience i { background: var(--bad); } .customer.urgent .bubble { animation: nudge2 .3s infinite alternate; }
@keyframes nudge2 { to { transform: translateY(-3px); } }
.customer.happy { opacity: 0; transform: translateX(-50%) translateY(-30px); }
.customer.angry { opacity: 0; transform: translateX(-50%) scale(1.3); }
.chef { position: absolute; bottom: 6%; transform: translateX(-50%); font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.6)); pointer-events: none; }
.chef .hand { position: absolute; right: -14px; top: -6px; font-size: 1.7rem; }
.toast-wrap { position: absolute; left: 0; right: 0; top: 8px; text-align: center; color: var(--gold); font-weight: 700; font-size: 1.1rem; pointer-events: none; }
.shelf { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.dish { position: relative; width: 64px; height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg3); font-size: 2rem; cursor: pointer; transition: transform .08s, border-color .1s; }
.dish:hover { transform: translateY(-2px); } .dish.held { border-color: var(--accent); box-shadow: 0 0 12px rgba(124,240,255,0.5); }
.dish kbd { position: absolute; left: 4px; top: 3px; }
