:root {
  --bg: #0d0a1f;
  --bg-2: #171233;
  --card: #130e30;
  --card-border: #3a3170;
  --text: #f2efff;
  --muted: #b9b2e0;
  --accent: #ffd23f;
  --cyan: #2de2e6;
  --pink: #ff3d81;
  --green: #39ff88;
  --ring: var(--cyan);
  --c0: #e21b3c;
  --c1: #1368ce;
  --c2: #ffd23f;
  --c3: #1f7a0a;
  --radius: 6px;
  --display: 'Bungee', 'Chakra Petch', system-ui, sans-serif;
  --shadow: 6px 6px 0 #000;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.4 'Chakra Petch', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* faint CRT scanlines */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .1) 3px, transparent 4px);
}
button, select, input { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius);
  padding: .7em 1.4em;
  background: var(--accent);
  color: #1a1300;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .02em;
  box-shadow: 4px 4px 0 var(--pink);
  transition: transform .1s, box-shadow .1s, background .2s, opacity .2s;
}
button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--pink); }
button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--pink); }
button:disabled { opacity: .35; cursor: not-allowed; }
button:focus-visible, .tile:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
input, select {
  padding: .6em;
  border-radius: var(--radius);
  border: 3px solid var(--card-border);
  background: var(--card);
  color: var(--text);
}
input:focus { outline: none; border-color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.error { color: #ff8a8a; font-weight: 600; }
.panel { background: var(--card); border: 3px solid var(--card-border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--card-border); font-weight: 600; }
.chip.off { opacity: .4; }
.dot { width: 14px; height: 14px; border-radius: 3px; flex: none; box-shadow: 2px 2px 0 #000; }
.ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; }
.c0 { background: var(--c0); } .c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); }

/* ---------- host (big screen) ---------- */
.host { padding: 28px 40px 40px; font-size: 20px; max-width: 1600px; margin: 0 auto; }
.host header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.brand { margin: 0; display: flex; align-items: center; gap: 14px; font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--accent); text-shadow: 3px 3px 0 var(--pink); }
.logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius); background: var(--card); border: 3px solid var(--cyan); font-size: 26px; color: var(--cyan); text-shadow: none; box-shadow: 4px 4px 0 #1a6f73; }
button.ghost { background: transparent; border: 2px solid var(--cyan); color: var(--cyan); padding: .5em 1em; box-shadow: none; font-size: 15px; }
button.ghost:hover:not(:disabled) { background: rgba(45, 226, 230, .1); box-shadow: none; }
button.link { background: none; padding: 0; color: var(--ring); font: 600 15px 'Chakra Petch', system-ui, sans-serif; box-shadow: none; }
button.link:hover:not(:disabled) { box-shadow: none; text-decoration: underline; }

.card {
  background: var(--card);
  border: 3px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.eyebrow, .label { font-family: var(--display); font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; }
.pill { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius); background: rgba(45, 226, 230, .14); color: var(--cyan); }
.divider { height: 3px; background: var(--card-border); margin: 24px 0 0; }

.lobby { display: grid; grid-template-columns: minmax(340px, 400px) 1fr; gap: 28px; align-items: start; }

/* join card */
.join { text-align: center; position: sticky; top: 24px; border-color: var(--cyan); box-shadow: 8px 8px 0 #1a6f73; }
.qr-frame {
  margin: 16px auto 20px;
  width: min(100%, 300px);
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 6px 6px 0 var(--cyan);
}
.qr-frame img { width: 100%; display: block; }
.code-tiles { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; }
.code-tiles span {
  width: 62px; height: 74px;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 40px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #0d0a1f;
  box-shadow: 4px 4px 0 var(--pink);
}
.join strong { color: var(--text); font-weight: 600; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 14px 8px; text-align: center; }
.avatar .bubble {
  width: 56px; height: 56px; margin: 0 auto 6px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  font-family: var(--display); font-size: 24px; color: #fff;
  background: var(--c);
  box-shadow: 4px 4px 0 #000;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .45);
}
.avatar .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.off { opacity: .35; }
.avatar.waiting .bubble { background: none; border: 2px dashed var(--card-border); color: var(--muted); box-shadow: none; animation: pulse 2s ease-in-out infinite; }
.avatar.waiting .name { color: var(--muted); }
.avatar { position: relative; }
.avatar .kick {
  position: absolute; top: -4px; right: 2px;
  width: 24px; height: 24px; padding: 0; border-radius: var(--radius);
  font: 12px 'Chakra Petch', system-ui, sans-serif; background: #2a2350; color: var(--text); border: 2px solid var(--card-border);
  box-shadow: none; opacity: 0;
}
.avatar:hover .kick, .avatar .kick:focus-visible { opacity: 1; }
@media (hover: none) { .avatar .kick { opacity: .7; } }
.avatars.compact { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px 6px; }
.avatars.compact .bubble { width: 40px; height: 40px; font-size: 18px; }
.avatars.compact .name { font-size: 12px; }
.join-url { font-size: 15px; word-break: break-all; margin-bottom: 14px; }
.join-actions { justify-content: center; }
a.ghost-link { color: var(--ring); font-weight: 600; font-size: 16px; text-decoration: none; }
a.ghost-link:hover { text-decoration: underline; }
.join.remote .qr-frame { width: 160px; padding: 8px; margin: 12px auto; }
.join.remote .join-url { font-size: 20px; }
@keyframes pulse { 50% { border-color: var(--ring); color: var(--ring); } }

/* setup card */
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.setup h2 { margin: 6px 0 4px; font-family: var(--display); font-size: 36px; font-weight: 400; }
.setup-head p { margin: 0; max-width: 46ch; }
.seg { display: inline-flex; padding: 0; gap: 0; border-radius: var(--radius); border: 3px solid var(--text); overflow: hidden; }
.seg button { background: none; color: var(--text); padding: .55em 1em; border-radius: 0; font-size: 14px; white-space: nowrap; box-shadow: none; }
.seg button:hover:not(.on):not(:disabled) { background: rgba(255, 255, 255, .08); transform: none; box-shadow: none; }
.seg button:active:not(:disabled) { transform: none; box-shadow: none; }
.seg button.on { background: var(--text); color: var(--bg); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile, .mode {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  text-align: left;
  font: 500 18px/1.35 'Chakra Petch', system-ui, sans-serif;
  background: var(--card);
  border: 3px solid var(--card-border);
  color: var(--muted);
  box-shadow: 4px 4px 0 #000;
}
.tile { opacity: .6; }
.tile:hover:not(:disabled), .mode:hover:not(:disabled) { opacity: .95; box-shadow: 5px 5px 0 #000; }
.tile:active:not(:disabled), .mode:active:not(:disabled) { box-shadow: 1px 1px 0 #000; }
.tile .icon { font-size: 32px; line-height: 1; margin-bottom: 6px; color: var(--muted); }
.tile-name { font-family: var(--display); font-size: 16px; color: var(--text); }
.tile .check {
  position: absolute; top: 12px; right: 12px;
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: var(--radius); font-size: 14px;
  border: 2px solid var(--card-border); color: transparent;
}
.tile.on, .mode.on { opacity: 1; background: #1d1648; border-color: var(--accent); color: var(--text); box-shadow: 6px 6px 0 var(--accent); }
.tile.on .icon { color: var(--accent); }
.mode .tile-name .ico { color: var(--muted); }
.mode.on .tile-name .ico { color: var(--accent); }
.tile.on .check { background: var(--accent); border-color: var(--accent); color: #1a1300; }

.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mode { gap: 6px; }
.warn { color: #ffb86b; }
.fields { display: flex; flex-wrap: wrap; gap: 20px 28px; margin-top: 26px; }
.field .label { margin-bottom: 10px; }

.start-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 24px;
  border-top: 3px solid var(--card-border);
}
.summary { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-weight: 600; }
.summary .warn { color: #ffb86b; }
.start-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
button.start { font-size: 24px; padding: .8em 1.8em; box-shadow: 6px 6px 0 var(--pink); }
button.start:hover:not(:disabled) { box-shadow: 7px 7px 0 var(--pink); }
button.start:disabled { box-shadow: none; filter: grayscale(.6); }

/* in-game */
.q-head { display: flex; justify-content: space-between; align-items: center; color: var(--cyan); font-family: var(--display); font-size: 16px; }
.q-text {
  font-family: var(--display); font-size: 42px; font-weight: 400; line-height: 1.25; text-align: center;
  margin: 32px 0; padding: 32px; background: var(--card); border: 3px solid var(--text); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--card-border);
}
#timer { font-family: var(--display); font-size: 56px; color: var(--accent); min-width: 2ch; text-align: center; text-shadow: 4px 4px 0 var(--pink); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice { display: flex; align-items: center; gap: 16px; padding: 24px; border-radius: var(--radius); font-family: var(--display); font-size: 30px; color: #fff; box-shadow: 6px 6px 0 rgba(0, 0, 0, .55); }
.choice.c2, .pad .c2 { color: #1a1300; }
.choice .count { margin-left: auto; font-size: 28px; }
.choice.dim { opacity: .25; }
.board { max-width: 800px; margin: 0 auto; }
.board-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; margin: 10px 0; background: var(--card); border: 3px solid var(--card-border); border-radius: var(--radius); box-shadow: 4px 4px 0 #000; font-family: var(--display); font-size: 28px; animation: slide .4s ease-out both; }
.board-row .score { margin-left: auto; font-variant-numeric: tabular-nums; }
.board-row .who, .tally-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board.two { max-width: 1200px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.board.two .board-row { font-size: 22px; padding: 10px 16px; margin: 5px 0; }
.small-q { font-size: 30px; margin: 20px 0; padding: 22px; }
.answer-big { text-align: center; font-family: var(--display); font-size: 72px; color: var(--accent); text-shadow: 5px 5px 0 var(--pink); margin: 0 0 20px; }
.blank { display: inline-block; width: 4em; border-bottom: 4px solid var(--accent); margin: 0 .2em; vertical-align: baseline; }
.tally { max-width: 900px; margin: 0 auto; display: grid; gap: 12px; }
.tally-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-radius: var(--radius); background: var(--card); border: 3px solid var(--card-border); box-shadow: 4px 4px 0 #000; font-size: 28px; font-weight: 700; animation: slide .4s ease-out both; }
.tally-row .who { display: flex; align-items: center; gap: 10px; }
.tally-row.win { border-color: var(--accent); box-shadow: 5px 5px 0 var(--accent); }
.tally-row .score { margin-left: auto; }
.voters { display: flex; flex-wrap: wrap; gap: 6px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.option { padding: 20px 22px; border-radius: var(--radius); background: var(--card); border: 3px solid var(--card-border); box-shadow: 4px 4px 0 #000; font-size: 28px; font-weight: 700; display: grid; gap: 8px; animation: slide .4s ease-out both; }
.option.truth { border-color: var(--green); box-shadow: 6px 6px 0 var(--green); }
.option .voters .chip { font-size: 16px; padding: 4px 10px; }
.good { color: var(--green); }
.bad { color: #ff8a8a; }
.board-row .gain { color: var(--green); font-size: 20px; }
@keyframes slide { from { transform: translateX(-40px); opacity: 0; } }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 20px; margin: 40px 0; }
.podium > div { width: 220px; text-align: center; border-radius: var(--radius) var(--radius) 0 0; background: var(--card); border: 3px solid var(--card-border); padding: 16px; font-family: var(--display); font-size: 26px; }
.center { text-align: center; margin-top: 24px; }

/* ---------- phone ---------- */
.phone { padding: 16px; min-height: 100vh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.phone .top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; }
.phone .main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; text-align: center; }
.phone form { display: flex; flex-direction: column; gap: 14px; }
.phone input { font-size: 22px; text-align: center; font-weight: 600; }
.phone input[name=code] { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); color: var(--accent); border-color: var(--accent); }
.big { font-family: var(--display); font-size: 26px; font-weight: 400; }
.huge { font-size: 64px; }
.pad { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; margin-top: 12px; }
.pad button { color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 18px; padding: 12px; min-height: 120px; box-shadow: 5px 5px 0 rgba(0, 0, 0, .55); }
.pad button:hover:not(:disabled) { box-shadow: 6px 6px 0 rgba(0, 0, 0, .55); }
.pad button:active:not(:disabled) { box-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
.pad .shape { font-size: 48px; line-height: 1; }
.prompt { font-size: 22px; font-weight: 700; margin: 0; }
.huge-name { font-family: var(--display); font-size: 36px; font-weight: 400; margin: 0; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; gap: 12px; }
.huge-name .dot { width: 24px; height: 24px; }
.pick-list { display: grid; gap: 12px; }
button.pick { display: flex; align-items: center; gap: 12px; padding: 16px 18px; font: 600 20px 'Chakra Petch', system-ui, sans-serif; text-align: left; background: var(--card); color: var(--text); border: 3px solid var(--card-border); box-shadow: 4px 4px 0 #000; }
button.pick:hover:not(:disabled) { background: #1d1648; box-shadow: 5px 5px 0 #000; }
button.pick:active:not(:disabled) { box-shadow: 1px 1px 0 #000; }
button.pick:disabled { opacity: .4; }
.answer-form { display: flex; flex-direction: column; gap: 12px; }
.answer-form .row input { flex: 1; min-width: 0; }
.secret { position: relative; min-height: 180px; border-radius: var(--radius); background: var(--pink); box-shadow: 6px 6px 0 #7a1d44; padding: 20px; display: grid; place-items: center; user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; }
.secret .secret-back { display: none; background: var(--bg-2); border-radius: var(--radius); padding: 20px; width: 100%; }
.secret.open .secret-front { display: none; }
.secret.open .secret-back { display: grid; gap: 8px; }
.secret-front { font-family: var(--display); font-size: 20px; color: #fff; }

@media (max-width: 1000px) {
  .host { padding: 20px 16px; }
  .lobby { grid-template-columns: 1fr; }
  .join { position: static; }
  .setup-head { flex-direction: column; }
  .q-text { font-size: 28px; padding: 22px; }
  .choice { font-size: 20px; padding: 16px; }
  .board.two { grid-template-columns: 1fr; }
  .answer-big { font-size: 48px; }
  .option { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- landing (/ and /es) ---------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
.landing a { color: var(--ring); }
.land-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.land-head .brand { font-size: 22px; text-decoration: none; }
.land-head nav a { font-weight: 600; text-decoration: none; }
.landing section { margin: 56px 0; }
.landing h1 { font-family: var(--display); font-size: clamp(32px, 5.5vw, 56px); line-height: 1.1; font-weight: 400; color: var(--accent); text-shadow: 4px 4px 0 var(--pink); margin: 0 0 18px; }
.landing h2 { font-family: var(--display); font-size: clamp(24px, 3.6vw, 32px); font-weight: 400; margin: 0 0 20px; }
.hero { text-align: center; }
.lead { font-size: 22px; color: var(--muted); max-width: 40ch; margin: 0 auto 28px; }
a.cta { display: inline-block; padding: .8em 1.8em; border-radius: var(--radius); background: var(--accent); color: #1a1300; font-family: var(--display); font-size: 22px; text-decoration: none; box-shadow: 6px 6px 0 var(--pink); margin-bottom: 14px; transition: transform .1s, box-shadow .1s; }
.landing a.cta { color: #1a1300; }
a.cta:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--pink); }
a.cta:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.steps, .features, .cats { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.steps { counter-reset: step; }
.steps li, .features li { display: flex; flex-direction: column; gap: 6px; }
.steps li::before { counter-increment: step; content: counter(step); width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius); background: var(--accent); color: #1a1300; font-family: var(--display); box-shadow: 3px 3px 0 var(--pink); margin-bottom: 6px; }
.cats { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); margin-bottom: 14px; }
.cats li { padding: 14px 18px; border-radius: var(--radius); background: var(--card); border: 3px solid var(--card-border); box-shadow: 4px 4px 0 #000; font-weight: 600; }
.landing details { margin-bottom: 12px; padding: 16px 22px; }
.landing summary { cursor: pointer; font-weight: 700; }
.landing details p { margin: 10px 0 0; color: var(--muted); }
.land-foot { text-align: center; padding-top: 24px; border-top: 3px solid var(--card-border); }
.ways { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.ways h3 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0 0 14px; }
.ways .steps { grid-template-columns: 1fr; }
