/* Aurora: room shell (topbar, mode bar, lobby, sidebar, team, missions, podium), voice and call, live captions, AI translator, talk card
   Owned by the "room" screen group, and only by it. Loaded after /style.css and
   /aurora/base.css, so a rule here overrides both. Never edit style.css or
   base.css from here: use the tokens (--au-*, --ink, --muted...) and the base
   pieces (.card, .btn.brand, .au-hero, .au-tile, .au-chip, .au-stat, .au-ring,
   .au-progress, .seg/.tabs, .au-row, .au-dock...) described in base.css.
   Scope every rule to this group's own classes.

   The phone room (linguino-mobile Room.tsx, Call.tsx, Talk.tsx) is the model:
   the lobby leads with a big title and the violet "invite" hero (the penguin
   trio on a floe, the code in big Outfit letters, the one orange action), then
   the languages as glass chips, "Learn" as glass rows and the games as glass
   tiles with their hue as a glow and a dot. Phone (<=480) is that, one column;
   from 1024 the stage sits beside a 352px column of glass cards.

   The frame is the one every other screen uses (.au-page, .hero-inner and
   .au-topbar in base.css): a 1180 box with --au-gutter inside it. The room's
   bar, its layout and the caption bar all share that edge, so the logo and the
   content edges stay put going from the profile into a room and back. The
   edge, as base.css's .au-topbar writes it, is
   max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter))). */

/* ===================== the room's frame ===================== */

.layout { grid-template-columns: minmax(0, 1fr) 352px; gap: 24px; padding: 22px var(--au-gutter) 28px; max-width: 1180px; }
.stage { gap: 16px; }
.sidebar { gap: 14px; }
#mode-tip:empty, #corrections:empty { display: none; }
@media (max-width: 1023px) {
  /* Room at the bottom for the translator's button, so it never sits on the
     last card for good. */
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px var(--au-gutter) 104px; }
}
/* A desktop: the column beside is pinned to the window, from under the bar
   (its cards start level with the stage's first card, at 84) down to 16px off
   the foot, scrolling on its own when it is taller than that, so its bottom
   edge is the window's, not a cut through a card halfway down. Pinned rather
   than sticky: a sticky column stayed inside the layout, so when the stage was
   short (or the caption bar's room was under it) scrolling down to the credit
   pushed the whole column up under the bar with the end of the layout.
   The translator's button sits over its foot (see .ai-fab below): the 96px at
   the bottom of the column let the last card scroll clear of it, and only that
   strip, behind the button, fades into the sky. When the cards fit, the fade
   falls on that empty padding and shows nothing. The 12px either side give
   the cards' shadows room inside the scroller; the grid keeps the column's
   352px track empty, so the stage is as wide as before.
   The credit is the stage's, under it (the column runs past it), and the
   layout is tall enough to put it on the window's foot when the stage is
   short, so a short game does not scroll at all. */
@media (min-width: 1024px) {
  .layout { --room-credit-h: 85px; min-height: calc(100dvh - 62px - var(--room-credit-h)); }
  .sidebar {
    position: fixed; top: 78px;
    right: calc(max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter))) - 12px);
    width: 376px;
    max-height: calc(100dvh - 78px - 16px); overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 6px 12px 96px;
    scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  }
  .layout ~ .credit {
    box-sizing: border-box; min-height: 85px;
    width: calc(min(100%, 1180px) - 2 * var(--au-gutter) - 376px);
    margin-left: calc((100% - min(100%, 1180px)) / 2 + var(--au-gutter));
  }
}
/* A phone in the lobby: who is here and the call come before the games, like
   the phone's own team tab, rather than after twelve tiles. The wrappers step
   aside so the lobby's sections and the column's cards share one order. */
@media (max-width: 600px) {
  .layout[data-stage="lobby"] :is(.stage, #stage-body, #lobby-root, .lobby, .sidebar) { display: contents; }
  .layout[data-stage="lobby"] :is(#voice-channel, #team) { order: 1; }
  .layout[data-stage="lobby"] :is(.lobby-h, .lobby-need, .learn-grid, .modes-grid) { order: 2; }
  .layout[data-stage="lobby"] :is(#missions, #corrections, #social) { order: 3; }
}
/* A tablet: the column beside goes under the stage as two columns of cards. */
@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .sidebar > #social, .sidebar > #corrections { grid-column: 1 / -1; }
}
.layout ~ .credit { padding: 18px 16px 30px; }
/* The name in the credit: plain ink everywhere (home, learn, the room). */
.credit b { background: none; color: var(--ink); -webkit-text-fill-color: currentColor; }

/* ===================== the bar at the top ===================== */

/* The frosted bar (base.css), its content lined up with the layout below
   (and with .au-topbar on every other screen). */
.topbar {
  gap: 8px; min-height: 62px;
  padding: 10px max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter)));
}
@media (max-width: 1023px) { .topbar { padding: 10px var(--au-gutter); } }
@media (max-width: 480px) { .topbar { padding: 9px 12px; gap: 6px; min-height: 58px; } }
.topbar .brand { gap: 8px; }
.topbar .brand-mark { width: 32px; height: 32px; box-shadow: none; }
.topbar .brand-name { font: 700 19px/1 var(--display); letter-spacing: -0.015em; color: var(--ink); }

/* The room code: a glass pill, a teal key, the letters spaced in Outfit. */
.topbar .room-code {
  min-height: 34px; padding: 0 12px; gap: 6px;
  font: 700 15px/1 var(--display); letter-spacing: 0.12em; font-variant-numeric: tabular-nums;
  border-radius: 999px; cursor: pointer;
}
.topbar .room-code > .i:first-child { width: 14px; height: 14px; color: var(--au-teal); }
.topbar .room-code .dim { width: 13px; height: 13px; opacity: 0.55; }
@media (hover: hover) and (pointer: fine) { .topbar .room-code:hover { border-color: color-mix(in srgb, var(--au-teal) 60%, transparent); } }

/* Groups: the call, then the tools, then the way out, kept apart by a hairline. */
.topbar .tb-group { gap: 6px; }
.topbar .tb-group + .tb-group { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line-hi); }

/* The tools as glass: 38px tall, a rounded square when the label has folded. */
.topbar :is(.tb-group, .tb-wide) .btn.small:not(.theme-toggle) { min-height: 38px; min-width: 38px; padding: 0 12px; border-radius: var(--au-r-small); font-size: 13.5px; }
.topbar :is(.tb-group, .tb-wide) .btn.small.ghost:not(.theme-toggle) {
  color: var(--ink);
  background-color: var(--au-glass-base);
  background-image: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
:root[data-theme="light"] .topbar :is(.tb-group, .tb-wide) .btn.small.ghost:not(.theme-toggle) { background-image: linear-gradient(var(--au-glass-hi) 0 0); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line); }
.topbar .btn .i-wrap { display: inline-grid; place-items: center; }
/* The way out: the tools' glass with a danger outline (a red fill under a red
   icon was too faint on the darkest sky). */
.topbar .btn.small.tb-leave, .tb-menu .tb-leave { color: var(--bad); }
.topbar .btn.small.ghost.tb-leave { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 55%, transparent); }
@media (hover: hover) and (pointer: fine) { .topbar .btn.small.ghost.tb-leave:hover { background-image: linear-gradient(color-mix(in srgb, var(--bad) 16%, transparent) 0 0); } }
/* Correcting: a tool like the others, its pen in violet. */
.topbar .tb-correct .i, .tb-menu .tb-correct .i { color: var(--violet-ink); }

/* Vocabulary, reading, stories and the deck: one glass tray of icons (their
   titles say what they are), its count a badge on the corner. */
.topbar .tb-wide .tb-tools {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 14px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
:root[data-theme="light"] .topbar .tb-wide .tb-tools { background: linear-gradient(var(--au-glass-hi) 0 0); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line); }
.topbar .tb-wide .tb-tools .btn.small.ghost {
  position: relative; width: 36px; min-width: 36px; min-height: 34px; height: 34px; padding: 0;
  border-radius: 12px; color: var(--ink-2); background: none; box-shadow: none;
}
@media (hover: hover) and (pointer: fine) { .topbar .tb-wide .tb-tools .btn.small.ghost:hover { color: var(--ink); background: var(--au-glass-flat); } }
.topbar .tb-wide .tb-tools .tb-label { display: none; }
.topbar .tb-wide .tb-tools .tb-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; box-shadow: 0 0 0 2px var(--au-bg1);
}
/* The tray stays icons at every desktop width: the bar shares the 1180 frame
   of the other screens, and with the tray's labels it no longer fits one row
   in Russian, Italian, German, Spanish or Georgian (it went to two rows, over
   the stage). Each icon's title still says what it is. */
.tb-menu .tb-tools { display: contents; }
:root[data-theme="light"] .topbar .tb-wide .tb-tools .btn.small.ghost,
:root[data-theme="light"] .topbar .tb-wide .btn.small.ghost.tb-leave { background: none; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  :root[data-theme="light"] .topbar .tb-wide .tb-tools .btn.small.ghost:hover { background: #fff; color: var(--ink); }
  :root[data-theme="light"] .topbar .tb-wide .btn.small.ghost.tb-leave:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
}

/* The way out stands apart, past a hairline, in a quiet red: no glass box. */
.topbar .tb-wide .btn.small.ghost.tb-leave {
  position: relative; margin-left: 9px;
  background: none; box-shadow: none; color: color-mix(in srgb, var(--bad) 88%, var(--ink));
}
.topbar .tb-wide .tb-leave::before { content: ''; position: absolute; left: -9px; top: 9px; bottom: 9px; width: 1px; background: var(--line-hi); pointer-events: none; }
/* With no box, its ink is its edge: pulled out by its own padding so the
   label (or the icon, once it folds) ends on the frame's edge, where the boxed
   last item ends on every other screen. Its hover wash hangs past the edge. */
.topbar .tb-wide .btn.small.ghost.tb-leave:last-child { margin-right: -12px; }
@media (hover: hover) and (pointer: fine) { .topbar .tb-wide .btn.small.ghost.tb-leave:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); box-shadow: none; } }

/* A count on a tool: teal, so the orange stays the one action. */
.tb-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--au-teal); color: var(--au-on-teal); font: 700 11px/1 var(--font);
}
/* The call button folds to its icon on a phone; its title still says it. */
@media (max-width: 480px) {
  .topbar .tb-voice .tb-label { display: none; }
  .topbar .tb-voice { width: 38px; padding: 0; }
  .topbar .room-code { padding: 0 10px; letter-spacing: 0.08em; }
  .topbar .room-code .dim { display: none; }
  /* The lobby already shows the code in big letters, under the title. */
  body:has(.layout[data-stage="lobby"]) .topbar .room-code { display: none; }
}
.tb-menu { padding: 8px; gap: 2px; }
.tb-menu .btn { border-radius: var(--au-r-small); min-height: 44px; }
.tb-menu .btn.ghost { box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .tb-menu .btn.ghost:hover { background: var(--au-glass-flat); } }
.tb-menu .tb-count { margin-left: auto; }

/* ===================== what is being played ===================== */

.mode-bar {
  gap: 10px; min-height: 58px; padding: 10px 12px 10px 14px;
  border-radius: var(--au-r-card);
}
.mode-bar h2 {
  font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mode-bar .mode-icon { display: none; }
.mode-bar .mode-dot { margin-left: 2px; }
.mode-bar .mode-pic .pic { width: 34px; height: 34px; vertical-align: middle; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
/* The way back, as a glass chip. */
.mode-bar .back-btn { min-height: 34px; padding: 0 13px 0 9px; border-radius: 999px; font-size: 13.5px; }
.mode-bar .back-btn .i { width: 16px; height: 16px; }
.mode-bar .pill .timer { font-variant-numeric: tabular-nums; }
.mode-bar .how-bar { color: var(--muted); }

/* In the lobby the bar is no bar: the page's big title and the head count. */
.layout[data-stage="lobby"] .mode-bar {
  min-height: 0; padding: 6px 2px 0; border: 0;
  background: none; box-shadow: none;
}
.layout[data-stage="lobby"] .mode-bar h2 {
  font: 700 var(--au-fs-screen)/1.05 var(--display); letter-spacing: -0.025em;
  white-space: normal; flex: 0 1 auto;
}
@media (min-width: 1024px) { .layout[data-stage="lobby"] .mode-bar h2 { font-size: 40px; } }
.mode-bar .lobby-reset { border-radius: 999px; gap: 6px; color: var(--ink-2); }
.mode-bar .lobby-reset .i { width: 15px; height: 15px; }
@media (max-width: 480px) {
  .mode-bar .lobby-reset { width: 38px; min-width: 38px; padding: 0; justify-content: center; }
  .mode-bar .lobby-reset .tb-label { display: none; }
}
.lobby-count .i { width: 20px; height: 20px; color: var(--au-teal); }

/* The line under a game that says the translator is there. */
.mode-tip {
  margin: 0; padding: 10px 12px; border: 0; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(100px 90px at calc(100% - 6px) 0, color-mix(in srgb, var(--au-violet) 30%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.mt-icon { width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--au-gold) 16%, transparent); color: var(--au-gold); }
.mt-say { font-size: 13px; color: var(--ink-2); }
.mt-say b { color: var(--violet-ink); }
.mode-tip { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.mt-close { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; color: var(--muted); }
.mt-close .i { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .mt-close:hover { color: var(--ink); } }
/* Its way in to the translator: quiet glass with a violet ink, so the
   violet button in the corner stays the one violet button. */
.mode-tip .mt-go {
  border-radius: 999px; gap: 7px; white-space: nowrap; color: var(--violet-ink);
  background: linear-gradient(color-mix(in srgb, var(--au-violet) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px color-mix(in srgb, var(--au-violet) 40%, transparent);
}
.mode-tip .mt-go .i { width: 16px; height: 16px; }
:root[data-theme="light"] .mode-tip .mt-go { background: color-mix(in srgb, var(--au-violet) 10%, #fff); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px color-mix(in srgb, var(--au-violet) 34%, transparent); }
@media (hover: hover) and (pointer: fine) { .mode-tip .mt-go:hover { background: linear-gradient(color-mix(in srgb, var(--au-violet) 24%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); } }
/* A phone: one short row above the board (the label folds to its icon, the
   bulb steps aside), and while it is up it is the way in, so the corner
   button does not sit on the board's last cards. */
@media (max-width: 560px) {
  .mode-tip { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 8px 8px 14px; }
  .mode-tip .mt-icon { display: none; }
  .mode-tip .mt-say { font-size: 12.5px; line-height: 1.35; }
  .mode-tip .mt-go { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; }
  .mode-tip .mt-go-l { display: none; }
  body:has(#mode-tip .mode-tip) .ai-fab { display: none; }
}

/* ===================== the lobby ===================== */

.lobby { gap: 18px; container: lobby / inline-size; }

/* Who is here, as glass chips. On a desktop the column beside says it. */
.lobby-who { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; }
.lobby-who::-webkit-scrollbar { display: none; }
.lobby-who:empty { display: none; }
@media (min-width: 1024px) { .lobby-who { display: none; } }
.lobby-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px;
  border-radius: 999px; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.lobby-chip .cm-avatar { width: 28px; height: 28px; font-size: 13px; box-shadow: none; }
.lobby-chip b { font-size: 14px; font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-chip .i { width: 14px; height: 14px; color: var(--au-gold); }
.lobby-chip .flag { width: 18px; height: 12px; border-radius: 2px; }

/* The invitation and the languages; side by side once the stage is wide. */
.lobby-me { display: grid; gap: 16px; align-items: stretch; }
/* A wide stage: the invitation as one band across it (the trio, the words,
   then the code over its button at the right) and the languages under it as
   one card, each language row in a tidy grid. Side by side, both cards were
   half empty and the language chips wrapped onto a row of their own. */

/* The violet hero: the trio above, the copy centred under it. */
.lobby-invite { display: grid; justify-items: center; align-content: center; gap: 10px; padding: 18px 20px 22px; text-align: center; }
.lobby-trio { position: relative; width: 156px; height: 104px; margin-top: -6px; }
.lobby-floe {
  position: absolute; left: 0; bottom: -4px; width: 156px; height: 33px; border-radius: 50%;
  background: var(--au-ice);
  box-shadow: 0 0 36px 8px color-mix(in srgb, #3ee6c8 30%, transparent);
}
.lobby-floe::after { content: ''; position: absolute; left: 14%; right: 14%; top: 12%; height: 26%; border-radius: 50%; background: #f4fbff; opacity: 0.6; }
.lobby-trio .penguin { position: absolute; bottom: 12px; }
.lobby-trio .lt-a { left: 12px; }
.lobby-trio .lt-b { left: 50px; bottom: 14px; z-index: 1; }
.lobby-trio .lt-c { left: 104px; }
.invite-body { display: grid; justify-items: center; gap: 14px; width: 100%; }
.lobby-invite .invite-text { margin: 0; display: grid; gap: 6px; }
.lobby-invite .invite-text h3 { font: 700 var(--au-fs-hero-sm)/1.08 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.lobby-invite .invite-text .muted { font-size: var(--au-fs-body-sm); line-height: 1.4; color: var(--ink-2); }
/* The code as four compact boxes, the size of Play's join boxes. */
.lobby-invite .invite-code { gap: 8px; justify-content: center; border-radius: 16px; }
.lobby-invite .invite-code span {
  width: 50px; height: 56px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: var(--au-r-small);
  font: 700 28px/1 var(--display); letter-spacing: 0; color: var(--ink);
  background: rgba(5, 12, 30, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: box-shadow var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .lobby-invite .invite-code:hover span { border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1.5px color-mix(in srgb, #3ee6c8 70%, transparent); } }
.lobby-invite .invite-code:focus-visible { outline: 2px solid var(--au-teal); outline-offset: 3px; }
.lobby-invite .invite-go { width: 100%; max-width: 420px; }
@container lobby (min-width: 760px) {
  .lobby-invite { grid-template-columns: 170px minmax(0, 1fr); justify-items: stretch; text-align: left; gap: 8px 26px; padding: 22px 28px; }
  .lobby-trio { align-self: center; justify-self: center; }
  .invite-body {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text code" "text go";
    align-items: center; justify-items: stretch; gap: 12px 28px;
  }
  .lobby-invite .invite-text { grid-area: text; }
  .lobby-invite .invite-code { grid-area: code; justify-content: center; }
  .lobby-invite .invite-go { grid-area: go; width: 100%; min-width: 230px; }
}
/* One column but room to spare (a tablet, a narrow desktop window): the trio
   beside the copy rather than above it. */
@container lobby (min-width: 560px) and (max-width: 759px) {
  .lobby-invite { grid-template-columns: 170px minmax(0, 1fr); justify-items: start; text-align: left; gap: 8px 20px; padding: 22px 24px; }
  .lobby-trio { align-self: center; justify-self: center; }
  .invite-body { justify-items: start; }
  .lobby-invite .invite-code { justify-content: flex-start; }
}

/* The languages as glass chips, wrapped on every width (a sideways row made
   the whole page wider than a phone). */
.lobby-langs { display: grid; gap: 14px; align-content: start; container: langs / inline-size; }
.lobby-langs .ll-row { display: grid; gap: 10px; min-width: 0; }
.lobby-langs .ll-row + .ll-row { padding-top: 14px; border-top: 1px solid var(--line-hi); }
.lobby-langs .lobby-lang-label { min-width: 0; margin: 0; font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.lobby-langs .learn-seg {
  display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding: 0;
  background: none; box-shadow: none; border-radius: 0;
}
.lobby-langs .learn-seg .seg-opt {
  flex: none; flex-direction: row; gap: 8px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; font: 700 14px/1 var(--font); letter-spacing: 0; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  cursor: pointer;
}
.lobby-langs .learn-seg .seg-opt span { display: inline; }
.lobby-langs .learn-seg .seg-opt .flag { width: 22px; height: 15px; border-radius: 3px; }
.lobby-langs .learn-seg .seg-opt.on {
  background: linear-gradient(color-mix(in srgb, var(--au-teal) 16%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent);
}
.lobby-langs .learn-seg .seg-opt.on::after { display: none; }
:root[data-theme="light"] .lobby-langs .learn-seg .seg-opt:not(.on) { background: linear-gradient(var(--au-glass-hi) 0 0); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .lobby-langs .learn-seg .seg-opt:not(.on):not(.off):hover { box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); } }
.lobby-langs .learn-seg .seg-opt:has(input:focus-visible) { outline: 2px solid var(--au-teal); outline-offset: 2px; }
.lobby-me > *, .lobby-langs, .lobby-langs .ll-row > * { min-width: 0; }
/* Fourteen languages never leave one alone on a row: with room they sit in
   a grid of five (five, five and four, the same widths); in a narrow card
   they are one row that scrolls sideways, as on the phone, fading at its edge. */
@container langs (min-width: 460px) {
  .lobby-langs .learn-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lobby-langs .learn-seg .seg-opt { justify-content: flex-start; min-width: 0; }
  .lobby-langs .learn-seg .seg-opt .flag { flex: none; }
  .lobby-langs .learn-seg .seg-opt span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@container langs (max-width: 459.98px) {
  .lobby-langs .learn-seg {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin: -3px; padding: 3px 28px 3px 3px; width: calc(100% + 6px);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .lobby-langs .learn-seg::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) {
  .lobby-langs .learn-seg { gap: 6px; }
  .lobby-langs .learn-seg .seg-opt { min-height: 38px; padding: 0 12px 0 9px; font-size: 13.5px; }
}

/* A game picked before there was anybody to play it with. */
.lobby-waiting {
  grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; margin: 0; padding: 14px 16px;
  border: 0; border-radius: var(--au-r-card);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(90px 90px at calc(100% - 8px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 40%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.lobby-waiting .lw-icon { width: 48px; height: 48px; border-radius: 16px; background: color-mix(in srgb, var(--hue, var(--au-teal)) 14%, transparent); }
.lobby-waiting .lw-icon .pic { width: 34px; height: 34px; }
.lobby-waiting b { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }
.lobby-waiting .muted { font-size: var(--au-fs-body-sm); }
.lw-dots i { background: var(--au-teal); }

/* Section titles: "Learn", "Play". */
.lobby-h { margin: 8px 2px -6px; font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; }

/* "Invite 1 more": once, above the games that are waiting for people. */
.lobby-need {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: var(--au-r-mission);
  background: color-mix(in srgb, var(--au-gold) 9%, var(--au-glass-base));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-gold) 30%, transparent);
}
.lobby-need .ln-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--au-gold); background: color-mix(in srgb, var(--au-gold) 16%, transparent); }
.lobby-need .ln-icon .i { width: 16px; height: 16px; }
.lobby-need b { font: 600 15px/1.25 var(--display); color: var(--ink); }
.lobby-need .ln-go { border-radius: 999px; white-space: nowrap; }
:root[data-theme="light"] .lobby-need { background: color-mix(in srgb, var(--au-gold) 12%, #fff); }
:root[data-theme="light"] .lobby-need .ln-icon { color: var(--warn); }
@media (max-width: 380px) { .lobby-need .ln-go { width: 38px; padding: 0; font-size: 0; gap: 0; } }

/* Learn: glass rows, a picture in a well lit by its hue, a chevron. */
/* One column, two once the stage is wide; today's review runs across the
   middle so five rows never leave a hole. */
.learn-grid { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row dense; gap: 10px; }
@container lobby (min-width: 560px) {
  .learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-grid > .card-wrap:has(> .learn-card[data-act="deck"]) { grid-column: 1 / -1; }
}
.learn-grid .learn-card {
  grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; padding: 14px;
  border: 0; border-radius: var(--au-r-tile); color: var(--ink);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(70px 70px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 36%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
:root[data-theme="light"] .learn-grid .learn-card { background-image: radial-gradient(70px 70px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 26%, transparent), transparent 72%), var(--au-glass); }
@media (hover: hover) and (pointer: fine) { .learn-grid .learn-card:hover { transform: translateY(-1px); filter: brightness(1.08); border-color: transparent; box-shadow: var(--au-shadow); } }
.learn-grid .learn-card:active { transform: scale(0.985); }
.learn-grid .learn-card.due { border-color: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 55%, transparent), var(--au-drop); }
.learn-grid .learn-icon {
  position: relative; width: 52px; height: 52px; border-radius: 16px; color: var(--ink);
  background: color-mix(in srgb, var(--hue, var(--au-teal)) 14%, transparent);
}
.learn-grid .learn-icon .pic { width: 32px; height: 32px; }
.learn-grid .learn-icon .rv-badge { position: absolute; top: -5px; right: -5px; background: var(--au-teal); color: var(--au-on-teal); box-shadow: 0 0 0 2px var(--au-bg1); }
.learn-grid .learn-text { display: grid; gap: 2px; min-width: 0; }
.learn-grid .learn-card b { padding-right: 0; font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learn-grid .learn-card .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 18px; }
.learn-grid .learn-card > span:last-child { display: inline-grid; place-items: center; }
.learn-grid .learn-card > span:last-child .i { width: 18px; height: 18px; color: var(--muted); }
.learn-grid .learn-card.has-how .learn-text { padding-right: 36px; }

/* "How to play": a quiet glass dot, inline before the chevron on a row and
   bottom right on a tile, beside who it needs, never on the picture. (It
   arrives wrapped in a span, so these are not child selectors.) */
.lobby .card-wrap .how-btn {
  width: 30px; height: 30px; border: 0; color: var(--muted);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.lobby .card-wrap .how-btn .i { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .lobby .card-wrap .how-btn:hover { color: var(--ink); background: linear-gradient(var(--au-glass-hi) 0 0), linear-gradient(var(--au-glass-base) 0 0); } }
.learn-grid .card-wrap .how-btn { top: 50%; right: 40px; transform: translateY(-50%); }
.learn-grid .card-wrap .how-btn:active { transform: translateY(-50%) scale(0.94); }
@media (hover: hover) and (pointer: fine) { .learn-grid .card-wrap .how-btn:hover { transform: translateY(-50%); } }
.modes-grid .card-wrap .how-btn { top: auto; bottom: 10px; right: 10px; transform: none; }
:root[data-theme="light"] .lobby .card-wrap .how-btn { color: var(--muted); background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line); }

/* Play: the games as glass tiles. The hue only glows (top right) and dots
   (top left), the picture sits top right, the title and who it needs below. */
.modes-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.modes-grid .mode-card {
  --glow-o: 42;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  min-height: 176px; padding: 14px; border: 0; border-radius: var(--au-r-tile);
  color: var(--ink); text-align: left;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(96px 96px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) calc(var(--glow-o) * 1%), transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
.modes-grid .mode-card.warm { --glow-o: 22; }
:root[data-theme="light"] .modes-grid .mode-card { --glow-o: 32; }
:root[data-theme="light"] .modes-grid .mode-card.warm { --glow-o: 22; }
.modes-grid .mode-card::before { display: none; }
@media (hover: hover) and (pointer: fine) {
  .modes-grid .mode-card:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); border-color: transparent; box-shadow: var(--au-shadow); }
  .modes-grid .mode-card:disabled:hover { transform: none; box-shadow: var(--au-shadow); }
}
.modes-grid .mode-card:not(:disabled):active { transform: scale(0.985); }
.modes-grid .mode-card:disabled { opacity: 1; cursor: default; }
.mode-card .mc-top { display: flex; justify-content: space-between; align-items: flex-start; min-height: 46px; margin-bottom: 2px; }
.mode-card .mc-top > .au-dot { margin: 6px 0 0 2px; }
.mode-card .mc-top .au-chip { margin-top: 2px; }
.mode-card .mc-pic { width: 46px; height: 46px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.modes-grid .mode-card h3 { padding-right: 0; font: 600 15px/1.15 var(--display); letter-spacing: -0.01em; }
.modes-grid .mode-card p {
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; line-height: 16px; color: var(--muted);
}
/* Who it needs: a quiet line at the bottom, not a pill; room on its right for
   the "how to play" dot. */
.modes-grid .mode-card .pill {
  margin-top: auto; align-self: stretch; justify-self: auto;
  min-height: 20px; padding: 0 36px 0 0; border: 0; border-radius: 0;
  background: none; box-shadow: none;
  font: 600 12px/1.35 var(--font); color: var(--muted);
}
.modes-grid .mode-card .pill .i { width: 13px; height: 13px; flex: none; }
.modes-grid .mode-card .pill.violet { display: none; }
.modes-grid .mode-card .need-pill { color: var(--muted); }
.modes-grid .mode-card .soon-pill { align-items: flex-start; }
.modes-grid .mode-card .soon-pill .flag { width: 14px; height: 10px; vertical-align: -1px; }
.modes-grid .mode-card.live .pill { color: var(--au-teal); }
.modes-grid .mode-card.short :is(h3, p, .mc-pic), .modes-grid .mode-card.soon :is(h3, p, .mc-pic) { opacity: 0.72; }
.modes-grid .mode-card.short .icon, .modes-grid .mode-card.soon .mc-pic { filter: saturate(0.6) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
@media (max-width: 560px) {
  /* Two to a row on a phone, like the phone app. */
  .modes-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .modes-grid .mode-card { padding: 14px; gap: 6px; }
  .modes-grid .mode-card h3 { font-size: 15px; padding-right: 0; }
  .modes-grid .mode-card p { display: -webkit-box; -webkit-line-clamp: 4; }
  .modes-grid .mode-card .pill { font-size: 12px; padding: 0 34px 0 0; }
  .learn-grid { gap: 10px; }
  .learn-grid .learn-card { padding: 14px; gap: 14px; }
  .learn-grid .learn-card .muted { display: -webkit-box; }
  .learn-grid .learn-icon { width: 52px; height: 52px; border-radius: 16px; }
  .lobby .card-wrap .how-btn { width: 28px; height: 28px; }
}

/* ===================== the column beside ===================== */

.sidebar .card { padding: 16px; }
.sidebar .card h3 { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }

/* Who is in the call: teal-lit glass while anybody is. */
.vc-card { gap: 12px; }
.vc-head { gap: 8px; font: 600 var(--au-fs-card)/1.2 var(--display); }
.vc-head .i { width: 18px; height: 18px; color: var(--au-teal); }
.vc-member { gap: 10px; padding: 6px 8px; border-radius: var(--au-r-small); }
@media (hover: hover) and (pointer: fine) { .vc-member:hover { background: var(--au-glass-flat); } }
.vc-member .cm-avatar { width: 32px; height: 32px; font-size: 13px; box-shadow: none; }
.vc-member.talking .cm-avatar { box-shadow: 0 0 0 2px var(--au-teal), 0 0 14px 2px color-mix(in srgb, var(--au-teal) 60%, transparent); }
.vc-name { font-size: 14px; }
.vc-icons { color: var(--bad); align-items: center; }
.vc-screen { color: var(--au-sky-hue); }
.vc-join { width: 100%; padding: 12px; font-size: 15px; }
.vc-connected {
  padding: 10px 10px 10px 12px; border: 0; border-radius: var(--au-r-small);
  background: color-mix(in srgb, var(--au-teal) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 32%, transparent);
}
.vc-status b { color: var(--au-teal); }
.vc-status .cm-time { font-variant-numeric: tabular-nums; }
.vc-controls { gap: 6px; flex-wrap: wrap; }
.vc-controls .btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.vc-talk {
  gap: 8px; padding: 9px 12px; border: 0; border-radius: var(--au-r-small);
  background: color-mix(in srgb, var(--au-violet) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-violet) 32%, transparent);
}
@media (hover: hover) and (pointer: fine) { .vc-talk:hover { background: color-mix(in srgb, var(--au-violet) 20%, transparent); } }
.vc-talk .i { color: var(--violet-ink); }

/* The call's live dot: teal, ringing. */
.cm-dot { background: var(--au-teal); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--au-teal) 60%, transparent); }
.cm-dot::after { --ring-c: color-mix(in srgb, var(--au-teal) 60%, transparent); }

/* The team: the score as a small night hero, then the players, then the goal. */
.team-card { gap: 14px; }
.team-card .team-head {
  margin: -4px -4px 0; padding: 14px 16px; border-radius: 20px;
  background:
    radial-gradient(200px 150px at calc(100% + 20px) -30px, color-mix(in srgb, #3ee6c8 34%, transparent), transparent 70%),
    radial-gradient(160px 130px at -30px calc(100% + 30px), color-mix(in srgb, #9a83ff 28%, transparent), transparent 70%),
    var(--au-hero-navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 30px -18px rgba(0, 0, 0, 0.6);
}
.team-score {
  font: 700 44px/0.95 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #ffffff 10%, #b6fff0 55%, #c9bcff 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.team-head .muted { font-size: 12px; color: var(--ink-2); }
.team-card .streak { color: var(--ink-2); }
.team-card .streak.on { color: var(--au-gold); }
.team-card .streak.on b { color: var(--ink); }
.team-card .streak.met .i { filter: drop-shadow(0 0 8px rgba(255, 201, 77, 0.7)); }
#team .players { gap: 4px; }
#team .player { padding: 7px 8px; border-radius: var(--au-r-small); }
#team .player.me { background: color-mix(in srgb, var(--au-teal) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 30%, transparent); }
#team .player .avatar { width: 36px; height: 36px; border-radius: 50%; font-family: var(--display); font-weight: 700; box-shadow: none; }
#team .player .name { font-size: 14.5px; }
#team .player .i.gold { color: var(--au-gold); }
#team .player .langs .flag { width: 16px; height: 11px; }
#team .player .score.small { font: 600 15px/1 var(--display); color: var(--au-teal); font-variant-numeric: tabular-nums; }
.team-card .goal { gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-hi); }
.team-card .goal-head h3 { font: 600 15px/1.2 var(--display); }
.team-card .goal-head h3 .i { color: var(--au-teal); }
.team-card .goal-seg { padding: 3px; border-radius: 12px; }
.team-card .goal-seg button { padding: 4px 9px 7px; font-size: 12.5px; border-radius: 9px; }
.team-card .goal-seg button.on::after { bottom: 2px; width: 12px; height: 2px; margin-left: -6px; }
.goal .clock-bar .track { height: 6px; background: var(--line-hi); }
.goal .clock-bar .fill { background: var(--au-progress); }
.goal .clock-bar.active .track { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--au-gold) 70%, transparent), 0 0 12px color-mix(in srgb, var(--au-gold) 35%, transparent); }
.goal .clock-bar .flag { width: 16px; height: 11px; }
.team-card .goal-note.ok { color: var(--au-teal); }
.team-card .goal-note .i { color: var(--au-teal); }

/* My level (the teal-to-violet ring) and today's missions. */
#missions { gap: 12px; }
#missions .lv-head { gap: 12px; }
#missions .lv-badge.au-ring {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: none; color: var(--ink); font: 600 17px/1 var(--display);
}
#missions .lv-text b { font: 600 var(--au-fs-card)/1.2 var(--display); }
#missions .lv-bar { height: 6px; background: var(--line-hi); }
#missions .lv-bar > div { background: var(--au-progress); }
#missions .mis-h { margin-top: 2px; font: 600 15px/1.2 var(--display); }
#missions .mis-h .i { color: var(--au-teal); }
#missions .mis-list { gap: 0; }
#missions .mis { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; }
#missions .mis + .mis { border-top: 1px solid var(--line-hi); }
#missions .mis-icon {
  width: 36px; height: 36px; border-radius: 50%; color: var(--violet-ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
#missions .mis-bar { height: 6px; background: var(--line-hi); }
#missions .mis-bar > div { background: var(--au-progress); }
#missions .mis-xp { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
#missions .mis-xp small { color: var(--au-gold); font-weight: 700; }
#missions .mis.done .mis-icon { background: var(--au-teal); color: var(--au-on-teal); box-shadow: 0 0 12px -2px color-mix(in srgb, var(--au-teal) 70%, transparent); }
#missions .mis.done .mis-bar > div { background: var(--au-teal); }
#missions .mis.done .mis-xp { color: var(--au-teal); }

/* Corrections waiting for an answer. */
#corrections .correction {
  border: 0; border-radius: var(--au-r-small);
  background: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 0 0 1px var(--au-edge);
}
#corrections .card h3 .i { color: var(--violet-ink); }

/* The feed and the chat. */
#social .tabs { width: 100%; margin-bottom: 12px; }
#social .tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#social .tabs button .i { width: 15px; height: 15px; }
#social .feed .plus { color: var(--au-teal); }
#social .chat-msg .tr-out { color: var(--ink-2); border-left-color: color-mix(in srgb, var(--au-teal) 45%, transparent); }
#social .chat-form { gap: 8px; }
#social .chat-form .btn.small { min-width: 42px; border-radius: var(--au-r-small); }

/* ===================== captions ===================== */

/* The caption bar: frosted like the dock, above the game. */
.live-bar {
  gap: 8px; padding: 10px 12px; border: 0; border-radius: var(--au-r-card);
  background: var(--au-dock);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] .live-bar { box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line), 0 20px 50px -20px rgba(30, 70, 130, 0.45); }
/* A desktop: exactly as wide as the stage, so it never covers the column
   beside (or the translator's button, which sits over that column); 376 is
   the 352px column plus the 24px gap. It rides in the page's flow, after the
   credit, stuck 16px off the window's foot (its root is a flex item of the
   body, under #app, which fills the window), rather than fixed: its own
   height is then the room kept for it at the end of the page, whatever it
   holds (one slim row on the call's screen, the head and the log elsewhere),
   so scrolled to the end the stage's last row and the credit always clear it,
   and the 34vh style.css keeps under a fixed bar goes. Under it, the sky
   (the body's own, painted fixed so it matches) covers the 16px below and
   its round corners, so the stage does not show again through that gap. */
@media (min-width: 1024px) {
  body:has(.layout) #live-root {
    position: sticky; bottom: 16px; z-index: 35;
    width: calc(min(100%, 1180px) - 2 * var(--au-gutter) - 376px);
    margin: 0 0 16px calc((100% - min(100%, 1180px)) / 2 + var(--au-gutter));
  }
  body:has(.layout) #live-root .live-bar { position: relative; left: auto; right: auto; bottom: auto; z-index: auto; }
  body:has(.layout) #live-root::before {
    content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: -16px; height: 44px; pointer-events: none;
    background-color: var(--au-bg0);
    background-image:
      radial-gradient(70% 42% at 16% 3%, rgb(var(--au-blob-teal) / calc(0.30 * var(--au-blob-o))), rgb(var(--au-blob-teal) / calc(0.12 * var(--au-blob-o))) 45%, transparent 75%),
      radial-gradient(62% 44% at 92% 12%, rgb(var(--au-blob-violet) / calc(0.30 * var(--au-blob-o))), rgb(var(--au-blob-violet) / calc(0.12 * var(--au-blob-o))) 45%, transparent 75%),
      radial-gradient(48% 30% at var(--au-blob3-at, 46% 28%), rgb(var(--au-blob-blue) / calc(0.17 * var(--au-blob-o))), transparent 72%),
      var(--au-sky);
    background-repeat: no-repeat; background-attachment: fixed;
  }
  body.with-live-bar:has(.layout) { padding-bottom: 0; }
  /* The call's own screen is the stage: it already has the big live line, the
     whole log and the call's buttons (mute, what I speak, translating, read
     aloud). The bar stays on, as it does everywhere once somebody talks, but
     only as its head with what the call has not got (the toggle, the badge,
     the caption quality), one slim row instead of the same buttons and the
     same "Nothing said yet" twice over the call's cards. */
  body:has(.layout[data-stage="call"]) .live-bar { gap: 0; }
  body:has(.layout[data-stage="call"]) .live-bar > :is(.live-bar-log, .live-bar-interim),
  body:has(.layout[data-stage="call"]) .live-bar-head > :is([data-act="mute"], .stt-pill, .live-noapi, .muted, [data-act="live-lang"], [data-act="live-tr"], [data-act="live-tts"]) { display: none; }
}
@media (max-width: 480px) { .live-bar { left: 8px; right: 8px; bottom: 8px; padding: 8px 10px; border-radius: 22px; } }
.live-bar-head { gap: 6px; }
.live-badge { font: 600 14px/1.2 var(--display); }
.live-badge .i { color: var(--au-teal); }
.live-bar-head > .muted { font-size: 12.5px; }
/* Toggles and the language I speak: glass chips, the chosen one with a teal ring. */
:is(.live-bar-head, .call-bar, .float-bar) .btn.small { border-radius: 999px; }
:is(.live-bar-head, .call-bar) .btn.small.violet, .gate-flags .btn.violet {
  color: var(--ink);
  background-color: var(--au-glass-base);
  background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 16%, transparent) 0 0);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent);
}
:is(.live-bar-head, .call-bar) .btn.small.violet:active:not(:disabled), .gate-flags .btn.violet:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent); }
.float-bar .btn.violet { background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 16%, transparent) 0 0); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent); }
:is(.live-bar-head, .call-bar) .btn .flag, .gate-flags .btn .flag { border-radius: 2px; }

/* One line of the log: a hairline on its left, violet for my own. */
.call-line { border-left: 2px solid var(--line-hi); padding: 2px 0 2px 12px; }
.call-line.own { border-left-color: var(--au-violet); }
.call-line-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.call-line-head .btn.tiny { border-radius: 999px; }
.call-line-main { font-weight: 600; line-height: 1.35; }
.call-line-sub { line-height: 1.4; }
.live-bar-interim { color: var(--ink-2); }
.live-bar-interim.listening::after { background: var(--au-teal); }
.call-live-line .cap-tr { color: var(--ai-ink); }

/* What my captions are doing. */
.stt-pill { font-size: 12px; }
.stt-listening { background: color-mix(in srgb, var(--au-teal) 14%, transparent); color: var(--au-teal); border-color: color-mix(in srgb, var(--au-teal) 40%, transparent); }
.stt-paused, .stt-listenOnly { background: color-mix(in srgb, var(--au-violet) 14%, transparent); color: var(--violet-ink); border-color: color-mix(in srgb, var(--au-violet) 35%, transparent); }
.stt-optIn { background: color-mix(in srgb, var(--au-violet) 16%, transparent); color: var(--violet-ink); border-color: color-mix(in srgb, var(--au-violet) 45%, transparent); }
.stt-muted, .stt-blocked, .stt-audio { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.stt-network { background: color-mix(in srgb, var(--au-gold) 14%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--au-gold) 35%, transparent); }

/* The better recogniser on its way. */
.live-upgrade {
  border: 0; border-radius: var(--au-r-small);
  background: color-mix(in srgb, var(--au-violet) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-violet) 32%, transparent);
}
.live-upgrade > .i { color: var(--violet-ink); }
.live-upgrade-bar { background: var(--line-hi); }
.live-upgrade-bar > i { background: var(--au-progress); }

/* Caption quality: a sheet like the room's menu. */
.live-q-menu {
  padding: 8px; border: 0; border-radius: var(--au-r-card);
  background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 24px 60px -18px rgba(0, 0, 0, 0.55);
}
.live-q-title { font: 600 14px/1.2 var(--display); color: var(--ink); }
.live-q-opt { border-radius: var(--au-r-small); box-shadow: none; }
.live-q-opt .i { color: var(--muted); }
.live-q-opt.on { background: color-mix(in srgb, var(--au-teal) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 40%, transparent); }
.live-q-opt.on .i { color: var(--au-teal); }
.live-q-note { color: var(--warn); }

/* A word in a language you are learning, and one already kept: teal, not
   orange (the orange is the screen's one action). */
.vocab-word { border-radius: 4px; }
@media (hover: hover) and (pointer: fine) { .vocab-word:hover { background: color-mix(in srgb, var(--au-violet) 20%, transparent); } }
.vocab-word:focus-visible { outline: 2px solid var(--au-teal); outline-offset: 1px; }
.vocab-word.saved { color: var(--au-teal); background: color-mix(in srgb, var(--au-teal) 14%, transparent); border-bottom-color: color-mix(in srgb, var(--au-teal) 80%, transparent); }
@media (hover: hover) and (pointer: fine) { .vocab-word.saved:hover { background: color-mix(in srgb, var(--au-teal) 24%, transparent); } }
.fun-float.fun-word { color: var(--au-teal); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }

/* ===================== the call's own screen ===================== */

.call-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* Wider than a phone: a small call sits centred, its tiles no wider than they
   need, instead of two tiles on the left and empty tracks after them. Every
   tile lays out from the top with its name on one line ("Dio (you)" no longer
   wraps: style.css makes every .muted in a tile a flex row, the "(you)" in the
   name too), so the language chip and the microphone sit at one height in all. */
@media (min-width: 481px) {
  .call-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); justify-content: center; }
  .call-tile { align-content: start; }
  .call-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .call-tile .call-name .muted { display: inline; }
}
.call-tile {
  padding: 18px 12px 16px; border: 0; border-radius: var(--au-r-tile);
  background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: var(--au-shadow);
}
.call-tile.talking {
  border-color: transparent;
  background-image: radial-gradient(90px 90px at calc(100% - 6px) 0, color-mix(in srgb, var(--au-teal) 45%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.call-avatar { border-radius: 50%; font-family: var(--display); font-weight: 700; transition: box-shadow var(--dur-2); }
.call-tile.talking .call-avatar { box-shadow: 0 0 0 3px var(--au-teal), 0 0 24px 4px color-mix(in srgb, var(--au-teal) 55%, transparent); }
.call-name { font: 600 15px/1.2 var(--display); }
/* The live captions: teal-lit while somebody is talking, in a bigger type. */
.call-live { min-height: 84px; font-size: 18px; }
.call-live:has(.call-live-line) { background-image: radial-gradient(130px 120px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-teal) 36%, transparent), transparent 72%), var(--au-glass); }
.call-bar { gap: 8px; }
.call-bar .btn.brand.big { min-width: 200px; }
.call-hint { font-size: 12.5px; }
.call-hint .i { width: 14px; height: 14px; vertical-align: -2px; }
.call-log { gap: 12px; }

/* What to talk about: teal-lit glass for a topic, violet for a scene. */
.talk-card { gap: 12px; }
.talk-card.tk-on {
  border-color: transparent;
  background-image: radial-gradient(150px 130px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-teal) 32%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.talk-card.tk-on:has(.tk-role) { background-image: radial-gradient(150px 130px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 36%, transparent), transparent 72%), var(--au-glass); }
.tk-head { gap: 8px; font: 600 var(--au-fs-card)/1.2 var(--display); }
.tk-head .i { color: var(--au-teal); }
.talk-card:has(.tk-role) .tk-head > .i { color: var(--violet-ink); }
.tk-head .btn.small { border-radius: 999px; }
.tk-hint { font-size: var(--au-fs-body-sm); line-height: 1.45; }
.tk-topic { font: 600 24px/1.25 var(--display); letter-spacing: -0.015em; }
.tk-role { font-family: var(--display); font-size: 19px; }
.tk-lines { gap: 8px; }
.tk-lines li {
  padding: 8px 12px; border: 0; border-radius: var(--au-r-small);
  background: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 0 0 1px var(--au-edge);
}
.tk-say { color: var(--au-teal); }
.tk-others { border-top-color: var(--line-hi); }
.tk-note .i { color: var(--warn); }
@media (max-width: 560px) { .tk-topic { font-size: 20px; } }

/* The roulette: aurora slices (client/talk.ts) on a soft halo, a gold pointer. */
.tk-wheel { isolation: isolate; }
.tk-wheel::before {
  content: ''; position: absolute; z-index: -1; inset: -18%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--au-teal) 34%, transparent), transparent);
}
.tk-wheel.scene::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--au-violet) 38%, transparent), transparent); }
.tk-disc { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.3)); }
.tk-disc path { stroke: #f4fbff; stroke-width: 1.5; }
.tk-pointer { width: 26px; height: 26px; top: -4px; fill: var(--au-gold); stroke: var(--au-brand-deep); stroke-width: 1; stroke-linejoin: round; }

/* Shared screens. */
.screen-tile { padding: 12px; }
.screen-head .i { color: var(--au-sky-hue); }
.screen-video { border-radius: var(--au-r-small); }
.screen-wait { border-radius: var(--au-r-small); background: linear-gradient(var(--au-glass-flat) 0 0); }

/* ===================== floating above the room ===================== */

/* Somebody is in the call and I am not. */
#call-invite {
  gap: 12px; padding: 12px 14px; border: 0; border-radius: var(--au-r-card);
  background: var(--au-sheet);
  backdrop-filter: none;
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 42%, transparent), 0 24px 50px -20px rgba(0, 0, 0, 0.6), 0 0 34px -8px color-mix(in srgb, var(--au-teal) 40%, transparent);
}
.ci-ring { background: linear-gradient(180deg, #5af0d4, #22c3a6); color: #053a33; box-shadow: 0 3px 0 #11806d; }
.ci-ring::after { --ring-c: color-mix(in srgb, #3ee6c8 55%, transparent); }
.ci-text b { font: 600 var(--au-fs-card)/1.2 var(--display); }
.btn.pulse::after { --ring-c: rgb(var(--brand-rgb) / 0.55); }

/* Joining the call on the way in. */
.gate-modal { gap: 14px; padding: 30px 26px 22px; }
.gate-modal h2 { font: 700 26px/1.1 var(--display); letter-spacing: -0.02em; }
.gate-modal p { font-size: 14.5px; }
.gate-mic {
  width: 84px; height: 84px; color: #053a33;
  background: linear-gradient(180deg, #5af0d4, #22c3a6);
  box-shadow: 0 4px 0 #11806d, 0 0 0 12px color-mix(in srgb, #3ee6c8 14%, transparent), 0 0 0 24px color-mix(in srgb, #3ee6c8 6%, transparent), 0 0 46px 8px color-mix(in srgb, #3ee6c8 38%, transparent);
}
.gate-here { background: color-mix(in srgb, var(--au-teal) 12%, transparent); color: var(--au-teal); border-color: color-mix(in srgb, var(--au-teal) 38%, transparent); }
.gate-flags .btn { min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; }
.gate-flags .btn.ghost { box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); background: linear-gradient(var(--au-glass-flat) 0 0); color: var(--ink); }
.gate-later { color: var(--muted); }
@media (max-width: 480px) { .gate-modal { padding: 28px 18px calc(20px + env(safe-area-inset-bottom)); } }

/* My call, small: a frosted pill. Shown wherever the column beside is not
   beside the game (below 1024), bottom centre. */
.call-mini .cm {
  border: 0; background: var(--au-dock);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 34%, transparent), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
}
.call-mini .cm-head b { font-family: var(--display); font-weight: 600; }
.call-mini .cm-avatar { box-shadow: 0 0 0 2px var(--au-bg1); }
.call-mini .cm-avatar.talking { box-shadow: 0 0 0 2px var(--au-teal), 0 0 12px 2px color-mix(in srgb, var(--au-teal) 55%, transparent); }
@media (max-width: 1023px) {
  .call-mini { display: block; top: auto; bottom: 14px; left: 50%; right: auto; transform: translateX(-50%); }
  body.with-live-bar .call-mini { bottom: 150px; }
}

/* My call, big: a sheet. */
.call-sheet-backdrop { background: var(--au-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.call-sheet {
  border: 0; border-radius: var(--au-r-sheet); padding: 20px;
  background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}
.call-sheet-head h2 { font: 700 24px/1.1 var(--display); }

/* The call floating above the other tabs: its own small document. */
body.float-body { background-color: var(--au-bg0); background-image: var(--au-sky); }
.float-people .cm-avatar { box-shadow: 0 0 0 2px var(--au-bg1); }
.float-people .cm-avatar.talking { box-shadow: 0 0 0 2px var(--au-teal), 0 0 10px 2px color-mix(in srgb, var(--au-teal) 55%, transparent); }
.float-log { padding: 2px; }
.float-screen .screen-video { border-radius: var(--au-r-small); }

/* The end of a game. */
#podium { background: var(--au-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pd-card {
  border: 0; border-radius: var(--au-r-sheet);
  background: radial-gradient(320px 220px at 50% -60px, color-mix(in srgb, var(--au-gold) 26%, transparent), transparent 70%), var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}
.pd-card h2 { font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; }
.pd-col .cm-avatar { box-shadow: 0 0 0 2px var(--au-glass-hi); font-family: var(--display); }
.pd-col b { font-weight: 700; }
.pd-pts { color: var(--au-gold); font-family: var(--display); font-weight: 700; }
.pd-block { border-radius: 14px 14px 6px 6px; font: 700 28px/1 var(--display); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.pd-1 .pd-block { background: linear-gradient(180deg, #ffd977, #f5a524); color: #5a3a00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 34px -6px rgba(255, 201, 77, 0.7); }
.pd-2 .pd-block { background: linear-gradient(180deg, #a996ff, #7a62f5); color: #fff; }
.pd-3 .pd-block { background: linear-gradient(180deg, #5af0d4, #22c3a6); color: #053a33; }

/* ===================== the translator ===================== */

/* The button in the corner: the violet 3D button, as a pill. */
.ai-fab {
  padding: 12px 18px 12px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #a996ff, #7a62f5); color: #fff;
  font: 700 15px/1.2 var(--font);
  box-shadow: 0 4px 0 #4f37c9, 0 14px 30px -12px rgba(122, 98, 245, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ai-fab:active { transform: translateY(2px); box-shadow: 0 2px 0 #4f37c9, 0 8px 18px -10px rgba(122, 98, 245, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
@media (hover: hover) and (pointer: fine) { .ai-fab:hover { transform: none; filter: brightness(1.06); } }
.ai-fab .spark { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 600px) { .ai-fab { padding: 13px; right: 16px; } }
/* A desktop: the button and the panel belong to the room's column, not to the
   window's corner. Both line up with the column's right edge (the frame's
   edge, as for the bar at the top and the caption bar), and the panel is the
   column's width and its height (from level with the column's first card,
   and the stage's, down to the column's foot), whatever the window, so open
   it covers the column exactly rather than half a card of it and a strip of
   sky; its body row takes the height its content does not. The column keeps
   room at its foot for the button. */
@media (min-width: 1024px) {
  .ai-fab, .ai-panel { right: max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter))); }
  .ai-panel { width: 352px; top: 84px; bottom: 16px; max-height: none; }
}

/* The panel: a sheet with a violet night head (a dark island in the day too). */
.ai-panel {
  border: 0; border-radius: var(--au-r-sheet);
  background: var(--au-sheet);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 90px -20px rgba(0, 0, 0, 0.8);
}
:root[data-theme="light"] .ai-panel { box-shadow: inset 0 1px 0 #fff, 0 30px 60px -24px rgba(30, 70, 130, 0.45); }
.ai-head {
  padding: 12px 14px 12px 10px;
  background:
    radial-gradient(240px 180px at calc(100% + 30px) -40px, color-mix(in srgb, #3ee6c8 38%, transparent), transparent 70%),
    radial-gradient(200px 160px at -30px calc(100% + 40px), color-mix(in srgb, #9a83ff 34%, transparent), transparent 70%),
    var(--au-hero-violet);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.ai-head .ai-brand { font: 700 11px/1.2 var(--display); letter-spacing: 0.16em; color: #b6fff0; opacity: 1; }
.ai-head .ai-title b { font: 700 18px/1.15 var(--display); letter-spacing: -0.01em; }
.ai-head .ai-title small { color: rgba(234, 244, 255, 0.78) !important; }
.ai-head [data-ai="close"] { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.ai-body { gap: 12px; }
.ai-swap { width: 38px; height: 38px; border-radius: 50%; }
.ai-input-wrap textarea { border-radius: var(--au-r-small); }
.ai-out {
  border: 0; border-radius: 20px;
  background: radial-gradient(170px 130px at calc(100% - 6px) 0, color-mix(in srgb, var(--au-teal) 24%, transparent), transparent 72%), linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 30%, transparent);
}
.ai-out .ai-text { font-weight: 600; letter-spacing: -0.005em; }
.ai-status .dot.ready { background: var(--au-teal); box-shadow: 0 0 10px var(--au-teal); }
.ai-status .dot.busy { background: var(--au-gold); }
.ai-progress { background: var(--line-hi); }
.ai-progress div { background: var(--au-progress); }
.ai-thinking i { background: var(--au-teal); }
.ai-history h4 { font: 700 11px/1.2 var(--font); letter-spacing: 0.14em; color: var(--muted); }
.ai-hist-item {
  border: 0; border-radius: var(--au-r-small);
  background: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 0 0 1px var(--au-edge);
}
@media (hover: hover) and (pointer: fine) { .ai-hist-item:hover { border-color: transparent; background: linear-gradient(var(--au-glass-hi) 0 0); } }
/* On a phone the panel is a bottom sheet. */
@media (max-width: 480px) {
  .ai-panel {
    left: 0; right: 0; bottom: 0; width: auto;
    max-height: calc(100dvh - 24px);
    border-radius: var(--au-r-sheet) var(--au-r-sheet) 0 0;
    transform-origin: bottom center;
  }
  .ai-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .modes-grid .mode-card, .learn-grid .learn-card { transition: none; }
  .modes-grid .mode-card:hover, .learn-grid .learn-card:hover { transform: none; }
}
