/* Ellenial brand (final, 1 Nov 2026): one palette for every Ellenial app, light and dark,
   Fraunces for headings and DM Sans for text, both served from this site.
   Accessibility: text at least 4.5:1, controls and outlines at least 3:1, never colour alone.
   Periwinkle is a fill only (Night or Indigo text on it), never text on Peach or Card.
   Line is decorative only; anything you can tap gets the stronger --edge. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-500-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

/* Light (Peach). Dark is chosen with the Auto / Light / Dark switch (ellenial-theme.js sets
   data-theme on <html>), or follows the phone when JavaScript is off. Keep the two dark blocks identical. */
:root {
  --bg: #FEF2E2;         /* Peach: page */
  --card: #FFFBF5;       /* Card: cards, panels */
  --lavender: #F1EAF8;   /* soft highlights, secondary chips */
  --peri: #B7B1E6;       /* Periwinkle: selected, active tiles, play screens (fill only) */
  --accent: #342E86;     /* Indigo: buttons, accents */
  --on-accent: #FFFBF5;  /* on-indigo: text on Indigo (10.8:1) */
  --accent-ink: #342E86; /* accent-coloured text */
  --ink: #1F1A2E;        /* Night: text */
  --muted: #575166;      /* secondary text */
  --on-peri-muted: #1F1A2E; /* Muted is only 3.8:1 on Periwinkle, so use Night there */
  --line: #EDE1D1;       /* decorative borders only (1.2:1) */
  --edge: #342E86;       /* Indigo: edges of tappable things (design system rule), 10:1 on Peach */
  --night: #1F1A2E;      /* "You're the imposter" card */
  --night-ink: #FFFBF5;  /* Card colour on Night */
  --ok: #D5E3D6;         /* semantic: correct / ready (always with ✓ or a word) */
  --no: #EED3D6;         /* semantic: same thing (always with a word) */
  --danger: #A2433B;     /* semantic: errors, time running out */
  --red: #B23A33;        /* Don't say the same thing: "= Same thing" */
  --green: #2E7A4C;      /* Don't say the same thing: "≠ Different", ✓ Guessed */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #17141F; --card: #221E2C; --lavender: #2D2640; --peri: #463C6E;
    --accent: #B39AE8; --on-accent: #1A1430; --accent-ink: #B39AE8;
    --ink: #F3EEF8; --muted: #C2BACF; --on-peri-muted: #C2BACF; --line: #332D40; --edge: #B39AE8;
    --night: #2D2640; --night-ink: #F3EEF8;
    --ok: #31423A; --no: #47343A; --danger: #E59A91; --red: #C2453D; --green: #2F7F50;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #17141F; --card: #221E2C; --lavender: #2D2640; --peri: #463C6E;
    --accent: #B39AE8; --on-accent: #1A1430; --accent-ink: #B39AE8;
    --ink: #F3EEF8; --muted: #C2BACF; --on-peri-muted: #C2BACF; --line: #332D40; --edge: #B39AE8;
    --night: #2D2640; --night-ink: #F3EEF8;
    --ok: #31423A; --no: #47343A; --danger: #E59A91; --red: #C2453D; --green: #2F7F50;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* No zoom at all: no double-tap zoom on fast taps, no pinch-zoom (see also the viewport tag and the iPhone guard in app.js) */
html { touch-action: pan-x pan-y; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  max-width: 480px;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top bar */
.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bar.center { justify-content: space-between; }
.bar-title { font-family: var(--display); font-weight: 500; font-size: 20px; }
h1.bar-title { font-size: 28px; margin: 0; }
.round-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 2px solid var(--edge); border-radius: 999px; background: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
}
.round-btn svg { stroke: var(--ink); }
.spacer { width: 44px; flex-shrink: 0; }

/* Home */
/* Top row: icon + eyebrow left, language and "?" right. Name and tagline span the full width below. */
.home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand btns" "name name" "tag tag"; align-items: center; column-gap: 12px; }
.home-head .brand-row { grid-area: brand; min-width: 0; }
.home-head .head-btns { grid-area: btns; }
.home-head h1 { grid-area: name; margin: 10px 0 0; font-family: var(--display); font-weight: 500; font-size: 34px; line-height: 1.1; overflow-wrap: anywhere; }
.home-head p { grid-area: tag; margin: 6px 0 0; color: var(--muted); }
.home-head .ellenial-eyebrow { margin: 0; }
.chip-btn {
  border: 2px solid var(--edge); background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 15px; min-height: 44px; padding: 0 14px; border-radius: 999px; flex-shrink: 0;
}
.draft { background: var(--lavender); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 700; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.game-card {
  width: 100%; text-align: left; border: 2px solid var(--edge); background: var(--card); color: var(--ink);
  border-radius: 22px; padding: 16px; display: flex; gap: 14px; align-items: center;
}
.game-icon { width: 80px; height: 80px; border-radius: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.game-icon svg { stroke: var(--ink); }
.game-icon img { width: 74px; height: 74px; display: block; }
.gi-pannben { background: var(--peri); }
.gi-imposter { background: var(--lavender); }
.gi-charades { background: var(--peri); }
.gi-samething { background: var(--lavender); }
.gi-packs { background: var(--lavender); }
.gi-packs svg { stroke: var(--ink); }
.game-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.game-name { font-family: var(--display); font-weight: 500; font-size: 22px; }
.game-sub { white-space: nowrap; display: inline-block; font-family: var(--body); font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.game-desc { font-size: 15px; color: var(--muted); line-height: 1.35; }
.game-meta { font-size: 13px; color: var(--muted); font-weight: 700; }
.foot { margin-top: auto; text-align: center; font-size: 13px; color: var(--muted); }

/* Setup */
section.group { display: flex; flex-direction: column; gap: 10px; }
.label { margin: 0; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.help { margin: 0; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  border: 2px solid var(--edge); background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 15px; min-height: 44px; padding: 0 16px; border-radius: 999px;
}
/* Selected: Periwinkle fill with a strong Indigo edge and a tick, so it never relies on colour. */
.chip[aria-pressed="true"] { background: var(--peri); color: var(--ink); border-color: var(--accent); }
.chip[aria-pressed="true"]::before, .seg button[aria-pressed="true"]::before { content: "✓ "; }
.chip.own { border: 2px solid var(--accent); background: var(--lavender); color: var(--accent-ink); }
.chip.own[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: var(--card); border: 2px solid var(--edge); border-radius: 16px; padding: 4px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 16px; height: 48px; border-radius: 12px; }
.seg button[aria-pressed="true"] { background: var(--peri); color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.seg button:disabled { opacity: 0.45; }
.stepper { background: var(--card); border-radius: 20px; padding: 8px; display: flex; align-items: center; justify-content: space-between; }
.step-btn { width: 52px; height: 52px; border: 2px solid var(--edge); border-radius: 999px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.step-btn svg { stroke: var(--ink); }
.step-btn.plus { background: var(--accent); border-color: var(--accent); }
.step-btn.plus svg { stroke: var(--on-accent); }
.step-btn:disabled { opacity: 0.4; }
.step-num { font-family: var(--display); font-weight: 500; font-size: 40px; }
.names { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.names input, .text-input {
  width: 100%; min-width: 0; height: 44px; border: 2px solid var(--edge); border-radius: 12px; background: var(--card);
  padding: 0 10px; font-weight: 700; font-size: 16px; /* 16px minimum: iPhone zooms in on smaller text fields */
}
.names input::placeholder, .text-input::placeholder { color: var(--muted); font-weight: 600; }
.tip { background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.tip svg { flex-shrink: 0; margin-top: 1px; stroke: var(--accent); }
.tip p { margin: 0; font-size: 15px; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

/* Buttons */
.btn {
  border: 0; border-radius: 999px; min-height: 60px; padding: 0 24px;
  font-family: var(--body); font-weight: 600; font-size: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--card); color: var(--ink); border: 2px solid var(--edge); min-height: 56px; font-size: 19px; }
.btn-teal { background: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: 0.5; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Big cards for play */
.stage {
  flex: 1; min-height: 340px; border: 0; border-radius: 28px; padding: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: var(--card); color: var(--ink);
}
.stage.teal { background: var(--accent); color: var(--on-accent); }
.stage.night { background: var(--night); color: var(--night-ink); }
.stage.yellow { background: var(--peri); color: var(--ink); }
.stage svg.big { stroke: var(--accent); }
.kicker { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.stage.teal .kicker, .stage.night .kicker { color: inherit; opacity: 0.85; }
.big-word { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 12vw, 56px); line-height: 1.08; overflow-wrap: anywhere; }
.stage-title { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.15; }
.stage-text { font-size: 17px; line-height: 1.5; max-width: 300px; }
.stage .stage-text.soft { color: var(--muted); }
.stage.teal .stage-text, .stage.night .stage-text { color: inherit; opacity: 0.92; }
.pill { background: var(--lavender); color: var(--ink); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.center-text { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.dots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 2px var(--edge); }
.dot.done { background: var(--muted); box-shadow: none; }
.dot.now { width: 24px; background: var(--accent); box-shadow: none; }
.progress { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.progress p { margin: 0; font-weight: 700; color: var(--muted); }

/* Timer ring */
.ring { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset 0.9s linear; }
.ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 36px; }
.ring.low .fill { stroke: var(--danger); }

/* Totals */
.total { font-family: var(--display); font-weight: 500; font-size: 104px; line-height: 1; }

/* PANNBEN play: fills the whole screen */
.pb {
  position: fixed; inset: 0; z-index: 10;
  background: var(--peri); color: var(--ink);
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  transition: background-color 0.15s;
}
.pb.ok { background: var(--ok); }
.pb.skip { background: var(--lavender); }
.pb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pb-badge { background: var(--card); font-weight: 700; font-size: 18px; min-height: 40px; padding: 0 16px; border-radius: 999px; display: flex; align-items: center; }
.pb-time { background: var(--ink); color: var(--bg); font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 22px; min-height: 40px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center; }
.pb-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.pb-word { font-family: var(--display); font-weight: 500; font-size: clamp(48px, 24vmin, 150px); line-height: 1.02; overflow-wrap: anywhere; }
.pb-cat { font-size: 18px; font-weight: 700; }
.pb-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pb-btn { border: 0; min-height: 56px; min-width: 140px; border-radius: 999px; font-family: var(--body); font-weight: 600; font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; }
.pb-pass { background: var(--card); color: var(--ink); border: 2px solid var(--ink); }
.pb-pass svg { stroke: var(--ink); }
.pb-got { background: var(--accent); color: var(--on-accent); }
.pb-got svg { stroke: var(--on-accent); }
.pb-hint { font-size: 15px; font-weight: 700; text-align: center; }
.pb-count { font-family: var(--display); font-weight: 500; font-size: 40vmin; line-height: 1; }
/* PANNBEN is always played sideways. If the phone keeps the screen portrait (iPhone, or
   rotation lock on), turn the play screen 90° to match how the phone is held.
   rot-l = phone's top points left, rot-r = top points right (set from motion in app.js). */
@media (orientation: portrait) {
  .pb.rot-l, .pb.rot-r {
    inset: auto; top: 50%; left: 50%;
    width: 100vh; height: 100vw;
    width: 100dvh; height: 100dvw;
    padding: 16px max(24px, env(safe-area-inset-top), env(safe-area-inset-bottom));
  }
  .pb.rot-l { transform: translate(-50%, -50%) rotate(90deg); }
  .pb.rot-r { transform: translate(-50%, -50%) rotate(-90deg); }
  .pb-word { font-size: clamp(48px, 13vmax, 150px); }
  .pb-count { font-size: 40vmax; }
}

/* Don't say the same thing: fills the screen and scales up for a TV or laptop */
.st {
  position: fixed; inset: 0; z-index: 10; overflow: auto;
  background: var(--bg); color: var(--ink);
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: clamp(12px, 3vmin, 32px);
  transition: background-color 0.15s;
}
.st > * { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
.st.same { background: var(--no); }
.st.diff { background: var(--ok); }
.st-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.st-badge { background: var(--card); font-weight: 700; font-size: clamp(15px, 2.4vmin, 26px); min-height: 40px; padding: 4px 16px; border-radius: 999px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.st-pts { background: var(--ink); color: var(--bg); }
.st-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: clamp(8px, 2vmin, 24px); }
.st-title { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 9vmin, 110px); line-height: 1.05; }
.st-ask { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 6vmin, 72px); line-height: 1.1; color: var(--accent-ink); }
.st-how { font-size: clamp(16px, 2.6vmin, 28px); line-height: 1.45; max-width: 34em; color: var(--muted); }
.st-cat { font-family: var(--display); font-weight: 500; font-size: clamp(44px, 12vmin, 150px); line-height: 1.05; overflow-wrap: anywhere; }
.st-count { font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; font-size: clamp(80px, 28vmin, 320px); line-height: 1; color: var(--accent); }
.st-hold { visibility: hidden; }
.st-say { font-family: var(--display); font-weight: 500; font-size: clamp(44px, 12vmin, 150px); line-height: 1.1; color: var(--accent-ink); }
.st-flash { font-size: clamp(32px, 8vmin, 100px); }
.st-total { font-family: var(--display); font-weight: 500; font-size: clamp(96px, 26vmin, 300px); line-height: 1; }
.st-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2.5vmin, 32px); }
.st-big, .st-ready {
  border: 0; border-radius: 999px; min-height: clamp(64px, 13vmin, 150px); padding: 8px 16px;
  font-family: var(--body); font-weight: 600; font-size: clamp(19px, 4vmin, 48px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15;
}
.st-big:disabled { opacity: 0.35; }
.st-same { background: var(--red); color: #fff; }
.st-diff, .st-go { background: var(--green); color: #fff; }
.st-neutral { background: var(--card); color: var(--ink); border: 2px solid var(--edge); }
.st-ready { background: var(--card); color: var(--ink); border: 3px solid var(--edge); }
.st-ready.on { background: var(--green); color: #fff; border-color: var(--green); }
.st-who { font-size: 0.6em; font-weight: 700; }
.st-keys { margin: 0; text-align: center; font-size: clamp(13px, 1.8vmin, 20px); color: var(--muted); }
@media (hover: none) { .st-keys.kb { display: none; } } /* keyboard hint only where there is a keyboard-ish device */

/* TV mode (tv.ellenial.app): read from the sofa, steered with a remote. Sizes follow the screen. */
html.tv button:focus { outline: max(5px, 0.7vmin) solid var(--accent); outline-offset: max(5px, 0.7vmin); }
html.tv .st-big:focus, html.tv .tvh-card:focus { transform: scale(1.03); }
html.tv #app { max-width: none; }
.tvh { display: flex; flex-direction: column; gap: 4vmin; min-height: calc(100vh - 48px); padding: 2vmin 4vmin; }
.tvh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 3vmin; }
.tvh-head h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(36px, 8vmin, 110px); line-height: 1.05; }
.tvh-head p { margin: 1vmin 0 0; color: var(--muted); font-size: clamp(16px, 3vmin, 36px); }
.tvh-lang { font-size: clamp(15px, 2.6vmin, 30px); min-height: clamp(44px, 7vmin, 80px); padding: 0 3vmin; }
.tvh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 60vmin), 1fr)); gap: 3vmin; }
.tvh-card { text-align: left; border: max(2px, 0.3vmin) solid var(--edge); background: var(--card); color: var(--ink); border-radius: 4vmin; padding: 3vmin; display: flex; gap: 3vmin; align-items: center; transition: transform 0.12s; }
.tvh-card .game-icon { width: clamp(80px, 14vmin, 180px); height: clamp(80px, 14vmin, 180px); border-radius: 3vmin; }
.tvh-card .game-icon svg { width: 55%; height: 55%; }
.tvh-card .game-icon img { width: 90%; height: 90%; }
.tvh-name { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 5vmin, 64px); line-height: 1.1; }
.tvh-desc { font-size: clamp(15px, 2.8vmin, 32px); color: var(--muted); line-height: 1.35; }
.tvh-more { margin: 0; color: var(--muted); font-size: clamp(15px, 2.6vmin, 30px); }
.tvh-foot { margin: auto 0 0; text-align: center; color: var(--muted); font-size: clamp(13px, 2vmin, 24px); }
.st-buttons:has(.st-one) { grid-template-columns: minmax(0, 1fr); max-width: 700px; }
.st-big { transition: transform 0.12s; }
html.tv .st-keys { font-size: clamp(16px, 2.6vmin, 30px); }

/* Own packs */
.pack-row { width: 100%; text-align: left; border: 2px solid var(--edge); background: var(--card); color: var(--ink); border-radius: 18px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; }
.pack-row strong { font-size: 17px; }
.pack-row span { color: var(--muted); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.notice { display: flex; align-items: center; gap: 10px; background: var(--lavender); color: var(--accent-ink); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.notice svg { flex-shrink: 0; stroke: currentColor; }
.name-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-family: var(--display); font-weight: 500; font-size: 26px; padding: 0 4px; border-bottom: 2px dashed var(--edge); }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--edge); border-radius: 16px; background: var(--card); padding: 0 14px; font-weight: 700; font-size: 16px; }
.add-row button { border: 0; background: var(--accent); color: var(--on-accent); font-family: var(--body); font-weight: 600; font-size: 18px; height: 52px; padding: 0 20px; border-radius: 16px; }
.word-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.word-list li { display: flex; align-items: center; gap: 2px; background: var(--card); border-radius: 999px; padding: 0 4px 0 14px; min-height: 44px; font-weight: 700; font-size: 15px; }
.word-list button { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.word-list button svg { stroke: var(--muted); }
.link-danger { border: 0; background: transparent; color: var(--danger); font-weight: 700; font-size: 15px; min-height: 44px; text-decoration: underline; align-self: center; }
.confirm { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.confirm p { margin: 0; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Lapp i hatt */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.h-input { height: 52px; font-size: 17px; border: 2px solid var(--edge); }
.h-codein { font-family: var(--body); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; font-size: 22px; }
.h-note { margin: 0; background: var(--lavender); color: var(--accent-ink); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.h-err { margin: 0; color: var(--danger); font-weight: 700; text-align: center; }
.h-invite { margin-left: auto; }
.h-codebox { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 16px; padding: 10px 16px; }
.h-codebox span { color: var(--muted); font-weight: 700; font-size: 14px; }
.h-codebox strong { font-weight: 600; font-size: 24px; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.h-mine { flex-direction: column; }
.h-mine li { border-radius: 14px; justify-content: space-between; font-size: 16px; }
.h-w0 { background: var(--peri) !important; } .h-w1 { background: var(--lavender) !important; }
.h-w2 { background: var(--peri) !important; } .h-w3 { background: var(--lavender) !important; }
.h-card { background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.h-card.h-row, .h-row { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.h-line { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.h-line:last-child { border-bottom: 0; }
.h-people { display: flex; flex-wrap: wrap; gap: 6px; }
.h-p { padding: 6px 12px; border-radius: 999px; border: 2px dashed var(--edge); color: var(--muted); font-weight: 700; font-size: 14px; }
.h-p.on { border: 2px solid var(--ink); background: var(--ok); color: var(--ink); }
.h-team0 { background: var(--peri); }
.h-team1 { background: var(--lavender); }
.h-p.h-team0, .h-p.h-team1 { color: var(--ink); }
.h-teambtn { border: 3px solid var(--edge); border-radius: 18px; min-height: 60px; font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--ink); }
.h-teambtn[aria-pressed="true"] { border-color: var(--ink); }
.h-rounds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.h-rounds li, .h-check > span:first-child:not(.h-check-text) { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.h-rn { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; color: var(--ink); }
.h-r1 { background: var(--peri); } .h-r2 { background: var(--lavender); } .h-r3 { background: var(--peri); } .h-r4 { background: var(--lavender); }
.h-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 2px solid var(--edge); border-radius: 16px; padding: 10px 16px; min-height: 56px; cursor: pointer; }
.h-check input { width: 24px; height: 24px; accent-color: var(--accent); flex-shrink: 0; }
.h-check-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.h-seg4 button { font-size: 15px; padding: 0 2px; }
.h-check-text small { color: var(--muted); font-size: 14px; }
.h-pill { font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; color: var(--ink); text-align: center; }
.h-title { margin: 0; font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.15; }
.h-teamlist { display: flex; flex-direction: column; gap: 10px; }
.h-teamcard { border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.h-teamcard strong { font-family: var(--display); font-weight: 500; font-size: 22px; }
.h-roundcard, .h-yours, .h-watch { min-height: 240px; color: var(--ink); }
.h-scores { gap: 10px; }
.h-score { border-radius: 18px; padding: 12px; display: flex; flex-direction: column; align-items: center; border: 3px solid transparent; }
.h-score span { font-weight: 700; font-size: 14px; }
.h-score strong { font-family: var(--display); font-weight: 500; font-size: 40px; line-height: 1.1; }
.h-score.now { border-color: var(--ink); }
.h-time { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.h-time span[data-htimer] { font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 56px; line-height: 1; }
.h-bar { width: 100%; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; display: block; }
.h-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.25s linear; }
.h-time.low span[data-htimer] { color: var(--danger); }
.h-time.low .h-bar i { background: var(--danger); }
.h-word { min-height: 260px; }
.h-skip { background: var(--card); color: var(--ink); border: 2px solid var(--edge); min-height: 76px; }
.h-skip > span { display: flex; flex-direction: column; line-height: 1.2; }
.h-skip small { font-weight: 500; font-size: 14px; color: var(--muted); }
.h-got { background: var(--green); color: #FFFFFF; min-height: 76px; font-size: 20px; }
.h-final { border-radius: 20px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.h-final strong { font-family: var(--display); font-weight: 500; font-size: 24px; }
.h-final span { font-family: var(--display); font-weight: 500; font-size: 44px; line-height: 1; }
.gi-hatt { background: var(--lavender); }
.gi-hatt svg { stroke: var(--ink); }

/* Periwinkle surfaces: Muted is too faint there in light mode, so secondary text uses Night. */
.pb, .stage.yellow, .gi-pannben, .gi-charades, .h-team0, .h-r1, .h-r3, .h-w0, .h-w2, .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { --muted: var(--on-peri-muted); }
/* …and edges on Periwinkle use Night (8.4:1), the strongest pair on that fill. */
.pb, .stage.yellow, .h-team0, .st.same, .st.diff { --edge: var(--ink); }
/* A big tappable card needs a visible edge too. */
button.stage { border: 2px solid var(--edge); }

/* Auto / Light / Dark: the shared Ellenial switch (ellenial-theme.js), saved on this phone only.
   The chosen one is underlined and bold, not just a different colour. */
.prefs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 6px; margin: 0; font-size: 14px; color: var(--muted); }
.prefs-label { font-weight: 600; }
.theme-switch { display: inline-flex; gap: 2px; align-items: center; }
.theme-switch__btn { border: none; background: none; min-height: 44px; min-width: 44px; padding: 6px 6px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.theme-switch__btn[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
html.tv .prefs { font-size: clamp(15px, 2.4vmin, 28px); }
html.tv .theme-switch__btn { font-size: clamp(15px, 2.4vmin, 28px); min-height: clamp(44px, 7vmin, 80px); padding: 0 1.5vmin; }
.foot-wrap { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.foot-wrap .foot { margin-top: 0; }
.h-seg4 button[aria-pressed="true"]::before { content: none; } /* too narrow for a tick; the Indigo outline marks it */

/* Wolf in Sheep's Clothing. Night screens always use the dark palette, whatever the theme:
   it sets the mood, and a dim screen is kinder while everyone else has their eyes closed. */
:root.wolf-night {
  --bg: #17141F; --card: #221E2C; --lavender: #2D2640; --peri: #463C6E;
  --accent: #B39AE8; --on-accent: #1A1430; --accent-ink: #B39AE8;
  --ink: #F3EEF8; --muted: #C2BACF; --on-peri-muted: #C2BACF; --line: #332D40; --edge: #B39AE8;
  --night: #2D2640; --night-ink: #F3EEF8;
  color-scheme: dark;
}
.gi-wolf { background: var(--peri); }
.gi-wolf svg { stroke: var(--ink); }
.w-intro { margin-top: -8px; font-size: 15px; }
.w-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.w-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.w-names li { display: flex; align-items: center; background: var(--lavender); border-radius: 999px; padding-left: 14px; font-weight: 700; font-size: 15px; }
.w-names button { width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.w-names button svg { stroke: var(--ink); }
.step-num.w-min { font-size: 30px; }
.w-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.w-phase { display: inline-flex; align-items: center; gap: 6px; }
.w-ic { stroke: var(--ink); }
.w-tap { font-size: 22px; margin-top: 6px; }
.w-ask { display: flex; flex-direction: column; gap: 6px; }
.w-picks { display: flex; flex-direction: column; gap: 8px; }
.w-picks.w-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w-pick {
  min-height: 52px; border: 2px solid var(--edge); border-radius: 16px; background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 16px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
}
.w-grid .w-pick { justify-content: center; text-align: center; min-height: 56px; }
.w-pick small { font-size: 13px; font-weight: 500; color: var(--muted); }
/* Selected: Periwinkle with a strong edge and a tick, never colour alone. */
.w-pick[aria-pressed="true"] { background: var(--peri); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); --muted: var(--on-peri-muted); }
.w-pick[aria-pressed="true"] > span::before { content: "✓ "; }
.w-pick.w-nobody { border-style: dashed; background: transparent; color: var(--accent-ink); }
.w-pick.w-nobody[aria-pressed="true"] { border-style: solid; background: var(--peri); color: var(--ink); }
.w-news strong { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.25; }
.w-time span[data-wtimer] { font-family: var(--display); font-weight: 500; font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.w-time .h-bar { max-width: 260px; }
.w-count { background: var(--lavender); border-radius: 16px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.w-count strong { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.1; }
.w-count span { font-size: 13px; color: var(--muted); }
.w-end { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding-top: 8px; }
.h-title.w-win { font-size: 40px; line-height: 1.1; }
.w-note { margin: 0; font-weight: 600; }
.w-roles { list-style: none; margin: 0; padding: 0; }
.w-art { display: block; object-fit: contain; flex: none; margin: 0 auto; }
.w-lg { width: min(52vw, 190px); height: min(52vw, 190px); }
.w-sm { width: 64px; height: 64px; margin: 0; }
.w-xs { width: 36px; height: 36px; margin: 0; }
.w-hero { width: min(70vw, 250px); height: min(70vw, 250px); }
.w-flock { width: 120px; height: 120px; }
.w-fleece { display: block; flex: none; width: min(48vw, 170px); height: min(48vw, 170px); background: var(--peri);
  -webkit-mask: url(art/fleece.webp) center / contain no-repeat; mask: url(art/fleece.webp) center / contain no-repeat; }
.w-roles .w-who { flex: 1; }
.w-roles li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.w-who { display: flex; flex-direction: column; min-width: 0; }
.w-who small { color: var(--muted); font-size: 13px; }
.w-rp { padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; flex-shrink: 0; color: var(--ink); }
.w-rp-wolf { background: var(--night); color: var(--night-ink); }
.w-rp-shepherd, .w-rp-dog { background: var(--peri); }
.w-rp-sheep { background: var(--lavender); }
.gi-wolf, .w-rp-shepherd, .w-rp-dog { --muted: var(--on-peri-muted); }

/* "?" help (shared ellenial-help.css does the rest) */
.head-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.bar .eh-q { margin-left: auto; }

/* "Ellenial" above the app's name (decided 8 Nov 2026): credit where credit is due, without making the name longer. */
.ellenial-eyebrow { display: block; font-family: 'DM Sans', system-ui, sans-serif; font-size: 11px; line-height: 14px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 2px; }
.tvh-head .ellenial-eyebrow { font-size: clamp(11px, 1.6vmin, 22px); line-height: 1.3; }

/* Ellenial shared footer (9 Nov 2026): the same lines, order and look in every app.
   App-specific notes on top in Fraunces italic, the shared block in DM Sans, controls last. */
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/fraunces-latin-400-italic.woff2') format('woff2'); }
.ell-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 28px; padding: 20px 16px 24px; border-top: 1px solid var(--line, rgba(127,127,127,.25)); text-align: center; font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; line-height: 18px; color: var(--muted); }
.ell-foot p { margin: 0; }
.ell-foot a { color: var(--accent); }
.ell-notes { display: flex; flex-direction: column; gap: 4px; font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 400; line-height: 19px; max-width: 520px; }
.ell-shared { display: flex; flex-direction: column; gap: 6px; }
.ell-controls { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.foot-wrap .ell-foot { margin-top: 0; }

/* App icon beside the eyebrow and name, like Lunch, Weather, Quiz and Present (9 Nov 2026) */
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; display: block; }
