/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ── */
/* One light palette for every screen — modern slate neutrals with a teal brand.
   A second view that looks unrelated to the word game is the thing a passer-by
   notices, so they share the palette and the switch stays unremarkable. */
:root {
  --bg:          #f8fafc;   /* page */
  --surf-1:      #ffffff;   /* card */
  --surf-2:      #f8fafc;
  --surf-3:      #f1f5f9;   /* inset / tile */
  --border:      #e2e8f0;
  --accent:      #0d9488;   /* teal */
  --accent-hover:#0f766e;
  --accent-dim:  rgba(13, 148, 136, 0.10);
  --accent-ring: rgba(13, 148, 136, 0.28);
  --text:        #0f172a;
  --muted:       #64748b;
  --error:       #b91c1c;
  --msg-self-bg: #0d9488;   /* own row accent — teal */
  --msg-peer-bg: #ffffff;   /* other row card — white */
  --radius:      14px;
  --radius-sm:   10px;
}

html, body {
  height: 100%;
  /* No webfonts: the page is served under `font-src 'none'`, so the stack is
     built entirely from faces already on the device. */
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ══════════════════════════════════════
   VIEWS
══════════════════════════════════════ */
.view { display: none; width: 100%; min-height: 100vh; }
.view.active { display: flex; }

/* ── Game view: a normal scrolling page, not a fixed app shell ── */
#v-game {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  height: auto;
  margin: 0;
  overflow: visible;
  background: #f8fafc;
  position: relative;
}
/* .view.active sets display:flex for the inner views; the site layout
   wants normal block flow so the document itself scrolls. */
#v-game.active { display: block; }

/* ══════════════════════════════════════
   GAME — marketing-style site layout
   Sticky full-width navbar → centred hero → feature grid → promo band →
   content sections → multi-column footer. Teal brand on slate neutrals.
   Variable names are kept (--lac-*) so the game's inline styles keep working.
══════════════════════════════════════ */
.vb {
  --lac-paper:  #f8fafc;
  --lac-card:   #ffffff;
  --lac-ink:    #0f172a;
  --lac-ink2:   #1e293b;
  --lac-soft:   #475569;
  --lac-dim:    #64748b;
  --lac-faint:  #94a3b8;
  --lac-line:   #e2e8f0;
  --lac-blue:   #0d9488;
  --lac-blue-d: #0f766e;
  --lac-blue-l: #f0fdfa;
  --lac-ring:   #99f6e4;
  --lac-tile:   #f1f5f9;
  --lac-ok:     #15803d;
  --lac-ok-bg:  #dcfce7;
  --lac-warn:   #b91c1c;
  --lac-warn-bg:#fee2e2;
  --lac-sh:     0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.06);
  --lac-sh-lg:  0 4px 6px rgba(15,23,42,.04), 0 12px 28px rgba(15,23,42,.09);
  --lac-r:      14px;
  --lac-max:    1200px;

  display: block;
  width: 100%;
  overflow-x: clip;   /* full-bleed hero layers can't cause a sideways scroll */
  background: var(--lac-paper);
  color: var(--lac-ink);
  -webkit-tap-highlight-color: transparent;
}
.lac-serif { font-family: inherit; }

/* Contained inner column for full-bleed bands. */
.lac-wrap {
  width: 100%; max-width: var(--lac-max);
  margin: 0 auto; padding: 0 1.25rem;
}

/* ══ Navbar — sticky, full width, contained inner ══ */
.lac-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--lac-line);
}
.lac-topin {
  width: 100%; max-width: var(--lac-max); margin: 0 auto;
  padding: .625rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.lac-brand {
  flex: 0 0 auto;
  margin-right: auto;            /* pushes the whole action cluster right */
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.0625rem; font-weight: 800; letter-spacing: -.025em;
  white-space: nowrap; cursor: pointer;
}
.lac-brand::before {
  content: ""; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 9px;
  background: url("/icon.svg") center / cover no-repeat;
  box-shadow: 0 2px 6px rgba(13,148,136,.35);
}
.lac-navlink {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .5rem .7rem; border: none; border-radius: 9px;
  background: none; color: var(--lac-dim); cursor: pointer;
  font-family: inherit; font-size: .875rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.lac-navlink svg { width: 17px; height: 17px; flex: 0 0 auto; }
.lac-navlink:hover { background: var(--lac-tile); color: var(--lac-ink); }
.lac-navlink.on { background: var(--lac-blue-l); color: var(--lac-blue-d); font-weight: 600; }
.lac-top-right { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
/* Narrow screens: drop the labels so the cluster stays on one row as icons. */
@media (max-width: 600px) {
  .lac-navlink span { display: none; }
  .lac-navlink {
    width: 38px; height: 38px; padding: 0;
    justify-content: center; border: 1px solid var(--lac-line); border-radius: 10px;
    background: var(--lac-card);
  }
  .lac-navlink svg { width: 18px; height: 18px; }
  .lac-topin    { padding: .55rem .75rem; gap: .5rem; }
  .lac-top-right { gap: .25rem; }
}
/* Phones: the row is logo + up to five icons (+ the back button on inner screens).
   Where that can't fit, keep the logo mark and drop the "VocabList" text, so every
   icon stays on screen and tappable. */
@media (max-width: 440px) {
  .lac-topin:has(> .lac-icon:not([hidden])) .lac-brand { font-size: 0; gap: 0; }
}
@media (max-width: 345px) {
  .lac-brand { font-size: 0; gap: 0; }
}
/* The narrowest phones (folded Galaxy Fold, ~280px): slightly smaller icons. */
@media (max-width: 300px) {
  .lac-topin .lac-navlink, .lac-topin .lac-icon { width: 34px; height: 34px; }
  .lac-topin     { gap: .35rem; }
  .lac-top-right { gap: .15rem; }
}

.lac-icon {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--lac-line); border-radius: 10px;
  background: var(--lac-card); color: var(--lac-soft); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.lac-icon svg { width: 18px; height: 18px; display: block; }
.lac-icon:hover  { background: var(--lac-tile); color: var(--lac-ink); }
.lac-icon:active { transform: scale(.94); }
.lac-icon[hidden] { display: none; }

/* ── Offline banner ── */
.lac-offline {
  text-align: center; padding: .5rem 1rem;
  font-size: .8125rem; font-weight: 500;
  background: var(--lac-warn-bg); color: var(--lac-warn);
}
.lac-offline[hidden] { display: none; }

/* ══ Sections ══ */
.lac-body { display: block; width: 100%; }
.lac-screen[hidden] { display: none; }
.lac-screen {
  display: block;
  width: 100%; max-width: var(--lac-max);
  margin: 0 auto; padding: 2rem 1.25rem 3.5rem;
  animation: lacUp .2s ease-out;
}
@keyframes lacUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lac-screen { animation: none; } }
/* Vertical rhythm between the blocks a screen renders. */
.lac-screen > * + * { margin-top: 1rem; }
.lac-screen > .lac-band + *, .lac-screen > * + .lac-band { margin-top: 3rem; }

.lac-input {
  position: absolute; opacity: 0; height: 1px; width: 1px;
  border: 0; padding: 0; top: 45%; left: 50%; pointer-events: none;
}

/* ══ Hero — centred, stacked ══ */
.lac-hero { text-align: center; padding: 2.5rem 0 2rem; }
.lac-hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
  background: var(--lac-blue-l); border: 1px solid var(--lac-ring);
  color: var(--lac-blue-d); font-size: .8125rem; font-weight: 600;
}
.lac-hero h1 {
  font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.035em;
  max-width: 20ch; margin: 0 auto;
}
.lac-hero h1 em { font-style: normal; color: var(--lac-blue); }
.lac-hero p {
  margin: .875rem auto 0; max-width: 52ch;
  font-size: 1.0625rem; line-height: 1.6; color: var(--lac-dim);
}
.lac-hero-cta { display: flex; flex-wrap: wrap; gap: .625rem; justify-content: center; margin-top: 1.5rem; }
.lac-hero-cta .lac-btn { width: auto; min-width: 180px; padding: 0 1.5rem; }

/* ══ Section heading ══ */
.lac-head { text-align: center; margin-bottom: 1.5rem; }
.lac-head h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.lac-head p  { margin-top: .375rem; font-size: .9375rem; color: var(--lac-dim); }
.lac-section {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.lac-section .lac-eyebrow { font-size: 1.125rem; font-weight: 800; color: var(--lac-ink); letter-spacing: -.02em; }
.lac-link { font-size: .875rem; color: var(--lac-blue-d); cursor: pointer; font-weight: 600; }
.lac-link:hover { text-decoration: underline; }

/* ══ Feature card grid — five across on wide screens ══ */
.lac-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 560px)  { .lac-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 900px)  { .lac-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1100px) { .lac-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
/* A shorter list (home preview) stays at four across. */
@media (min-width: 1100px) { .lac-grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); } }

.lac-feat {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.5rem 1.25rem 1.375rem;
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: 16px; cursor: pointer; box-shadow: var(--lac-sh);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.lac-feat:hover { transform: translateY(-3px); box-shadow: var(--lac-sh-lg); border-color: var(--t, var(--lac-ring)); }
/* Decorative pattern blob, echoing the reference's card overlays. */
.lac-feat::after {
  content: ""; position: absolute; right: -28px; top: -28px;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--tb, var(--lac-blue-l)); opacity: .55; pointer-events: none;
}
.lac-feat > * { position: relative; z-index: 1; }
.lac-ico {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; font-size: 1.4rem; line-height: 1;
  background: var(--tb, var(--lac-blue-l));
}
.lac-feat-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.015em; }
.lac-feat-desc { font-size: .875rem; line-height: 1.55; color: var(--lac-dim); flex: 1; }
.lac-feat-cta  { font-size: .875rem; font-weight: 700; color: var(--t, var(--lac-blue-d)); }
.lac-bar  { height: 6px; margin-top: .25rem; border-radius: 99px; background: var(--lac-tile); overflow: hidden; }
.lac-bar i { display: block; height: 100%; border-radius: 99px; background: var(--t, var(--lac-blue)); transition: width .4s; }

/* ══ Promo band — full-bleed ══ */
.lac-band {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  color: #fff;
  /* break out of the contained screen to run edge to edge */
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  padding: 2.5rem calc(50vw - 50% + 1.25rem);
}
.lac-band::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
.lac-band-in {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
}
.lac-band h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.lac-band p  { margin-top: .375rem; font-size: .9375rem; color: rgba(255,255,255,.88); max-width: 46ch; }
.lac-band .lac-btn { width: auto; min-width: 190px; padding: 0 1.5rem; background: #fff; color: var(--lac-blue-d); }
.lac-band .lac-btn:hover { background: #ecfdf5; }

/* ══ Cards / primitives ══ */
.lac-card {
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: var(--lac-r); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .875rem;
  box-shadow: var(--lac-sh);
}
.lac-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lac-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: var(--lac-dim); }
.lac-pos {
  align-self: flex-start; padding: .2rem .55rem; border-radius: 999px;
  background: var(--lac-tile); color: var(--lac-soft); font-size: .75rem; font-weight: 500;
}
.lac-clue { font-size: .9375rem; line-height: 1.6; color: var(--lac-soft); }
.lac-fine { font-size: .8125rem; color: var(--lac-faint); line-height: 1.55; }
.lac-empty { text-align: center; padding: 3rem 1rem; color: var(--lac-dim); font-size: .9375rem; }
.lac-preview { font-size: 1.75rem; font-weight: 700; letter-spacing: .18em; word-break: break-word; }

.lac-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 48px; border: 1px solid transparent; border-radius: 11px;
  font-family: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.lac-btn:active { transform: scale(.985); }
.lac-btn-blue  { background: var(--lac-blue); color: #fff; box-shadow: 0 1px 2px rgba(13,148,136,.3); }
.lac-btn-blue:hover  { background: var(--lac-blue-d); }
.lac-btn-dark  { background: var(--lac-ink); color: #fff; }
.lac-btn-dark:hover  { background: var(--lac-ink2); }
.lac-btn-ghost { background: var(--lac-card); border-color: var(--lac-line); color: var(--lac-ink2); }
.lac-btn-ghost:hover { background: var(--lac-tile); }
.lac-chip {
  align-self: flex-start; padding: .4rem .8rem; border-radius: 8px;
  background: var(--lac-blue-l); color: var(--lac-blue-d); border: 1px solid var(--lac-ring);
  font-size: .8125rem; font-weight: 600; cursor: pointer;
}

/* ══ How it works ══ */
.lac-steps { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 820px) { .lac-steps { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.5rem; } }
.lac-step {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: 16px; padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--lac-sh);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lac-step:hover { border-color: var(--lac-ring); box-shadow: var(--lac-sh-lg); transform: translateY(-3px); }
/* Oversized ghost numeral in the corner. */
.lac-step::after {
  content: attr(data-n); position: absolute; right: .75rem; top: .25rem; z-index: -1;
  font-size: 4.5rem; font-weight: 800; line-height: 1;
  color: var(--lac-tile); letter-spacing: -.05em;
}
/* Dashed connector between steps on wide screens. */
@media (min-width: 820px) {
  .lac-step:not(:last-child)::before {
    content: ""; position: absolute; top: 3.1rem; right: -1.5rem; width: 1.5rem;
    border-top: 2px dashed var(--lac-line);
  }
  .lac-step { overflow: visible; }
}
.lac-step-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.35rem; background: var(--tb, var(--lac-blue-l)); margin-bottom: .875rem;
}
.lac-step-k {
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--t, var(--lac-blue)); margin-bottom: .25rem;
}
.lac-step h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.02em; }
.lac-step p { margin-top: .4rem; font-size: .9375rem; line-height: 1.6; color: var(--lac-dim); }

/* ══ Main choice cards (Vocabulary / Games) ══ */
.lac-mains { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 700px) { .lac-mains { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1040px) { .lac-mains { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.lac-main {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: .625rem;
  padding: 2rem 1.75rem 1.75rem; border-radius: 20px;
  color: #fff; cursor: pointer; border: none; text-align: left;
  font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.lac-main:hover { transform: translateY(-4px); }
.lac-main-voc { background: linear-gradient(135deg, #0ea5a4 0%, #0d9488 50%, #0f766e 100%);
                box-shadow: 0 10px 30px rgba(13,148,136,.28); }
.lac-main-gam { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 55%, #5b21b6 100%);
                box-shadow: 0 10px 30px rgba(109,40,217,.28); }
.lac-main-sav { background: linear-gradient(135deg, #f59e0b 0%, #d97706 55%, #b45309 100%);
                box-shadow: 0 10px 30px rgba(217,119,6,.28); }
/* Count badge on the My Words card. */
.lac-main-count {
  position: absolute; right: 1.25rem; top: 1.25rem; z-index: 1;
  padding: .25rem .7rem; border-radius: 999px;
  background: rgba(255,255,255,.22); font-size: .8125rem; font-weight: 700;
}
/* Oversized watermark glyph + soft orb, so each card reads instantly. */
.lac-main::before {
  content: ""; position: absolute; right: -50px; top: -50px; z-index: -1;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.lac-main::after {
  content: attr(data-glyph); position: absolute; right: 12px; bottom: -28px; z-index: -1;
  font-size: 7rem; font-weight: 800; line-height: 1; color: rgba(255,255,255,.14);
}
.lac-main-ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 1.6rem;
}
.lac-main h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.lac-main p  { font-size: .9375rem; line-height: 1.55; color: rgba(255,255,255,.88); }
.lac-main-go {
  margin-top: .375rem; font-size: .875rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: gap .2s ease;
}
.lac-main:hover .lac-main-go { gap: .75rem; }

/* ══ Vocabulary browser ══ */
.lac-tools { display: flex; flex-direction: column; gap: .75rem; }
.lac-search { position: relative; display: flex; align-items: center; }
.lac-search svg { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--lac-faint); pointer-events: none; }
/* Wrapper for the Vocabulary results (refreshed on its own while typing); it adds no
   box of its own, so the layout is exactly as before. */
.lac-results { display: contents; }
.lac-search input {
  width: 100%; padding: .75rem 1rem .75rem 2.5rem;
  border: 1px solid var(--lac-line); border-radius: 11px;
  background: var(--lac-card); color: var(--lac-ink);
  font-family: inherit; font-size: .9375rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.lac-search input:focus { border-color: var(--lac-blue); box-shadow: 0 0 0 3px rgba(13,148,136,.13); }
.lac-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* A–Z jump strip. Letters with no words are dimmed rather than hidden, so the
   alphabet stays in a stable, scannable position. */
.lac-alpha { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.lac-alpha button {
  min-width: 2rem; height: 2rem; padding: 0 .35rem;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--lac-line); background: var(--lac-card);
  font-size: .8125rem; font-weight: 700; color: var(--lac-soft);
  text-transform: uppercase;
  transition: background .12s, color .12s, border-color .12s, transform .1s;
}
.lac-alpha button:hover:not(:disabled) { background: var(--lac-blue-l); border-color: var(--lac-ring); color: var(--lac-blue-d); }
.lac-alpha button:active:not(:disabled) { transform: scale(.92); }
.lac-alpha button.on { background: var(--lac-blue); border-color: var(--lac-blue); color: #fff; }
.lac-alpha button:disabled { opacity: .32; cursor: not-allowed; }
.lac-alpha .lac-alpha-all { min-width: auto; padding: 0 .7rem; }
.lac-fchip {
  padding: .4rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--lac-line); background: var(--lac-card);
  font-family: inherit; font-size: .8125rem; font-weight: 600; color: var(--lac-dim);
  transition: background .15s, color .15s, border-color .15s;
}
.lac-fchip:hover { background: var(--lac-tile); color: var(--lac-ink); }
.lac-fchip.on { background: var(--lac-blue); border-color: var(--lac-blue); color: #fff; }
.lac-fchip b { font-weight: 700; opacity: .7; margin-left: .3rem; }

/* Topic tags (Vocabulary): one row that scrolls sideways; the right edge fades
   so it reads as "more this way". */
.lac-tags {
  display: flex; gap: .4rem; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0 -1rem; padding: .1rem 1rem .35rem; scroll-padding: 0 1rem;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
.lac-tags::-webkit-scrollbar { height: 4px; }
.lac-tags::-webkit-scrollbar-thumb { background: var(--lac-line); border-radius: 4px; }
.lac-tag { flex: 0 0 auto; white-space: nowrap; }
.lac-tag:last-child { margin-right: 2rem; }
.lac-tag-go { display: flex; }
@media (max-width: 560px) { .lac-tag-go .lac-btn { width: 100%; justify-content: center; } }

/* minmax(0,1fr), not 1fr: a plain 1fr column grows to fit its widest card, which
   pushed word cards past the edge of a phone screen. */
.lac-words { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
@media (min-width: 820px) { .lac-words { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.lac-word {
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: 14px; padding: 1.125rem 1.25rem;
  box-shadow: var(--lac-sh); transition: border-color .15s, box-shadow .15s;
}
.lac-word:hover { border-color: var(--lac-ring); box-shadow: var(--lac-sh-lg); }
/* The word keeps its full width; if word + tag + buttons can't share one line (a long
   word on a small phone), the tag and buttons move to a second line, right-aligned,
   instead of squeezing the word or overflowing the card. */
.lac-word-top { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; row-gap: .5rem; }
.lac-word-w { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; flex: 1 0 auto; max-width: 100%; overflow-wrap: anywhere; }
.lac-word-ctrl { display: flex; align-items: center; gap: .625rem; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 400px) {
  .lac-word { padding: 1rem; }
  .lac-word-top, .lac-word-ctrl { gap: .45rem; }
  .lac-word .lac-say { width: 32px; height: 32px; }
}
.lac-say {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--lac-line); background: var(--lac-card);
  color: var(--lac-blue-d); cursor: pointer; transition: background .15s, transform .12s;
}
.lac-say:hover { background: var(--lac-blue-l); }
.lac-say:active { transform: scale(.9); }
.lac-say.on { background: var(--lac-blue); color: #fff; border-color: var(--lac-blue); }
.lac-say svg { width: 17px; height: 17px; }

/* Save / remove toggle, sharing the icon-button shape. */
.lac-save { color: var(--lac-faint); }
.lac-save:hover { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.lac-save.on { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.lac-save.on svg { fill: currentColor; }
.lac-report { color: var(--lac-faint); }
.lac-report:hover { background: var(--lac-warn-bg); color: var(--lac-warn); border-color: #fca5a5; }
.lac-del { color: var(--lac-faint); }
.lac-del:hover { background: var(--lac-warn-bg); color: var(--lac-warn); border-color: #fca5a5; }

/* Empty state for a list with nothing in it yet. */
.lac-blank {
  text-align: center; padding: 3rem 1.5rem;
  background: var(--lac-card); border: 1px dashed var(--lac-line);
  border-radius: var(--lac-r);
}
.lac-blank-ico {
  width: 54px; height: 54px; margin: 0 auto .875rem; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.6rem; background: var(--lac-tile);
}
.lac-blank h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.02em; }
.lac-blank p { margin-top: .4rem; font-size: .9375rem; color: var(--lac-dim); line-height: 1.55; }
.lac-blank .lac-btn { width: auto; min-width: 200px; margin: 1.25rem auto 0; padding: 0 1.5rem; }
/* Part-of-speech tag, colour-coded per class. */
.lac-pos-tag {
  flex: 0 0 auto; padding: .15rem .55rem; border-radius: 999px;
  font-size: .6875rem; font-weight: 700; text-transform: lowercase;
  background: var(--lac-tile); color: var(--lac-soft);
}
.lac-pos-noun      { background: #dbeafe; color: #1d4ed8; }
.lac-pos-verb      { background: #dcfce7; color: #15803d; }
.lac-pos-adjective { background: #fef3c7; color: #b45309; }
.lac-pos-adverb    { background: #ede9fe; color: #6d28d9; }
/* Mastery: five dots reflecting the word's Leitner box. */
.lac-mastery { display: inline-flex; gap: 3px; margin-top: .5rem; align-items: center; }
.lac-mastery i { width: 6px; height: 6px; border-radius: 99px; background: var(--lac-line); }
.lac-mastery i.on { background: var(--lac-faint); }
.lac-mastery.learned i.on { background: var(--lac-blue); }
.lac-word-m { margin-top: .4rem; font-size: .9375rem; line-height: 1.55; color: var(--lac-soft); }
.lac-word-e {
  margin-top: .625rem; padding-left: .75rem;
  border-left: 3px solid var(--lac-ring);
  font-size: .875rem; line-height: 1.55; font-style: italic; color: var(--lac-dim);
}
/* Regional variant tags: (GB) beside a British headword, (US) on its equivalent. */
.lac-var {
  font-size: .625rem; font-weight: 700; letter-spacing: .02em;
  color: var(--lac-soft); vertical-align: middle; margin-left: .3rem;
}
.lac-word-us { margin-top: .4rem; font-size: .875rem; line-height: 1.5; }
.lac-var-word { font-weight: 700; color: var(--lac-soft); }
.lac-us-m { color: var(--lac-dim); }
/* Practise actions on the saved list. */
.lac-practise { display: grid; grid-template-columns: 1fr; gap: .625rem; }
@media (min-width: 640px) { .lac-practise { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lac-practise .lac-btn[disabled] { opacity: .5; cursor: not-allowed; }

.lac-more { display: flex; justify-content: center; }
.lac-more .lac-btn { width: auto; min-width: 200px; padding: 0 1.5rem; }

/* ══ Games page ══ */
/* The game cards sit side by side once there is room, and stack on a phone.
   Grid keeps them equal height regardless of how much copy each one carries. */
.lac-games-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .lac-games-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lac-gcard {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 2rem 1.75rem; border-radius: 20px; cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #5b21b6); color: #fff;
  box-shadow: 0 10px 30px rgba(109,40,217,.26);
  display: flex; flex-direction: column; gap: .625rem;
  transition: transform .2s ease;
}
.lac-gcard:hover { transform: translateY(-4px); }
.lac-gcard::before {
  content: ""; position: absolute; right: -60px; top: -60px; z-index: -1;
  width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.lac-gcard h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.lac-gcard p { font-size: .9375rem; color: rgba(255,255,255,.88); max-width: 46ch; line-height: 1.55; }
.lac-gtags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.lac-gtag {
  padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: rgba(255,255,255,.18);
}

/* ══ Modal ══ */
.lac-modal {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  background: rgba(15,23,42,.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: lacFade .2s ease both;
}
.lac-modal[hidden] { display: none; }
@keyframes lacFade { from { opacity: 0; } to { opacity: 1; } }
.lac-dialog {
  width: 100%; max-width: 30rem; max-height: 88vh; overflow-y: auto;
  background: var(--lac-card); border-radius: 20px; padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(15,23,42,.3);
  animation: lacZoom .26s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes lacZoom { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.lac-dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.lac-dialog h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -.025em; }
.lac-dialog-top p { margin-top: .25rem; font-size: .875rem; color: var(--lac-dim); }
.lac-x {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid var(--lac-line); border-radius: 10px; background: var(--lac-card);
  color: var(--lac-soft); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.lac-x:hover { background: var(--lac-tile); }
.lac-levels { display: flex; flex-direction: column; gap: .625rem; }
.lac-level {
  display: flex; align-items: center; gap: .875rem; text-align: left;
  padding: 1rem 1.125rem; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--lac-line); background: var(--lac-card);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.lac-level:hover { border-color: var(--lac-blue); transform: translateX(3px); }
.lac-level.on { border-color: var(--lac-blue); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.lac-level-n { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px;
               display: grid; place-items: center; font-size: 1.2rem;
               background: var(--tb, var(--lac-blue-l)); }
.lac-level b { display: block; font-size: 1rem; font-weight: 700; }
.lac-level s { display: block; font-size: .8125rem; color: var(--lac-dim); text-decoration: none; margin-top: .1rem; }
/* Report-a-problem popup (Vocabulary word cards). */
.lac-rep-opts { display: flex; flex-direction: column; gap: .5rem; }
.lac-rep-opt {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  padding: .8rem 1rem; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: .9375rem; color: var(--lac-ink, inherit);
  border: 1px solid var(--lac-line); background: var(--lac-card);
  transition: border-color .15s, background .15s;
}
.lac-rep-opt:hover { border-color: var(--lac-blue); }
.lac-rep-opt.on { border-color: var(--lac-blue); background: var(--lac-blue-l); }
.lac-rep-box {
  width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px;
  border: 2px solid var(--lac-line); background: var(--lac-card); position: relative;
}
.lac-rep-opt.on .lac-rep-box { background: var(--lac-blue); border-color: var(--lac-blue); }
.lac-rep-opt.on .lac-rep-box::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lac-rep-msg { min-height: 1.25rem; margin: .75rem 0 0; font-size: .875rem; color: var(--lac-dim); }
.lac-rep-msg.err { color: var(--lac-warn); }
.lac-rep-go { display: flex; justify-content: flex-end; margin-top: .5rem; }
.lac-rep-go .lac-btn[disabled] { opacity: .45; cursor: not-allowed; }
.lac-rep-done { text-align: center; padding: .5rem 0; }
.lac-rep-done p { margin: .4rem 0 1.25rem; color: var(--lac-dim); }
@media (prefers-reduced-motion: reduce) {
  .lac-modal, .lac-dialog { animation: none; }
  .lac-main:hover, .lac-gcard:hover, .lac-level:hover { transform: none; }
}

/* ══ Segmented difficulty selector ══ */
.lac-pick { display: flex; flex-direction: column; gap: .5rem; }
.lac-pick-l {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--lac-dim);
}
.lac-seg {
  display: inline-flex; align-self: flex-start; gap: 2px;
  padding: 4px; border-radius: 12px;
  background: var(--lac-tile); border: 1px solid var(--lac-line);
}
.lac-seg button {
  padding: .5rem .95rem; border: none; border-radius: 9px;
  background: none; font-family: inherit; font-size: .875rem; font-weight: 600;
  color: var(--lac-dim); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.lac-seg button:hover { color: var(--lac-ink); }
.lac-seg button.on {
  background: #fff; color: var(--lac-blue-d);
  box-shadow: 0 1px 3px rgba(15,23,42,.12);
}
@media (max-width: 420px) {
  .lac-seg { width: 100%; }
  .lac-seg button { flex: 1; padding: .5rem .4rem; font-size: .8125rem; }
}

/* ══ Lists (difficulty, settings rows) ══ */
.lac-list { display: flex; flex-direction: column; gap: .75rem; }
.lac-tier {
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: var(--lac-r); padding: 1.25rem 1.375rem; cursor: pointer;
  box-shadow: var(--lac-sh); transition: border-color .15s, box-shadow .15s;
}
.lac-tier:hover { border-color: var(--lac-ring); }
.lac-tier.on { border-color: var(--lac-blue); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.lac-tier-name { font-size: 1.125rem; font-weight: 700; letter-spacing: -.015em; }
.lac-tier-meta { font-size: .75rem; font-weight: 500; color: var(--lac-faint); }
.lac-tier-desc { font-size: .9375rem; color: var(--lac-dim); margin-top: .4rem; line-height: 1.55; }

/* ══ Play ══ */
/* Run header: what you are playing on the left, time remaining on the right. */
.lac-run { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lac-run-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.lac-rchip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 999px;
  background: var(--lac-tile); color: var(--lac-soft);
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.lac-rchip b { color: var(--lac-ink); font-weight: 800; }
.lac-rchip.warm { background: #fef3c7; color: #b45309; }

/* Countdown ring — the arc drains as the clock runs down. */
.lac-ring {
  width: 76px; height: 76px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  position: relative; isolation: isolate;
  background: conic-gradient(var(--lac-blue) var(--p, 100%), var(--lac-line) 0);
  transition: background .3s linear;
}
.lac-ring::after {
  content: ""; position: absolute; inset: 6px; z-index: -1;
  border-radius: 50%; background: var(--lac-card);
}
.lac-ring b { font-size: 1.0625rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lac-ring.low { background: conic-gradient(var(--lac-warn) var(--p, 100%), var(--lac-line) 0); }
.lac-ring.low b { color: var(--lac-warn); }
.lac-ring.low { animation: lacPulse 1s ease-in-out infinite; }
@keyframes lacPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* A wide stage makes a five-letter word look lost, so the run keeps a narrow,
   focused column at every screen size — the game is the same shape everywhere. */
#lac-play, #lac-quiz, #lac-win { max-width: 540px; }

/* The puzzle itself sits on a raised stage rather than loose on the page. */
.lac-stage {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: 22px; padding: 2.75rem 1.5rem 2rem;
  box-shadow: var(--lac-sh-lg);
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  text-align: center;
}
/* Accent strip along the top edge. */
.lac-stage::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #2dd4bf, var(--lac-blue) 45%, #6366f1);
}
/* Faint graph paper, echoing the hero — a page you fill in. */
.lac-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.035) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(75% 65% at 50% 40%, #000 25%, transparent 78%);
  mask-image: radial-gradient(75% 65% at 50% 40%, #000 25%, transparent 78%);
}
.lac-stage-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center; }
/* The clue is the heart of the puzzle, so it is set like a pull quote. */
.lac-clue-big {
  position: relative; margin-top: .75rem;
  font-size: 1.25rem; line-height: 1.5; font-weight: 500;
  color: var(--lac-ink); max-width: 26rem; text-wrap: pretty;
}
.lac-clue-big::before {
  content: "\201C"; position: absolute; left: 50%; top: -1.9rem;
  transform: translateX(-50%);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3rem; line-height: 1; color: var(--lac-ring);
  pointer-events: none;
}
@media (min-width: 760px) { .lac-clue-big { font-size: 1.3125rem; } }

/* Keyboard affordances, shown as real keys. */
.lac-keys {
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; justify-content: center;
  font-size: .8125rem; color: var(--lac-faint);
}
.lac-keys span { display: inline-flex; align-items: center; gap: .35rem; }
.lac-keys kbd {
  font-family: inherit; font-size: .6875rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: 5px;
  background: var(--lac-tile); border: 1px solid var(--lac-line);
  color: var(--lac-soft);
}

.lac-tiles { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; cursor: text; }
.lac-tile {
  width: 3rem; height: 3.5rem; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.625rem; font-weight: 700;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s, transform .15s;
}
/* An empty gap reads as a recess cut into the page. */
.lac-tile.gap {
  background: var(--lac-paper); border: 2px solid var(--lac-line);
  color: var(--lac-ink); cursor: pointer;
  box-shadow: inset 0 2px 5px rgba(15,23,42,.05);
}
.lac-tile.gap.filled {
  border-color: var(--lac-ring); background: var(--lac-blue-l);
  box-shadow: 0 2px 6px rgba(13,148,136,.16);
}
/* The gap you are about to type into lifts off the row. */
.lac-tile.gap.active {
  border-color: var(--lac-blue); background: var(--lac-card);
  box-shadow: 0 0 0 4px rgba(13,148,136,.14), 0 8px 16px rgba(13,148,136,.18);
  transform: translateY(-3px);
}
.lac-tile.gap.reveal { color: var(--lac-blue-d); }
/* Given letters read as already written in, on a faint ruled line. */
.lac-tile.given {
  background: transparent; border: 2px solid transparent;
  border-bottom: 2px solid var(--lac-line); border-radius: 0;
  color: var(--lac-faint);
}
.lac-tile.space { width: .75rem; background: transparent; border: none; }
.lac-tiles.wrong .lac-tile.gap { border-color: #fca5a5; background: var(--lac-warn-bg); color: var(--lac-warn); }
@media (max-width: 400px) { .lac-tile { width: 2.15rem; height: 2.65rem; font-size: 1.2rem; } }

.lac-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.lac-pill {
  padding: .5625rem 1rem; border-radius: 9px; font-size: .875rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  background: var(--lac-blue-l); color: var(--lac-blue-d); border: 1px solid var(--lac-ring);
  transition: background .15s;
}
.lac-pill:hover { background: #ccfbf1; }
.lac-pill[disabled] { opacity: .45; cursor: not-allowed; }
.lac-pill-ghost { background: var(--lac-card); border-color: var(--lac-line); color: var(--lac-soft); }
.lac-pill-ghost:hover { background: var(--lac-tile); }
.lac-input-hint { text-align: center; font-size: .8125rem; color: var(--lac-faint); }
.lac-input-hint.warn { color: var(--lac-warn); font-weight: 500; }

/* ══ Quiz (Match the Meaning) ══ */
.lac-qdots { display: flex; gap: .3rem; justify-content: center; }
.lac-qdots i { width: 100%; max-width: 30px; height: 5px; border-radius: 99px; background: var(--lac-line); }
.lac-qdots i.ok  { background: var(--lac-blue); }
.lac-qdots i.no  { background: #fca5a5; }
.lac-qdots i.now { background: var(--lac-ink); }

.lac-qword {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  padding: 1.5rem 0 .25rem;
}
.lac-qword b { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; }
.lac-qask { text-align: center; font-size: .9375rem; color: var(--lac-dim); margin-bottom: 1.25rem; }

.lac-opts { display: flex; flex-direction: column; gap: .625rem; }
.lac-opt {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  padding: 1rem 1.125rem; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--lac-line); background: var(--lac-card);
  font-family: inherit; font-size: .9375rem; line-height: 1.5; color: var(--lac-ink);
  box-shadow: var(--lac-sh);
  transition: border-color .15s, background .15s, transform .12s;
}
.lac-opt:hover:not(:disabled) { border-color: var(--lac-blue); background: var(--lac-blue-l); }
.lac-opt:active:not(:disabled) { transform: scale(.995); }
.lac-opt::before {
  content: ""; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--lac-line);
}
.lac-opt.right { border-color: var(--lac-ok); background: var(--lac-ok-bg); color: var(--lac-ok); font-weight: 600; }
.lac-opt.right::before {
  content: "\2713"; border-color: var(--lac-ok); background: var(--lac-ok); color: #fff;
  display: grid; place-items: center; font-size: .65rem; font-weight: 700;
}
.lac-opt.wrong { border-color: var(--lac-warn); background: var(--lac-warn-bg); color: var(--lac-warn); }
.lac-opt.wrong::before {
  content: "\2715"; border-color: var(--lac-warn); background: var(--lac-warn); color: #fff;
  display: grid; place-items: center; font-size: .65rem; font-weight: 700;
}
.lac-opt:disabled { cursor: default; }
.lac-opt-k {
  margin-left: auto; flex: 0 0 auto; font-size: .6875rem; font-weight: 700;
  color: var(--lac-faint); padding: .1rem .4rem; border-radius: 5px;
  background: var(--lac-tile); border: 1px solid var(--lac-line);
}
.lac-qfeed { text-align: center; font-size: .9375rem; line-height: 1.55; }
.lac-qfeed.ok { color: var(--lac-ok); }
.lac-qfeed.no { color: var(--lac-warn); }
.lac-qex {
  margin-top: .5rem; font-style: italic; color: var(--lac-dim); font-size: .875rem;
}

/* ══ Result ══ */
.lac-win { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.25rem; padding: 2.5rem 0; }
.lac-outcome { padding: .3rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.lac-outcome.solved  { background: var(--lac-ok-bg);   color: var(--lac-ok); }
.lac-outcome.shown   { background: var(--lac-tile);    color: var(--lac-soft); }
.lac-outcome.timeout { background: var(--lac-warn-bg); color: var(--lac-warn); }
.lac-win-word { font-size: 2.5rem; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.lac-win-clue { font-size: 1rem; line-height: 1.6; color: var(--lac-dim); max-width: 30rem; }
.lac-example {
  max-width: 30rem; width: 100%; padding: 1rem 1.125rem; border-radius: 12px;
  background: var(--lac-card); border: 1px solid var(--lac-line); text-align: left;
  box-shadow: var(--lac-sh);
}
.lac-example s {
  display: block; font-size: .6875rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--lac-faint); text-decoration: none; margin-bottom: .3rem;
}
.lac-example i { font-style: italic; font-size: .9375rem; line-height: 1.55; color: var(--lac-ink2); }
.lac-win-stats { display: flex; gap: 2rem; }
.lac-win-stats div { display: flex; flex-direction: column; gap: .1rem; }
.lac-win-stats b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.lac-win-stats s { font-size: .75rem; color: var(--lac-dim); text-decoration: none; }

/* ══ Stats ══ */
.lac-big-num { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.035em; color: var(--lac-blue-d); }
.lac-week { display: flex; gap: .4rem; align-items: flex-end; height: 90px; }
.lac-week i { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--lac-ring); }
.lac-week i.hi { background: var(--lac-blue); }
.lac-week-lbl { display: flex; justify-content: space-between; font-size: .75rem; color: var(--lac-faint); }
.lac-stat-row {
  background: var(--lac-card); border: 1px solid var(--lac-line); border-radius: 12px;
  padding: 1rem 1.125rem; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--lac-sh);
}
.lac-stat-row b { font-size: 1.125rem; font-weight: 700; }

/* ══ Settings ══ */
/* Settings and Progress are personal pages of rows and figures, not grids, so
   they keep the same narrow phone-width column as the run screens rather than
   stranding each value on the far right of a wide sheet. */
#lac-settings, #lac-stats { max-width: 540px; }

.lac-set-group { margin-top: 1.75rem; }
.lac-set-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--lac-faint);
  margin: 0 .25rem .625rem;
}
/* Each row gets a colour-coded tile, so the list scans by icon not by reading. */
.lac-toggle-ico {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 11px;
  font-size: 1.05rem; background: var(--tb, var(--lac-tile));
}
.lac-toggle-main { display: flex; align-items: center; gap: .875rem; min-width: 0; flex: 1; }

/* About card */
.lac-about {
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: var(--lac-r); padding: 1.25rem; box-shadow: var(--lac-sh);
  display: flex; flex-direction: column; gap: .75rem;
}
.lac-about-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.lac-about-row s { color: var(--lac-dim); font-size: .875rem; text-decoration: none; }
.lac-about-row b { font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Destructive actions are fenced off rather than sitting in the normal flow. */
.lac-danger {
  border: 1px solid #fca5a5; border-radius: var(--lac-r);
  background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem;
}
.lac-danger b { font-size: .9375rem; font-weight: 700; color: var(--lac-warn); }
.lac-danger p { font-size: .875rem; line-height: 1.55; color: var(--lac-soft); }
.lac-danger .lac-btn {
  width: auto; align-self: flex-start; margin-top: .5rem; padding: 0 1.25rem; height: 42px;
  background: var(--lac-card); border-color: #fca5a5; color: var(--lac-warn);
}
.lac-danger .lac-btn:hover { background: var(--lac-warn); color: #fff; border-color: var(--lac-warn); }
.lac-danger .lac-btn.armed { background: var(--lac-warn); color: #fff; border-color: var(--lac-warn); }

.lac-toggle-list {
  background: var(--lac-card); border: 1px solid var(--lac-line);
  border-radius: var(--lac-r); overflow: hidden; box-shadow: var(--lac-sh);
}
.lac-toggle { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.125rem; cursor: pointer; }
.lac-toggle:hover { background: var(--lac-paper); }
.lac-toggle + .lac-toggle { border-top: 1px solid var(--lac-line); }
.lac-toggle-l b { display: block; font-size: .9375rem; font-weight: 600; }
.lac-toggle-l s { display: block; font-size: .8125rem; color: var(--lac-dim); text-decoration: none; margin-top: .05rem; }
.lac-track {
  width: 44px; height: 26px; flex: none; border-radius: 999px;
  background: #cbd5e1; padding: 3px; display: flex; justify-content: flex-start;
  transition: background .18s;
}
.lac-track.on { background: var(--lac-blue); justify-content: flex-end; }
.lac-track i { width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); }

/* ══ Onboarding ══ */
.lac-ob { text-align: center; padding: 3rem 0; }
.lac-ob-title { font-size: 2.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }
.lac-ob-copy  { margin: 1rem auto 0; font-size: 1.0625rem; line-height: 1.6; color: var(--lac-dim); max-width: 46ch; }
.lac-ob-mark  {
  margin-top: 1.75rem; display: inline-flex;
  padding: .5rem .9rem; border-radius: 10px;
  background: var(--lac-blue-l); color: var(--lac-blue-d); border: 1px solid var(--lac-ring);
  font-size: 1.25rem; font-weight: 700; letter-spacing: .22em;
}
.lac-ob-dots  { display: flex; gap: .375rem; margin: 2rem auto 0; justify-content: center; }
.lac-ob-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--lac-line); transition: width .2s, background .2s; }
.lac-ob-dots i.on { width: 22px; background: var(--lac-blue); }
.lac-ob .lac-btn { width: auto; min-width: 220px; margin: 1.5rem auto 0; padding: 0 1.5rem; }
.lac-skip { margin-top: .875rem; font-size: .875rem; color: var(--lac-dim); cursor: pointer; }

/* ══ Footer — multi-column ══ */
.lac-foot {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f8 100%);
  border-top: 1px solid var(--lac-line);
  margin-top: 3rem; padding: 3.25rem 0 1.5rem;
}
/* Creative touch: a thin teal→sky accent ribbon along the top edge. */
.lac-foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #2dd4bf, #0d9488 55%, #0ea5e9);
}
.lac-foot[hidden] { display: none; }

/* Responsive grid: mobile = brand full width + link columns 2×2; small screens
   = 4 columns in a row under the brand; desktop = brand + 4 columns in one row. */
.lac-foot-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2rem 1.25rem;
  max-width: var(--lac-max); margin: 0 auto; padding: 0 1.25rem;
}
.lac-foot-brand { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 560px) { .lac-foot-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 960px) {
  .lac-foot-grid { grid-template-columns: 1.9fr repeat(4, minmax(0,1fr)); align-items: start; }
  .lac-foot-brand { grid-column: auto; }
}

.lac-foot-logo {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -.025em; color: var(--lac-ink);
}
.lac-foot-logo::before {
  content: ""; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  background: url("/icon.svg") center / cover no-repeat;
  box-shadow: 0 3px 8px rgba(13,148,136,.3);
}
.lac-foot-brand p { font-size: .875rem; line-height: 1.6; color: var(--lac-dim); max-width: 34ch; }

.lac-foot-col h3 {
  position: relative; padding-bottom: .45rem; margin-bottom: .9rem;
  font-size: .8125rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--lac-ink);
}
.lac-foot-col h3::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 20px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, #2dd4bf, #0d9488);
}
/* Each link gets a 26px+ tall tap area (padding), with the list gap reduced to match,
   so the spacing looks the same but meets the 24px minimum tap-target size. */
.lac-foot-col ul { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.lac-foot-col li, .lac-foot-a {
  padding: .2rem 0;
  font-size: .875rem; color: var(--lac-dim); cursor: pointer;
  text-decoration: none; display: inline-block; width: fit-content;
  transition: color .15s, transform .15s;
}
.lac-foot-col li:hover, .lac-foot-a:hover { color: var(--lac-blue-d); transform: translateX(3px); }

.lac-foot-bar {
  max-width: var(--lac-max); margin: 2.75rem auto 0; padding: 1.25rem 1.25rem 0;
  border-top: 1px solid var(--lac-line);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: center; justify-content: space-between;
  font-size: .8125rem; color: var(--lac-faint);
}

/* ══════════════════════════════════════
   Creative layer — motion, texture, personality.
   Everything here is decorative and switches off under
   prefers-reduced-motion; nothing is required to use the app.
══════════════════════════════════════ */

/* ── Hero: gradient mesh + faint grid, with floating letter tiles ── */
.lac-hero { position: relative; isolation: isolate; }
.lac-hero::before {
  /* Bleeds to the full screen width (calc(50% - 50vw) on each side). The
     sideways-swipe this used to cause on mobile is prevented by
     `overflow-x: clip` on .vb (clip, not hidden, so the sticky header still works). */
  content: ""; position: absolute; inset: -20% calc(50% - 50vw) 0;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 55% at 18% 28%, rgba(45,212,191,.22), transparent 70%),
    radial-gradient(34% 50% at 82% 22%, rgba(13,148,136,.16), transparent 70%),
    radial-gradient(30% 45% at 50% 80%, rgba(56,189,248,.12), transparent 70%);
  filter: blur(6px);
}
/* Faint graph-paper texture, a nod to filling in blanks on a page. */
.lac-hero::after {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 75%);
}

/* Decorative letter tiles drifting behind the headline. */
.lac-floats { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.lac-float {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 54px; border-radius: 12px;
  background: #fff; border: 1px solid var(--lac-line);
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
  font-size: 1.35rem; font-weight: 800; color: var(--lac-ring);
  animation: lacFloat 9s ease-in-out infinite;
}
@keyframes lacFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, -8deg)); }
  50%      { transform: translateY(-16px) rotate(calc(var(--r, -8deg) * -.6)); }
}

/* ── Hero demo: a word solving itself on a loop ── */
.lac-demo {
  display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap;
  margin: 2rem auto 0; min-height: 3.5rem;
}
.lac-demo-t {
  width: 2.5rem; height: 3rem; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 800;
  background: #fff; border: 2px solid var(--lac-line); color: var(--lac-ink);
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.lac-demo-t.blank { border-style: dashed; border-color: var(--lac-ring); background: var(--lac-blue-l); }
.lac-demo-t.fill  { animation: lacFlip .45s ease-out both; border-color: var(--lac-blue); color: var(--lac-blue-d); }
@keyframes lacFlip {
  0%   { transform: rotateX(-90deg) scale(.9); opacity: .2; }
  60%  { transform: rotateX(12deg)  scale(1.04); opacity: 1; }
  100% { transform: rotateX(0)      scale(1); }
}
.lac-demo-cap { margin-top: .875rem; font-size: .875rem; color: var(--lac-dim); }

/* ── Scroll reveal ── */
.lac-rv { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.lac-rv.in { opacity: 1; transform: none; }

/* ── Feature card micro-interactions ── */
.lac-feat .lac-ico { transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.lac-feat:hover .lac-ico { transform: scale(1.1) rotate(-6deg); }
.lac-feat .lac-feat-cta { transition: transform .2s ease; }
.lac-feat:hover .lac-feat-cta { transform: translateX(5px); }
/* Staggered entrance for a grid of cards. */
.lac-grid > .lac-rv:nth-child(1) { transition-delay: .00s; }
.lac-grid > .lac-rv:nth-child(2) { transition-delay: .06s; }
.lac-grid > .lac-rv:nth-child(3) { transition-delay: .12s; }
.lac-grid > .lac-rv:nth-child(4) { transition-delay: .18s; }
.lac-grid > .lac-rv:nth-child(5) { transition-delay: .24s; }

/* ── Play: tactile tiles ── */
.lac-tile.gap.filled { animation: lacPop .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes lacPop { 0% { transform: scale(.82); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.lac-tile.gap.active::after {
  content: ""; width: 60%; height: 2px; border-radius: 2px;
  background: var(--lac-blue); position: absolute; bottom: 7px;
  animation: lacCaret 1.1s steps(2, jump-none) infinite;
}
.lac-tile.gap { position: relative; }
@keyframes lacCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.lac-tiles.wrong { animation: lacShake .4s ease; }
@keyframes lacShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

/* ── Result: celebration ── */
.lac-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 900; overflow: hidden; }
.lac-confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: lacFall linear forwards;
}
@keyframes lacFall {
  to { transform: translateY(104vh) rotate(720deg); opacity: .15; }
}
.lac-win-word { animation: lacRise .5s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes lacRise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* Respect the OS setting: drop every decorative animation. */
@media (prefers-reduced-motion: reduce) {
  .lac-tile.gap.active { transform: none; }
  .lac-float, .lac-demo-t.fill, .lac-tile.gap.filled,
  .lac-tiles.wrong, .lac-win-word, .lac-confetti i, .lac-tile.gap.active::after {
    animation: none !important;
  }
  .lac-rv { opacity: 1; transform: none; transition: none; }
  .lac-feat:hover .lac-ico, .lac-feat:hover .lac-feat-cta { transform: none; }
}

/* ══ Desktop type scale ══ */
@media (min-width: 760px) {
  .lac-screen   { padding: 3rem 1.5rem 4rem; }
  .lac-hero     { padding: 4rem 0 3rem; }
  .lac-hero h1  { font-size: 3rem; }
  .lac-hero p   { font-size: 1.125rem; }
  .lac-head h2  { font-size: 1.875rem; }
  .lac-ob-title { font-size: 3.25rem; }
  .lac-band     { padding-top: 3.5rem; padding-bottom: 3.5rem; }

  /* Keep entry lines readable instead of spanning the full width. */
  .room-layout { max-width: 780px; margin: 0 auto; }
}
/* ══════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s, opacity .15s;
  white-space: nowrap;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:active        { transform: scale(.97); }
.btn:disabled      { opacity: .38; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent-ring); }

.btn-danger-ghost {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(248,113,113,.22);
  padding: .35rem .8rem;
  font-size: .78rem;
}
.btn-danger-ghost:hover:not(:disabled) { background: rgba(248,113,113,.09); }

.text-input {
  width: 100%;
  background: var(--surf-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: .65rem 1rem;
  outline: none;
  transition: border-color .15s;
}
.text-input:focus        { border-color: var(--accent); }
.text-input::placeholder { color: var(--muted); }

.error-msg        { font-size: .8rem; color: var(--error); margin-top: .25rem; }
.error-msg.hidden { display: none; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .65rem;
}
.logo-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .18rem .65rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-ring);
}

.card {
  background: var(--surf-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.card h2 { font-size: 1.05rem; font-weight: 700; }

/* ── Never print ── */
@media print { body { display: none !important; } }

.input-group {
  display: flex;
  gap: .5rem;
}
.input-group .text-input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .9rem;
}
@keyframes pulse {
  0%   { transform: scale(.85); opacity: 1; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(.85); opacity: 0; }
}

.room-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  isolation: isolate;           /* own stacking context for the backdrop layers */
  background: var(--bg);
}
/* Homepage-hero backdrop across the whole view (mobile + desktop): soft
   teal/cyan gradient mesh + faint graph-paper grid, so the view reads as the
   same site at a glance. Layers sit at z-index:-1 behind everything; the frosted
   bars and opaque cards above stay fully readable. */
.room-layout::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 55% at 18% 28%, rgba(45,212,191,.22), transparent 70%),
    radial-gradient(34% 50% at 82% 22%, rgba(13,148,136,.16), transparent 70%),
    radial-gradient(30% 45% at 50% 80%, rgba(56,189,248,.12), transparent 70%);
  filter: blur(6px);
}
.room-layout::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15,23,42,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 75%);
}

/* Floating letter tiles drifting behind the room — the same motif as the homepage
   hero, so the backdrop matches the rest of the site. Purely decorative: it sits in
   the -1 layer behind the frosted bars and the opaque cards, and is kept
   near the edges with reduced opacity so it never competes with the content. */
.room-floats { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.room-float {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 54px; border-radius: 12px;
  background: #fff; border: 1px solid var(--lac-line);
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
  font-size: 1.35rem; font-weight: 800; color: var(--lac-ring);
  opacity: .55;
  animation: lacFloat 9s ease-in-out infinite;
}
@media (max-width: 600px) {
  /* Fewer, lighter tiles on a narrow screen so they stay out of the way. */
  .room-float { width: 40px; height: 48px; font-size: 1.15rem; opacity: .45; }
}

/* Centred word-tile watermark (the "LETTERS" motif + 6 empty boxes).
   Sits in the -1 layer like the other backdrop, fixed in the middle as content scrolls. */
.room-center {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .45rem;
}
/* Hero-style heading above the letter tiles — matches the homepage hero exactly
   (dark title + teal <em>), sitting over the word-game backdrop. */
.rc-head {
  text-align: center; max-width: 18ch; margin: 0 auto 1rem;
  font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.035em;
  color: var(--text); opacity: .92;
}
.rc-head em { font-style: normal; color: var(--accent); }
@media (max-width: 600px) { .rc-head { font-size: 1.45rem; margin-bottom: .7rem; } }
.rc-row { display: flex; gap: .4rem; perspective: 500px; opacity: .55; }
.rc-tile, .rc-box {
  width: 2.3rem; height: 2.7rem; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; border: 2px solid #e2e8f0;
  font-size: 1.25rem; font-weight: 800; color: #334155;
  box-shadow: 0 6px 16px rgba(15,23,42,.06);
}
.rc-tile.on { border-color: #0d9488; color: #0d9488; }

/* Each tile flip-reveals when the word changes, like the homepage. */
.rc-tile { transform-origin: center; backface-visibility: hidden; transition: transform .22s ease; }
@media (max-width: 600px) {
  .rc-tile, .rc-box { width: 1.9rem; height: 2.3rem; font-size: 1rem; border-radius: 8px; }
}

/* Header */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid rgba(15,23,42,.06);
  background: transparent;          /* let the backdrop show through the bar */
  flex-shrink: 0;
}
.header-left  { display: flex; align-items: center; gap: .55rem; min-width: 0; }

/* Status dot — green (ready) / red (not ready). */
.peer-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  display: inline-block; vertical-align: middle;
  background: var(--error); box-shadow: 0 0 5px rgba(220,38,38,.35);
  transition: background .3s, box-shadow .3s;
}
.peer-dot.online  { background: #3f9457; box-shadow: 0 0 7px #3f9457aa; }
.peer-dot.offline { background: var(--error); box-shadow: 0 0 5px rgba(220,38,38,.35); }

.header-room {
  font-family: monospace;
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .1em;
}


/* ── Conversation view on small screens: compact header bar. ── */
@media (max-width: 600px) {
  .room-header  { padding: .45rem .7rem; }
  .header-left  { gap: .4rem; min-width: 0; }
  .header-room  { font-size: .68rem; letter-spacing: .05em; max-width: 84px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-danger-ghost { padding: .3rem .6rem; font-size: .72rem; }
}
@media (max-width: 400px) {  /* logo only */
  .header-room { display: none; }
}

/* Conversation body wrapper */
.room-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Messages */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  animation: msg-in .14s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg.self { align-self: flex-end; align-items: flex-end; }
.msg.peer { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: .52rem .9rem;
  border-radius: 16px;
  font-size: .88rem;
  line-height: 1.52;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg.self .bubble {
  background: var(--msg-peer-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
}
.msg.peer .bubble {
  background: var(--msg-peer-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: .65rem;
  color: var(--muted);
  padding: 0 .2rem;
  margin-top: .12rem;
}
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes msg-out {
  to { opacity: 0; transform: translateY(-4px); max-height: 0; margin: 0; overflow: hidden; }
}

.sys-msg {
  align-self: center;
  font-size: .7rem;
  color: var(--muted);
  background: var(--surf-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .18rem .75rem;
  margin: .2rem 0;
  text-align: center;
}

/* Input bar — sits at bottom of .room-body */
.input-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  /* Keep the bar above the iOS home indicator / notched safe area. */
  padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(15,23,42,.06);
  background: transparent;          /* let the backdrop show through the bar */
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
/* Small phones: a little less padding and spacing so every button keeps its size. */
@media (max-width: 360px) {
  .input-bar { gap: .35rem; padding-left: .6rem; padding-right: .6rem; }
  .msg-input { padding: .6rem .7rem; }
}

.msg-input {
  flex: 1;
  /* A text box won't shrink below its built-in width (~190px) unless told to; on a
     narrow phone that pushed the send button off the screen. */
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  padding: .6rem 1rem;
  outline: none;
  transition: border-color .15s;
}
/* No focus ring on the typing box: the blinking caret already shows it is active, and
   since Send no longer takes focus the ring stayed on screen permanently. */
.msg-input:focus, .msg-input:focus-visible { box-shadow: none; outline: none; }
.msg-input::placeholder{ color: var(--muted); }
.msg-input:disabled    { opacity: .45; cursor: not-allowed; }

.btn-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  color: #9ca3af;   /* light gray icon */
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .1s;
  outline: none;
}
.btn-send:hover:not(:disabled)  { background: rgba(15,23,42,.06); color: var(--text); }
.btn-send:active:not(:disabled) { transform: scale(.92); }
.btn-send:focus-visible         { box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-send:disabled              { opacity: .35; cursor: not-allowed; }

/* Close button on the left of the typing bar — a large touch target. */
.btn-leave-bar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  color: #9ca3af;   /* light gray icon */
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .1s;
  outline: none;
}
.btn-leave-bar:hover         { background: rgba(15,23,42,.06); color: var(--text); }
.btn-leave-bar:active        { transform: scale(.92); }
.btn-leave-bar:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

/* ── Scrollbar ── */
::-webkit-scrollbar            { width: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: var(--surf-3); border-radius: 2px; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .card                 { padding: 1.1rem .55rem; }
  .msg                  { max-width: 88%; }
  .input-group          { flex-direction: row; }
}

/* ══════════════════════════════════════════════════════════════════
   Word of the Day, three games, dark mode.
   All use the --lac-* tokens so they follow the light/dark theme.
══════════════════════════════════════════════════════════════════ */

/* Five game cards flow naturally. */
.lac-games-row { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }

/* ── Word of the Day ── */
.lac-wotd {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff; border-radius: 20px; padding: 1.4rem 1.5rem;
  max-width: 560px; margin: 2.5rem auto 0;
  box-shadow: 0 14px 34px rgba(13,148,136,.28);
}
.lac-wotd-eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.lac-wotd-top { display: flex; align-items: center; gap: .6rem; margin: .35rem 0 .45rem; flex-wrap: wrap; }
.lac-wotd-w { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.lac-wotd .lac-pos-tag { background: rgba(255,255,255,.2); color: #fff; }
.lac-wotd .lac-say { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.lac-wotd .lac-say:hover { background: rgba(255,255,255,.28); }
.lac-wotd-m { font-size: 1rem; line-height: 1.5; opacity: .96; }
.lac-wotd-e { margin-top: .5rem; font-style: italic; opacity: .85; font-size: .9rem; }
.lac-wotd-btns { margin-top: .9rem; }
.lac-wotd .lac-btn-ghost { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.lac-wotd .lac-btn-ghost:hover { background: rgba(255,255,255,.28); }
.lac-btn-sm { padding: .45rem .9rem; font-size: .85rem; }

/* ── Shared game chrome ── */
.lac-gtop { display: flex; align-items: center; justify-content: space-between; margin: .4rem 0 1.1rem; }
.lac-gtop-t { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; color: var(--lac-ink); }
.lac-gtop-c { font-size: .9rem; font-weight: 700; color: var(--lac-blue); }
.lac-card-btns { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.lac-card-btns .lac-btn { flex: 1; min-width: 130px; justify-content: center; }
.lac-card-hintrow { margin-top: 1rem; text-align: center; color: var(--lac-dim); font-size: .9rem; }

/* ── Flashcards ── */
.lac-flash { max-width: 440px; margin: 0 auto; }
.lac-flash-card {
  background: var(--lac-card); border: 1px solid var(--lac-line); border-radius: 20px;
  padding: 2rem 1.6rem; min-height: 220px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem;
  text-align: center; box-shadow: var(--lac-sh); transition: transform .12s;
}
.lac-flash-card:active { transform: scale(.99); }
.lac-flash-top { display: flex; align-items: center; gap: .5rem; }
.lac-flash-w { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--lac-ink); }
.lac-flash-hint { color: var(--lac-faint); font-size: .9rem; }
.lac-flash-m { font-size: 1.05rem; line-height: 1.55; color: var(--lac-soft); }
.lac-flash-e { font-style: italic; color: var(--lac-dim); font-size: .9rem; }

/* ── Word Scramble ── */
.lac-scr { max-width: 460px; margin: 0 auto; }
.lac-scr-clue {
  background: var(--lac-card); border: 1px solid var(--lac-line); border-radius: 14px;
  padding: 1rem 1.2rem; font-size: 1.02rem; line-height: 1.5; color: var(--lac-soft);
  text-align: center; box-shadow: var(--lac-sh);
}
.lac-scr-slots { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: 1.3rem 0; }
.lac-scr-slot {
  width: 2.6rem; height: 3rem; border-radius: 10px; display: grid; place-items: center;
  background: var(--lac-tile); border: 2px solid var(--lac-line);
  font-size: 1.3rem; font-weight: 800; color: var(--lac-ink);
}
.lac-scr-slots.ok .lac-scr-slot { border-color: var(--lac-ok); background: var(--lac-ok-bg); color: var(--lac-ok); }
.lac-scr-slots.no .lac-scr-slot { border-color: var(--lac-warn); background: var(--lac-warn-bg); color: var(--lac-warn); animation: lacShake .4s; }
@keyframes lacShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.lac-scr-tiles { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.lac-scr-tile {
  width: 2.6rem; height: 3rem; border-radius: 10px;
  background: var(--lac-card); border: 1px solid var(--lac-line);
  font-size: 1.25rem; font-weight: 800; color: var(--lac-ink); cursor: pointer;
  box-shadow: var(--lac-sh); transition: transform .1s, opacity .15s;
}
.lac-scr-tile:active { transform: scale(.92); }
.lac-scr-tile.used { opacity: .25; pointer-events: none; }

/* ── Spelling Bee ── */
.lac-spell { max-width: 440px; margin: 0 auto; text-align: center; }
.lac-spell-hear { width: 100%; justify-content: center; padding: .85rem; font-size: 1rem; }
.lac-spell-meta { display: flex; gap: .5rem; align-items: center; justify-content: center; margin: 1rem 0 .3rem; }
.lac-spell-len { font-size: .8rem; color: var(--lac-dim); font-weight: 600; }
.lac-spell-hint { color: var(--lac-soft); font-size: .95rem; line-height: 1.5; margin-bottom: 1rem; }
.lac-spell-input {
  width: 100%; box-sizing: border-box; padding: .8rem 1rem; font-size: 1.1rem; text-align: center;
  border: 2px solid var(--lac-line); border-radius: 12px; background: var(--lac-card); color: var(--lac-ink);
  letter-spacing: .04em; margin-bottom: .8rem; font-family: inherit;
}
.lac-spell-input:focus { outline: none; border-color: var(--lac-blue); }
.lac-spell .lac-btn-dark { width: 100%; justify-content: center; padding: .8rem; }
.lac-spell-fb { margin-top: .9rem; font-weight: 700; min-height: 1.2rem; }
.lac-spell-fb.ok { color: var(--lac-ok); }
.lac-spell-fb.no { color: var(--lac-warn); }

/* ── Completion card ── */
.lac-done {
  max-width: 420px; margin: 2rem auto; text-align: center;
  background: var(--lac-card); border: 1px solid var(--lac-line); border-radius: 20px;
  padding: 2.2rem 1.6rem; box-shadow: var(--lac-sh);
}
.lac-done-ico { font-size: 3rem; }
.lac-done h2 { font-size: 1.5rem; font-weight: 800; margin: .5rem 0 .3rem; color: var(--lac-ink); }
.lac-done p { color: var(--lac-dim); margin-bottom: .5rem; }

/* ── Google Material Symbols (Outlined), inlined as SVG — they replace the old emojis ── */
.lac-mi { display: inline-flex; width: 1em; height: 1em; flex: 0 0 auto; line-height: 0; vertical-align: -0.15em; }
.lac-mi svg { width: 100%; height: 100%; display: block; }
/* Icon sizes inside each badge (emoji used to set these via font-size). */
.lac-main-ico  { font-size: 1.75rem; color: #fff; }
.lac-ico       { font-size: 1.55rem; color: var(--t, var(--lac-blue)); }
.lac-step-ico  { font-size: 1.5rem;  color: var(--t, var(--lac-blue)); }
.lac-level-n   { font-size: 1.35rem; color: var(--t, var(--lac-blue)); }
.lac-toggle-ico{ font-size: 1.25rem; color: var(--t, var(--lac-blue)); }
.lac-blank-ico { font-size: 1.75rem; color: var(--lac-blue); }
.lac-why-ico   { font-size: 1.6rem;  color: #0d9488; }
.lac-done-ico  { font-size: 3.2rem;  color: var(--lac-blue); display: flex; justify-content: center; }
.lac-hero-badge .lac-mi { font-size: 1.05rem; }
.lac-gtag { display: inline-flex; align-items: center; gap: .3rem; }
.lac-gtag .lac-mi { font-size: .95rem; }
.lac-rchip .lac-mi { font-size: .95rem; }
.lac-wotd-eyebrow { display: inline-flex; align-items: center; gap: .35rem; }
.lac-wotd-eyebrow .lac-mi { font-size: 1rem; }

/* Breathing room between the three front-door cards and "How it works". */
.lac-hiw { margin-top: 4.5rem; }
@media (max-width: 559px) { .lac-hiw { margin-top: 3rem; } }

/* ── "Why VocabList" — bold teal panel with glass cards ── */
.lac-why-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  color: #fff; border-radius: 28px; padding: 3rem 1.5rem; margin: 3rem 0;
  box-shadow: 0 24px 60px rgba(13,148,136,.30);
}
.lac-why-panel::before {             /* graph-paper grid, like the hero */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(90% 80% at 50% 30%, #000 40%, transparent 95%);
  mask-image: radial-gradient(90% 80% at 50% 30%, #000 40%, transparent 95%);
}
.lac-why-panel::after {              /* soft glow blob */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 420px; height: 420px; right: -140px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(94,234,212,.35), transparent 70%);
}
.lac-why-head { text-align: center; max-width: 560px; margin: 0 auto 2.2rem; }
.lac-why-eyebrow {
  display: inline-block; padding: .3rem .85rem; border-radius: 999px; margin-bottom: .9rem;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.lac-why-head h2 { font-size: 1.9rem; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.lac-why-head p { margin-top: .7rem; font-size: 1rem; opacity: .88; line-height: 1.55; }

.lac-why { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 1000px; margin: 0 auto; }
@media (min-width: 560px) { .lac-why { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .lac-why { grid-template-columns: repeat(3, 1fr); gap: 1.15rem; } }

.lac-why-card {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20);
  border-radius: 20px; padding: 1.4rem 1.3rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: .35rem;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.lac-why-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.38); }
.lac-why-ico {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: #fff; font-size: 1.5rem; margin-bottom: .6rem;
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
}
.lac-why-card h3 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.lac-why-card p { font-size: .88rem; line-height: 1.55; color: rgba(255,255,255,.82); }
@media (max-width: 559px) {
  .lac-why-panel { padding: 2.2rem 1.1rem; border-radius: 22px; }
  .lac-why-head h2 { font-size: 1.5rem; }
}
@media (hover: none) { .lac-why-card:hover { transform: none; } }

/* ── FAQ: intro panel + numbered accordion ── */
.lac-faq-wrap {
  display: grid; grid-template-columns: 1fr; gap: 1.75rem;
  max-width: 1040px; margin: 4rem auto 0; align-items: start;
}
@media (min-width: 880px) { .lac-faq-wrap { grid-template-columns: 340px 1fr; gap: 2.5rem; } }

/* Left: intro panel (sticks beside the questions on wide screens). */
.lac-faq-side { text-align: left; }
@media (min-width: 880px) { .lac-faq-side { position: sticky; top: 6rem; } }
.lac-faq-eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem; border-radius: 999px; margin-bottom: .9rem;
  background: var(--lac-blue-l); border: 1px solid var(--lac-ring); color: var(--lac-blue-d);
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.lac-faq-eyebrow .lac-mi { font-size: 1rem; }
.lac-faq-side h2 { font-size: 2rem; font-weight: 800; line-height: 1.12; letter-spacing: -.035em; color: var(--lac-ink); }
.lac-faq-side p { margin-top: .7rem; font-size: .98rem; line-height: 1.6; color: var(--lac-dim); }

/* "Still curious?" contact card — teal gradient + graph-paper, like the hero. */
.lac-faq-contact {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: .85rem; margin-top: 1.4rem;
  padding: 1rem 1.1rem; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  box-shadow: 0 12px 28px rgba(13,148,136,.26);
  transition: transform .18s ease, box-shadow .18s ease;
}
.lac-faq-contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.lac-faq-contact:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(13,148,136,.34); }
.lac-faq-contact-ico {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 1.35rem;
}
.lac-faq-contact-t { flex: 1; min-width: 0; }
.lac-faq-contact-t b { display: block; font-size: 1rem; font-weight: 800; }
.lac-faq-contact-t s { display: block; text-decoration: none; font-size: .85rem; opacity: .85; }
.lac-faq-go { font-size: 1.3rem; transition: transform .18s ease; }
.lac-faq-contact:hover .lac-faq-go { transform: translateX(4px); }

/* Right: accordion */
.lac-faq { display: flex; flex-direction: column; gap: .7rem; }
.lac-faq-item {
  position: relative; overflow: hidden;
  background: var(--lac-card); border: 1px solid var(--lac-line); border-radius: 18px;
  box-shadow: var(--lac-sh); transition: border-color .2s ease, box-shadow .2s ease;
}
.lac-faq-item::before {           /* teal accent bar on the open item */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
  transform: scaleY(0); transform-origin: top; transition: transform .25s ease;
}
.lac-faq-item.open { border-color: var(--lac-ring); box-shadow: var(--lac-sh-lg); }
.lac-faq-item.open::before { transform: scaleY(1); }
.lac-faq-q {
  width: 100%; display: flex; align-items: center; gap: .85rem;
  padding: 1.05rem 1.2rem; background: transparent; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; color: var(--lac-ink); text-align: left; font-family: inherit;
}
.lac-faq-n { font-size: .78rem; font-weight: 800; color: var(--lac-faint); letter-spacing: .04em; flex: 0 0 auto; min-width: 1.4rem; }
.lac-faq-qi {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  background: var(--lac-blue-l); color: var(--lac-blue); font-size: 1.2rem;
  transition: background .2s ease, color .2s ease;
}
.lac-faq-item.open .lac-faq-qi { background: var(--lac-blue); color: #fff; }
.lac-faq-qt { flex: 1; min-width: 0; }
.lac-faq-chev { font-size: 1.45rem; color: var(--lac-dim); transition: transform .25s ease, color .2s ease; }
.lac-faq-item.open .lac-faq-chev { transform: rotate(180deg); color: var(--lac-blue); }
.lac-faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.lac-faq-item.open .lac-faq-a { max-height: 320px; }
.lac-faq-a p { padding: 0 1.2rem 1.15rem calc(1.2rem + 1.4rem + .85rem + 38px + .85rem); font-size: .93rem; line-height: 1.65; color: var(--lac-dim); }
@media (max-width: 559px) {
  .lac-faq-side h2 { font-size: 1.6rem; }
  .lac-faq-n { display: none; }
  .lac-faq-a p { padding-left: calc(1.2rem + 38px + .85rem); }
}

/* ── Dark mode (scoped to .vb) ── */
html[data-theme="dark"] { background: #0b1220; }
html[data-theme="dark"] .vb {
  --lac-paper:  #0b1220;
  --lac-card:   #131d31;
  --lac-ink:    #e8eef7;
  --lac-ink2:   #cdd8e8;
  --lac-soft:   #aab7c9;
  --lac-dim:    #8da0b8;
  --lac-faint:  #64748b;
  --lac-line:   #25324b;
  --lac-blue:   #2dd4bf;
  --lac-blue-d: #14b8a6;
  --lac-blue-l: #0e2a2a;
  --lac-ring:   #0f766e;
  --lac-tile:   #1a2537;
  --lac-ok:     #4ade80;
  --lac-ok-bg:  #0f2a1c;
  --lac-warn:   #f87171;
  --lac-warn-bg:#2a1414;
  --lac-sh:     0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.4);
  --lac-sh-lg:  0 4px 6px rgba(0,0,0,.3), 0 12px 28px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════
   WORD HELPER
   Conversation view built by game.js. It uses the shared conversation layout
   (.room-layout, .messages, .bubble, .input-bar …); the rules below add its own
   viewport pinning, header placement and answer formatting.
══════════════════════════════════════ */
#v-help {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
#help-topbar { position: relative; top: auto; z-index: 2; flex: 0 0 auto; }
#help-topbar .lac-topin { max-width: none; }
@media (max-width: 600px) {
  #help-topbar .lac-topin     { padding: .5rem .7rem; gap: .5rem; }
  #help-topbar .lac-brand     { font-size: .95rem; gap: .45rem; }
  #help-topbar .lac-top-right { gap: .25rem; }
}
@media (max-width: 400px) {
  #help-topbar .lac-brand { font-size: 0; gap: 0; }
}

/* Answer formatting inside a bubble. */
.wh-intro { margin-bottom: .35rem; }
.wh-list {
  list-style: none; margin: .15rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: .3rem; white-space: normal;
}
.wh-word {
  appearance: none; -webkit-appearance: none; background: none; border: none; padding: 0;
  font: inherit; font-weight: 700; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent-ring); text-underline-offset: 2px;
}
.wh-pos   { font-size: .72rem; color: var(--muted); font-style: italic; }
.wh-gloss { color: var(--text); }
.wh-head  { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; white-space: normal; }
.wh-term  { font-size: 1.05rem; }
.wh-def   { margin-top: .2rem; }
.wh-ex    { margin-top: .25rem; color: var(--muted); font-style: italic; }
.wh-meta  { margin-top: .45rem; display: flex; align-items: center; gap: .6rem; font-size: .72rem; color: var(--muted); }
.wh-more  { margin-top: .4rem; font-size: .72rem; color: var(--muted); }
.wh-act {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: .25rem;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 999px; padding: .15rem .6rem;
  font: inherit; font-size: .72rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.wh-act svg   { width: 14px; height: 14px; display: block; }
.wh-act:hover,
.wh-act.on    { border-color: var(--accent); color: var(--accent); }
.wh-go        { margin-top: .55rem; }

/* Suggestion chips under a reply. */
.wh-chips {
  align-self: flex-start; max-width: 88%;
  display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .45rem;
}
.wh-chip {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: .75rem; color: var(--text);
  background: var(--surf-2); border: 1px solid var(--border);
  border-radius: 999px; padding: .32rem .8rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.wh-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Floating launcher — round button pinned to the bottom-right corner, kept
   clear of the iPhone home indicator and notch via the safe-area insets. */
.wh-fab {
  position: fixed; z-index: 60;
  right: calc(22px + env(safe-area-inset-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; padding: 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: #0d9488; color: #fff;
  box-shadow: 0 10px 26px rgba(13,148,136,.42), 0 2px 6px rgba(15,23,42,.18);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  animation: whFabIn .4s ease both;
  -webkit-tap-highlight-color: transparent;
}
.wh-fab svg { width: 28px; height: 28px; display: block; }
.wh-fab:hover  { background: #0f766e; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(13,148,136,.48), 0 3px 8px rgba(15,23,42,.2); }
.wh-fab:active { transform: scale(.93); }
.wh-fab:focus-visible { outline: 3px solid rgba(13,148,136,.45); outline-offset: 3px; }
.wh-fab[hidden] { display: none; }
/* Name label that slides out to the left on desktop hover / keyboard focus. */
.wh-fab-label {
  position: absolute; right: calc(100% + 12px); top: 50%;
  transform: translate(6px, -50%); opacity: 0; pointer-events: none;
  white-space: nowrap; background: #0f172a; color: #fff;
  font-size: .8rem; font-weight: 600; letter-spacing: .01em;
  padding: .45rem .75rem; border-radius: 9px;
  box-shadow: 0 6px 16px rgba(15,23,42,.22);
  transition: opacity .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .wh-fab:hover .wh-fab-label { opacity: 1; transform: translate(0, -50%); }
}
.wh-fab:focus-visible .wh-fab-label { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 600px) {
  .wh-fab {
    width: 56px; height: 56px;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .wh-fab svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { .wh-fab { animation: none; transition: none; } }
@keyframes whFabIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
