/* Snowball Fight — the page's styles (public/index.html links this file). */
  :root {
    /* Keep the authored colours when the browser tries to darken the page. The media query still follows the device. */
    color-scheme: only light;
    --bg: #c9d9ea; --snow1: #f8fbff; --snow2: #edf3fa; --snowdot: #dbe7f4; --shade: rgba(84, 124, 184, .22); --edge: #9fb7d1;
    --tree: #2c6a4c; --tree2: #3d875f; --trunk: #6d4c35; --fort: #eef4fb; --fort-edge: #b5c9e0; --fort-line: #c9d8ea;
    --ball: #ffffff; --ball-shade: #b9cde6; --crack: #6f8fb8; --print: rgba(110, 145, 195, .28); --track: rgba(140, 170, 210, .22);
    --panel: rgba(250, 252, 255, .97); --ink: #1d2b3c; --ink-soft: #5b6c80; --line: #d6e1ee;
    --accent: #2f78d0; --on-accent: #fff; --field: #fff; --err: #c3264a;
    --hud: rgba(22, 38, 60, .55); --hud-ink: #f6faff;
    --shadow: 0 12px 40px rgba(30, 60, 110, .25);
    /* The night cards' tiles (the "Great game!" pop-up and the round results, 24 Nov 2026), the same in light and dark. */
    --nightTile: #1b3264; --nightEdge: #34508a; --nightDeep: #142a55; --nightLine: #2c4679; --nightGold: #3a3218; --nightGoldEdge: #b8902a;
  }
  @media (prefers-color-scheme: dark) {
    /* The field keeps its white snow (--bg … --track above); panels, buttons and text go dark. */
    :root {
      --panel: rgba(20, 28, 42, .97); --ink: #eaf1fa; --ink-soft: #a3b3c7; --line: #2f3d52;
      --accent: #6aa8ff; --on-accent: #0b1424; --field: #141d2b; --err: #ff7a95;
      --hud: rgba(5, 9, 16, .6); --hud-ink: #f6faff;
    }
  }
  /* Arabic letters only, self-hosted under SIL OFL; English stays in the system font. */
  @font-face {
    font-family: "Noto Kufi Arabic"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(/fonts/noto-kufi-arabic.woff2) format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
  }
  /* Emoji in Google's Noto design for everyone (SIL OFL, fonts/Noto-Emoji-OFL.txt), not the phone's own: Apple's and
     Samsung's are not licensed for ads (the owner's ask, 14 Nov 2026). Only the game's emoji, cut by assets/emoji/make.py;
     anything else in the range falls through to the device. COLRv1 (Chrome, Edge, Firefox, Android) where the browser
     says it has it; else the SVG copy, which Safari on iPhone and Mac draws. Flags stay the device's. */
  @font-face {
    font-family: "Noto Color Emoji"; font-display: swap;
    src: url(/fonts/noto-emoji-svg.woff2) format("woff2");
    src: url(/fonts/noto-emoji-colr.woff2) format("woff2") tech(color-COLRv1), url(/fonts/noto-emoji-svg.woff2) format("woff2");
    unicode-range: U+200D, U+FE0F, U+2300-23FF, U+2600-27BF, U+2B00-2BFF, U+1F300-1FAFF;
  }
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { height: 100%; }
  /* iPhone Safari zooms the page on a fast second tap and ignores user-scalable=no.
     manipulation turns that double-tap off everywhere; pinch still works, and a
     child's own touch-action (the field, THROW, the open scoreboard) still wins. */
  html { touch-action: manipulation; }
  body {
    margin: 0; overflow: hidden; background: var(--bg); color: var(--ink);
    font: 16px/1.45 "Noto Kufi Arabic", "Noto Color Emoji", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none;
    overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  }
  canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
  /* iPhone Home Screen app, status bar over the page: the page is measured one status bar shorter than the screen, so the
     whole screen is 100lvh (class set by resize() in index.html; 31 Oct 2026). */
  html.fullh, html.fullh body { height: 100lvh; }
  html.fullh canvas { height: 100lvh; }
  button, input, select { font: inherit; }
  button {
    cursor: pointer; border-radius: 12px; border: 1px solid var(--line); background: var(--field);
    color: var(--ink); padding: 8px 14px; min-height: 44px; min-width: 44px; touch-action: manipulation;
  }
  button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; }

  .overlay {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
    overflow-y: auto; -webkit-user-select: text; user-select: text;
  }
  .card {
    width: 100%; max-width: 440px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow);
    padding: 18px; border: 1px solid var(--line); margin: auto;
  }
  .card h1 { margin: 0; font-size: clamp(2rem, 7vw, 2.6rem); line-height: 1.05; letter-spacing: -.02em; }


  /* Notifications and Invite friends: small round icons with a word under each. */
  .quick { display: flex; justify-content: center; gap: 34px; margin-top: 10px; }
  .quick button { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--ink); }
  .quick span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--field); border: 1.5px solid var(--line); box-shadow: 0 4px 12px rgba(30, 60, 110, .1); color: var(--accent); }
  .quick #shareGame span { color: #f08a24; position: relative; }
  .quick svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* The notifications switch: a crossed-out grey bell and "Off" while off, a blue bell and "On" while on. */
  :is(.quick, .menuDlg) .off { display: inline; }
  :is(.quick, .menuDlg) .on .off { display: none; }
  :is(.quick, .menuDlg) #pushBtn:not(.on) span { color: var(--ink-soft); }
  :is(.quick, .menuDlg, #roomDlg) .sw { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: .72rem; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--line); color: var(--ink-soft); }
  :is(.quick, .menuDlg, #roomDlg) .sw::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
  :is(.quick, .menuDlg, #roomDlg) .on .sw { flex-direction: row-reverse; padding: 2px 3px 2px 8px; background: var(--accent); color: #fff; }
  .quick button:hover span { border-color: currentColor; }
  .quick button:disabled { opacity: .5; }
  .hint.center { text-align: center; margin-top: 8px; }
  .chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; padding: 0; }
  .chips li { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
  .card h1 span { color: var(--accent); }
  .brandline { display: flex; align-items: center; gap: 3%; container-type: inline-size; }
  .brandline img { flex: none; width: 16%; max-width: 64px; height: auto; }
  .brandline h1 { min-width: 0; white-space: nowrap; font-size: clamp(.72rem, 7.5cqw, 2.6rem); }
  .lead { margin: 4px 0 14px; color: var(--ink-soft); font-size: .95rem; }
  .topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  button.lang { min-height: 34px; min-width: 0; padding: 3px 12px; border-radius: 999px; font-size: .88rem; color: var(--ink-soft); }
  /* The Roll and Wall pads stay on the right in both languages. On an iPhone on its side the right inset is the notch's
     width (about 47–59 px) on both sides, though the pads sit low, clear of the notch: they keep 30 px less (29 Oct 2026). */
  html[dir=rtl] #roll { inset-inline-end: auto; right: max(18px, env(safe-area-inset-right) - 30px); }
  html[dir=rtl] #build { inset-inline-end: auto; right: max(26px, env(safe-area-inset-right) - 30px); }
  label.f { display: grid; gap: 4px; font-size: .9rem; color: var(--ink-soft); margin-bottom: 10px; }
  .namePick { display: flex; gap: 8px; margin: -6px 0 10px; }
  .namePick input { min-width: 0; flex: 1; }
  .namePick button { flex: none; display: flex; align-items: center; gap: 3px; padding: 4px 10px; font-size: 1.45rem; line-height: 1; }
  input, textarea {
    width: 100%; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--field); color: var(--ink);
  }
  .hues { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin: 2px 0 12px; }
  .hues button {
    min-width: 0; min-height: 44px; padding: 0; aspect-ratio: 1; border-radius: 14px; border: 2px solid transparent;
    background: color-mix(in srgb, var(--c) 20%, var(--field)); display: grid; place-items: center;
    font-size: clamp(1.25rem, 5.5vw, 1.6rem); line-height: 1; transition: transform .12s, box-shadow .12s;
  }
  @media (max-width: 420px) {
    .hues { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hues button { aspect-ratio: auto; min-height: 46px; }
  }
  .hues button span { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
  .hues button:hover { transform: translateY(-1px); }
  .hues button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 38%, var(--field));
    transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 14px -6px var(--c); }
  .row { display: flex; gap: 8px; flex-wrap: wrap; }
  .row > * { flex: 1 1 auto; }
  .play { width: 100%; font-size: 1.15rem; min-height: 52px; margin-bottom: 10px; }
  /* Offline (switch offline): a small button beside Play now, the open field in this browser with bots. */
  .playRow { display: flex; gap: 8px; margin-bottom: 10px; }
  .playRow .play { flex: 1; margin-bottom: 0; }
  .offline { flex: none; min-height: 52px; padding: 2px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: transparent; color: var(--accent); border-color: var(--accent); font-size: .78rem; font-weight: 700; line-height: 1.1; }
  .offline span { font-size: 1.15rem; }
  .modes { border: 0; padding: 0; margin: 4px 0 8px; min-width: 0; }
  .modes legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
  .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  .flagOff { display: none !important; }   /* switched off on the admin page (public/js/config.js) */
  .seg label { position: relative; }
  .seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .seg span {
    display: grid; justify-items: center; align-content: center; gap: 2px; height: 100%; min-height: 110px;
    padding: 9px 7px 13px; text-align: center; cursor: pointer; border: 1px solid var(--line); border-radius: 11px;
    background: color-mix(in srgb, var(--accent) 8%, var(--field));
    box-shadow: inset 0 -5px color-mix(in srgb, var(--accent) 18%, var(--field));
  }
  .seg label:nth-child(2) span { background: color-mix(in srgb, #a99be7 12%, var(--field)); box-shadow: inset 0 -5px color-mix(in srgb, #a99be7 23%, var(--field)); }
  /* The 3D mode pictures (assets/3d/modes.html): a flat snow island, 3 wide by 2 high, floating on its own shadow. */
  .modeArt { width: 96px; height: 64px; flex: none; object-fit: contain; }
  .seg b { font-size: .95rem; line-height: 1.2; }
  .seg small { color: var(--ink-soft); font-size: .76rem; line-height: 1.25; }
  .seg input:checked + span, .seg label:nth-child(2) input:checked + span {
    border: 2px solid var(--accent); padding: 8px 6px 12px;
    background: color-mix(in srgb, var(--accent) 18%, var(--field));
    box-shadow: inset 0 -5px color-mix(in srgb, var(--accent) 42%, var(--field)), 0 3px 8px rgba(47, 120, 208, .18);
  }
  .seg input:checked + span::after { content: '✓'; position: absolute; top: 5px; inset-inline-end: 9px; color: var(--accent); font-weight: 900; }
  .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
  .panel { margin-bottom: 10px; }
  .panel .hint:last-child, .panel label.f:last-child { margin-bottom: 0; }
  #code { text-transform: uppercase; letter-spacing: .1em; }
  .topline .tools { display: flex; gap: 6px; margin-inline-start: auto; }
  .topline .exitApp { padding-inline: 12px; font-weight: 700; }
  .setup { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .setup .row { margin: 0; }
  .setup label.f { flex: 1 1 100%; margin-bottom: 6px; }
  select {
    width: 100%; padding: 8px 10px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--field); color: var(--ink);
  }
  .hint { margin: 0 0 8px; color: var(--ink-soft); font-size: .84rem; }
  #help {
    width: calc(100% - 36px); max-width: 520px; max-height: calc(100% - 36px); overflow-y: auto; padding: 18px;
    background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    -webkit-user-select: text; user-select: text;
  }
  #help::backdrop { background: rgba(10, 20, 35, .45); }
  #help .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  #help h2 { margin: 0; font-size: 1.35rem; }
  #help .helpReport { display: block; margin: 12px auto 0; }
  /* The Practice button sits right under the title, so it is the first thing the ? panel offers. */
  #help .helpCoach {
    display: block; width: 100%; margin: 10px 0 4px; padding: 10px 14px; font-weight: 800; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent); border: 2px solid var(--accent); border-radius: 12px;
  }
  #help h3 { margin: 14px 0 6px; font-size: 1rem; }
  #help p { margin: 6px 0; font-size: .92rem; }
  #help .how { margin-top: 0; }
  #help .play { margin: 14px 0 0; }
  /* Three even-ish columns: the action wraps instead of squeezing the phone and computer columns. */
  .keys { width: 100%; border-collapse: collapse; font-size: .86rem; table-layout: fixed; }
  .keys th, .keys td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; line-height: 1.35; }
  .keys th:first-child, .keys td:first-child { padding-inline-start: 0; width: 34%; }
  .keys th:last-child, .keys td:last-child { padding-inline-end: 0; }
  .keys thead th { color: var(--ink-soft); font-weight: 600; padding-top: 4px; }
  .keys tbody th { font-weight: 700; }
  .keys tbody tr:last-child > * { border-bottom: 0; }
  .keys span[dir=ltr] { white-space: nowrap; }
  /* At the bottom, above the hints when they show: alone in your room, or a timed room waiting for its
     owner's Start — the owner gets Start and the bot buttons. */
  #wait {
    left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + 8px); transform: translateX(-50%);
    background: var(--hud); border-radius: 14px; padding: 8px 14px; font-size: .9rem; text-align: center; line-height: 1.35;
    display: grid; gap: 8px; justify-items: center; width: max-content; max-width: min(460px, calc(100vw - 32px)); z-index: 4;
  }
  #wait .row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
  #wait .row[hidden] { display: none; }
  #wait button { min-height: 38px; padding: 4px 14px; color: var(--hud-ink); background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
  #wait button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; }
  #wait .bots { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
  #wait .bots button { min-width: 38px; padding: 0; font-size: 1.1rem; }
  body:has(#roll:not([hidden])) #wait { max-width: min(440px, calc(100vw - 380px)); min-width: 240px; }
  /* 18px of screen around every pop-up, on every side (the owner's rule, 16 Nov 2026). */
  #roomDlg, .pop { width: calc(100% - 36px); max-width: 360px; padding: 18px; background: var(--panel); color: var(--ink);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
  #roomDlg::backdrop, .pop::backdrop { background: rgba(10, 20, 35, .45); }
  #roomDlg .head, .pop .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  #roomDlg h2, .pop h2 { margin: 0; font-size: 1.2rem; }
  /* The private room pop-ups (start screen): a choice of two, the code box, a new room's settings. */
  .pop { max-width: 380px; max-height: calc(100% - 36px); max-height: calc(100dvh - 36px); overflow-y: auto; }
  /* The iPhone full-screen pop-up fits any screen without scrolling: everything is sized in em from the screen's height,
     between 12 and 16 px, so it shrinks on a phone on its side (the owner's ask, 31 Oct 2026). */
  #nameDlg .invited { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; text-align: center; font-weight: 800;
    background: color-mix(in srgb, var(--accent) 14%, var(--field)); color: var(--ink); }
  #nameDlg input { width: 100%; text-align: center; margin: 4px 0 6px; }
  #iosDlg { font-size: clamp(12px, 3.4dvh, 16px); padding: 1em; overflow: hidden; }
  #iosDlg .head { margin-bottom: .4em; }
  #iosDlg h2 { font-size: 1.2em; }
  #iosDlg .popClose { min-height: 2.6em; min-width: 2.6em; padding: 0; font-size: 1em; }
  #iosDlg p { margin: 0 0 .4em; }
  /* The steps, numbered, each with the iPhone button it means (More, Share, Add to Home Screen, the game's icon). */
  #iosDlg .iosSteps { list-style: none; counter-reset: step; margin: 0 0 .6em; padding: 0; }
  #iosDlg .iosSteps li { counter-increment: step; display: flex; align-items: center; gap: .45em; margin: .2em 0; }
  #iosDlg .iosSteps li::before { content: counter(step) "."; min-width: 1em; }
  #iosDlg .iosSteps svg { flex: none; width: 1.4em; height: 1.4em; padding: .15em; border-radius: .4em; background: var(--line);
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  #iosDlg .iosSteps img { flex: none; width: 1.4em; height: 1.4em; border-radius: .35em; }
  #iosDlg .iosOff { display: flex; align-items: center; gap: .5em; margin: 0 0 .6em; font-size: .9em; color: var(--ink-soft); }
  #iosDlg .iosOff input { width: 1.3em; height: 1.3em; margin: 0; accent-color: var(--accent); }
  #iosDlg .leaveBtns button { min-height: 2.75em; padding: .4em .6em; font-size: 1em; }
  #iosDlg #iosPlay { background: var(--line); border-color: var(--line); color: var(--ink); }   /* grey: not the step we hope for */
  .pop .head { margin-bottom: 12px; }
  /* A team mode's rules, the first time (public/js/modehelp.js): a see-through pop-up of four small moving pictures. */
  #modeDlg { max-width: 460px; background: color-mix(in srgb, var(--panel) 80%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .mhNever { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; font-size: 14px; cursor: pointer; }
  .mhNever input { width: 18px; height: 18px; margin: 0; }
  #modeDlg::backdrop { background: rgba(12, 24, 44, .18); }
  .mhCards { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; counter-reset: mh; }
  /* The steps in order (the owner's ask, 12 Nov 2026): a number on each card, and an arrow to the next one beside it. */
  .mhCard { position: relative; counter-increment: mh; }
  .mhCard::before { content: counter(mh); position: absolute; top: -8px; inset-inline-start: -8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
    background: #2f78d0; color: #fff; font: 900 15px/26px "Noto Color Emoji", system-ui, sans-serif; text-align: center; box-shadow: 0 2px 0 #1d5aa6, 0 0 0 3px #fff; }
  .mhCard::after { content: '→'; display: none; position: absolute; top: 38px; inset-inline-end: -14px; z-index: 2; width: 14px; text-align: center;
    color: #2f78d0; font: 900 16px/1 "Noto Color Emoji", system-ui, sans-serif; }
  :root[dir="rtl"] .mhCard::after { content: '←'; }
  .mhCard:nth-child(odd)::after { display: block; }
  .mhCard { background: color-mix(in srgb, var(--panel) 70%, transparent); border-radius: 14px; padding: 8px; text-align: center; }
  .mhCard p { margin: 6px 0 0; font-weight: 700; font-size: 14px; line-height: 1.25; }
  .mhStage { position: relative; height: 76px; border-radius: 10px; background: #eef5fb; overflow: hidden; direction: ltr; }
  .mhStage > * { position: absolute; }
  .mhChar { width: 36px; height: 36px; top: 18px; left: calc(50% - 18px); font-size: 28px; line-height: 36px; text-align: center; border-radius: 50%; }
  .mhChar.tb { background: rgba(79, 149, 232, .3); box-shadow: 0 0 0 2px #4f95e8; } .mhChar.to { background: rgba(240, 138, 36, .3); box-shadow: 0 0 0 2px #f08a24; }
  .mhLeft { left: 12%; } .mhRight { left: auto; right: 12%; }
  .mhVs { top: 26px; left: calc(50% - 14px); font-weight: 900; color: #5a6b85; }
  .mhZone { width: 66px; height: 66px; top: 5px; left: calc(50% - 33px); border-radius: 50%; border: 3px dashed; box-sizing: border-box; }
  .mhZone.zo { border-color: #f08a24; background: rgba(240, 138, 36, .14); } .mhZone.zb { border-color: #4f95e8; background: rgba(79, 149, 232, .14); }
  .mhFlag { top: 10px; left: calc(50% + 4px); font-size: 18px; }
  .mhTime { bottom: 3px; left: calc(50% - 16px); width: 32px; font: 800 13px "Noto Color Emoji", system-ui, sans-serif; color: #2f78d0; }
  .mhBall { width: 12px; height: 12px; top: 33px; left: 30%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px #9fbcd8; }
  .mhBadge { top: 4px; right: 8px; font: 900 16px "Noto Color Emoji", system-ui, sans-serif; color: #2f78d0; }
  .mhPlus { top: 6px; right: 14%; font: 900 15px "Noto Color Emoji", system-ui, sans-serif; color: #2f78d0; animation: mhPop 1.8s infinite; }
  .mhTrophy { top: 6px; left: calc(50% - 15px); font-size: 28px; }
  .mhIn1 { left: calc(50% - 36px); } .mhIn2 { left: calc(50% + 0px); }
  /* The fill rules carry .mhZone, so they win over the zone's own colour (.mhZone.zo), which hid the fill until 12 Nov 2026. */
  @property --mhf { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
  .mhZone:is(.mhFill, .mhFill2) { border-style: solid; background: conic-gradient(rgba(79, 149, 232, .45) var(--mhf), rgba(240, 138, 36, .14) 0); animation: mhFill 3s linear infinite; }
  .mhFill2 { animation-duration: 1.5s; }
  .mhRunIn { animation: mhRun 3s ease-out infinite; }
  .mhThrow { animation: mhThrow 1.8s ease-in infinite; }
  .mhThrowIn { left: auto; right: 6%; animation: mhThrowIn 1.8s ease-in infinite; }
  .mhPass { animation: mhPass 1.8s linear infinite; }
  .mhHit { animation: mhHit 1.8s infinite; }
  .mhPulse { animation: mhPulse 1.2s ease-in-out infinite; }
  .mhJump { animation: mhJump 0.9s ease-in-out infinite; } .mhJump2 { animation: mhJump 0.9s ease-in-out 0.45s infinite; }
  @keyframes mhFill { to { --mhf: 100%; } }
  /* Hold the castle: the castle shakes harder as the zone fills; stepping out drains the fill, back in fills it again. */
  .mhCastle { top: 14px; left: calc(50% - 15px); font-size: 26px; line-height: 1; animation: mhCrack 3s linear infinite; }
  .mhBeside { left: calc(50% + 12px); top: 30px; width: 30px; height: 30px; font-size: 22px; line-height: 30px; }
  .mhZone.mhDrain { border-style: solid; background: conic-gradient(rgba(79, 149, 232, .45) var(--mhf), rgba(240, 138, 36, .14) 0); animation: mhDrain 4s linear infinite; }
  .mhOutIn { animation: mhOutIn 4s ease-in-out infinite; }
  @keyframes mhCrack { 0%, 40% { transform: none; filter: none; } 45% { transform: translateX(-1px) rotate(-3deg); } 55% { transform: translateX(1px) rotate(3deg); }
    65% { transform: rotate(-5deg); filter: grayscale(.4); } 75% { transform: rotate(5deg); filter: grayscale(.6); } 85%, 95% { transform: translateY(4px) rotate(-8deg); filter: grayscale(.8); opacity: .8; } 100% { transform: none; filter: none; } }
  @keyframes mhDrain { 0%, 15% { --mhf: 60%; } 50% { --mhf: 30%; } 85%, 100% { --mhf: 60%; } }
  @keyframes mhOutIn { 0%, 12% { transform: none; } 22%, 50% { transform: translateX(62px); } 62%, 100% { transform: none; } }
  @keyframes mhRun { 0% { transform: translateX(-60px); } 35%, 100% { transform: none; } }
  @keyframes mhThrow { 0% { left: 28%; opacity: 1; } 60% { left: 68%; opacity: 1; } 61%, 100% { left: 68%; opacity: 0; } }
  @keyframes mhThrowIn { 0% { right: 6%; opacity: 1; } 60% { right: 52%; opacity: 1; } 61%, 100% { right: 52%; opacity: 0; } }
  @keyframes mhPass { 0% { left: 18%; } 100% { left: 80%; } }
  @keyframes mhHit { 0%, 55% { transform: none; filter: none; } 62% { transform: translateX(4px) rotate(8deg); filter: brightness(1.6); } 75%, 100% { transform: none; filter: none; } }
  @keyframes mhPulse { 50% { transform: scale(1.25); } }
  @keyframes mhPop { 0%, 55% { opacity: 0; transform: none; } 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
  @keyframes mhJump { 50% { transform: translateY(-8px); } }
  @media (max-height: 500px) { #modeDlg { max-width: 620px; } .mhCards { grid-template-columns: repeat(4, 1fr); } .mhCard:not(:last-child)::after { display: block; } }
  @media (prefers-reduced-motion: reduce) { .mhStage * { animation: none !important; } }
  /* Keep the game (#keepDlg): the address big, two buttons, the store badges greyed until the apps are out. */
  #keepDlg .keepUrl { margin: .2em 0 .8em; padding: .6em; border-radius: 12px; text-align: center; font-weight: 800; font-size: 1.05em;
    background: color-mix(in srgb, var(--accent) 14%, var(--field)); color: var(--ink); overflow-wrap: anywhere; }
  #keepDlg .leaveBtns button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding-inline: 6px; white-space: nowrap; font-size: .95em; }   /* one line (the owner's ask, 5 Nov 2026) */
  #keepShare svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  #keepShare { background: var(--line); border-color: var(--line); color: var(--ink); }
  /* Five stars after the first game (#keepDlg, #betaDlg; public/js/rating.js): hover lights them up to the pointer, a tap picks. */
  .stars { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: .9em 0 1.5em; }   /* in Arabic the first star is on the right */
  .stars[hidden] { display: none; }
  .stars button { width: 44px; height: 44px; padding: 0; border: 0; background: none; box-shadow: none; font-size: 34px; line-height: 1; color: var(--line); cursor: pointer; transition: transform .1s, color .1s; }
  .stars button.lit { color: #f5b301; }
  .stars button:hover { transform: scale(1.15); }   /* a rating can be changed any time (18 Nov 2026) */
  .stars small { flex-basis: 100%; margin-top: .5em; text-align: center; font-weight: 700; color: var(--ink-soft); display: none; }
  .stars.done small { display: block; }
  #keepDlg .keepSoon { margin: 1.5em 0 .7em; font-size: .85em; color: var(--ink-soft); text-align: center; }
  #keepDlg .keepStores { display: flex; gap: 8px; justify-content: center; }
  #keepDlg .keepStores button { display: flex; align-items: center; gap: 6px; padding: 6px 10px; white-space: nowrap; font-size: .9em; border-radius: 10px; background: #111; color: #fff;
    border: 1px solid #111; opacity: .4; cursor: not-allowed; filter: grayscale(1); text-align: start; line-height: 1.1; font-weight: 700; direction: ltr; }
  #keepDlg .keepStores svg { width: 22px; height: 22px; flex: none; }
  #keepDlg .keepStores small { display: block; font-size: .65em; font-weight: 500; }
  #keepDlg .keepStores b { display: block; }
  /* Private room: two tiles side by side, each island rising above its tile's top edge (the owner's pick, 25 Nov 2026). */
  #pickDlg .tiles { display: flex; gap: 10px; padding-top: 34px; margin-bottom: 12px; }
  #pickDlg .pick { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 8px 14px; text-align: center;
    border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, #85cbb9 12%, var(--field)); color: var(--ink);
    box-shadow: inset 0 -4px color-mix(in srgb, #85cbb9 23%, var(--field)); }
  #pickDlg #pickJoin { background: color-mix(in srgb, #f4c18b 12%, var(--field)); box-shadow: inset 0 -4px color-mix(in srgb, #f4c18b 25%, var(--field)); }
  #pickDlg .pick .modeArt { margin-top: -40px; }   /* its size and shadow: with #modeList's cards, below */
  #pickDlg .pick b { font-size: 1.05rem; }
  #pickDlg .pick:hover { border-color: var(--accent); }
  #pickDlg .pick:active { transform: translateY(2px); box-shadow: none; }
  #pickDlg .pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .joinRow { display: flex; gap: 8px; }
  .joinRow input { flex: 1 1 auto; min-width: 0; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .14em; }
  .joinRow button { flex: none; padding: 0 22px; }
  .pop .err:empty { display: none; }
  .pop .wide { width: 100%; margin-top: 8px; }
  .pop .link { border: 0; background: transparent; color: var(--accent); font-weight: 700; }
  .pop .row label.f { flex: 1 1 100%; margin-bottom: 6px; }
  @media (max-height: 500px) { .pop { max-width: 560px; } .pop .row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; } }
  /* A tablet: a new room's three choices side by side, so Create shows without scrolling. */
  @media (min-width: 760px) and (min-height: 501px) { #newDlg { max-width: 640px; } #newDlg .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; } }
  /* Share the game, get a skin (js/invite.js): the 🎁 on Invite friends and its pop-up, with the scarf on your snowman. */
  .quick .giftTag { position: absolute; top: -8px; inset-inline-end: -10px; font-style: normal; font-size: 1.15rem; line-height: 1; animation: giftWiggle 2.6s ease-in-out infinite; }
  @keyframes giftWiggle {
    0%, 60%, 100% { transform: none; }
    66% { transform: translateY(-5px) rotate(-12deg) scale(1.08); }
    74% { transform: translateY(-5px) rotate(10deg) scale(1.08); }
    82% { transform: translateY(-2px) rotate(-6deg); }
    90% { transform: none; }
  }
  @media (prefers-reduced-motion: reduce) { .quick .giftTag { animation: none; } }
  .pop.gift { padding: 0; text-align: center; }
  /* The countdown to an event room's start (#waitDlg): the logo on the snowy top, the room's name and code, the two teams,
     big time tiles and a link per team to copy or share. Width, padding and type grow with the screen (clamp). */
  #waitDlg { width: calc(100% - 20px); max-width: 560px; padding-bottom: 0; }
  #waitDlg .waitTop { padding: clamp(18px, 4vh, 30px) 0 clamp(10px, 2vh, 16px); gap: 8px; }
  #waitDlg .waitTop img { width: clamp(150px, 45vw, 240px); height: auto; }
  #waitDlg .waitRoom { padding: 4px 14px; border-radius: 999px; background: var(--panel); font-weight: 800; font-size: clamp(.85rem, 2.4vw, 1rem); letter-spacing: .06em; }
  #waitDlg .waitBody { padding: clamp(14px, 3vh, 24px) clamp(20px, 7vw, 48px) clamp(20px, 4vh, 32px); display: grid; gap: clamp(8px, 1.6vh, 14px); }
  #waitDlg .waitBody > * { margin: 0; }
  #waitDlg h2 { font-size: clamp(1.35rem, 5vw, 1.9rem); line-height: 1.2; overflow-wrap: anywhere; }
  #waitDlg .waitVs { font-size: clamp(1rem, 3.6vw, 1.25rem); font-weight: 700; color: var(--ink-soft); }
  #waitDlg .waitVs b { padding: 2px 10px; border-radius: 999px; color: #fff; }
  #waitDlg .waitVs b.t1 { background: #2f78d0; } #waitDlg .waitVs b.t2 { background: #c25e00; }
  #waitDlg .waitMode { display: grid; justify-items: center; gap: 2px; padding: 8px 14px; border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, var(--field)); }
  #waitDlg .waitMode small { font-size: clamp(.72rem, 2.2vw, .82rem); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
  #waitDlg .waitMode b { font-size: clamp(1.05rem, 3.6vw, 1.3rem); line-height: 1.25; }
  #waitDlg .waitIn { font-size: clamp(.95rem, 3vw, 1.1rem); }
  #waitDlg .waitClock { display: flex; justify-content: center; gap: clamp(6px, 2vw, 12px); }
  #waitDlg .waitClock span { display: grid; flex: 1 1 0; max-width: 104px; padding: clamp(10px, 2vh, 16px) 4px clamp(6px, 1.4vh, 10px); border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 14%, var(--field)); }
  #waitDlg .waitClock b { font-size: clamp(1.8rem, 9vw, 2.8rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
  #waitDlg .waitClock small { margin-top: 4px; font-size: clamp(.68rem, 2.2vw, .8rem); font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
  #waitDlg .waitAt { font-weight: 800; font-size: clamp(1rem, 3.4vw, 1.15rem); }
  #waitDlg .soft { color: var(--ink-soft); font-size: clamp(.85rem, 2.8vw, 1rem); line-height: 1.45; }
  #waitDlg .waitLinks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
  #waitDlg .waitLinks:not(:has(.t2)) { grid-template-columns: 1fr; }
  #waitDlg .waitLink { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; padding: 3px 3px 3px 8px; border-radius: 10px;
    border: 1.5px solid var(--line); background: var(--field); text-align: start; font-weight: 700; font-size: clamp(.7rem, 2.2vw, .82rem); }
  #waitDlg .waitLink.t1 { border-color: #2f78d0; } #waitDlg .waitLink.t2 { border-color: #c25e00; }
  #waitDlg .waitLink span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #waitDlg .waitLink button { flex: none; min-width: 0; min-height: 28px; padding: 0 7px; font-size: .75rem; }
  /* A phone on its side: the logo and code on one side, the rest beside it, the two links side by side. */
  @media (max-height: 500px) {
    #waitDlg.pop.gift { max-width: 860px; grid-template-columns: minmax(170px, 30%) 1fr; align-items: stretch; overflow: hidden; }
    #waitDlg .waitTop { padding: 12px; align-content: center; }
    #waitDlg .waitTop img { width: clamp(120px, 22vw, 180px); }
    #waitDlg .waitBody { max-height: calc(100dvh - 26px); overflow-y: auto; padding: 14px clamp(56px, 7vw, 72px) 16px clamp(16px, 3vw, 28px); gap: 6px; }
    #waitDlg h2, #waitDlg p { text-align: center; margin: 0; }
    #waitDlg .waitClock span { max-width: 88px; padding: 8px 4px 5px; }
    #waitDlg .waitClock b { font-size: clamp(1.5rem, 8vh, 2.2rem); }
    #waitDlg .waitLink button { min-height: 28px; }
  }
  .gift .giftTop { position: relative; display: grid; place-items: center; padding: 18px 0 6px;
    background: radial-gradient(circle at 18% 30%, #fff 0 3px, transparent 4px), radial-gradient(circle at 82% 22%, #fff 0 2px, transparent 3px),
      radial-gradient(circle at 70% 70%, #fff 0 3px, transparent 4px), radial-gradient(circle at 28% 78%, #fff 0 2px, transparent 3px),
      linear-gradient(180deg, color-mix(in srgb, #9cc6f5 55%, var(--field)), var(--panel)); }
  .gift .giftTop .popClose { position: absolute; top: 12px; inset-inline-end: 12px; }
  .gift canvas { position: static; width: 150px; height: 150px; touch-action: auto; }
  .gift h2 { margin: 4px 18px 0; font-size: 1.3rem; }
  .gift p { margin: 8px 18px; }
  .gift .giftProgress { margin: 12px 18px 4px; display: grid; gap: 6px; }
  .gift .giftProgress b { color: var(--accent); font-size: .9rem; }
  .gift .giftProgress > i { display: block; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .gift .giftProgress > i > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d42f3c, #f08a24); }
  .gift .wide { width: calc(100% - 36px); margin: 10px 18px 0; }
  .gift .giftSend { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .gift .giftSend svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .gift .giftRules { font-size: .78rem; color: var(--ink-soft); margin: 12px 18px 16px; }
  /* The admin's note with free coins (js/coins.js, 18 Nov 2026): a quoted line in gold. */
  .pop.gift p.grantNote { margin: 4px 18px 6px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 210, 90, .14); color: #ffd86b; font-weight: 700; overflow-wrap: anywhere; }
  .pop.gift p.grantNote[hidden] { display: none; }
  /* Phones on their side: the picture beside the title, smaller, so the Send button stays in view. */
  @media (max-height: 500px) {
    .pop.gift { max-width: 560px; display: grid; grid-template-columns: 120px 1fr; align-items: center; }
    .pop.gift:not([open]) { display: none; }
    .gift .giftTop { position: static; grid-row: 1 / span 2; align-self: stretch; padding: 10px 0; }
    .gift h2 { margin-inline-end: 64px; }
    .gift canvas { width: 104px; height: 104px; }
    .gift h2, .gift p { text-align: start; }
    .gift .giftProgress, .gift .wide, .gift .giftRules { grid-column: 1 / -1; }
  }
  /* Private rooms switched off: still on the screen, as coming soon. */
  .seg .soon span { opacity: .6; border-style: dashed; cursor: not-allowed; }
  .seg .soon input { pointer-events: none; }
  .soonPill { display: none; justify-self: center; margin-top: 3px; padding: 2px 8px; border-radius: 999px; font-style: normal;
    font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #F08A24; color: #fff; }
  .seg .soon .soonPill { display: block; }
  .soonNote { margin: 8px 0 0; padding: 10px; border: 1px solid #F08A24; border-radius: 12px;
    background: color-mix(in srgb, #F08A24 10%, transparent); font-size: .9rem; }
  #roomDlg p { margin: 8px 0; color: var(--ink-soft); font-size: .9rem; }
  .stepper { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
  .stepper b { flex: 1; text-align: center; font-size: 1.05rem; }
  .stepper button { width: 52px; font-size: 1.3rem; font-weight: 800; }
  #roomDlg .wide { width: 100%; margin-top: 10px; }
  /* Labels as the ☰ menu's section titles: small, upper case, soft (the owner's ask, 15 Nov 2026). */
  #roomDlg :is(p.lvl, .roomHead) { margin: 14px 2px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
  #meName { width: 100%; box-sizing: border-box; text-align: center; font-weight: 800; }
  /* You, in one card as the menu's lists: your character turning on its stand, ‹ › either side, then your name. */
  #roomDlg { --hs: 96px; }
  #roomDlg .meRow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 10px 16px; align-items: center;
    padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); }
  #roomDlg .meRow .hStage { min-height: 0; gap: clamp(4px, 1.5vw, 12px); }
  #roomDlg .mePick { display: flex; flex-direction: column; align-items: center; }
  #roomDlg .meAnimal { margin: 4px 0 10px; text-align: center; color: var(--ink); font-weight: 800; }
  #roomDlg #meLeft { margin: 6px 0 0; text-align: center; font-size: .8rem; }
  #roomDlg .hStage .hArrow { width: 44px; height: 44px; font-size: 1.4rem; background: color-mix(in srgb, var(--accent) 12%, var(--field)); box-shadow: none; }
  #roomDlg .hArrow:disabled { opacity: .35; }
  @media (max-height: 500px) { #roomDlg { --hs: 72px; max-width: 600px; } #roomDlg .meAnimal { margin-bottom: 0; } }
  .levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .levels button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 800; }
  dialog.sheet {
    width: min(760px, calc(100% - 24px)); max-height: min(88vh, 900px); padding: 0; overflow: hidden;
    border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
    -webkit-user-select: text; user-select: text;
  }
  dialog.sheet[open] { display: flex; flex-direction: column; }
  dialog.sheet::backdrop { background: rgba(10, 20, 35, .3); }
  .sheet header { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; border-bottom: 1px solid var(--line); }
  .sheet header img { flex: none; width: 40px; height: 40px; }
  .sheet header h2 { margin: 0; flex: 1; font-size: 1.35rem; }
  .sheet .body { overflow-y: auto; padding: 4px 18px 22px; }
  .sheet h3 { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
  .sheet p { margin: 0 0 10px; color: var(--ink-soft); }
  .sheet p.big { font-size: 1.05rem; color: var(--ink); margin-top: 14px; }
  .qa { border: 1px solid var(--line); border-radius: 12px; background: var(--field); margin-bottom: 8px; }
  .qa summary { padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; }
  .qa summary::-webkit-details-marker { display: none; }
  .qa summary::after { content: '+'; color: var(--accent); font-weight: 800; font-size: 1.2rem; flex: none; }
  .qa[open] summary::after { content: '−'; }
  .qa p { margin: 0; padding: 0 14px 12px; }
  .news { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 4px; color: var(--ink-soft); }
  .sheet .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .sheet .links a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--field); color: var(--ink); text-decoration: none; }
  /* The store (js/store.js): a tab per kind of item (seven, so they scroll sideways when narrow), a card per item
     saying when it is yours, a Use button once it is; the coming-soon ones stay greyed with a dashed button. */
  .quick #storeBtn span { color: #8e4ec6; }
  .storeTabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .storeTabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 4px;
    border: 1.5px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink-soft); font-size: .8rem; font-weight: 700; line-height: 1.15; }
  /* One height for every tab's picture (an emoji, a sticker, a face), so the words line up. */
  .storeTabs button span { display: grid; place-items: center; height: 28px; font-size: 1.35rem; line-height: 1; }
  .storeTabs button span > * { max-height: 100%; width: auto; }
  .storeTabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .store .soonNote { margin: 12px 0; }
  /* Cards like a game shop: a stage with a spotlight and a floor, the item on it (3D animals turning on hover and while
     in use; locked ones a dark shadow, as games hide what is still to win), a corner badge, then the words and a chunky
     button. --tint colours the stage: the animal's coat, the scarf's first colour, a sticker's card. */
  .storeGrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
  .storeGrid li { --tint: #5b8def; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; border: 2px solid color-mix(in srgb, var(--tint) 35%, var(--line));
    border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 10%, var(--panel)), var(--panel) 60%); box-shadow: 0 4px 0 color-mix(in srgb, var(--tint) 25%, var(--line)), 0 8px 18px rgba(20, 40, 80, .12);
    transition: transform .15s, box-shadow .15s; }
  .storeGrid li:hover { transform: translateY(-3px); }
  .storeArt { position: relative; display: grid; place-items: center; height: 150px; margin-bottom: 6px; overflow: hidden; border-radius: 13px;
    background: radial-gradient(ellipse 46% 9% at 50% 86%, rgba(255, 255, 255, .55), transparent 70%),
      radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tint) 45%, #fff) 0, color-mix(in srgb, var(--tint) 75%, #0b1e3d) 62%, color-mix(in srgb, var(--tint) 40%, #06122a) 100%); }
  .storeArt::after { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 32%, rgba(255, 255, 255, .07) 0 8deg, transparent 8deg 22deg); pointer-events: none; }
  .storeArt i { z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-style: normal; font-size: 3rem;
    background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--tint) 18%, #fff)); box-shadow: 0 6px 0 rgba(0, 0, 0, .15), 0 10px 22px rgba(0, 0, 0, .25); }
  .storeArt i:has(svg, img.quick) { width: auto; height: auto; background: none; box-shadow: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
  .storeArt i svg { width: 124px; height: 124px; }
  /* The 3D pictures: one turning row of 16 (js/home.js strip), facing you while still; the pick-ups' sheet has 5 rows. */
  .storeArt .spr { --s: 140px; position: absolute; z-index: 1; left: calc(50% - var(--s) / 2); bottom: 2px; width: var(--s); height: var(--s);
    background: no-repeat 0 0 / calc(var(--s) * 16) var(--s); background-position-x: calc(var(--s) * -4); filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .35)); }
  .storeArt .spr.pk { --s: 120px; bottom: 14px; background-image: url(../sprites/pickups.webp); background-size: calc(var(--s) * 16) calc(var(--s) * 5);
    background-position-y: calc(var(--s) * var(--row) * -1); background-position-x: 0; animation: storeTurn 2.4s steps(16) infinite; }
  .storeArt.is3d i { display: none; }
  .storeGrid li:is(:hover, .on) .spr:not(.pk) { animation: storeTurn 3.2s steps(16) infinite; }
  @keyframes storeTurn { from { background-position-x: 0; } to { background-position-x: calc(var(--s) * -16); } }
  @media (prefers-reduced-motion: reduce) { .storeArt .spr { animation: none !important; } }
  /* Locked: in full colour (the owner's ask, 11 Nov 2026), only the badge and the button say which level opens it. */
  .storeGrid li.locked:hover { transform: none; }
  .storeGrid li.locked .tag { background: rgba(8, 20, 45, .78); font-size: .78rem; }
  /* Chat stickers bob and wobble like stickers in a chat, each a little out of step. */
  .storeArt i img.quick { display: block; }
  .storeArt i :is(svg.sticker, img.quick) { width: 132px; height: 132px; transform-origin: 50% 85%; animation: stickerBob 2.6s ease-in-out infinite; }
  .storeGrid li:nth-child(3n+2) :is(svg.sticker, img.quick) { animation-delay: -.9s; }
  .storeGrid li:nth-child(3n) :is(svg.sticker, img.quick) { animation-delay: -1.7s; }
  .storeGrid li:hover :is(svg.sticker, img.quick) { animation-duration: .9s; }
  @keyframes stickerBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg) scale(1.04); } }
  @media (prefers-reduced-motion: reduce) { .storeArt i :is(svg.sticker, img.quick) { animation: none; } }
  /* A snowball and its trail flying across the stage. */
  .storeArt.trailArt i { display: none; }
  .storeArt.trailArt { background: radial-gradient(ellipse 46% 9% at 50% 86%, rgba(255, 255, 255, .35), transparent 70%), radial-gradient(circle at 50% 30%, #4a6fae, #0f2246); }
  .storeArt.trailArt::before { content: ""; z-index: 1; width: 80%; height: 28px; border-radius: 14px; transform: rotate(-12deg);
    background: radial-gradient(circle at calc(100% - 14px) 50%, #fff 0 13px, #cfe4ff 13.5px 14px, transparent 14.5px), var(--trail); filter: drop-shadow(0 0 10px rgba(255, 255, 255, .45)); }
  /* A sticker card's picture plays the sticker as a game shows it (js/sticker-preview.js, 24 Nov 2026). */
  .storeArt.canPreview { cursor: pointer; }
  .storeArt.canPreview:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
  .storeArt canvas.stickerPreview { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
  .storeArt:has(canvas.stickerPreview) > i, .storeArt:has(canvas.stickerPreview) .previewHint { opacity: 0; }
  .storeArt .previewHint { position: absolute; z-index: 2; bottom: 6px; inset-inline-end: 8px; padding: 2px 8px; border-radius: 999px; font-style: normal;
    font-size: .68rem; font-weight: 900; color: #fff; background: rgba(27, 42, 65, .55); }
  /* The corner badge: in use (gold), locked, or coming soon (a purple ribbon). */
  .storeArt .tag { position: absolute; z-index: 2; top: 8px; inset-inline-start: 8px; padding: 3px 9px; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 900;
    letter-spacing: .02em; color: #fff; background: rgba(8, 20, 45, .65); backdrop-filter: blur(4px); }
  .storeGrid li.on .tag { background: linear-gradient(180deg, #ffd54a, #f2a20c); color: #4a2a00; }
  .storeGrid li.soon .tag { background: linear-gradient(180deg, #a56bf0, #7a3fd1); text-transform: uppercase; }
  .storeGrid b { font-size: 1rem; font-weight: 900; }
  .storeGrid small { flex: 1; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
  .storeGrid li > em { font-style: normal; font-size: .76rem; font-weight: 800; color: #1f9254; }
  .storeGrid li.locked > em, .storeGrid li.soon > em { color: var(--ink-soft); }
  .storeGrid li.on { border-color: #f2b632; box-shadow: 0 4px 0 #d18f00, 0 0 0 3px color-mix(in srgb, #ffd54a 45%, transparent), 0 10px 22px rgba(242, 162, 12, .25); }
  #storeTabs { display: flex; flex-shrink: 0; overflow-x: auto; scrollbar-width: thin; }
  #storeTabs button { flex: 1 0 auto; min-width: 84px; padding-inline: 10px; }
  #storeTabs button[hidden] { display: none; }
  /* Chunky game buttons: green to use, gold while in use, a gift, a dark lock, a quiet coming soon. */
  .storeGrid button { margin-top: 8px; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 12px; font-size: .85rem; font-weight: 900; white-space: nowrap; letter-spacing: .02em; opacity: 1; }
  .storeGrid button.useBtn { color: #fff; background: linear-gradient(180deg, #4fd27b, #23a455); box-shadow: 0 4px 0 #17803f; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
  .storeGrid button.useBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #17803f; }
  .storeGrid button.giftBtn { color: #fff; background: linear-gradient(180deg, #ff7aa8, #e2366f); box-shadow: 0 4px 0 #a81e4e; }
  .storeGrid button.inUse { color: #5a3500; background: linear-gradient(180deg, #ffe07a, #f5b82e); box-shadow: 0 4px 0 #c98a00; cursor: default; }
  .storeGrid button.lockBtn { color: #c9d3e6; background: linear-gradient(180deg, #56647e, #3b4760); box-shadow: 0 4px 0 #262f42; cursor: not-allowed; }
  .storeGrid button.soonBtn { color: #7a3fd1; background: color-mix(in srgb, #a56bf0 14%, transparent); border: 1.5px dashed #a56bf0; cursor: not-allowed; }
  @media (max-width: 420px) { .storeGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .storeArt { height: 120px; } .storeArt .spr { --s: 112px; } .storeArt .spr.pk { --s: 96px; } .storeArt i { width: 64px; height: 64px; font-size: 2.3rem; } }
  @media (max-height: 500px) { .store header, #colDlg header { padding: 8px 14px; } .store header img, #colDlg header img { width: 30px; height: 30px; } #colDlg > .colHead { padding-top: 6px; } .storeTabs { padding: 6px 14px; }
    .storeTabs button { flex-direction: row; gap: 6px; min-height: 40px; } .store .soonNote { margin: 8px 0; padding: 6px 10px; } .storeArt { height: 110px; } .storeArt .spr { --s: 104px; } .storeArt .spr.pk { --s: 88px; } .storeArt i { width: 60px; height: 60px; font-size: 2.1rem; } }
  .f.check { display: flex; align-items: center; gap: 10px; flex-direction: row; color: var(--ink); font-weight: 600; min-height: 44px; }
  .f.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); }
  #roomDlg select { margin-bottom: 4px; }
  /* The scoreboard's first line: the room (or open field), how many play, and the round's clock. */
  #board li.head { justify-content: space-between; gap: .4em; white-space: normal; font-weight: 700; font-size: .92em;
    padding-bottom: .3em; margin-bottom: .15em; border-bottom: 1px solid rgba(255, 255, 255, .2); }
  #board li.what { font-size: .72em; opacity: .78; font-weight: 600; margin-top: -.1em; }
  #boardToggle { flex: none; min-width: 1.7em; min-height: 1.7em; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.16); color: inherit; line-height: 1; }
  #clock { flex: none; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 0 .5em; font-weight: 800; font-variant-numeric: tabular-nums; }
  #clock.late { background: rgba(195, 38, 74, .85); }
  #clock.idle { opacity: .75; }
  /* Round over (the owner's choice "R1", 11 Nov 2026): a night-blue card with falling snow, the top three's 3D characters on
     a snow podium, your own line, three award badges and the buttons; "See all N players" opens everyone's results in the
     card (beside the podium on a wide screen, in its place on an upright phone). */
  #results {
    --gold: #ffd36b; --orange: #f08a24; --soft: #a9c4e6;
    z-index: 8; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(28rem, calc(100vw - 20px));
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)));
    /* Scrolls when a short screen can't hold it all; the buttons stay pinned at its bottom (.acts), so Share and Leave
       are never cut off (players' report, 25 Nov 2026). */
    overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: none; isolation: isolate; font-size: clamp(.82rem, min(2vmin, 2.7vh), 1.05rem); color: #fff; text-shadow: none; text-align: center; pointer-events: auto;
    /* See-through, so the field shows behind it (the owner's ask, 12 Nov 2026). */
    /* The night sky of the "Great game!" pop-up, nearly solid (the owner's ask, 24 Nov 2026; was see-through since 12 Nov 2026). */
    background: linear-gradient(180deg, rgba(11, 26, 58, .96), rgba(20, 42, 85, .96) 60%, rgba(29, 58, 110, .96)); border: 1px solid rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .06);
    padding: clamp(18px, 3.2vh, 32px) clamp(18px, 4vw, 32px) clamp(16px, 2.8vh, 28px);
    display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2.2vh, 22px); animation: resPop .35s cubic-bezier(.2, 1.4, .4, 1);
  }
  #results[hidden] { display: none; }
  @keyframes resPop { from { transform: translate(-50%, -50%) scale(.92); opacity: 0; } }
  /* Snow: two layers of dots drifting down behind everything (one element, no script). The dots move, not the element,
     so nothing sticks out of the card to scroll to (900 and 901: whole tiles of 90 and 53, so the loop is seamless). */
  #results::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
    background-image: radial-gradient(circle, #fff 1.5px, transparent 2px), radial-gradient(circle, rgba(255, 255, 255, .7) 1px, transparent 1.5px);
    background-size: 90px 90px, 53px 53px; background-position: 0 0, 25px 31px; animation: resSnow 28s linear infinite; }
  @keyframes resSnow { to { background-position: 0 900px, 25px 932px; } }
  #results::after { content: ''; position: absolute; inset: auto 0 0; height: 20%; z-index: -1; pointer-events: none;
    background: radial-gradient(120% 100% at 30% 100%, rgba(255, 255, 255, .07) 60%, transparent 61%), radial-gradient(120% 100% at 80% 110%, rgba(255, 255, 255, .05) 60%, transparent 61%); }
  @media (prefers-reduced-motion: reduce) { #results, #results::before, #results .resCh { animation: none !important; } }
  #results p, #results h2 { margin: 0; }
  .resLogo { height: clamp(28px, 5vh, 46px); width: auto; flex: none; }
  .resHead { display: grid; gap: 4px; justify-items: center; flex: none; }
  .resOver { font-size: .78em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
  .resWin { font-size: 1.5em; font-weight: 900; }
  .resWin[hidden], .resVs[hidden], .resOver[hidden] { display: none; }
  .resVs { display: flex; align-items: center; justify-content: center; gap: 10px; }
  .resVs .n { font-size: 2.1em; line-height: 1; font-variant-numeric: tabular-nums; }
  .resVs .n.t1 { color: #6fb2ff; } .resVs .n.t2 { color: #ffa24a; } .resVs i { color: var(--soft); font-style: normal; font-size: 1.4em; }
  .resVs .tn { font-size: .78em; font-weight: 800; color: var(--soft); white-space: nowrap; line-height: 1.3; }   /* one line: wrapped, it ran into the number and the tag */
  /* A team game with a winner (the owner's ask, 12 Nov 2026): the card glows in the winning team's colour, the score is
     two team tiles (the winner's big, coloured and crowned), and the winning team stands together on one stage. */
  #results.tw1 { --tc: #3d8ae6; --tcd: #2f78d0; } #results.tw2 { --tc: #ffa043; --tcd: #f08a24; }
  #results:is(.tw1, .tw2) { background: radial-gradient(120% 55% at 50% 0%, color-mix(in srgb, var(--tc) 45%, transparent) 0%, transparent 62%), linear-gradient(180deg, rgba(19, 50, 95, .74), rgba(10, 29, 58, .8)); }
  #results:is(.tw1, .tw2) .resHead { gap: 14px; }
  #results:is(.tw1, .tw2) .resWin { font-size: 1.55em; white-space: nowrap; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
  #results.open:is(.tw1, .tw2) .resWin { white-space: normal; font-size: 1.3em; }
  #results.open .resPod.team { display: none; }   /* the table shows the teams */
  .resVs .tt { display: grid; justify-items: center; gap: 4px; padding: 6px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); min-width: 6.5em; position: relative; }
  .resVs .tt .n { font-size: 2.1em; } .resVs .tt.t1 .n { color: #6fb2ff; } .resVs .tt.t2 .n { color: #ffa24a; }
  .resVs .tt.won { padding: 14px 20px 10px; transform: scale(1.08); background: linear-gradient(180deg, var(--tc), var(--tcd)); box-shadow: 0 6px 22px color-mix(in srgb, var(--tc) 45%, transparent), inset 0 0 0 2px rgba(255, 255, 255, .35); }
  .resVs .tt.won .n, .resVs .tt.won .tn { color: #fff; } .resVs .tt.won .n { font-size: 2.6em; }
  .resVs .tt.lost { opacity: .6; transform: scale(.92); }
  .resVs .tt .cr { position: absolute; top: -.75em; font-size: 1.1em; line-height: 1; }
  .resVs .tt .tag { font-size: .62em; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; background: rgba(255, 255, 255, .25); padding: 1px 8px; border-radius: 999px; }
  .resPod.team { display: grid; justify-items: center; gap: 0; }
  .resPod .crew { display: flex; justify-content: center; align-items: flex-end; flex-wrap: nowrap; max-width: 100%; position: relative; z-index: 1; }
  .resPod .mate { display: grid; justify-items: center; min-width: 0; width: 5.4em; }
  .resPod .mate .resCh.d3 { width: 4.2em; height: 4.2em; transform: scale(1.35); transform-origin: 50% 80%; }
  .resPod .mate .who { font-size: .8em; margin: .2em 0 0; color: #fff; }
  .resPod .mate.me .who { color: var(--gold); }
  .resPod .more { align-self: center; font-weight: 900; color: var(--soft); margin-inline-start: .6em; }
  .resPod .stage { width: 92%; height: 1.2em; margin-top: -.5em; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tc) 60%, #fff) 0%, var(--tcd) 70%, transparent 100%); }
  /* A 3D character: the front-facing column of its sheet (rows 0–12); the winner throws now and then. Else its emoji. */
  .resCh { display: grid; place-items: center; width: 4em; height: 4em; font-size: 1em; line-height: 1; background-repeat: no-repeat; background-size: 100% 1300%; background-position: 0 0; }
  .resCh:not(.d3) { font-size: 2.4em; width: 1.7em; height: 1.7em; }
  .resCh.d3.win { animation: resThrow 1.6s steps(1) infinite; }
  @keyframes resThrow { 0%, 62% { background-position: 0 0; } 70% { background-position: 0 75%; } 78% { background-position: 0 83.33%; } 86% { background-position: 0 91.67%; } 94% { background-position: 0 100%; } }
  .resPod { display: flex; align-items: flex-end; justify-content: center; gap: 6px; width: 100%; flex: none; }
  .resPod .st { flex: 1; max-width: 8.5em; display: grid; justify-items: center; min-width: 0; }
  .resPod .resCh.d3 { width: 4.2em; height: 4.2em; transform: scale(1.45); transform-origin: 50% 70%; }
  .resPod .n1 .resCh.d3 { width: 5.2em; height: 5.2em; }
  .resPod .who { font-weight: 800; font-size: .9em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: .3em 0 4px; }
  .resPod .me .who { color: var(--gold); }
  .resPod .blk { width: 100%; display: grid; justify-items: center; align-content: start; padding-top: 6px; border-radius: 14px 14px 6px 6px;
    background: linear-gradient(180deg, #f4f9ff, #c9dcf2); color: #0c2242; box-shadow: inset 0 -4px 0 rgba(12, 34, 66, .12); }
  .resPod .n1 .blk { height: 4.8em; } .resPod .n2 .blk { height: 3.9em; } .resPod .n3 .blk { height: 3.3em; }
  .resPod .rk { width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .85em; }
  .resPod .n1 .rk { background: linear-gradient(#ffd96b, #f0a81e); } .resPod .n2 .rk { background: linear-gradient(#d4dee9, #9aabbf); } .resPod .n3 .rk { background: linear-gradient(#f1b382, #c97a3d); }
  .resPod .p { font-weight: 900; font-size: 1.1em; font-variant-numeric: tabular-nums; }
  .resPod .tm1 .blk { box-shadow: inset 0 -5px 0 #2f78d0; } .resPod .tm2 .blk { box-shadow: inset 0 -5px 0 #f08a24; }
  /* A small round picture in the player's colour. */
  .resPet { --h: 205; flex: none; width: 2em; height: 2em; border-radius: 50%; overflow: hidden; position: relative; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 35%, hsl(var(--h) 75% 70%), hsl(var(--h) 60% 42%)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
  .resPet .resCh.d3 { position: absolute; width: 140%; height: 140%; left: -20%; top: -12%; }
  .resPet .resCh:not(.d3) { font-size: 1.2em; }
  .resMe { width: 100%; display: flex; align-items: center; gap: 10px; row-gap: 12px; padding: 12px 14px; border-radius: 16px; flex: none;
    background: var(--nightTile); box-shadow: inset 0 0 0 1px var(--nightEdge); }
  .resMe[hidden] { display: none; }
  .resMe #resMePlace { font-size: 1.35em; } .resMe .of { color: var(--soft); font-size: .85em; } .resMe .sp { flex: 1; }
  .resMe { flex-wrap: wrap; }   /* the pills: below, with the night tiles */
  .resMe .pill[hidden] { display: none; }
  .resAw { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 8px; width: 100%; flex: none; }
  .resAw[hidden] { display: none; }
  .resAw li { flex: 1; max-width: 9em; min-width: 0; display: grid; justify-items: center; padding: 8px 4px; border-radius: 14px; background: var(--nightTile); box-shadow: inset 0 0 0 1px var(--nightEdge); }
  .resAw .ic { font-size: 1.15em; line-height: 1.2; } .resAw small { color: var(--soft); font-size: .7em; font-weight: 700; }
  .resAw b { font-size: .85em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Everyone: place, player, points, hits, times snowed in. Only the rows scroll. */
  .resTbl { width: 100%; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; border-radius: 16px; background: rgba(255, 255, 255, .05); overflow: hidden; }
  .resTbl[hidden] { display: none; }
  .resTbl .tb { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent; }
  .resTbl .tr { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) 2.6em 2.2em 2.2em; align-items: center; gap: 6px; padding: 3px 10px; }
  .resTbl .th { font-size: .72em; font-weight: 800; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; padding-block: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .resTbl .tb .tr:nth-child(even) { background: rgba(255, 255, 255, .035); }
  .resTbl .tr.me { background: linear-gradient(90deg, rgba(240, 138, 36, .38), rgba(240, 138, 36, .16)) !important; box-shadow: inset 0 0 0 2px var(--orange); border-radius: 12px; }
  .resTbl .rk { text-align: center; color: var(--soft); font-weight: 800; } .resTbl .n { text-align: center; font-variant-numeric: tabular-nums; } .resTbl .n.s { color: var(--soft); font-size: .9em; }
  .resTbl .nm { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: start; }
  .resTbl .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
  .resTbl .resPet { width: 1.8em; height: 1.8em; }
  .resTbl .tm { display: flex; justify-content: space-between; padding: 4px 12px; font-weight: 800; font-size: .9em; }
  .resTbl .tm.t1 { background: linear-gradient(90deg, #2f78d0, #3d8ae6); } .resTbl .tm.t2 { background: linear-gradient(90deg, #f08a24, #ffa043); }
  .resTbl .tm.won b:first-child::before { content: '👑 '; }
  .resTbl .key { padding: 4px 10px 6px; font-size: .7em; color: var(--soft); }
  .resMore { background: none; border: 0; box-shadow: none; color: #8cc8ff; font-weight: 800; font-size: .95em; padding: 4px 10px; min-height: 32px; flex: none; }
  .resMore[hidden] { display: none; }
  /* The buttons: Play again big and orange, Share scores and Leave under it. */
  #results .acts { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; flex: none; position: sticky; bottom: 0; z-index: 1; }
  #results .acts button { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 48px; border-radius: 16px; border: 0; font-size: 1em; font-weight: 800; white-space: nowrap; padding: .3em 1em; }
  #results .acts > :is(#againBtn, #nextIn, #nextBtn), #results #shareRes:is([hidden], .flagOff) ~ #leaveRes { grid-column: 1 / -1; }
  #results #againBtn { min-height: 54px; font-size: 1.12em; border: 2px solid #fff3c4; border-radius: 999px; background: linear-gradient(180deg, #ffe58a, #ffc93c 55%, #f5a800); color: #5a3500; font-weight: 900;
    box-shadow: 0 5px 0 #b97a00, 0 0 24px rgba(255, 201, 60, .45); }   /* gold, as in the "Great game!" pop-up (24 Nov 2026) */
  #results #againBtn:disabled { opacity: .75; }
  #results #shareRes { border-radius: 999px; background: #2a4271; color: #fff; box-shadow: inset 0 0 0 1px #4a6596; }
  #results #shareRes svg { width: 1.1em; height: 1.1em; flex: none; }
  #results #leaveRes { border-radius: 999px; background: rgba(255, 255, 255, .08); color: #dbe7f6; box-shadow: none; }
  #nextIn { margin: 0; color: var(--soft); font-size: .82em; }
  #nextIn:empty { display: none; }
  #nextBtn { background: none !important; color: #8cc8ff !important; border: 1px solid rgba(255, 255, 255, .2) !important; box-shadow: none; }
  /* Upright phones (before the short ones below, whose smaller type must win: it was undone here until 25 Nov 2026). */
  @media (max-width: 520px) {
    #results { font-size: 1rem; } .resMe { flex-wrap: wrap; justify-content: center; } .resMe .sp { display: none; }
    /* Open on an upright phone: the podium makes way for the table. */
    #results.open :is(.resPod, .resLogo, .resMe, .resAw) { display: none; }
    .resVs .tt.won { transform: none; padding: 8px 16px 6px; } .resVs .tt.won .n, .resVs .tt .n { font-size: 2em; }   /* room for the buttons under it */
  }
  /* Short upright phones: everything a little smaller, so the buttons always fit. */
  @media (max-width: 520px) and (max-height: 700px) {
    #results { font-size: .86rem; gap: 7px; padding: 12px 14px; } .resLogo { height: 24px; }
    .resPod .resCh.d3 { width: 3.4em; height: 3.4em; } .resPod .n1 .resCh.d3 { width: 4.2em; height: 4.2em; }
    .resPod .n1 .blk { height: 3.8em; } .resPod .n2 .blk { height: 3.1em; } .resPod .n3 .blk { height: 2.8em; }
    .resVs .n { font-size: 1.7em; } .resWin { font-size: 1.3em; } .resAw li { padding: 3px 2px; }
    #results .acts button { min-height: 42px; } #results #againBtn { min-height: 46px; }
  }
  /* A phone on its side: the podium on one side, your line, the awards (or the table) on the other. */
  @media (max-height: 520px) {
    #results { width: min(40rem, calc(100vw - 20px)); font-size: .82rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; row-gap: 6px; align-items: center; padding: 12px 18px; border-radius: 22px; }
    .resLogo { display: none; }
    /* Both sides filled (the owner's ask, 15 Nov 2026): the podium alone on one side; on the other who won and the
       scores, your line, the awards and "See all", one under the other. */
    .resPod { grid-column: 1; grid-row: 1 / span 4; align-self: center; }
    .resHead { grid-column: 2; grid-row: 1; } .resMe { grid-column: 2; grid-row: 2; flex-wrap: wrap; }
    .resAw { grid-column: 2; grid-row: 3; } .resMore { grid-column: 2; grid-row: 4; }
    /* Low screen: the winner's tile no bigger than it needs, so the buttons always fit under it. */
    #results:is(.tw1, .tw2) .resHead { gap: 6px; } #results:is(.tw1, .tw2) .resWin { font-size: 1.3em; }
    .resVs .tt.won { transform: none; padding: 8px 16px 6px; } .resVs .tt.won .n, .resVs .tt .n { font-size: 2em; } .resVs .tt { gap: 2px; }
    .resAw li { padding-block: 4px; } .resMe { padding-block: 6px; }
    #results.open .resMe, #results.open .resAw { display: none; }
    #results.open .resHead { grid-column: 1; } #results.open .resPod { grid-row: 2 / span 3; }   /* open: the table takes the other side, as before */
    .resTbl { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; max-height: calc(100dvh - 120px); }
    /* The buttons at their own width, centred, and "2 of 4 ready" under Play again (the owner's ask, 15 Nov 2026). */
    #results .acts { grid-column: 1 / -1; grid-template-columns: minmax(12em, auto) auto auto; justify-content: center; row-gap: 4px; }
    #results .acts > #againBtn { grid-column: 1; grid-row: 1; } #results .acts > #nextIn { grid-column: 1; grid-row: 2; }
    #results .acts > :is(#shareRes, #leaveRes) { grid-row: 1; } #results #shareRes:is([hidden], .flagOff) ~ #leaveRes { grid-column: auto; } #results .acts > #nextBtn { grid-row: 3; }
    #results .acts button, #results #againBtn { min-height: 42px; }
    .resPod .resCh.d3 { width: 3.4em; height: 3.4em; } .resPod .n1 .resCh.d3 { width: 4.2em; height: 4.2em; }
    .resPod .n1 .blk { height: 3.9em; } .resPod .n2 .blk { height: 3.2em; } .resPod .n3 .blk { height: 2.9em; } .resPod .blk { padding-top: 3px; }
    .resTbl .tr { padding-block: 1px; } .resTbl .resPet { width: 1.5em; height: 1.5em; } .resTbl .key { display: none; }
  }
  /* A tablet or a computer: a bigger card; open, the podium on one side and the whole table on the other. */
  @media (min-width: 900px) and (min-height: 600px) {
    #results { font-size: .98rem; width: 28rem; }
    #results.open { width: min(60rem, calc(100vw - 40px)); display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); column-gap: 26px; row-gap: 12px; align-items: center; }
    #results.open > :is(.resLogo, .resHead, .resPod, .resMe, .resAw, .resMore) { grid-column: 1; }
    #results.open .resTbl { grid-column: 2; grid-row: 1 / span 6; align-self: stretch; max-height: calc(100dvh - 190px); }
    #results.open .acts { grid-column: 1 / -1; }
  }
  #pausedBox {
    left: 50%; top: 40%; transform: translate(-50%, -50%); display: grid; gap: 8px; justify-items: center; text-align: center;
    background: var(--hud); border-radius: 18px; padding: 16px 22px; width: max-content; max-width: 86vw;
  }
  #pausedBox b { font-size: 1.8rem; letter-spacing: -.01em; }
  #pausedBox button { pointer-events: auto; min-width: 140px; }
  #bar #invite.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .how { margin: 12px 0 0; padding-inline-start: 18px; color: var(--ink-soft); font-size: .88rem; }
  .how li { margin-bottom: 3px; }
  .how b { color: var(--ink); }
  .human { display: flex; justify-content: center; margin-top: 10px; }
  #consent { position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60; margin: 0 auto; max-width: 560px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--panel); color: var(--ink);
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: .92rem; }
  #consent p { margin: 0; flex: 1 1 240px; min-width: 0; }
  #consent button { padding: 8px 14px; }
  textarea { font: inherit; resize: vertical; min-height: 110px; }
  #reportSend { width: 100%; }
  #reportMsg { min-height: 1.4em; margin: 4px 0 10px; color: var(--ink); font-weight: 600; }
  #reportShots { padding: 8px; }
  #reportShotList { margin: 0 0 10px; color: var(--ink); font-size: .85rem; white-space: pre-wrap; }
  #reportShotList:empty { display: none; }
  .mail { margin: 4px 0 0; }
  .mail a { font-weight: 800; font-size: 1.15rem; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
  .mail a:hover { text-decoration: underline; }
  .err { color: var(--err); font-size: .92rem; margin: 6px 0 0; min-height: 1.2em; }
  #form > .err:empty { min-height: 0; margin: 0; }   /* no empty line between Play and Install; still announced when an error arrives */
  .mine { font-size: .85rem; color: var(--ink-soft); text-align: center; margin: 10px 0 0; }
  /* Social media buttons: each platform's own logo (Simple Icons, CC0), its action word and its name. */
  .followHead { margin: 16px 0 6px; }
  .social { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .social a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--field); color: var(--ink); text-decoration: none; min-width: 0; }
  .social a:hover, .social a:focus-visible { border-color: currentColor; }
  .social svg { width: 24px; height: 24px; fill: currentColor; }
  .social b { font-size: .74rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .social small { font-size: .66rem; color: var(--ink-soft); line-height: 1.1; }
  .social .s-youtube svg { fill: #ff0000; } .social .s-instagram svg { fill: #e4405f; } .social .s-facebook svg { fill: #0866ff; } .social .s-discord svg { fill: #5865f2; }
  .social.wide a { padding: 10px 4px 8px; } .social.wide svg { width: 28px; height: 28px; }
  .social.wide b { font-size: .9rem; } .social.wide small { font-size: .78rem; }
  @media (max-width: 420px) { .social { gap: 4px; } .social a { padding-inline: 0; } .social b { font-size: .66rem; letter-spacing: -.01em; } .social small { font-size: .6rem; }
    .social.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .social.wide b { font-size: .84rem; } .social.wide small { font-size: .72rem; } }

  /* Notices: announcements from public/announcement.json and the page's own warnings (offline, lag, errors). */
  /* Bottom corner on the end side (right in English, left in Arabic): the empty side, away from the menu card,
     the top bar and the scoreboard. Above THROW/WALL on touch screens and above the cookie banner. */
  #notices { position: fixed; z-index: 1000; bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); inset-inline-end: 16px;
    width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; pointer-events: none; }
  body:has(#bar:not([hidden])) #notices { bottom: max(40px, calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + var(--flash-h, 0px) + 20px)); }
  body:has(#bar:not([hidden])) #notices { inset-inline-end: auto; right: 16px; left: auto; }   /* the small map has the lower left */
  body:has(#roll:not([hidden])) #notices { bottom: max(calc(max(18px, env(safe-area-inset-bottom)) + 216px), calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + var(--flash-h, 0px) + 20px)); }
  body:has(#consent:not([hidden])) #notices { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); }
  /* One size for every message in a game (notices, the first-game hints, the short messages), set by the screen's
     shorter side, so they look the same on every phone, upright or on its side, and on a computer: about 12 px on a
     small phone, 15 px at most (the owner's report, 20 Nov 2026: a notice and a hint filled half of a phone on its side). */
  :root { --msg: clamp(12px, 3.4vmin, 15px); }
  .notice { pointer-events: auto; display: flex; align-items: center; gap: .6em; padding: .5em .7em; border-radius: 12px; font-size: var(--msg); line-height: 1.3;
    background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-inline-start: 6px solid var(--n, var(--accent)); box-shadow: var(--shadow);
    animation: notice-in .35s ease-out; }
  .notice.warn { --n: #e8a33c; } .notice.error { --n: var(--err); }
  .notice .ic { font-size: 1.25em; line-height: 1; }
  .notice .tx { flex: 1; min-width: 0; }
  .notice a { color: var(--accent); font-weight: 700; }
  .notice button { font: inherit; font-weight: 700; padding: .35em .8em; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; }
  .notice button.x { padding: .2em .5em; background: none; border: 0; color: var(--ink-soft); font-size: 1.1em; }
  .notice.flash { animation: notice-in .35s ease-out, notice-flash 1.2s ease-in-out 2; }
  @keyframes notice-in { from { opacity: 0; transform: translateY(10px); } }
  .notice.out { opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; }
  @keyframes notice-flash { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--n, var(--accent)) 45%, transparent), var(--shadow); } }
  @media (prefers-reduced-motion: reduce) { .notice, .notice.flash { animation: none; } }
  .hud { position: fixed; color: var(--hud-ink); text-shadow: 0 1px 3px rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
  #bar {
    top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));   /* left and right, not inline: in Arabic the inline sides swap the insets, and ✕ sat a cut-out's width from the right (29 Oct 2026) */
    display: flex; gap: 8px; align-items: center; pointer-events: none;
  }
  #bar button { flex: none; pointer-events: auto; min-height: 40px; min-width: 40px; padding: 4px 10px; background: var(--hud); color: var(--hud-ink); border-color: rgba(255,255,255,.22); }
  #fsBtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
  #fsBtn .out, #fsBtn.on .in { display: none; }
  #fsBtn.on .out { display: inline; }
  #info { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* In a game both languages use one layout (the Arabic one): ✕ alone at the top right, the other buttons at the top left,
     the hearts and score box on the left with the small map under it, the scoreboard on the right. Text inside each box
     still runs in its own language's direction. */
  #bar { flex-direction: row-reverse; }
  html[dir=rtl] #bar { flex-direction: row; }
  #quit { margin-left: auto; }
  :root { --board-fs: clamp(.84rem, 1.8vmin, 1.5rem); }   /* the scoreboard's text size; at its widest it is about 15 of these */
  /* The hearts box and the scoreboard sit under the top bar (--bar-h is its height, kept by the page)
     and grow with the screen, so they stay readable on a big monitor. */
  #stats {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--bar-h, 42px) + 8px); left: max(8px, env(safe-area-inset-left));
    background: var(--hud); border-radius: 12px; padding: .3em .7em; pointer-events: auto; cursor: pointer; font-size: clamp(.9rem, 1.9vmin, 1.55rem); display: grid; gap: 0;
  }
  #stats:not(.open) > :not(#statsToggle) { display: none !important; }
  #statsToggle { display: flex; align-items: center; justify-content: space-between; gap: .5em; min-width: 0; min-height: 36px; padding: 0; border: 0; background: none; color: inherit; text-shadow: inherit; }
  #statsToggle .arrow { font-size: .8em; opacity: .85; }
  #hearts { font-size: 1.28em; letter-spacing: 2px; color: #ff6b81; }
  /* Open: hearts, your level with its bar, then any powers (28 Oct 2026: the ball size and the score lines went; your
     score is on the scoreboard, which always shows your row). */
  #stats.open { row-gap: .35em; padding-bottom: .5em; min-width: 9em; }
  #board {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--bar-h, 42px) + 8px); right: max(8px, env(safe-area-inset-right));
    margin: 0; padding: .45em .6em; list-style: none; background: var(--hud); border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px; font-size: var(--board-fs); pointer-events: none; display: grid; gap: .15em; min-width: 10.5em;
  }
  #board li { display: flex; align-items: center; gap: .45em; white-space: nowrap; }
  #board .dot { width: 1.5em; height: 1.5em; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 1em; line-height: 1; text-shadow: none; }
  #board .nm { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; max-width: 8.2em; }
  #board .flag { flex: none; font-size: 1em; line-height: 1; text-shadow: none; }
  #board .flag:empty { display: none; }
  /* Tap the board to see everyone, scrolling inside it, then close it to the leader. */
  #board.more { pointer-events: auto; cursor: pointer; -webkit-user-select: none; user-select: none; }
  #board.open { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; align-content: start; }
  /* Flags drawn by the page (DRAWN_FLAGS in index.html), at an emoji flag's size. */
  :is(#board, #roomRoster) .flag.drawn { display: block; width: 1.2em; height: .8em; border-radius: 2px; background: center / 100% 100% no-repeat; }
  :is(#board, #roomRoster) .flag.sy { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 600'><path fill='%23007a3d' d='M0 0h900v200H0z'/><path fill='%23fff' d='M0 200h900v200H0z'/><path d='M0 400h900v200H0z'/><path fill='%23ce1126' d='M225 225 242 277 296 277 252 309 269 361 225 329 181 361 198 309 154 277 208 277zM450 225 467 277 521 277 477 309 494 361 450 329 406 361 423 309 379 277 433 277zM675 225 692 277 746 277 702 309 719 361 675 329 631 361 648 309 604 277 658 277z'/></svg>"); }
  #board .pt { margin-inline-start: auto; font-weight: 800; min-width: 2ch; text-align: end; }
  #board li.me .nm { font-weight: 800; color: #bfe0ff; }
  #board .you { flex: none; font-size: .8em; color: #bfe0ff; margin-inline-start: -.2em; }
  /* The slim HUD (the owner's ask, 29 Oct 2026: more room to play). The bar's buttons sit behind an arrow, the hearts box shows
     your points while closed, the closed scoreboard is one line (the two team totals and the clock in a team room, a crown, the
     leader's animal, name and points otherwise), the map button sits in the corner under the arrow. html.slim (under 500 px
     tall: a phone on its side, or a short window) starts everything folded and opens the buttons over the boxes for 4 s;
     html.big (500 px tall and 900 px wide or more) starts everything open and folds by hand; the page sets both and keeps
     what the player chose. html.fold is the folded layout: the hearts box and the scoreboard up beside the arrow. */
  #barMore, #pts { display: none; }
  #barMore svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
  #barMore[aria-expanded="true"] svg { transform: rotate(180deg); }   /* the row opens to the right, and the arrow turns back to fold it */
  #pts { margin-inline-start: auto; font-size: .95em; font-weight: 900; color: #ffd25a; }
  html:is(.slim, .big) #barMore { display: block; }
  html:is(.slim, .big) #stats:not(.open) .lvRing { display: none; }   /* closed, the box shows your points in this game; the level ring is back once it is opened */
  html:is(.slim, .big) #stats:not(.open) #pts { display: block; }
  html:is(.slim, .big) #bar:not(.open) > :not(#quit):not(#barMore) { display: none !important; }
  html.slim #bar, html.big #bar:not(.open) { height: 0; align-items: flex-start; }
  html.slim:has(#bar.open) #stats { visibility: hidden; }   /* the opened row runs over it */
  html.fold #stats { top: max(8px, env(safe-area-inset-top)); left: calc(max(8px, env(safe-area-inset-left)) + 52px); }   /* 8 px after the 44 px arrow */
  html.fold #board { top: max(8px, env(safe-area-inset-top)); right: calc(max(8px, env(safe-area-inset-right)) + 48px); }   /* 8 px before the 40 px ✕ */
  html.slim #board { min-width: 0; font-size: .72rem; padding: .3em .5em; }
  html.slim #board .nm { max-width: 6em; }
  html:is(.slim, .big) #board:not(.open) .tn { display: none; }
  html:is(.slim, .big) #board:not(.open) { display: flex; align-items: center; gap: .6em; min-width: 0; }
  html:is(.slim, .big) #board:not(.open) li.head { border: 0; padding: 0; margin: 0; font-size: 1em; gap: .5em; }
  html:is(.slim, .big) #board:not(.open) :is(#info, li.teamScore .bar, li:not(.head):not(.teamScore):not(.top1), li.top1 ~ li.top1), html:is(.slim, .big) #board.team:not(.open) li.top1 { display: none; }   /* your own points are in the hearts box */
  #offlineTag { display: none; }
  html:is(.slim, .big) #board:not(.open) #offlineTag:not([hidden]) { display: inline; }
  html:is(.slim, .big) #board:not(.open) li.teamScore { flex: 1; min-width: 6.5em; }
  html:is(.slim, .big) #board:not(.open) li.top1 :is(.flag, .you) { display: none; }   /* no team line: the leader's animal, name and points */
  html:is(.slim, .big) #board:not(.open) li.top1::before { content: '👑'; margin-inline-end: -.1em; }
  html:is(.slim, .big) #board:not(.open) li.top1 .pt { margin-inline-start: .2em; min-width: 0; color: inherit; }
  /* Bottom left: the ping now and its average (switch pingTag, only in a game; empty between games). */
  #corner { display: flex; gap: 4px; bottom: max(2px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); z-index: 5; pointer-events: none; }
  #corner > span { padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.45); font-size: .6rem; line-height: 1.4; text-shadow: none; white-space: nowrap; }
  #pingTag { display: none; }
  body:has(#bar:not([hidden])) #pingTag:not(:empty) { display: block; }
  #pingTag::before { content: ''; display: inline-block; width: .6em; height: .6em; margin-inline-end: .5em; border-radius: 50%; background: #9aa; }
  #pingTag[data-q=good]::before { background: #3ecf6e; }
  #pingTag[data-q=ok]::before { background: #f2b630; }
  #pingTag[data-q=bad]::before { background: #ef5350; }
  /* Debug mode (?debug, or ` in a game): a bottom corner, left to right in every language. Only its two
     buttons take taps; the rest lets the game through. It sits above the waiting box and hints when they show. */
  #dbg {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + 14px); right: max(8px, env(safe-area-inset-right));
    z-index: 6; padding: 5px 8px; background: rgba(0,0,0,.72); border-radius: 8px; pointer-events: none; text-shadow: none;
    font: 10.5px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-width: calc(100vw - 16px); display: grid; gap: 4px;
  }
  #dbg .dbgRow { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
  #dbg .dbgRow span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #dbg button { pointer-events: auto; font: inherit; color: inherit; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 3px 7px; min-height: 26px; }
  #dbg pre { margin: 0; font: inherit; white-space: pre; overflow: hidden; }
  /* Phones: the corner left of THROW and WALL (in both languages), above the waiting box and hints. */
  body:has(#roll:not([hidden])) #dbg {
    left: max(8px, env(safe-area-inset-left)); right: auto; max-width: calc(100vw - 150px); font-size: 9px;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + var(--flash-h, 0px) + 6px);
  }
  /* The first-game practice joystick: above it. */
  body:has(#coachJoy:not([hidden])) #dbg { bottom: calc(max(36px, env(safe-area-inset-bottom)) + 172px); }
  /* …except opened on a phone on its side, where that would push it off the top. */
  @media (max-height: 500px) { body:has(#coachJoy:not([hidden])) #dbg:has(#dbgText:not([hidden])) { bottom: max(10px, env(safe-area-inset-bottom)); } }
  @media (max-width: 520px) { body:has(#coachJoy:not([hidden])) #dbg { bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + 190px); } }
  /* First-game hints: one step at a time, each done when the player does it. */
  /* At the bottom, out of the way of the field; on phones between the practice joystick and THROW. */
  #coach {
    left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 5;
    width: max-content; max-width: min(540px, calc(100vw - 32px)); padding: 10px 10px 10px 14px; border-radius: 16px;
    background: var(--hud); font-weight: 700; font-size: var(--msg); line-height: 1.3; box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
    animation: coach-in .35s ease-out;
  }
  #coach .ic { font-size: 1.7rem; flex: none; animation: coach-bob 1.2s ease-in-out infinite; }
  #coach .tx { display: grid; gap: 5px; }
  #coach .dots { display: flex; gap: 4px; }
  #coach .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
  #coach .dots i.on { background: #8cc8ff; }
  #coach button { flex: none; min-height: 34px; padding: 4px 10px; font-size: .78rem; color: var(--hud-ink); background: transparent; border-color: rgba(255, 255, 255, .3); }
  #coach.ready { border: 2px solid #8cc8ff; }
  /* The picture: the keys, mouse button or phone control to use. A key lights up while it is held. */
  #coach .pic { flex: none; display: flex; align-items: center; gap: 6px; direction: ltr; text-shadow: none; }
  #coach .pic .or { font-size: .72rem; font-weight: 600; opacity: .85; }
  #coach .keys { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; }
  #coach .keys :first-child { grid-column: 2; }
  #coach .keys :nth-child(2) { grid-column: 1; }
  #coach kbd {
    display: block; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; background: #f4f8ff; color: #0c2242;
    font: 800 .78rem/26px "Noto Color Emoji", system-ui, sans-serif; text-align: center; box-shadow: 0 3px 0 #7f9cc2; transition: transform .08s, background .08s, box-shadow .08s;
  }
  #coach kbd.wide { min-width: 100px; }
  #coach kbd.on { background: #8cc8ff; transform: translateY(2px); box-shadow: 0 1px 0 #4f7fb8; }
  #coach kbd.hot:not(.on) { animation: coach-key 1.1s ease-in-out infinite; }
  #coach .mouse { width: 36px; height: 54px; overflow: visible; }
  #coach .mouse rect { fill: #f4f8ff; }
  #coach .mouse path { fill: #f4f8ff; stroke: #0c2242; stroke-width: 2; transition: fill .08s; }
  #coach .mouse path.hot:not(.on) { animation: coach-btn 1.1s ease-in-out infinite; }
  #coach .mouse path.on { fill: #2f78d0; }
  #coach .mouse .wheel { fill: #0c2242; }
  #coach .wiggle { animation: coach-wiggle 1.6s ease-in-out infinite; }
  #coach .arrows { font-size: 1.1rem; font-weight: 900; color: #8cc8ff; }
  #coach .stick { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: rgba(12, 34, 66, .35); }
  #coach .stick i, #coachJoy i { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: #fff; border: 3px solid #2f78d0; animation: coach-stick 2.4s linear infinite; }
  #coach .stick i { width: 22px; height: 22px; margin: -11px; --r: 13px; }
  #coach .thumb { display: grid; justify-items: center; font-size: .68rem; font-weight: 800; line-height: 1.1; color: #8cc8ff; white-space: nowrap; }
  #coach .thumb b { font-size: 1.3rem; line-height: 1; }
  #coach .btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(190, 220, 255, .85); background: rgba(255, 255, 255, .12); font: 900 .62rem "Noto Color Emoji", system-ui, sans-serif; color: #fff; }
  #coach .btn.sm { width: 38px; height: 38px; font-size: .55rem; }
  #coach .btn.on { background: rgba(70, 140, 230, .85); }
  #coach .prog { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
  #coach .prog i { display: block; height: 100%; width: 0; background: #8cc8ff; border-radius: 3px; transition: width .1s linear; }
  #coach .prog[hidden] { display: none; }
  /* On the field: a pretend joystick showing where a thumb goes, and a hand showing what to do with THROW and WALL. */
  #coachJoy { left: max(36px, env(safe-area-inset-left)); bottom: max(36px, env(safe-area-inset-bottom)); width: 128px; height: 128px; border-radius: 50%; pointer-events: none; border: 3px solid #fff; background: rgba(12, 34, 66, .22); box-shadow: 0 0 0 2px rgba(12, 34, 66, .25); }
  #coachJoy i { width: 44px; height: 44px; margin: -25px; --r: 40px; }
  #coachJoy b { position: absolute; left: 50%; top: 50%; font-size: 2.4rem; line-height: 1; margin: -6px 0 0 -14px; animation: coach-stick 2.4s linear infinite; --r: 40px; text-shadow: none; }
  #coachJoy small { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; font-weight: 800; font-size: .85rem; background: var(--hud); border-radius: 999px; padding: 3px 10px; }
  #coachHand { font-size: 2.6rem; line-height: 1; pointer-events: none; margin: -6px 0 0 -14px; text-shadow: none; z-index: 4; }
  #coachHand.press { animation: coach-press 1.2s ease-in-out infinite; }
  #coachHand.point { margin: -21px 0 0; animation: coach-nudge 1s ease-in-out infinite; }
  #coachHand.to-l { --n: -7px; }
  #coachHand.to-r { --n: 7px; }
  #coach .btn.map svg { width: 20px; height: 20px; }
  #coach .btn.gear { font-size: 1.3rem; font-weight: 400; }
  .coach-me { animation: coach-pulse 1.1s ease-in-out infinite; }
  @keyframes coach-in { from { opacity: 0; transform: translate(-50%, 10px); } }
  @keyframes coach-up { from { opacity: 0; transform: translateY(10px); } }
  @keyframes coach-nudge { 50% { transform: translateX(var(--n)); } }
  @keyframes coach-bob { 50% { transform: translateY(-4px); } }
  @keyframes coach-pulse { 50% { box-shadow: 0 0 0 12px rgba(140, 200, 255, .45); } }
  @keyframes coach-key { 50% { background: #8cc8ff; } }
  @keyframes coach-btn { 50% { fill: #8cc8ff; } }
  @keyframes coach-wiggle { 25% { transform: translateX(-9px) rotate(-6deg); } 75% { transform: translateX(9px) rotate(6deg); } }
  @keyframes coach-stick {
    0% { transform: rotate(0deg) translateX(var(--r)) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(var(--r)) rotate(-360deg); }
  }
  @keyframes coach-press { 0%, 100% { transform: translateY(-14px); opacity: .7; } 40%, 70% { transform: translateY(0) scale(.92); opacity: 1; } }
  /* A phone on its side has no height to spare: the hint sits at the bottom, between the joystick and THROW. */
  body:has(#roll:not([hidden])) #coach { max-width: min(440px, calc(100vw - 380px)); min-width: 280px; }
  @media (max-height: 500px) {
    #coach { bottom: max(12px, env(safe-area-inset-bottom)); padding: 8px 8px 8px 12px; }
  }
  #mapBtn { min-width: 34px; min-height: 34px; padding: 0; font-size: .95rem; line-height: 1; border-radius: 9px; background: var(--hud); color: var(--hud-ink); border-color: rgba(255, 255, 255, .3); z-index: 3; display: grid; place-items: center; }
  #mapBtn svg { width: 21px; height: 21px; }
  @keyframes fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
  /* Messages that come and go — "A snowed in B", "Snowed in! Back in 3…", "+1", "Walk a little first", "Go!" —
     share one grey stack at the bottom, like the room's box, above the hint and the waiting box
     (their heights: --coach-h, --wait-h). The newest short message sits lowest. */
  #flash {
    left: 50%; translate: -50% 0; bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--coach-h, 0px) + var(--wait-h, 0px) + 12px);
    display: grid; gap: 6px; justify-items: center; width: max-content; max-width: min(460px, calc(100vw - 32px)); pointer-events: none; z-index: 6;
  }
  body:has(#roll:not([hidden])) #flash { max-width: min(440px, calc(100vw - 380px)); }
  #toast, #big, #feed div { background: var(--hud); border-radius: 14px; padding: 8px 16px; text-align: center; line-height: 1.35; }
  #joinTip {
    right: max(8px, env(safe-area-inset-right)); top: 60px; z-index: 6; max-width: min(16em, calc(100vw - 16px)); pointer-events: none;
    padding: 5px 12px; border-radius: 12px; font-size: .85rem; font-weight: 700; line-height: 1.35;
    background: rgba(40, 170, 100, .5); border: 1px solid rgba(255,255,255,.3); opacity: 0; transition: opacity .4s;
  }
  #joinTip.show { opacity: 1; }
  #toast { display: none; font-weight: 800; font-size: var(--msg); }
  #toast.show { display: block; animation: toast 1.9s forwards; }
  #big { font-weight: 900; font-size: calc(var(--msg) * 1.25); }
  #big:empty { display: none; }
  #big small { display: block; font-size: .72em; font-weight: 600; opacity: .95; }
  #feed { display: grid; gap: 4px; justify-items: center; font-size: var(--msg); font-weight: 700; }
  #feed:empty { display: none; }
  #feed div { padding: 4px 12px; animation: fade 4s forwards; }
  /* The round's last seconds, big in the middle (callout() in index.html): a pop in, then a fade. */
  #callout { left: 50%; top: 42%; translate: -50% -50%; z-index: 7; pointer-events: none; display: none; white-space: nowrap;
    font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.6rem); padding: .3em .9em; border-radius: 22px; background: var(--hud); }
  #callout.num { font-size: clamp(4.5rem, 20vw, 8rem); padding: 0; line-height: 1; background: none; color: #fff;
    -webkit-text-stroke: .04em #1f5fae; paint-order: stroke fill; text-shadow: 0 .05em 0 #1f5fae, 0 .08em .2em rgba(0,0,0,.35); }
  #callout.show { display: block; animation: callout 2.5s forwards; }
  /* The last seconds' callouts sit small, in the middle of the screen a little above your own player: at the top they
     covered the first-game hints (the owner's ask, 25 Nov 2026); right in the middle they hid your player (15 Nov 2026). */
  #callout:not(.end) { top: 36%; translate: -50% -50%; font-size: clamp(1rem, 3vw, 1.35rem); padding: .3em .8em; border-radius: 14px; }
  #callout.num:not(.end) { font-size: clamp(2.2rem, 8vw, 3.4rem); padding: 0; }
  /* A phone held upright: the hints and notes fill the top half, so just under your player instead. */
  @media (max-width: 520px) { #callout:not(.end) { top: 62%; } }
  /* The round's end in a team game (showResults in index.html): who won, in the winners' colour, and your side under it. */
  #callout.end { font-size: clamp(1.3rem, 5vw, 2.4rem); white-space: normal; text-align: center; max-width: 92vw; width: max-content; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
  #callout.end small { display: block; font-size: .58em; font-weight: 800; opacity: .95; margin-top: .15em; }
  #callout.t1 { background: rgba(47, 120, 208, .88); } #callout.t2 { background: rgba(240, 138, 36, .9); }
  @keyframes callout { 0% { opacity: 0; scale: .6; } 15% { opacity: 1; scale: 1.08; } 25%, 75% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; } }
  @media (prefers-reduced-motion: reduce) { #callout.show { animation-name: fade; } }
  @keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  .pad {
    position: fixed; border-radius: 50%; font-weight: 900; background: var(--hud); color: var(--hud-ink);
    border: 2px solid rgba(190, 220, 255, .85); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  #roll { bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-end: max(18px, env(safe-area-inset-right) - 30px); width: 100px; height: 100px; font-size: .95rem; }
  #roll.on { background: rgba(70, 140, 230, .75); transform: scale(1.06); }
  #build { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 112px); inset-inline-end: max(26px, env(safe-area-inset-right) - 30px); width: 68px; height: 68px; font-size: .8rem; }
  #build.off { opacity: .45; }
  @media (hover: hover) and (pointer: fine) {
    #roll { width: 78px; height: 78px; font-size: .85rem; }
    #build { width: 58px; height: 58px; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 90px); }
  }
  @media (max-width: 520px) {
    #board { min-width: 0; font-size: .74rem; padding: 4px 6px; }
    #board .nm { max-width: 6.5em; }
    #bar { gap: 5px; }
    #bar button { padding-inline: 7px; }
    #wait, body:has(#roll:not([hidden])) #wait { max-width: calc(100vw - 150px); min-width: 0; left: max(10px, env(safe-area-inset-left)); transform: none; font-size: .8rem; }
    /* A phone held upright: the joystick keeps the bottom left corner (the owner's ask, 2 Nov 2026), so the hint goes to
       the top, small, under the hearts box, the scoreboard and the small map (--hud-bottom), and the waiting note and the
       short messages sit just above the joystick (36 px + its 128 px + a gap). */
    #coach, body:has(#roll:not([hidden])) #coach {
      top: calc(var(--hud-bottom, 140px) + 8px); bottom: auto; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right));
      transform: none; width: auto; max-width: none; min-width: 0; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 12px;
    }
    #coach .ic { font-size: 1.2rem; }
    #coach .pic { display: none; }   /* the same picture shows on the field, on the joystick and by THROW (#coachJoy) */
    #coach button { min-height: 30px; padding: 2px 8px; }
    #coachJoy { bottom: max(36px, env(safe-area-inset-bottom)); }
    #wait, body:has(#roll:not([hidden])) #wait { bottom: calc(max(36px, env(safe-area-inset-bottom)) + 140px); }
    #flash, body:has(#roll:not([hidden])) #flash { left: max(10px, env(safe-area-inset-left)); translate: none; max-width: calc(100vw - 150px); justify-items: start;
      bottom: calc(max(36px, env(safe-area-inset-bottom)) + 140px + var(--wait-h, 0px)); }
    #feed { justify-items: start; }
    /* No free corner on a phone held upright: in a game, notices go under the hearts box, the scoreboard and
       the small map (--hud-bottom, kept by miniMap) instead of over the controls. */
    body:has(#bar:not([hidden])) #notices { top: calc(var(--hud-bottom, 140px) + 14px + var(--coach-h, 0px)); bottom: auto; }
    body:has(#notices .notice) #coachJoy small { display: none; }
  }
  /* A short phone held upright has no room for the practice joystick too: the hint's own picture shows it. */
  @media (max-width: 520px) and (max-height: 700px) {
    #coachJoy { display: none !important; }   /* the hint says it too; the note needs the room */
  }
  /* The narrowest phones: smaller bar buttons, so they all stay on the screen. */
  @media (max-width: 380px) {
    #bar { gap: 4px; }
    #bar button { min-width: 34px; min-height: 36px; padding-inline: 5px; }
  }
  /* Phones have little room at the bottom: one message at a time — "Snowed in!" first, then the newest short
     message, then the newest feed line — and the practice joystick makes way while one shows. */
  @media (max-height: 500px), (max-width: 520px) {
    #flash:has(#big:not(:empty)) #toast, #flash:has(#big:not(:empty)) #feed, #flash:has(#toast.show) #feed { display: none; }
    #feed div:not(:last-child) { display: none; }
    #waitHint { display: none; }   /* the Start button says it */
    #toast, #big, #feed div { padding: 5px 12px; }
    body:has(#flash #toast.show, #flash #big:not(:empty), #flash #feed:not(:empty)) #coachJoy { display: none; }
  }
  /* A phone on its side: notices go to the free band at the top, between the boxes on the left and on the right
     (--top-l, --top-r, kept by miniMap), and the waiting box is compact. */
  @media (max-height: 500px) {
    body:has(#bar:not([hidden])) #notices { top: calc(max(8px, env(safe-area-inset-top)) + var(--bar-h, 42px) + 8px); bottom: auto;
      inset-inline-end: auto; left: calc(var(--top-l, 0px) + 8px); right: calc(100vw - var(--top-r, 100vw) + 8px); width: auto; }
    #wait { padding: 6px 10px; gap: 4px; font-size: .8rem; }
    #wait button { min-height: 32px; }
    #wait .row { flex-wrap: nowrap; }
    #startBtn { padding-inline: 10px; }
  }
  @media (max-height: 500px) {
    /* The practice joystick and THROW already show the hint's picture: the hint keeps only its words. */
    body:has(#coachJoy:not([hidden])) #coach .pic { display: none; }
    body:has(#roll:not([hidden])) #coach { min-width: 0; max-width: min(440px, calc(100vw - 350px)); }   /* between the joystick and THROW */
    /* The free band between the boxes at the top is too narrow on the smallest phones (150 px at 568 px wide): a notice
       is never narrower than about 60% of the screen (and stays on it), even if it then covers the edge of a box for a moment. */
    body:has(#bar:not([hidden])) #notices { --nw: min(60vw, 330px); right: auto; width: max(calc(var(--top-r, 100vw) - var(--top-l, 0px) - 16px), var(--nw));
      left: clamp(8px, calc(var(--top-l, 0px) + 8px), calc(100vw - var(--nw) - 8px)); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    #toast.show { opacity: 1; }
  }

  /* Arabic: messages read right to left and wrap onto more lines instead of being cut off. */
  :root[lang=ar] #info { line-height: 1.25; overflow-wrap: anywhere; }

  /* Teams mode (public/js/teams.js): the game-type choice, the team lists, the score line, your team and the results by team. */
  .lbl { margin: 10px 0 6px; font-size: .9rem; color: var(--ink-soft); }
  .gtype { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #newDlg .gtype { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gtype button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 60px; padding: 6px 8px; text-align: center; }
  #newDlg .gtype button { min-height: 126px; border-radius: 11px; background: color-mix(in srgb, #8ccbe9 12%, var(--field)); box-shadow: inset 0 -5px color-mix(in srgb, #8ccbe9 25%, var(--field)); }
  #newDlg .gtype button[data-teams="1"] { background: color-mix(in srgb, #bdb8e9 13%, var(--field)); box-shadow: inset 0 -5px color-mix(in srgb, #bdb8e9 26%, var(--field)); }
  #newDlg .gtype button[data-castle] { background: color-mix(in srgb, #f3c48d 15%, var(--field)); box-shadow: inset 0 -5px color-mix(in srgb, #f3c48d 30%, var(--field)); }
  .gtype.small .modeArt { width: 51px; height: 34px; }
  .gtype button small { color: var(--ink-soft); font-size: .78rem; }
  .gtype button[aria-pressed="true"] { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--field)); }
  #newDlg .gtype button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--field)); box-shadow: inset 0 -5px color-mix(in srgb, var(--accent) 42%, var(--field)); }
  .gtype button:disabled { opacity: .6; border-style: dashed; cursor: not-allowed; }
  .gtype button:disabled .soonPill { display: block; }
  .gtype.small button { min-height: 44px; font-weight: 700; }
  .layoutPick { display: flex; gap: 12px; align-items: center; margin: 4px 0 10px; }
  .layoutPick > div { flex: 1; min-width: 0; }
  .layoutPick .hint { margin: 4px 0 0; }
  #layoutPrev { position: static; width: 128px; height: 96px; flex: none; touch-action: auto; border-radius: 8px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-soft) 30%, transparent); }
  .gtype.small button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
  .teamsPanel { display: grid; gap: 8px; margin: 8px 0; }
  #teamDlg { max-width: 560px; }
  #teamDlg .teamsPanel { text-shadow: none; color: var(--ink); }
  .teamCols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .teamCol { border: 2px solid #2f78d0; background: rgba(79, 149, 232, .14); border-radius: 12px; padding: 6px 8px; display: grid; gap: 2px; align-content: start; background-clip: padding-box; }
  .teamCol.t2 { border-color: #c25e00; background: rgba(240, 138, 36, .14); }
  #teamDlg .teamCol { background: color-mix(in srgb, #2f78d0 14%, var(--panel)); }
  #teamDlg .teamCol.t2 { background: color-mix(in srgb, #f08a24 14%, var(--panel)); }
  .teamHead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
  .teamCol .teamHead b, .teamBox .teamHead b:first-child { color: #2f78d0; }
  .teamCol.t2 .teamHead b, .teamBox.t2 .teamHead b:first-child { color: #c25e00; }
  .teamHead small { color: var(--ink-soft); font-weight: 600; }
  .teamRow { display: flex; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--line); }
  .teamRow .pic { font-size: 20px; width: 26px; text-align: center; }
  .teamRow .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
  .teamRow .move { min-width: 44px; min-height: 34px; padding: 0 8px; font-weight: 800; }
  .teamRow .kick[data-sure="1"] { background: #d64545; color: #fff; }
  .teamRow.me { outline: 2px solid currentColor; border-radius: 8px; padding: 0 6px; margin: 0 -6px; border-top-color: transparent; }
  .teamsPanel .shuffle { justify-self: stretch; }
  #board li.teamScore { cursor: pointer; display: grid; grid-template-columns: 1fr auto 1fr; gap: .4em; align-items: center; font-weight: 800; white-space: nowrap; }
  #board li.teamScore b { border-radius: 8px; padding: 0 .5em; color: #fff; text-shadow: none; }
  #board li.teamScore .t1 { background: #2f78d0; }
  #board li.teamScore .t2 { background: #c25e00; text-align: end; }
  #board li.teamScore .vs { opacity: .8; font-size: .85em; }
  #board li.teamScore .bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: 999px; background: #f08a24; overflow: hidden; }
  #board li.teamScore .bar i { display: block; height: 100%; background: #4f95e8; }
  /* Your team, a button to the Teams pop-up, where you can switch sides (29 Oct 2026). */
  #myTeam { display: flex; align-items: center; gap: 6px; font-size: .85em; font-weight: 700; padding: 2px 8px; margin-inline: -4px; min-height: 30px;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .12); color: inherit; text-shadow: inherit; }
  #myTeam .tdot { width: .8em; height: .8em; border-radius: 50%; display: inline-block; }
  #myTeam .swap { margin-inline-start: auto; opacity: .85; }
  .teamsPanel .switchMe { font-weight: 800; color: #fff; border: 0; min-height: 40px; background: #2f78d0; }
  .teamsPanel .switchMe.t2 { background: #c25e00; }
  .teamsPanel .switchMe:hover { filter: brightness(1.08); }
  .teamsPanel { text-align: start; }
  .teamsPanel button { background: var(--field); color: var(--ink); border: 1px solid var(--line); opacity: 1; }
  .teamsPanel button:hover { border-color: var(--accent); }
  .teamCol { min-width: 0; }
  #roomTeams .teamCols { grid-template-columns: 1fr; }
  @media (max-width: 520px) { #teamDlg .teamCols { grid-template-columns: 1fr; } }
  /* Levels (public/js/progress.js, docs/progression/): the ring on the start card, a locked animal, your own level
     under the hearts, the XP line in the round results, the level-up banner and the collection. */
  .prog { display: flex; align-items: center; gap: 14px; width: 100%; margin: 4px 0 12px; padding: 8px 10px; text-align: start;
    border-radius: 16px; background: color-mix(in srgb, var(--accent) 7%, var(--field)); }
  .prog .ring { position: relative; flex: none; width: 76px; height: 76px; }
  .prog svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .prog circle { fill: none; stroke: var(--line); stroke-width: 8; }
  .prog #progFill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 289; transition: stroke-dasharray .6s ease-out; }
  .prog #progPet { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; line-height: 1; }
  .prog #progLv { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: .78rem;
    background: var(--accent); color: var(--on-accent); border: 2px solid var(--panel); border-radius: 999px; padding: 1px 8px; }
  .prog .txt { display: grid; gap: 4px; min-width: 0; flex: 1; }
  .prog .txt b { font-size: 1.05rem; }
  .prog .txt small { color: var(--ink-soft); }
  /* The XP bar beside the ring, the next reward and today's first-game bonus (28 Oct 2026). */
  .prog { flex-wrap: wrap; }
  .prog .top, .prog .nums { display: flex; justify-content: space-between; gap: 8px; }
  .prog .nums small { font-size: .8rem; font-weight: 700; }
  .prog .bar, .xpBox .bar { position: relative; display: block; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .prog .bar i, .xpBox .bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: linear-gradient(90deg, #5aa9ff, var(--accent)); transition: width .6s ease-out; }
  .xpBox .bar i.plus { background: linear-gradient(90deg, #ffd25a, #ffb020); }
  .prog .reward, .xpBox .reward { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--field); border: 1px dashed var(--edge); }
  .prog .reward .ic, .xpBox .reward .ic { font-size: 24px; line-height: 1; }
  .prog .reward b, .prog .reward small, .xpBox .reward b, .xpBox .reward small { display: block; }
  .prog .reward small, .xpBox .reward small { color: var(--ink-soft); font-size: .8rem; }
  .prog .bonus { flex: 1 0 100%; padding: 6px 10px; border-radius: 999px; background: #fff4d6; color: #8a5a00; font-weight: 800; font-size: .82rem; }
  .prog [hidden], .xpBox[hidden] { display: none; }
  .xpBox { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--field)); color: var(--ink); text-shadow: none; }
  .xpBox ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .85rem; }
  .xpBox li { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
  .xpBox li b { color: #1f8f4e; } .xpBox li.sum { border-top: 1px solid var(--line); padding-top: 4px; font-size: 1rem; }
  .xpBox li.cut b { color: var(--ink-soft); }
  .xpBox .nums { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
  /* The level-up card keeps its light gold in both themes, so its words are dark in both too (light on light in dark mode, 28 Oct 2026). */
  .xpBox .reward.up { border: 2px solid #ffb020; background: #fff8e6; color: #3d2c00; }
  .xpBox .reward.up small { color: #6b5414; }
  .hues button.locked { position: relative; border-style: dashed; border-color: var(--edge); background: var(--field); cursor: not-allowed; transform: none; box-shadow: none; }
  .hues button.locked span { filter: grayscale(1); opacity: .35; }
  .hues button.locked::after { content: attr(data-lv); position: absolute; inset-inline: 0; bottom: 2px; font-size: .62rem; font-weight: 800; color: var(--ink-soft); }
  /* Your level (28 Oct 2026, the owner's pick): a gold ring with the number next to the hearts, and in the opened panel
     a wide bar with the XP written inside it. */
  .lvRing { position: relative; flex: none; width: 1.75em; height: 1.75em; margin-inline-start: auto; }
  .lvRing svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
  .lvRing circle { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 4; }
  .lvRing #lvlRingFg { stroke: #ffd25a; stroke-linecap: round; stroke-dasharray: 0 88; transition: stroke-dasharray .6s ease-out; }
  .lvRing b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8em; font-weight: 900; }
  .lvRing[hidden] { display: none; }
  #lvl { position: relative; display: block; min-width: 9em; height: 1.15em; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; font-size: .8em; }
  #lvl > i { position: absolute; inset: 0; display: block; }
  #lvl > i > i { display: block; height: 100%; background: linear-gradient(90deg, #4f9dff, #7b6cff); transition: width .6s ease-out; }
  #lvl small { position: relative; display: block; text-align: center; font-weight: 800; line-height: 1.15em; font-size: .85em; }
  .colHead > i { flex: 1; min-width: 48px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); overflow: hidden; display: block; }
  .colHead > i > i { display: block; height: 100%; background: linear-gradient(90deg, #8fd0ff, #ffd25a); transition: width .6s ease-out; }
  #visitDlg .xpBox { margin: 0 0 12px; }
  #leaveDlg p { margin: 4px 0 14px; color: var(--ink-soft); }
  .leaveBtns { display: flex; gap: 8px; } .leaveBtns button { flex: 1; min-height: 44px; font-weight: 800; }
  /* The practice pop-up (public/js/practice.js): one dialog, two steps: before the practice (ask) and after it (done). */
  #learnDlg p { margin: 4px 0 14px; color: var(--ink-soft); line-height: 1.45; }
  #learnDlg .leaveBtns { flex-wrap: wrap; } #learnDlg .leaveBtns button { flex: 1 1 140px; }
  .learnPic { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 2px 0 8px; font-size: 2.4rem; direction: ltr; }
  .learnPic i { font-style: normal; font-size: 1.4rem; color: #8cc8ff; animation: coach-bob 1.2s ease-in-out infinite; }
  /* Top middle, under the bar (beside the arrow when the HUD is folded), between the hearts box and the scoreboard. */
  #practicePlay { left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + var(--bar-h, 42px) + 8px); transform: translateX(-50%); z-index: 5;
    min-height: 40px; padding: 4px 14px; border-radius: 999px; white-space: nowrap; font-weight: 800; text-shadow: none;
    background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  html.fold #practicePlay { top: max(8px, env(safe-area-inset-top)); }
  /* An upright phone has no room between the boxes: the free space in the bar's row, left of ✕. */
  @media (max-width: 520px) { #practicePlay { top: max(8px, env(safe-area-inset-top)); left: auto; right: calc(max(8px, env(safe-area-inset-right)) + 52px);
    transform: none; min-height: 36px; padding: 2px 10px; font-size: .8rem; } }
  #practicePlay[hidden] { display: none; }
  #lvlUp { left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + var(--bar-h, 42px) + 8px); transform: translateX(-50%); z-index: 6;
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(340px, calc(100vw - 32px)); padding-block: 5px; padding-inline: 5px 16px; border-radius: 999px;
    background: #0c2242; border: 2px solid #9cc6f5; box-shadow: 0 8px 24px rgba(12, 34, 66, .35); text-shadow: none; pointer-events: none; }
  #lvlUpN { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; }
  #lvlUp .lvlUpText { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  #lvlUpTitle { font-weight: 900; }
  #lvlUpTx { font-size: .8rem; font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #lvlUpTx[hidden] { display: none; }
  @media (prefers-reduced-motion: no-preference) { #lvlUp:not([hidden]) { animation: lvl-in .35s ease-out; } }
  @keyframes lvl-in { from { transform: translate(-50%, -14px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
  .colHead { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink); }
  /* The collection's tabs reuse the store's (js/progress.js); the level bar stays above them. */
  #colDlg > .colHead { margin: 0; padding: 12px 18px 0; }
  .colTabs { display: flex; flex-shrink: 0; overflow-x: auto; scrollbar-width: thin; }
  .colTabs button { flex: 1 0 auto; min-width: 76px; padding-inline: 8px; }
  .colTabs button { text-align: center; }
  @media (max-width: 420px) { .colTabs { gap: 4px; padding-inline: 10px; } .colTabs button { padding-inline: 0; font-size: .68rem; } }
  .colHead > i { background: var(--line); height: 8px; }
  .colHead > i > i { background: var(--accent); }
  .colGrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
  .colGrid li { display: grid; place-items: center; gap: 2px; min-height: 70px; border-radius: 12px; border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 10%, var(--field)); }
  .colGrid li span { font-size: 30px; line-height: 1; }
  .colGrid li small, .colList li small { font-size: .72rem; font-weight: 800; color: var(--ink-soft); }
  .colGrid li.locked { background: var(--field); border-style: dashed; border-color: var(--edge); }
  .colGrid li.locked span { filter: grayscale(1); opacity: .4; }
  /* A skin card: the whole card is the button; worn = the accent ring, locked = grey. */
  .colSkins li { padding: 0; overflow: hidden; }
  .colSkins button { display: grid; place-items: center; gap: 2px; width: 100%; height: 100%; padding: 6px 4px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; }
  .colSkins canvas { position: static; width: 52px; height: 52px; touch-action: auto; }
  .colSkins button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
  .colSkins li.locked canvas { filter: grayscale(1); opacity: .5; }
  .colList { list-style: none; margin: 0; padding: 0; display: grid; }
  .colList li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); font-weight: 700; }
  .colList li.locked span { color: var(--ink-soft); font-weight: 600; }
  /* Levels, phase 2: stars on the start card, power icons under the hearts, trails, this week's board, the save code. */
  .prog .txt .stars { font-size: .9rem; color: #a8690a; }
  #pow { justify-self: start; font-size: 1em; letter-spacing: 3px; padding: .05em .55em; border-radius: 999px; background: rgba(255, 255, 255, .16); }
  .colBoard { margin: 0; padding: 0; list-style: none; display: grid; }
  .colBoard li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--line); }
  .colBoard li b { width: 1.6em; text-align: center; }
  .colBoard li .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
  .colBoard li small { color: var(--ink-soft); font-weight: 800; }
  .colBoard li.empty { color: var(--ink-soft); }
  .saveRow { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
  .saveRow code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; padding: 8px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); -webkit-user-select: all; user-select: all; }
  .saveRow input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
  /* Levels, phase 3: achievements and the season's badge track. */
  .colAch { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .colAch li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px;
    border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 10%, var(--field)); }
  .colAch li span { grid-row: span 2; font-size: 26px; line-height: 1; }
  .colAch li b { font-size: .88rem; }
  .colAch li small { color: var(--ink-soft); font-weight: 800; font-size: .72rem; }
  .colAch li.locked { background: var(--field); border-style: dashed; border-color: var(--edge); }
  .colAch li.locked span { filter: grayscale(1); opacity: .45; }
  .seasonSteps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 10px; }
  .seasonSteps li { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--accent) 12%, var(--field)); border: 2px solid var(--accent); }
  .seasonSteps li.locked { border: 2px dashed var(--edge); background: var(--field); filter: grayscale(1); opacity: .5; }
  /* The loading screen (public/js/loader.js): the logo, a progress bar and one line, over everything but pop-ups,
     on a real frame of the game's field (public/brand/loading-*.webp, ~15 KB, wide or tall for the screen) under a veil, thicker in the middle so the logo and words stay clear. */
  #loader {
    position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 22px;
    padding: 24px; text-align: center; --veil-in: rgba(227, 237, 247, .92); --veil: rgba(227, 237, 247, .45); --shot: url(/brand/loading-wide.webp); --base: #c9d9ea;
    background: radial-gradient(var(--veil-in) 35%, var(--veil) 75%), var(--shot) center / cover, var(--base); color: var(--ink-soft); font-weight: 600;
  }
  #loaderLogo {
    grid-area: 1 / 1; width: min(78vw, 420px); width: min(78vw, 420px, 105dvh); aspect-ratio: 320 / 102;
    background: url(/brand/logo-en.png) center / contain no-repeat;
  }
  :lang(ar) #loaderLogo { background-image: url(/brand/logo-ar.png); }
  #loaderProgress, #loaderRecovery { grid-area: 2 / 1; }
  #loaderProgress { display: flex; flex-direction: column; align-items: center; gap: 22px; }
  #loaderRecovery { visibility: hidden; max-width: 32rem; }
  #loaderRecovery p { margin: 0 0 14px; }
  #loaderRetry { display: inline-block; padding: 10px 22px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
  /* Recovery also works when an early script never loads. Boot removes data-starting once it takes over. */
  #loader[data-starting] #loaderRecovery { animation: loader-show 0s 12s forwards; }
  #loader[data-starting] #loaderProgress { animation: loader-hide 0s 12s forwards; }
  @keyframes loader-show { to { visibility: visible; } }
  @keyframes loader-hide { to { visibility: hidden; } }
  @keyframes loader-spin { to { transform: rotate(1turn); } }
  #loaderBar { width: min(60vw, 280px); height: 8px; border-radius: 4px; background: rgba(47, 120, 208, .2); overflow: hidden; }
  #loaderBar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .3s ease-out; }
  #loaderBar:not([aria-valuenow]) span { width: 30%; margin-inline-start: 35%; animation: loader-wait 1s ease-in-out infinite alternate; }
  @keyframes loader-wait { from { opacity: .35; } to { opacity: 1; } }
  @media (orientation: portrait) { #loader { --shot: url(/brand/loading-tall.webp); } }
  @media (prefers-color-scheme: dark) {
    #loader { --veil-in: rgba(16, 24, 38, .9); --veil: rgba(16, 24, 38, .72); --base: #101826; }
    #loaderLogo { background-image: url(/brand/logo-en-dark.png); }
    :lang(ar) #loaderLogo { background-image: url(/brand/logo-ar-dark.png); }
  }
  @media (prefers-reduced-motion: reduce) { #loaderBar span { transition: none; animation: none !important; } }

/* The character picker (the collection's Animals tab since 15 Nov 2026): round coins in each animal's colour, a tick on yours, a padlock and level on the locked ones. */
#colPane-animals .hues { grid-template-columns: repeat(auto-fill, 66px); justify-content: center; gap: 12px 10px; padding: 6px 2px; margin-bottom: 4px; }
#colPane-animals .hues button { position: relative; aspect-ratio: 1; min-height: 0; border-radius: 50%; border: 3px solid #fff; font-size: 2rem; transform: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 58%, #fff));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 45%, #fff); }
#colPane-animals .hues button:hover { transform: translateY(-2px); }
#colPane-animals .hues button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--c), 0 6px 14px -4px var(--c); }
#colPane-animals .hues button[aria-pressed="true"]:not(.locked)::after { content: '✓'; position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid var(--panel); background: var(--c); color: #fff; font: 900 13px/22px "Noto Color Emoji", system-ui, sans-serif; text-align: center; }
#colPane-animals .hues button.locked { border: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent); background: color-mix(in srgb, var(--ink) 5%, var(--field)); box-shadow: none; transform: none; }
#colPane-animals .hues button.locked::after { content: '🔒 ' attr(data-lv); bottom: 4px; }
/* The round's results cover the field: the first-game hint, its practice joystick and hand wait behind them (a practice
   game is timed too since 4 Nov 2026, so its hints could still be running when the time is up). */
body:has(#results:not([hidden])) :is(#coach, #coachJoy, #coachHand) { display: none; }
/* Nor the controls and the boxes beside them: only ✕ stays; the score box too, the card has the score (the owner's ask, 15 Nov 2026). */
body:has(#results:not([hidden])) :is(#board, #stats, #mapBtn, #build, #roll, #bar > :not(#quit)) { visibility: hidden; }
/* Tips ("Turn your phone sideways" and the like) wait behind the results too; warnings and errors still show. */
body:has(dialog[open]) #notices .pushOffer,
body:has(#menu[hidden]) #notices .pushOffer,
body:has(#results:not([hidden])) #notices .notice.info { display: none; }

/* The start screen, layout C (the owner's choice, 8 Nov 2026; mockups in the Growth Plan): the live game shows behind it,
   your level and ☰ on top, your 3D character turning in the middle, your name, the way to play, and a dark bar with Play in
   the middle. Brand colours: night navy #0C2242 for the bar, ice blue #2F78D0 for Play (option 2 of 12, the owner's pick, 8 Nov 2026). */
#menu { --navy: #0C2242; --orange: #F08A24; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(rgba(230, 241, 251, .28), rgba(230, 241, 251, .08)); align-items: stretch; }
.seo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* for search engines and screen readers */
/* --progW: the level card's width from 520 px wide (the coins bubble under it follows it too). */
#form.home { --progW: clamp(230px, 34vw, 420px); --hs: clamp(120px, 30vh, 250px); width: 100%; max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home .hTop { width: 100%; display: flex; align-items: flex-start; gap: 10px; }
.home .hTop .sp { flex: 1; }
.home .hIco { position: relative; width: 46px; height: 46px; min-height: 0; padding: 0; border: 0; border-radius: 14px; background: #fff; color: var(--navy);
  box-shadow: 0 3px 0 #b7cbe3; display: grid; place-items: center; }
.home .hIco svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.home .dot { position: absolute; top: -4px; inset-inline-end: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
/* Your level: a small pill (ring with your animal, the level, the bar); the full card is the collection it opens. */
.home .prog { width: auto; max-width: 62%; margin: 0; gap: 8px; padding: 4px 14px 4px 4px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #1d3a6e, #142a55); box-shadow: 0 3px 0 #0b1a3a, inset 0 0 0 1px var(--nightEdge); }   /* night blue, as the "Great game!" pop-up (the owner's ask, 24 Nov 2026) */
html[dir=rtl] .home .prog { padding: 4px 4px 4px 14px; }
.home .prog .ring { width: 44px; height: 44px; }
.home .prog #progPet { font-size: 20px; }
.home .prog .txt { min-width: 0; }
.home .prog .txt b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home .prog .nums, .home .prog .reward, .home .prog .stars, .home .prog .bonus { display: none !important; }
/* The character on its snow stand, ‹ › either side. */
:is(.home, #roomDlg) .hStage { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(6px, 4vw, 30px); min-height: calc(var(--hs) + 20px); }
:is(.home, #roomDlg) .hArrow { width: 42px; height: 42px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--accent); font-size: 1.6rem; font-weight: 900;
  line-height: 1; box-shadow: 0 3px 0 #b7cbe3; flex: none; }
.home #animalPick { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0; min-height: 0; border: 0; background: none; box-shadow: none; }
:is(.home, #roomDlg) .hero { width: var(--hs); height: var(--hs); display: grid; place-items: center; position: relative; z-index: 1; background-repeat: no-repeat;
  filter: drop-shadow(0 12px 10px rgba(12, 34, 66, .28)); }
:is(.home, #roomDlg) .hero :is(#animalSelected, .heroEm) { font-size: calc(var(--hs) * .55); line-height: 1; }
:is(.home, #roomDlg) .hero.turn { background-size: calc(var(--hs) * 16) var(--hs); background-position: calc(var(--hs) * -4) 0; animation: heroTurn 4s steps(16) infinite; }
:is(.home, #roomDlg) .hero.turn :is(#animalSelected, .heroEm) { visibility: hidden; }
@keyframes heroTurn { from { background-position: 0 0; } to { background-position: calc(var(--hs) * -16) 0; } }
@media (prefers-reduced-motion: reduce) { :is(.home, #roomDlg) .hero.turn { animation: none; } }
:is(.home, #roomDlg) .podium { width: calc(var(--hs) * .85); height: calc(var(--hs) * .15); margin-top: calc(var(--hs) * -.13); border-radius: 50%;
  background: radial-gradient(#fff, #d7e6f6 72%); box-shadow: 0 6px 0 #a9c3e0; }
.home .namePick { width: min(300px, 100%); }
.home .nameField { position: relative; display: flex; width: 100%; }
.home .nameField input { min-height: 42px; text-align: center; font-weight: 800; border: 0; border-radius: 12px; padding-inline: 2.6em; box-shadow: 0 3px 0 #b7cbe3; }
.home #nameDice { position: absolute; inset-block: 0; inset-inline-end: .3em; margin: auto 0; width: 2.1em; height: 2.1em; min-height: 0; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--ink-soft); display: grid; place-items: center; }
.home #nameDice svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* The way to play: one dark row that opens the mode cards (styled at the end of this file). */
.home .modes { width: 100%; border: 0; margin: 0; padding: 0; min-width: 0; }
.home .soonNote { margin: 6px 0 0; background: #142a4a; color: #fff; }
.home .err:empty { display: none; }
/* The bar: Store, Notifications, Play, Season, Week. */
.home .dock { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 6px 8px; border-radius: 24px;
  background: color-mix(in srgb, var(--navy) 94%, transparent); box-shadow: 0 10px 30px rgba(12, 34, 66, .35); }
.home .dock > button:not(.play) { flex: 1; min-width: 0; min-height: 0; padding: 4px 0; border: 0; background: none; color: #cfe1f7; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; position: relative; }
.home .dock > button:not(.play) > span { position: relative; display: grid; place-items: center; }
.home .dock svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.home .dock b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .dock .play { flex: none; width: auto; min-width: 34%; margin: -26px 4px 0; padding: 10px 18px; border: 0; border-radius: 20px; font-size: 1.7rem; font-weight: 900;
  letter-spacing: .03em; text-transform: uppercase; color: #fff; background: linear-gradient(#5ea0ff, #2F78D0); box-shadow: 0 6px 0 #1d4f91, 0 12px 24px rgba(12, 34, 66, .3);
  text-shadow: 0 2px 0 rgba(12, 34, 66, .3); }
.home .dock .play.long { font-size: 1rem; text-transform: none; }
.home .dock .play:active { transform: translateY(4px); box-shadow: 0 2px 0 #1d4f91; }
.home .giftTag { position: absolute; top: -8px; inset-inline-end: -10px; font-size: .8rem; font-style: normal; }
/* A phone on its side: the same column, smaller, so it all fits in 360–430 px of height. */
@media (max-height: 500px) and (min-width: 500px) {
  #form.home { --hs: clamp(90px, 31vh, 150px); max-width: 440px; gap: 6px; }
  .home .hStage { min-height: 0; }
  .home .nameField input { min-height: 34px; }
  .home .dock { padding: 4px 8px; }
  .home .dock .play { margin-top: -20px; padding: 6px 16px; font-size: 1.4rem; }
}
/* Wider than a phone held upright (a phone on its side, a small tablet, a short computer window): the level pill and
   the buttons sit in the screen's corners, not at the edges of the narrow column (the owner's ask, 11 Nov 2026).
   Big screens move them further in, below. */
@media (min-width: 520px) {
  #form.home { padding-top: 52px; }
  .home .hTop { position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right)); width: auto; z-index: 3; }
  /* The level pill grows with the screen: about a quarter of its width (the owner's ask, 11 Nov 2026), its bar filling it. */
  .home .prog { width: var(--progW); }
  .home .prog .bar { width: auto; }
}
/* Keep the close button above the scroller, inside the visible area even with landscape cutouts. */
:is(.menuDlg, #roomDlg) {
  --dialog-top: max(12px, env(safe-area-inset-top, 0px));
  --dialog-right: max(12px, env(safe-area-inset-right, 0px));
  --dialog-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  --dialog-left: max(12px, env(safe-area-inset-left, 0px));
  position: fixed;
  inset: var(--dialog-top) var(--dialog-right) var(--dialog-bottom) var(--dialog-left);
  width: calc(100% - var(--dialog-left) - var(--dialog-right));
  max-height: calc(100% - var(--dialog-top) - var(--dialog-bottom));
  max-height: calc(100dvh - var(--dialog-top) - var(--dialog-bottom));
  padding: 0;
  overflow: hidden;
}
:is(.menuDlg, #roomDlg)[open] { display: flex; flex-direction: column; }
:is(.menuDlg, #roomDlg) .head { flex: none; margin: 0; padding: 16px 18px 8px; }
:is(.menuDlg, #roomDlg) .head button { flex: none; }
:is(.menuDlg, #roomDlg) .head h2 { min-width: 0; overflow-wrap: anywhere; }
:is(.menuDlg, #roomDlg) > .body { min-height: 0; padding: 8px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
/* The two sections stack until the panel itself has room for both. */
.menuDlg { max-width: 760px; }
.menuDlg .mCols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); align-content: start; gap: 4px 16px; }
.menuDlg h3 { margin: 10px 2px 6px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
:is(.menuDlg, #roomDlg) .mList { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--field); }
:is(.menuDlg, #roomDlg) .mList > button, :is(.menuDlg, #roomDlg) .mRow { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; min-height: 48px; margin: 0; padding: 6px 12px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); text-align: start; font-size: .95rem; font-weight: 700; }
:is(.menuDlg, #roomDlg) .mList > :is(button, .mRow) > b { flex: 1 1 7em; min-width: 0; overflow-wrap: anywhere; }
:is(.menuDlg, #roomDlg) .mList > :first-child { border-top: 0; }
:is(.menuDlg, #roomDlg) .mList > [hidden], :is(.menuDlg, #roomDlg) .mList > .flagOff { display: none; }
:is(.menuDlg, #roomDlg) .ic, .menuDlg #pushBtn > span, .menuDlg #installBtn > span { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--field)); color: var(--accent); }
.menuDlg svg, #roomDlg .mList svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.menuDlg .chev { margin-inline-start: auto; font-style: normal; color: var(--ink-soft); font-size: 1.2rem; }
html[dir=rtl] .menuDlg .chev { transform: scaleX(-1); }
:is(.menuDlg, #roomDlg) .mEnd { margin-inline-start: auto; min-height: 0; padding: 4px 10px; border-radius: 999px; font-size: .88rem; }
:is(.menuDlg, #roomDlg) .mEnd::after { content: ''; position: absolute; inset: 0; }   /* the whole row presses it */
/* A row's ? (Keep walking): above the row's press area, and its note under the row. */
:is(.menuDlg, #roomDlg) .mHelp { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; min-width: 0; min-height: 0; padding: 0;
  order: 1; margin-inline-start: auto; flex: none; border-radius: 50%; border: 1.5px solid currentColor; background: none; box-shadow: none; color: var(--ink-soft);
  font-size: .72rem; font-weight: 900; line-height: 1; }
/* The help button follows the switch and has a larger tap area than the circle. */
:is(.menuDlg, #roomDlg) .mHelp::before { content: ''; position: absolute; inset: -10px; }
:is(.menuDlg, #roomDlg) .mHelp[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
:is(.menuDlg, #roomDlg) .mNote { margin: 0 12px 10px; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--field)); color: var(--ink-soft); font-size: .76rem; font-weight: 600; line-height: 1.35; }
/* Keep walking as an On/Off switch (the owner's ask, 25 Nov 2026): the real checkbox stays for screen readers and keys, drawn
   by the .sw beside it; the whole row presses it. */
:is(.menuDlg, #roomDlg) .swBox { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; pointer-events: none; }
:is(.menuDlg, #roomDlg) .swBox:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
:is(.menuDlg, #roomDlg) .mRow .sw.mEnd { flex: none; white-space: nowrap; padding: 4px 12px 4px 4px; font-size: .8rem; font-weight: 800; min-width: 58px; justify-content: space-between; }
:is(.menuDlg, #roomDlg) .mRow.on .sw.mEnd { padding: 4px 4px 4px 12px; }
:is(.menuDlg, #roomDlg) .mRow .sw.mEnd::before { width: 18px; height: 18px; flex: none; }
:is(.menuDlg, #roomDlg) .mRow .sw.mEnd::after { position: absolute; inset: 0; }
/* The joystick's side: two buttons, Left and Right, on their own line under the row's name, each with a small phone showing
   where the stick sits. Left stays on the left in Arabic too, since it names the screen's side. */
:is(.menuDlg, #roomDlg) .sideSeg { order: 2; flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); direction: ltr; padding: 3px; gap: 3px; border-radius: 12px; background: var(--line); }
:is(.menuDlg, #roomDlg) .sideSeg label { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 4px 8px; border-radius: 9px;
  font-size: .85rem; font-weight: 800; color: var(--ink-soft); cursor: pointer; }
:is(.menuDlg, #roomDlg) .sideSeg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
:is(.menuDlg, #roomDlg) .sideSeg label:has(input:checked) { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
:is(.menuDlg, #roomDlg) .sideSeg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@supports not selector(:has(*)) {
  /* Older Android WebViews can still show which side is selected. */
  :is(.menuDlg, #roomDlg) .sideSeg input { position: static; opacity: 1; width: 1em; height: 1em; min-height: 0; padding: 0; accent-color: var(--accent); }
  :is(.menuDlg, #roomDlg) .sideSeg .segPic { display: none; }
}
:is(.menuDlg, #roomDlg) .sideSeg .segPic { width: 28px; height: 18px; stroke-width: 1.8; }
:is(.menuDlg, #roomDlg) .sideSeg .segPic .dot { fill: currentColor; stroke: none; }
.menuDlg #pushBtn .sw, .menuDlg #menuPush .sw { margin-inline-start: auto; }
.menuDlg .mine { margin: 10px 0 0; }
/* The game's version (js/version.js) across from the menu's title, next to ✕. */
/* The auto margin is on the title: the label is dir=ltr, so its own start/end would flip in Arabic. */
.menuDlg #menuTitle { margin-inline-end: auto; }
.menuDlg #buildTag { min-width: 0; max-width: 55%; padding: 4px 10px; border-radius: 999px; background: var(--line);
  font-size: .8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.menuDlg #buildTag:empty { display: none; }
.menuDlg .social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.menuDlg .social a { padding: 8px; border-radius: 50%; }
.menuDlg .social b, .menuDlg .social small { display: none; }
.home .offline { display: none !important; }   /* picked in the list; Play presses them */
@media (max-width: 420px) {
  .home .dock .play { min-width: 0; padding: 10px 14px; font-size: 1.3rem; }
  .home .dock > button:not(.play) { font-size: .62rem; }
}
/* The bell and the gift sit beside ☰ (the owner's ask, 8 Nov 2026): a red dot pulses on the bell while notifications are off,
   and the gift wiggles now and then to invite friends. Both stay still with reduced motion. */
.home .hTop .hIco + .hIco { margin-inline-start: -2px; }
.home #pushBtn > span { display: grid; place-items: center; }
.home #headSound .mute, .home #headSound[aria-pressed="false"] .wave { display: none; }
.home #headSound[aria-pressed="false"] .mute { display: inline; }
.home #headSound[aria-pressed="false"] { color: var(--ink-soft); }
.home #pushBtn b, .home #pushBtn .sw { display: none; }
.home #pushBtn:not(.on) { color: var(--ink-soft); }
.home #pushBtn:not(.on)::after { content: ''; position: absolute; top: -3px; inset-inline-end: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: #e8344e; border: 2px solid #fff; animation: bellDot 1.6s ease-out infinite; }
@keyframes bellDot { 0% { box-shadow: 0 0 0 0 rgba(232, 52, 78, .55); } 70% { box-shadow: 0 0 0 9px rgba(232, 52, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 52, 78, 0); } }
.home #pushBtn:not(.on) svg { animation: bellRing 4s ease-in-out 1s infinite; transform-origin: 50% 10%; }
@keyframes bellRing { 0%, 84%, 100% { transform: rotate(0); } 87% { transform: rotate(14deg); } 90% { transform: rotate(-12deg); } 93% { transform: rotate(8deg); } 96% { transform: rotate(-5deg); } }
.home .gift .giftIc { font-size: 24px; line-height: 1; display: block; animation: giftWiggle 3.2s ease-in-out infinite; }
@keyframes giftWiggle { 0%, 70%, 100% { transform: none; } 75% { transform: translateY(-4px) rotate(-10deg); } 80% { transform: translateY(-4px) rotate(10deg); }
  85% { transform: translateY(-2px) rotate(-6deg); } 90% { transform: none; } }
.home .gift .giftTag { display: none; }
@media (prefers-reduced-motion: reduce) { .home #pushBtn:not(.on)::after, .home #pushBtn svg, .home .gift .giftIc { animation: none; } }
/* The header bell is only for turning notifications on (the owner's ask, 19 Nov 2026): hidden until we know, and gone once they are on;
   what arrived is read from the bell in the bottom bar (js/inbox.js). */
.home #pushBtn:not(.ready), .home #pushBtn.on { display: none; }
/* The bottom bar's notifications button: a red count that pulses and a bell that shakes now and then while something is unread. */
.home .dock .inboxBadge { position: absolute; top: -7px; inset-inline-end: -11px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px;
  background: #e8344e; border: 2px solid var(--navy); color: #fff; font-style: normal; font-size: .68rem; font-weight: 900; line-height: 14px; text-align: center; animation: bellDot 1.6s ease-out infinite; }
.home .dock .inboxBadge[hidden] { display: none; }
.home .dock #inboxBtn.unread svg { animation: bellRing 4s ease-in-out .5s infinite; transform-origin: 50% 10%; }
@media (prefers-reduced-motion: reduce) { .home .dock .inboxBadge, .home .dock #inboxBtn.unread svg { animation: none; } }
/* The notification list pop-up: one card per message, a blue edge on the ones not read yet. */
.inboxList { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: min(60vh, 420px); overflow-y: auto; }
.inboxList li { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border-inline-start: 4px solid transparent; line-height: 1.4; overflow-wrap: anywhere; }
.inboxList li.new { border-inline-start-color: #4aa3ff; background: rgba(74, 163, 255, .16); }
.inboxList li.warn { border-inline-start-color: #ffb020; }
.inboxList small { opacity: .7; font-size: .75rem; }
.inboxList a { justify-self: start; color: #8cc8ff; font-weight: 800; }
#inboxDlg .hint { margin: 6px 0 0; text-align: center; }
/* Feedback round 3 (the owner, 8 Nov 2026): notices drop below the top bar on the start screen instead of covering the bar,
   the level pill keeps dark words in dark mode too, smaller top icons, and the bar shows icons only (their names are hints). */
body:has(#menu:not([hidden])) #notices { top: calc(max(10px, env(safe-area-inset-top)) + 62px); bottom: auto; left: 0; right: 0; margin-inline: auto; }
.home .prog { color: #fff; }
.home .prog circle { stroke: #0d1d40; }
.home .prog #progFill { stroke: #ffc93c; }
.home .prog #progPet { border-radius: 50%; background: radial-gradient(circle closest-side, #e6effa 0 80%, transparent 81%); }   /* a dark animal stays visible on the night blue */
.home .prog #progLv { font-size: .62rem; padding: 0 6px; bottom: -5px; border-color: #142a55; background: #ffc93c; color: #5a3500; font-weight: 900; }
/* "مستوى 10" is wider than the ring: it ran past the pill and off the screen's edge (the owner, 16 Nov 2026).
   In Arabic the pill gets room on the ring's side for it. */
html[dir=rtl] .home .prog { padding-right: 14px; }
.home .prog .bar { background: #0d1d40; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); }
.home .prog .bar i { background: linear-gradient(90deg, #ffb020, #ffd25a 70%, #fff1b8); }
.home .hIco { width: 40px; height: 40px; border-radius: 12px; }
.home .hIco svg { width: 20px; height: 20px; }
.home .gift .giftIc { font-size: 20px; }
.home #pushBtn:not(.on)::after { width: 11px; height: 11px; }
.home .prog .ring { width: 40px; height: 40px; }
.home .dock > button:not(.play) { padding: 8px 0; }
/* Mini animations (the owner's ask, 8 Nov 2026): the gift only bobs a little, the bell's red dot is smaller with a soft
   short pulse, and the bell tilts gently. */
.home .gift .giftIc { animation: giftMini 3.6s ease-in-out infinite; }
@keyframes giftMini { 0%, 80%, 100% { transform: none; } 85% { transform: translateY(-2px) rotate(-5deg); } 90% { transform: translateY(-2px) rotate(5deg); } 95% { transform: none; } }
.home #pushBtn:not(.on)::after { top: -2px; inset-inline-end: -2px; width: 9px; height: 9px; border-width: 1.5px; animation: none; }
/* The dot's pulse is a ring of its own behind it that grows and fades: transform and opacity only, so the graphics chip runs it
   and the start screen is not repainted every frame for it (the weak-phone check, 19 Nov 2026; it was a growing box-shadow). */
.home #pushBtn:not(.on)::before { content: ''; position: absolute; top: -2px; inset-inline-end: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(232, 52, 78, .45); pointer-events: none; animation: dotRing 2.4s ease-out infinite; }
@keyframes dotRing { 0% { transform: scale(1); opacity: 1; } 60%, 100% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .home #pushBtn:not(.on)::before { animation: none; opacity: 0; } }
.home #pushBtn:not(.on) svg { animation: bellMini 5s ease-in-out 1s infinite; }
@keyframes bellMini { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(7deg); } 94% { transform: rotate(-6deg); } 97% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .home #pushBtn:not(.on)::after, .home #pushBtn svg, .home .gift .giftIc { animation: none; } }
/* Wide screens: computers and tablets (option A, the owner's pick, 8 Nov 2026). The top bar goes to the corners and
   everything grows by about a quarter; the character stays at most 340 px, since its 3D frames are 160 px. */
@media (min-width: 760px) and (min-height: 560px) {
#form.home { --hs: clamp(220px, 40vh, 340px); max-width: none; gap: 14px; padding-top: 70px; }
.home .hTop { position: fixed; top: max(18px, env(safe-area-inset-top)); left: 28px; right: 28px; width: auto; z-index: 3; }
.home .hIco { width: 54px; height: 54px; border-radius: 16px; } .home .hIco svg { width: 26px; height: 26px; } .home .gift .giftIc { font-size: 27px; }
.home .prog { padding: 6px 22px 6px 6px; } html[dir=rtl] .home .prog { padding: 6px 6px 6px 22px; }
.home .prog .ring { width: 56px; height: 56px; } .home .prog #progPet { font-size: 26px; } .home .prog .txt b { font-size: 1.15rem; }
.home .hArrow { width: 58px; height: 58px; font-size: 2rem; }
.home .namePick { width: 380px; } .home .nameField input { min-height: 50px; font-size: 1.15rem; }
.home .modes, .home .dock { width: min(620px, 100%); }
.home .dock { padding: 10px 16px; border-radius: 30px; } .home .dock svg { width: 32px; height: 32px; }
.home .dock .play { font-size: 2.2rem; padding: 14px 34px; margin-top: -34px; }
}
@media (min-width: 760px) and (min-height: 560px) { body:has(#menu:not([hidden])) #notices { top: calc(max(18px, env(safe-area-inset-top)) + 70px); } }
/* PLAY rises above the bar; the bar keeps that much room so PLAY no longer covers the way-to-play box (the owner's report, 9 Nov 2026). */
.home .dock { margin-top: 14px; }
/* The Private room label (Join a room) is short now (the owner's ask, 9 Nov 2026): one line, a little smaller than PLAY NOW. */
.home .dock .play.long { font-size: 1.15rem; white-space: nowrap; padding-inline: 16px; }
/* The start screen shows no game messages (the owner's report, 9 Nov 2026): a toast, the feed, a round notice or a first-game
   hint left over from the game, or sent by the room while you leave, used to float over the bar. The level-up banner, the
   notices (moved under the top bar) and the admin's debug panel still show. Buttons there don't select as text when tapped. */
body:has(#menu:not([hidden])) :is(#flash, #joinTip, #callout, #coach, #coachJoy, #coachHand, #wait, #pingTag) { display: none !important; }
.home button { -webkit-user-select: none; user-select: none; }

/* Coins, phase 1 (the owner's picks, 12 Nov 2026; js/coins.js). The gold snowflake coin (#coin in index.html). */
.coinIc { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }
.coinIc.big { width: 44px; height: 44px; }
/* The level card (A): the coin beside the title, the bar below; on an upright phone it takes the bar's place (the ring
   round the animal still shows the level's progress). */
.coinTag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 3px; border-radius: 999px; background: #fff6d6; color: #0d2245; font-weight: 800; white-space: nowrap; }
html[dir=rtl] .coinTag { padding: 1px 3px 1px 8px; }
.coinTag[hidden] { display: none; }
.prog .txt { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.prog .txt > .top { grid-column: 1; } .prog .txt > .coinTag { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
.prog .txt > .bar, .prog .txt > .nums { grid-column: 1 / -1; }
.prog .coinIc { position: static; width: 1.25em; height: 1.25em; }
.home .prog .txt b.coinTag { font-size: .85rem; overflow: visible; padding-block: 2px; padding-inline: 4px 11px; background: var(--nightGold); color: #ffd25a; box-shadow: inset 0 0 0 1px var(--nightGoldEdge); }   /* more room around the coins (the owner's ask, 16 Nov 2026) */
@media (max-width: 519px) {
  .home .prog .txt > .coinTag:not([hidden]) { grid-column: 1; grid-row: 2; justify-self: start; }
  .home .prog .txt:has(> .coinTag:not([hidden])) > .bar { display: none; }
}
/* The results card in the style of the "Great game!" pop-up (the owner's ask, 24 Nov 2026): your points, XP and coins as
   big solid tiles (XP and coins count up, js/count-up.js) in the shared night colours (:root, --night*). The card, the
   award tiles and the buttons are styled where they are first set, above. */
.resMe .pills { display: flex; flex-basis: 100%; gap: 10px; margin: 0; }
.resMe .pill { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 4px; border-radius: 14px; white-space: nowrap;
  font-size: 1.12em; font-weight: 900; background: var(--nightDeep); box-shadow: inset 0 0 0 1px var(--nightLine); color: #fff; }
.resMe .pill.xp { color: #7ee2a8; flex-grow: 1.4; white-space: normal; line-height: 1.1; text-align: center; }   /* "+105 XP" is the longest; in Arabic it may take two lines */
.resMe .pill.coin { background: var(--nightGold); box-shadow: inset 0 0 0 1px var(--nightGoldEdge); color: #ffd25a; direction: ltr; unicode-bidi: isolate; }   /* +7 reads the same in Arabic */
.resMe .pill .coinIc { width: 1.1em; height: 1.1em; }
/* Short upright phones and phones on their side keep their tighter room, so the buttons always fit. */
@media (max-width: 520px) and (max-height: 700px) {
  #results { padding: 12px 14px; gap: 7px; } .resMe { padding: 8px 10px; row-gap: 8px; } .resMe .pill { padding: 6px 4px; font-size: 1em; } .resAw li { padding: 3px 2px; }
}
@media (max-height: 520px) { #results { padding: 12px 18px; row-gap: 6px; } .resMe { padding: 6px 10px; row-gap: 6px; } .resMe .pill { padding: 4px; font-size: .95em; } .resAw li { padding: 4px 2px; } }
/* The store (S3): a gold bar with your coins above the tabs, and how to earn more. */
.coinBar { display: flex; align-items: center; gap: 12px; margin: 10px 14px 0; padding: 8px 16px; border-radius: 16px; background: linear-gradient(90deg, #fff3c4, #ffe08a); color: #0d2245; flex-shrink: 0; }
.coinBar small { display: block; font-weight: 700; font-size: .8rem; color: #8a5a00; }
.coinBar b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.store > .coinBar { cursor: pointer; }   /* the whole gold bar opens how to earn (the owner's ask, 18 Nov 2026) */
.coinBar .link { margin-inline-start: auto; background: none; border: 0; padding: 6px; color: #2f78d0; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
/* The welcome (W1): a pile of five coins on the gift pop-up's snowy top; how to earn: a short list. */
.coinPile { position: relative; display: block; width: 116px; height: 82px; }
.coinPile svg { position: absolute; height: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .15)); }
/* The penguin (3D, turning) stands behind the pile; without 3D only the coins show. */
.coinHero { display: flex; align-items: flex-end; }
.coinPeng { --s: 104px; width: var(--s); height: var(--s); margin-inline-end: -30px; position: relative; z-index: 0;
  background: no-repeat calc(var(--s) * -4) 0 / calc(var(--s) * 16) var(--s); filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .3)); animation: storeTurn 3.2s steps(16) infinite; }
.coinPeng[hidden] { display: none; }
.coinPeng + .coinPile { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .coinPeng { animation: none; } }
@media (max-height: 500px) { .coinHero { flex-direction: column; align-items: center; } .coinPeng { --s: 72px; margin: 0 0 -26px; } .coinHero .coinPile { transform: scale(.8); } }
/* How to earn: a coloured card per way, a big icon, a title, one short line and a gold amount. */
.coinsHow { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 10px; }
.coinsHow li { --c: #2f78d0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 12%, var(--panel)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); }
.night .coinsHow li { background: color-mix(in srgb, var(--c) 28%, rgba(255, 255, 255, .06)); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.night .coinsHow b { color: color-mix(in srgb, var(--c) 45%, #fff); }
.night .coinsNote { color: #c9d6e6; }
.coinsHow li.hGame { --c: #1f9d6a; }
.coinsHow li.hFriend { --c: #d4407a; }
.coinsHow li.hDaily { --c: #e07a00; }
.coinsHow i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c); font-style: normal; font-size: 1.6rem;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); }
.coinsHow b { display: block; font-size: 1.05rem; font-weight: 900; color: var(--c); }
.coinsHow small { display: block; font-size: .82rem; color: var(--ink-soft); }
.night .coinsHow small { color: #d6e2f2; }
.coinsHow em { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-style: normal; font-weight: 900; font-size: 1.05rem;
  white-space: nowrap; color: #6b4300; background: linear-gradient(180deg, #ffe58a, #ffc93c); box-shadow: 0 2px 0 #d99a00; direction: ltr; }
.coinsHow em .coinIc { width: 20px; height: 20px; }
/* Your balance in the Collection's header: a gold pill before ✕. */
.colCoins { border: 0; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; padding: 5px 12px; border-radius: 999px; font-weight: 900; font-size: 1.05rem;
  color: #6b4300; background: linear-gradient(180deg, #ffe58a, #ffc93c); box-shadow: 0 2px 0 #d99a00; }
.colCoins[hidden] { display: none; }
.colCoins .coinIc { width: 22px; height: 22px; }
.coinsNote { display: flex; gap: 6px; align-items: center; }
#coinsLater { margin-bottom: 18px; }   /* room under the last button, as the gift's rules line gives */
/* Phone on its side: ✕ in the pop-up's corner, not inside the coins column (the night style makes every child
   position: relative), and the two buttons side by side so the pop-up fits the short screen. */
@media (max-height: 500px) {
  #coinsDlg { grid-template-columns: 120px 1fr 1fr; padding: 18px; }   /* the same room on every side */
  #coinsDlg .giftTop { position: static; grid-row: 1 / span 3; padding: 0; }
  #coinsDlg h2, #coinsDlg p { grid-column: 2 / -1; margin-inline: 8px 56px; }
  #coinsDlg h2 { margin-top: 4px; }
  #coinsDlg .wide { grid-column: auto; width: auto; margin: 10px 0 0; margin-inline-start: 8px; }
}
/* The night style for pop-ups (the owner's rule, 13 Nov 2026): a dark night sky with snow falling in two layers, light
   text, and buttons that read on the dark. Used by the coin pop-ups, the streak and the gift; add class "night". */
.pop.night { position: fixed; inset: 0; margin: auto; overflow: hidden auto; color: #fff; background: linear-gradient(180deg, #0b1a3a, #142a55 60%, #1d3a6e); border-color: rgba(255, 255, 255, .18); }
:is(.pop, .sheet).night::before, :is(.pop, .sheet).night::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, #fff 0 2px, transparent 2.5px), radial-gradient(circle, rgba(255, 255, 255, .8) 0 1.5px, transparent 2px);
  background-size: 90px 100px, 60px 70px; background-position: 10px 0, 40px 30px; animation: nightSnow 6s linear infinite; opacity: .8; }
/* The snow falls by moving the pattern, not the layer, by one tile per loop (each keyframe's end is the start plus the
   tile's height; change them together): a moved layer once reached past the
   pop-up's bottom, so night pop-ups could not scroll and a short screen cut them off (18 Nov 2026). */
:is(.pop, .sheet).night::after { background-size: 130px 140px, 75px 90px; background-position: 60px 20px, 5px 50px; animation-name: nightSnowFar; animation-duration: 9s; opacity: .45; }
@keyframes nightSnow { to { background-position: 10px 100px, 40px 100px; } }
@keyframes nightSnowFar { to { background-position: 60px 160px, 5px 140px; } }
.pop.night > * { position: relative; z-index: 1; }
.pop.night h2, .pop.night .head h2 { color: #fff; }
.pop.night p, .pop.night .hint, .pop.night small { color: #c9d6e6; }
.pop.night .head { border-color: rgba(255, 255, 255, .15); background: none; }
.pop.night .popClose { position: absolute; top: 16px; inset-inline-end: 16px; z-index: 2; background: #2a4271; border-color: #4a6596; color: #fff; }   /* solid: the snow never shows through */
.pop.night .head .popClose { position: static; }
.pop.night .gift .giftTop, .pop.night.gift .giftTop { background: none; }
.pop.night button.wide:not(.primary), .pop.night .buyLater { background: #2a4271; border: 1px solid #4a6596; color: #fff; }
.pop.night .giftProgress b { color: #ffd25a; }
@media (prefers-reduced-motion: reduce) { :is(.pop, .sheet).night::before, :is(.pop, .sheet).night::after { animation: none; } }
/* The big pop-ups (the store and the Collection, the owner's ask, 13 Nov 2026): the same night sky and snow, with the
   dark colours, so everything inside (tabs, cards, lists) follows; the snow falls behind the content. */
dialog.sheet.night { --panel: rgba(255, 255, 255, .06); --ink: #fff; --ink-soft: #c9d6e6; --line: rgba(255, 255, 255, .18); --field: rgba(255, 255, 255, .08);
  --accent: #ffc93c; --on-accent: #4a2a00; background: linear-gradient(180deg, #0b1a3a, #142a55 60%, #1d3a6e); color: #fff; border-color: rgba(255, 255, 255, .18); }
dialog.sheet.night { overflow: clip; }   /* the sheet scrolls inside its body */
.sheet.night > * { position: relative; z-index: 1; }
.sheet.night h3 { color: #ffd25a; }
.sheet.night .close { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
.sheet.night .saveTip { background: rgba(255, 255, 255, .1); color: #fff; }
.sheet.night .storeGrid li { background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 22%, rgba(255, 255, 255, .06)), rgba(255, 255, 255, .05) 60%);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--tint) 35%, rgba(0, 0, 0, .4)), 0 8px 18px rgba(0, 0, 0, .3); }
.sheet.night .storeGrid li > em { color: #7ee2a8; }
.sheet.night .storeGrid button.soonBtn { color: #d8c2ff; }
.sheet.night .storeGrid .buyBtn.need { background: rgba(255, 255, 255, .12); color: #c9d6e6; }

/* Coins phase 2, the daily streak (D1, 13 Nov 2026): a row of 7 days, the 3D penguin walking to today's tile, a gold
   Claim button that glows (the night sky is .night above). */
.streakDlg { width: min(420px, calc(100vw - 24px)); padding: 18px 16px 14px; text-align: center; }
.streakDlg h2 { margin: 4px 0 2px; font-size: 1.4rem; }
.streakDay { margin: 0; color: #ffd25a; font-weight: 800; }
.streakStage { position: relative; padding-top: 70px; }
/* The penguin's whole sheet at 96 px frames (js/sprite-files.js), shown at 64 px. */
.streakPeng { position: absolute; z-index: 2; width: 64px; height: 64px; margin: -60px 0 0 -32px; pointer-events: none;
  background: no-repeat 0 0 / 1024px 1600px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .35)); }
.streakPeng[hidden] { display: none; }
.streakRow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr) 1.5fr; gap: 5px; direction: ltr; }
.streakRow li { border-radius: 12px; background: rgba(255, 255, 255, .1); padding: 6px 0; font-weight: 900; font-size: .85rem; border: 2px solid transparent; }
.streakRow small { display: block; font-size: .62rem; color: #b8c8e0; font-weight: 700; white-space: nowrap; }
.streakRow i { display: block; height: 1.4em; font-style: normal; font-size: 1.1rem; line-height: 1.4; }
.streakRow i .coinIc { width: 18px; height: 18px; }
.streakRow .done { background: rgba(31, 157, 106, .35); color: #8ff0c2; }
.streakRow .today { background: rgba(255, 201, 60, .25); border-color: #ffc93c; box-shadow: 0 0 0 4px rgba(255, 201, 60, .3); }
.streakRow .big { background: linear-gradient(180deg, #ffe58a, #ffc93c); color: #6b4300; font-size: 1rem; }
.streakRow .big small { color: #8a5a00; }
.streakRow.got .done:last-of-type, .streakRow.got li.done { animation: streakGot .5s ease-out; }
@keyframes streakGot { 50% { transform: scale(1.15); } }
.streakClaim { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 16px 0 6px; padding: 14px;
  border-radius: 999px; border: 2px solid #fff3c4; background: linear-gradient(180deg, #ffe58a, #ffc93c 55%, #f5a800); color: #5a3500; font: inherit; font-weight: 900; font-size: 1.25rem;
  box-shadow: 0 5px 0 #b97a00, 0 0 24px rgba(255, 201, 60, .55); cursor: pointer; animation: streakPulse 1.6s ease-in-out infinite; }
.streakClaim[hidden] { display: none; }
.streakClaim:disabled { opacity: .7; animation: none; }
.streakClaim::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent); animation: streakShine 2.4s ease-in-out infinite; }
.streakClaim .coinIc { width: 28px; height: 28px; }
@keyframes streakPulse { 50% { transform: scale(1.04); box-shadow: 0 5px 0 #b97a00, 0 0 36px rgba(255, 201, 60, .8); } }
@keyframes streakShine { 0%, 40% { left: -60%; } 100% { left: 130%; } }
.streakNext { margin: 6px 0 2px; color: #c9d6e6; font-weight: 600; }
.streakDot { position: absolute; top: -10px; inset-inline-end: -14px; font-style: normal; font-size: 1rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); animation: streakDotPop 1.6s ease-in-out infinite; }
@keyframes streakDotPop { 50% { transform: scale(1.2); } }
.streakDot[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .streakClaim, .streakClaim::after, .streakDot { animation: none; } }
@media (max-height: 500px) { .streakDlg { padding-top: 10px; } .streakStage { padding-top: 58px; } .streakClaim { margin-top: 10px; padding: 10px; } }
/* Coins phase 3, buying looks (B3, 13 Nov 2026): a gold price button on the card (grey with how many more you need), the
   "Buy …?" check with your character wearing it, and the save-code tip in the store. */
.storeGrid .buyBtn { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 2px solid #fff3c4;
  background: linear-gradient(180deg, #ffe58a, #ffc93c 55%, #f5a800); color: #5a3500; font-weight: 900; box-shadow: 0 4px 0 #b97a00; white-space: nowrap; }
.storeGrid .buyBtn .coinIc { width: 20px; height: 20px; }
.storeGrid .buyBtn.need { background: var(--line); border-color: transparent; color: var(--ink-soft); box-shadow: none; font-weight: 800; white-space: normal; font-size: .85rem; }
.storeGrid .buyBtn.need .coinIc { filter: grayscale(1); opacity: .6; }
.buyDlg { width: min(360px, calc(100vw - 24px)); padding: 18px; text-align: center; }
.buyDlg .popClose { position: absolute; top: 12px; inset-inline-end: 12px; }
.buyArt { display: grid; place-items: center; }
.buyArt .storeArt { position: relative; width: 170px; height: 170px; border-radius: 22px; }
.buyDlg h2 { margin: 10px 0 2px; }
.buyCoins { margin: 0 0 6px; font-weight: 700; direction: ltr; unicode-bidi: plaintext; }
.buyErr { margin: 4px 0; color: #c62828; font-weight: 700; }
.night .buyErr { color: #ff9b9b; }
.buyDlg .buyGo { animation: none; }
.buyDlg .buyLater { width: 100%; margin-top: 8px; }
/* The weekly gift pop-up (13 Nov 2026), laid out like the Collection: a header row (icon, title, close) over a line, then
   the look. */
#weeklyDlg .head, #visitDlg .head { margin: -4px -2px 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
#weeklyDlg .head h2, #visitDlg .head h2 { flex: 1; margin: 0; text-align: start; font-size: 1.35rem; }
.weeklyIc { font-size: 1.8rem; line-height: 1; }
/* "Your visit" after an open-field game (13 Nov 2026; simpler, 24 Nov 2026): the night sky like the other coin pop-ups,
   the XP and the coins as two big tiles, the reasons as plain lines under them (the XP tile is the total), the level bar
   and the next reward. Every box is solid, so the falling snow never crosses the words. */
#visitDlg { padding: 32px; --ink: #fff; --ink-soft: #c9d6e6; --line: rgba(255, 255, 255, .18); --field: var(--nightTile); --edge: var(--nightEdge); --goldBg: var(--nightGold); --goldEdge: var(--nightGoldEdge); width: min(420px, calc(100vw - 24px)); }
#visitDlg .head { border-bottom: 0; padding-bottom: 0; margin: 0 0 24px; }
.visitHero { display: flex; gap: 14px; margin: 0 0 26px; }
.visitTile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 18px 10px; border-radius: 18px;
  background: var(--field); border: 1px solid var(--edge); text-align: center; }
.visitTile[hidden] { display: none; }
.visitTile b { display: flex; align-items: center; gap: 6px; font-size: 2rem; line-height: 1.1; font-weight: 900; }
.visitTile span { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.visitTile b { direction: ltr; unicode-bidi: isolate; }   /* +105 reads the same in Arabic */
.visitTile.xp b { color: #7ee2a8; }
.visitTile.coin { background: var(--goldBg); border-color: var(--goldEdge); }
.visitTile.coin b { color: #ffd25a; }
.visitTile.coin span { color: #ffe39a; }
.visitTile .coinIc { width: 30px; height: 30px; }
/* Simpler still (the owner's ask, 24 Nov 2026: "still too busy"): no box, no reasons, no next reward; only the level bar,
   and the level-up card when the visit opened a level. */
#visitDlg .xpBox { gap: 10px; margin: 4px 0 28px; padding: 0; background: none; border: 0; }
#visitDlg .xpBox ul, #visitDlg .xpBox .reward:not(.up) { display: none; }
/* The level bar fills in when the pop-up opens: the new XP (gold) grows from empty past the old XP (blue), then a light
   sweeps along it (the owner's ask, 24 Nov 2026: "more animated"). */
#visitDlg .xpBox .bar { height: 16px; background: #0d1d40; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45); }
#visitDlg .xpBox .bar i { border-radius: 999px; }
#visitDlg .xpBox .bar i.plus { background: linear-gradient(90deg, #ffb020, #ffd25a 70%, #fff1b8); box-shadow: 0 0 10px rgba(255, 210, 90, .7);
  animation: visitFill 1.4s cubic-bezier(.2, .8, .2, 1) .35s both; overflow: hidden; }   /* 1.4s and .35s: COUNT_MS and COUNT_DELAY_MS in js/count-up.js, keep them in step */
#visitDlg .xpBox .bar i.plus::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .75) 50%, transparent 70%); background-size: 250% 100%;
  animation: visitShine 2.2s ease-in-out 1.6s infinite; }
#visitDlg .xpBox .bar i:not(.plus) { animation: visitFill .6s ease-out both; }
@keyframes visitFill { from { width: 0; } }
@keyframes visitShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.visitTile b { animation: visitPop .5s cubic-bezier(.3, 1.6, .5, 1) .2s both; }
@keyframes visitPop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #visitDlg .xpBox .bar i, #visitDlg .xpBox .bar i::after, .visitTile b { animation: none; } }
#visitDlg .xpBox .nums { font-size: .85rem; color: var(--ink-soft); }
#visitDlg .xpBox .nums span:first-child { color: #fff; }
#visitDlg .xpBox .reward.up { border: 2px solid #ffc93c; background: #3a3420; color: #fff; padding: 10px 12px; }
#visitDlg .xpBox .reward.up small { color: #ffe39a; }
.visitCoins { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; font-weight: 800; color: #fff3c4 !important;
  background: var(--goldBg); border: 1px solid var(--goldEdge); }
.visitCoins[hidden] { display: none; }
#visitDlg .streakClaim { margin: 0; padding: 12px; animation: none; }
#visitDlg .buyLater { width: 100%; margin-top: 8px; }
.coinsHint { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px auto 6px; padding: 6px 14px; width: fit-content; border-radius: 999px;
  background: linear-gradient(180deg, #fff3c4, #ffd25a); color: #5a3500; font-weight: 800; font-size: .9rem; box-shadow: 0 3px 0 #b97a00; }
.coinsHint[hidden] { display: none; }
.coinsHint .coinIc { width: 20px; height: 20px; }   /* gold Play again: stands out on the night sky */
/* The start screen's coins line: a gold bubble under the level card on every screen (the owner's ask, 20 Nov 2026), so it
   never pushes PLAY and the bar down; always one line, its size following the room it has, from how long the words are
   in each language (--hintEm, the bubble's width in em with its padding, measured 20 Nov 2026): the game messages' size
   at most, and as wide as the level card on wider screens (--progW); an upright phone has its own rule below. */
.home .coinsHint { --hintEm: 15.7; position: absolute; z-index: 3; top: calc(100% + 6px); inset-inline-start: 0; width: max-content; margin: 0;
  padding: 4px 10px; border-radius: 12px; white-space: nowrap; line-height: 1.25;
  font-size: min(var(--msg), calc(var(--progW) / var(--hintEm))); }
html[lang=ar] .home .coinsHint { --hintEm: 16.2; }
.home .coinsHint .coinIc { width: 1.4em; height: 1.4em; }
.home .coinsHint::before { content: ''; position: absolute; top: -5px; inset-inline-start: 60px; width: 12px; height: 12px; background: #fff3c4; transform: rotate(45deg); }
/* A phone held upright: the Beta tag moves under the buttons on the other side, and the bubble takes the rest of the row
   (--tagEm: the tag's width in em, measured 20 Nov 2026). The character starts below that row. */
@media (max-width: 519px) {
  .home .hTop { --tagEm: 5.2; }
  html[lang=ar] .home .hTop { --tagEm: 8.9; }
  .home .coinsHint { font-size: min(var(--msg), calc((100vw - 32px - var(--tagEm) * clamp(10px, 3vmin, 13px)) / var(--hintEm))); }
  .home .hTop:has(> .coinsHint:not([hidden])) { margin-bottom: 32px; }
  .home .hTop:has(> .coinsHint:not([hidden])) .betaTag { inset-inline-start: auto; inset-inline-end: 0; }
}
/* A phone on its side: the character's arrows sit by its feet while the bubble shows, so the bubble never covers them. */
@media (max-height: 500px) and (min-width: 520px) {
  #form.home:has(.coinsHint:not([hidden])) .hStage { align-items: flex-end; }
}
/* Every screen (the owner's ask, 20 Nov 2026: always fitted, no scrolling): the character takes the size each screen
   gives it (--hs above) but never more than the height left for it (a size container), so the bar stays at the bottom. */
@supports (container-type: size) {
  #form.home .hStage { flex: 1 1 0; width: 100%; min-height: 0; container-type: size; --hsMax: var(--hs); }
  #form.home .hStage #animalPick { --hs: clamp(48px, 88cqh, var(--hsMax)); }   /* cqh: the stage's own height */
}
.giftEnds { margin: 0 0 4px; color: #ffd25a !important; font-weight: 800; font-size: .92rem; }
@media (max-height: 500px) { #weeklyDlg { padding-block: 10px; } #weeklyDlg .head { margin-bottom: 6px; padding-bottom: 6px; } #weeklyDlg .head h2 { font-size: 1.15rem; }
  #weeklyDlg .buyArt .storeArt { width: 90px; height: 90px; } #weeklyDlg .streakClaim { margin-top: 6px; } }
.visitCoins .coinIc { width: 28px; height: 28px; }
.visitCoins span { flex: 1; text-align: start; }
.visitCoins b { color: #ffd25a; font-size: 1.3rem; }
@media (max-height: 500px) {   /* a phone on its side: everything fits without scrolling, the next-reward card goes */
  #visitDlg { padding: 20px 32px; width: min(520px, calc(100vw - 24px)); } #visitDlg .head { margin-bottom: 12px; padding-bottom: 6px; } #visitDlg .head h2 { font-size: 1.15rem; }
  .visitCoins { padding: 5px 12px; margin-bottom: 6px; } .visitCoins b { font-size: 1.1rem; }
  .visitHero { margin-bottom: 14px; } .visitTile { flex-direction: row; justify-content: center; gap: 8px; padding: 10px 12px; } .visitTile b { font-size: 1.4rem; } .visitTile span { white-space: nowrap; }
  .visitTile .coinIc { width: 22px; height: 22px; }
  #visitDlg .xpBox { gap: 6px; margin-bottom: 14px; }
  .visitBtns { display: flex; gap: 8px; } .visitBtns > * { flex: 1; margin: 0 !important; } .visitBtns > [hidden] { display: none; }
}
.saveTip { margin: 8px 14px 0; padding: 8px 12px; border-radius: 12px; background: #e8f3ff; color: #0d2245; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
/* The store on a phone on its side (17 Nov 2026): stacked, the coins, tabs and note left about 80px for the items, so
   none showed whole and the list was hard to scroll. Here the coins and the tabs become a column at the
   side (the right in Arabic) and the items get the full height beside them. Since 21 Nov 2026 (the owner's ask: the first row
   of items whole on every screen) every wide screen up to 800px high, tablets on their side and small laptops too. */
@media (max-height: 800px) and (min-width: 480px) and (min-aspect-ratio: 5/4) {
  dialog.sheet.store { max-height: calc(100dvh - 16px); width: min(900px, calc(100% - 24px)); }
  dialog.sheet.store[open] { display: grid; grid-template-columns: clamp(192px, 27%, 230px) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); }
  .store > header { grid-column: 1 / -1; grid-row: 1; padding-block: 6px; }
  /* Coins as one slim line above the tabs (the owner's pick C, 17 Nov 2026): the coin, "Your coins", the number and a small "?"
     that opens How to earn coins. The button keeps its words for screen readers and a 36px tap area around the small circle. */
  .store > .coinBar { grid-column: 1; grid-row: 2; gap: 6px; margin: 8px 10px 0; padding: 2px; padding-inline: 8px 2px; border-radius: 14px; }
  .store > .coinBar .coinIc.big { width: 28px; height: 28px; }
  /* On one line: the words by the coin, the number by the "?" (the owner's ask, 17 Nov 2026). */
  .store > .coinBar > span { display: flex; flex: 1; justify-content: space-between; align-items: baseline; gap: 5px; min-width: 0; }
  .store > .coinBar small { min-width: 0; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .store > .coinBar b { flex: none; }
  .store > .coinBar b { font-size: 1.15rem; line-height: 1.05; }
  .store > .coinBar .link { display: grid; place-items: center; flex: none; width: 36px; height: 36px; min-width: 0; min-height: 0; padding: 0; line-height: 1; font-size: 0; text-decoration: none; }
  .store > .coinBar .link::before { content: "?"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; padding-top: 2px; box-sizing: border-box; background: #2f78d0; color: #fff; font-size: .85rem; font-weight: 900; line-height: 1; }
  :root[dir="rtl"] .store > .coinBar .link::before { content: "؟"; }
  .store > .saveTip { grid-column: 1; grid-row: 3; margin: 8px 10px 0; font-size: .8rem; }
  .store > #storeTabs { grid-column: 1; grid-row: 4; flex-direction: column; gap: 5px; min-height: 0; overflow: hidden auto; padding: 8px 10px 12px; border-bottom: 0; }
  .store > #storeTabs button { flex: none; justify-content: flex-start; min-width: 0; min-height: 38px; text-align: start; }
  .store > .body { grid-column: 2; grid-row: 2 / -1; min-height: 0; padding: 0 16px 16px; border-inline-start: 1px solid var(--line); }
  /* The Collection on its side too (the owner's ask, 20 Nov 2026): the same two columns, the level bar and the tabs on the left and the
     panel on the right, so the first row of items shows without scrolling. */
  dialog.sheet#colDlg { max-height: calc(100dvh - 12px); width: min(900px, calc(100% - 24px)); }
  dialog.sheet#colDlg[open] { display: grid; grid-template-columns: clamp(192px, 27%, 230px) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  #colDlg > header { grid-column: 1 / -1; grid-row: 1; padding-block: 6px; }
  #colDlg > .colHead { grid-column: 1; grid-row: 2; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px 0; }
  #colDlg > #colTabs { grid-column: 1; grid-row: 3; flex-direction: column; gap: 5px; min-height: 0; overflow: hidden auto; padding: 8px 10px 12px; border-bottom: 0; }
  #colDlg > #colTabs button { flex: none; justify-content: flex-start; min-width: 0; min-height: 38px; text-align: start; }
  #colDlg > .body { grid-column: 2; grid-row: 2 / -1; min-height: 0; padding: 10px 16px 16px; border-inline-start: 1px solid var(--line); }
  #colDlg .mineBar { margin: 0 0 8px; padding: 4px 12px; }   /* the coin banner as one slim line */
  #colDlg .mineBar .coinIc.big { width: 28px; height: 28px; }
  #colDlg .mineBar b { font-size: 1.15rem; }
  #colDlg .mineBar .storeGo { padding: 5px 14px; }
}
/* The whole first row of cards shows without scrolling (the owner's ask, 17 Nov 2026): the note goes under the cards,
   the pictures are lower, the text tighter and a power's two packs sit side by side. On every screen up to 800px high since
   21 Nov 2026, upright phones too, beside the two columns above or stacked. */
@media (max-height: 800px) {
  dialog.sheet:is(.store, #colDlg) { max-height: calc(100dvh - 12px); }
  .store > .body { display: flex; flex-direction: column; padding-top: 10px; }
  .store .soonNote { order: 1; margin: 12px 0 0; font-size: .8rem; }
  :is(.store, #colDlg) .storeGrid li { gap: 2px; padding: 6px 6px 8px; }
  :is(.store, #colDlg) .storeGrid b { font-size: .92rem; }
  :is(.store, #colDlg) .storeGrid small, :is(.store, #colDlg) .storeGrid li > em { font-size: .72rem; line-height: 1.25; }
  :is(.store, #colDlg) .storeGrid small { flex: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }   /* at most two lines */
  :is(.store, #colDlg) .storeGrid button { margin-top: 4px; min-height: 34px; }
  :is(.store, #colDlg) .storeGrid .packs { grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
  :is(.store, #colDlg) .storeGrid .packs:has(> :only-child) { grid-template-columns: 1fr; }   /* one pack (a tool's games): the whole width */
  :is(.store, #colDlg) .storeGrid .packs .buyBtn { margin-top: 0; padding-inline: 2px; gap: 2px; font-size: .74rem; white-space: nowrap; }
  :is(.store, #colDlg) .storeGrid .packs .buyBtn .coinIc { width: 14px; height: 14px; }
  :is(.store, #colDlg) .storeGrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  :is(.store, #colDlg) .storeArt { height: 78px; margin-bottom: 2px; }
  :is(.store, #colDlg) .storeArt .spr { --s: 76px; }
  :is(.store, #colDlg) .storeArt .spr.pk { --s: 66px; bottom: 6px; }
  :is(.store, #colDlg) .storeArt i { width: 52px; height: 52px; font-size: 1.8rem; }
  :is(.store, #colDlg) .storeArt i:has(img.quick) { width: auto; height: auto; }   /* a quick sticker's face sizes its own box, as the chat stickers' do */
  :is(.store, #colDlg) .storeArt i svg, :is(.store, #colDlg) .storeArt i :is(svg.sticker, img.quick) { width: 74px; height: 74px; }
}
@media (max-height: 340px) and (min-width: 480px) {   /* the smallest phones on their side */
  #colDlg > .body { padding-top: 4px; }
  #colDlg .mineBar { margin-bottom: 4px; padding-block: 1px; }
  :is(.store, #colDlg) .storeArt { height: 60px; }
  :is(.store, #colDlg) .storeArt .spr { --s: 60px; }
  :is(.store, #colDlg) .storeArt .spr.pk { --s: 52px; bottom: 4px; }
  :is(.store, #colDlg) .storeArt i svg, :is(.store, #colDlg) .storeArt i :is(svg.sticker, img.quick) { width: 58px; height: 58px; }
}
@media (max-height: 500px) { .buyArt .storeArt { width: 110px; height: 110px; } .buyDlg h2 { margin-top: 4px; } }
/* Coins phase 4 (P1, 13 Nov 2026): your bought powers as round buttons beside THROW, uses left on a gold badge; after a
   use they wait, shown as a dark slice running down. In the store, a power card has two gold pack buttons. */
.useBar { position: fixed; z-index: 6; bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-end: calc(max(18px, env(safe-area-inset-right) - 30px) + 112px);
  display: flex; flex-direction: column-reverse; gap: 10px; }
html[dir=rtl] .useBar { inset-inline-end: auto; right: calc(max(18px, env(safe-area-inset-right) - 30px) + 112px); }
.useBar[hidden] { display: none; }
.useBar .useBtn { --u: 68px; position: relative; overflow: visible; display: grid; place-items: center; width: var(--u); height: var(--u); padding: 0; border-radius: 50%;
  border: 3px solid #ffd54a; background: radial-gradient(circle at 50% 35%, #3a63a8, #142a55 70%); box-shadow: 0 4px 0 #b97a00, 0 6px 14px rgba(0, 0, 0, .35), inset 0 2px 6px rgba(255, 255, 255, .25);
  touch-action: none; -webkit-user-select: none; user-select: none; transition: filter .2s, transform .1s; }
.useBar .useBtn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b97a00, 0 3px 8px rgba(0, 0, 0, .35); }
/* The power's turning 3D picture (the pick-ups' sheet), clipped to the round button. */
.useBar .useBtn .pk { --s: calc(var(--u) + 2px); position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.useBar .useBtn .pk::after { content: ''; position: absolute; left: calc(50% - var(--s) / 2); top: calc(50% - var(--s) / 2 + 2px); width: var(--s); height: var(--s);
  background: url(../sprites/pickups.webp) 0 calc(var(--s) * var(--row) * -1) / calc(var(--s) * 16) calc(var(--s) * 5); animation: storeTurn 2.4s steps(16) infinite; }
/* Uses left: a gold pill with ×N, popping when the number changes. */
.useBar .useBtn b { position: absolute; top: -8px; inset-inline-end: -10px; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: linear-gradient(180deg, #fff1a8, #ffc93c 60%, #f5a800); color: #5a3500; border: 2px solid #fff; font-weight: 900; font-size: .85rem; line-height: 1;
  box-shadow: 0 2px 0 #b97a00, 0 2px 6px rgba(0, 0, 0, .3); z-index: 3; direction: ltr; }
.useBar .useBtn b.bump { animation: useBump .5s ease-out; }
@keyframes useBump { 40% { transform: scale(1.45); } }
/* Timers (15 Nov 2026): a clock sweeping down inside the round button. Bright while the power runs ('act'), grey for
   the rest of the wait after ('wait'); --dur is its whole time, --gone how far it already went (negative). */
@property --clock { syntax: '<number>'; inherits: false; initial-value: 0; }
.useBar .useBtn.act::after, .useBar .useBtn.wait::after { content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 2; pointer-events: none;
  animation: useClock var(--dur) linear var(--gone, 0s) forwards; }
.useBar .useBtn.act { border-color: #7dffb0; box-shadow: 0 4px 0 #1f9a55, 0 0 14px rgba(125, 255, 176, .8), inset 0 2px 6px rgba(255, 255, 255, .25); }
.useBar .useBtn.act::after { background: conic-gradient(#7dffb0 calc(var(--clock) * 1turn), rgba(0, 30, 20, .55) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px)); }
.useBar .useBtn.wait { filter: grayscale(.9) brightness(.85); border-color: #9aa8b8; box-shadow: 0 4px 0 #5d6b7a, 0 6px 14px rgba(0, 0, 0, .3); }
.useBar .useBtn.wait .pk::after { animation: none; }
.useBar .useBtn.wait::after { background: conic-gradient(rgba(5, 15, 35, .7) calc(var(--clock) * 1turn), transparent 0); }
@keyframes useClock { from { --clock: 1; } to { --clock: 0; } }
/* Streaks appear in the status HUD. Only actionable powers belong beside the controls. */
#useBar .useChip, #useBar:not(:has(.useBtn)) { display: none; }
/* Can't be used right now: frozen, grey under a sheet of ice with a snowflake, the picture still. */
.useBar .useBtn.off { filter: grayscale(.85) brightness(.9); border-color: #bfe3ff; box-shadow: 0 4px 0 #6f8fb0, 0 6px 14px rgba(0, 0, 0, .3); cursor: not-allowed; }
.useBar .useBtn.off .pk::after { animation: none; }
.useBar .useBtn.off::before { content: '❄'; position: absolute; inset: 0; z-index: 2; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 40, 90, .6); background: linear-gradient(135deg, rgba(220, 240, 255, .55), rgba(150, 200, 240, .25) 50%, rgba(220, 240, 255, .5)); }
.useBar .useBtn.off b { filter: grayscale(1); }
@media (prefers-reduced-motion: reduce) { .useBar .useBtn .pk::after, .useBar .useBtn b.bump { animation: none; } }
/* Computers (the owner's pick D, 19 Nov 2026; the old column crowded the field's edge): one dark panel down the right side, at the bottom
   (clear of the scoreboard even on a short screen), the buttons in the order of the 1, 2, 3 keys. Visible pads use the separate layout below. */
@media (hover: hover) and (pointer: fine) {
  html .useBar.useBar, html[dir=rtl] .useBar.useBar { top: auto; bottom: max(28px, env(safe-area-inset-bottom)); inset-inline-end: auto; left: auto; right: 22px;   /* the logical one first: in English it is `right` */
    flex-direction: column; align-items: center; gap: 16px; padding: 14px 10px; border-radius: 34px; background: rgba(13, 34, 69, .78); }
  .useBar .useBtn { --u: 64px; }
}
@media (hover: hover) and (pointer: fine) and (max-height: 700px) { .useBar .useBtn { --u: 50px; } html .useBar.useBar { gap: 12px; padding: 10px 8px; } }
/* Anchor the store-button arc to the actual pad edge whenever either control is shown.
   A mouse-only session keeps its panel. Physical sides follow the joystick setting in either language. */
body:has(> :is(#roll, #build):not([hidden])) #useBar:not([hidden]):has(.useBtn) {
  --pad-edge: max(18px, env(safe-area-inset-right) - 30px);
  inset-inline-end: auto; right: var(--pad-edge); left: auto; bottom: max(18px, env(safe-area-inset-bottom));
  display: block; width: 0; height: 0; padding: 0; background: transparent; pointer-events: none;
}
body:has(> :is(#roll, #build):not([hidden])) #useBar > * {
  position: absolute; right: calc(var(--x) - var(--u) / 2); bottom: calc(var(--y) - var(--u) / 2);
}
body:has(> :is(#roll, #build):not([hidden])) #useBar .useBtn {
  /* Original centres on the 100px arc (-25°, 17°, 59°), also usable without CSS trigonometry. */
  --u: 56px; --x: 136.631px; --y: 55.738px; pointer-events: auto;
}
body:has(> :is(#roll, #build):not([hidden])) #useBar .useBtn:nth-child(2) { --x: 141.630px; --y: 127.237px; }
body:has(> :is(#roll, #build):not([hidden])) #useBar .useBtn:nth-child(3) { --x: 97.504px; --y: 183.717px; }
html.swapSides body:has(> :is(#roll, #build):not([hidden])) #useBar:not([hidden]):has(.useBtn) {
  right: auto; left: max(18px, env(safe-area-inset-left) - 30px);
}
html.swapSides body:has(> :is(#roll, #build):not([hidden])) #useBar > * { right: auto; left: calc(var(--x) - var(--u) / 2); }
/* A short, narrow landscape can also use the compact tutorial. Keep it between the thumb zones. */
@media (max-width: 520px) and (max-height: 500px) {
  body:has(#roll:not([hidden])) #coach { left: 50%; right: auto; transform: translateX(-50%); }
}
.storeGrid .packs { display: grid; gap: 6px; }
.storeGrid .packs .buyBtn { padding-inline: 6px; font-size: .95rem; direction: ltr; }
/* Things move in the night pop-ups (the owner's rule, 13 Nov 2026): the welcome's coins bob and flip in turn, the How to
   earn icons bounce, every gold coin icon spins now and then, the Buy check's character keeps turning, the streak's
   coins spin. Still for reduced motion. */
.coinPile svg { animation: coinBob 2.4s ease-in-out infinite; }
.coinPile svg:nth-child(2) { animation-delay: -.5s; } .coinPile svg:nth-child(3) { animation-delay: -1s; }
.coinPile svg:nth-child(4) { animation-delay: -1.5s; } .coinPile svg:nth-child(5) { animation-delay: -2s; }
@keyframes coinBob { 0%, 100% { transform: translateY(0) rotateY(0); } 40% { transform: translateY(-6px) rotateY(0); } 50% { transform: translateY(-6px) rotateY(180deg); } 60% { transform: translateY(-6px) rotateY(360deg); } }
.night .coinsHow i { animation: iconBounce 2s ease-in-out infinite; }
.night .coinsHow li:nth-child(2) i { animation-delay: -.5s; } .night .coinsHow li:nth-child(3) i { animation-delay: -1s; } .night .coinsHow li:nth-child(4) i { animation-delay: -1.5s; }
@keyframes iconBounce { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-5px) rotate(-8deg); } 50% { transform: translateY(0) rotate(0); } 75% { transform: translateY(-3px) rotate(8deg); } }
.night .coinIc { animation: coinSpin 3s ease-in-out infinite; }
@keyframes coinSpin { 0%, 70%, 100% { transform: rotateY(0); } 85% { transform: rotateY(360deg); } }
.buyArt .storeArt .spr:not(.pk) { animation: storeTurn 3.2s steps(16) infinite; }
.buyArt .storeArt i { animation: iconBounce 2s ease-in-out infinite; }
.streakRow .today { animation: todayGlow 1.6s ease-in-out infinite; }
@keyframes todayGlow { 50% { box-shadow: 0 0 0 7px rgba(255, 201, 60, .45); transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .coinPile svg, .night .coinsHow i, .night .coinIc, .buyArt .storeArt .spr, .buyArt .storeArt i, .streakRow .today { animation: none !important; } }
/* The Collection's My items (13 Nov 2026): the gold coin bar with a button to the store, then your items as store cards. */
.mineBar { margin: 12px 0; }
/* The label and the amount on one line, one at each end (the owner's ask, 19 Nov 2026), and the whole banner opens how to earn. */
.mineBar { cursor: pointer; }
.mineBar > span { display: flex; flex: 1; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.mineBar small { display: inline; }
.mineBar b { display: inline; }
.mineBar .storeGo { margin-inline-start: auto; padding: 8px 16px; border-radius: 999px; border: 2px solid #fff3c4; background: linear-gradient(180deg, #4fd27b, #23a455);
  color: #fff; font: inherit; font-weight: 900; box-shadow: 0 3px 0 #17803f; cursor: pointer; }
#colItemsNone { text-align: center; margin-top: 14px; }
/* The coin history under My items: a row per change, icon, what, when, +/− and the balance after. */
.coinHist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.coinHist li { display: grid; grid-template-columns: auto 1fr auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px;
  border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.coinHist li.empty { display: block; text-align: center; color: var(--ink-soft); }
.coinHist i { grid-row: span 2; font-style: normal; font-size: 1.4rem; }
.coinHist b { font-weight: 800; }
.coinHist small { grid-column: 2; grid-row: 2; color: var(--ink-soft); font-size: .75rem; }
.coinHist em { grid-column: 3; grid-row: span 2; font-style: normal; font-weight: 900; font-size: 1.05rem; direction: ltr; }
.coinHist em.in { color: #7ee2a8; } .coinHist em.out { color: #ff9b9b; }
.coinHist span { grid-column: 4; grid-row: span 2; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-weight: 700; font-size: .85rem; direction: ltr; }
.coinHist .coinIc { width: 16px; height: 16px; }
/* An animal's face (/js/face.js), one emoji wide where the phone's emoji used to be (14 Nov 2026). */
img.face { width: 1.2em; height: 1.2em; vertical-align: middle; object-fit: contain; pointer-events: none; }
/* The picker's big round tiles (the owner's ask, 19 Nov 2026: the characters were not in the middle of their circles): the picture was
   wider than the circle and hung from its top corner. Now the tile centres it and the picture fits inside with a little room. */
#colPane-animals .hues button { display: grid; place-items: center; padding: 0; }
#colPane-animals .hues button > span { display: grid; place-items: center; width: 100%; height: 100%; }
#colPane-animals .hues button img.face { width: 84%; height: 84%; }

/* Every pop-up in the night style of the results card: a dark night sky with snow falling, and the dark colours, so
   everything inside (lists, inputs, buttons, cards) follows (the owner's ask, 15 Nov 2026: "all the pop-ups the same
   style"). The snow is part of the background, so a pop-up that scrolls still scrolls; it stops with reduced motion. */
dialog:is(.pop, .sheet, #help, #roomDlg) {
  --panel: rgba(255, 255, 255, .06); --ink: #fff; --ink-soft: #c9d6e6; --line: rgba(255, 255, 255, .18); --field: rgba(255, 255, 255, .08);
  --accent: #6aa8ff; --on-accent: #0b1424; --err: #ff9bb0;
  color-scheme: only dark; color: var(--ink); border-color: var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
  background: radial-gradient(circle, rgba(255, 255, 255, .8) 0 1.5px, transparent 2px) 10px 0 / 90px 100px,
    radial-gradient(circle, rgba(255, 255, 255, .5) 0 1px, transparent 1.5px) 40px 30px / 60px 70px,
    radial-gradient(120% 60% at 50% 0%, rgba(36, 86, 154, .6) 0%, transparent 60%), linear-gradient(180deg, #0b1a3a, #142a55 60%, #1d3a6e);
  animation: popSnow 8s linear infinite;
}
@keyframes popSnow { to { background-position: 10px 100px, 40px 100px, 0 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { dialog:is(.pop, .sheet, #help, #roomDlg) { animation: none; } }
dialog:is(.pop, .sheet, #help, #roomDlg)::backdrop { background: rgba(6, 14, 30, .55); }
dialog:is(.pop, .sheet, #help, #roomDlg) :is(input, select, textarea) { background: rgba(255, 255, 255, .1); }
dialog.pop .gift .giftTop, dialog.pop.gift .giftTop { background: none; }

/* Back in a game after time away (index.html, backStart): the last picture greyed with "Reconnecting…" over it until
   current updates are in, instead of the logo screen (the owner's ask, 15 Nov 2026). */
body.rejoin #cv { filter: grayscale(1) brightness(.85); }
#rejoin { position: fixed; left: 50%; top: 50%; translate: -50% -50%; z-index: 90; display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; background: rgba(12, 34, 66, .88); color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); pointer-events: none; white-space: nowrap; }
#rejoin[hidden] { display: none; }
#rejoin i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: loader-spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { #rejoin i { animation: none; } }
/* Beta (the owner's ask, 16 Nov 2026): a small tag on the start screen that opens #betaDlg; the report form as feedback (#reportDlg.fb). */
.home .betaTag { align-self: center; min-height: 0; margin: 0; padding: 5px 11px; border: 2px solid #fff; border-radius: 999px;
  background: #ff8a00; color: #fff; font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer; }
.home .betaTag:hover { filter: brightness(1.08); }
/* Always one line, its size set by the screen's shorter side (the owner's ask, 20 Nov 2026): it wrapped onto two lines on small phones on their side. */
.home .betaTag { flex: none; white-space: nowrap; font-size: clamp(10px, 3vmin, 13px); padding: .4em .9em; }
/* A phone held upright has no room beside the level pill: the tag sits just under it. */
@media (max-width: 519px) { .home .hTop { position: relative; } .home .betaTag { position: absolute; top: calc(100% + 8px); inset-inline-start: 4px; z-index: 2; } }
#betaDlg { padding: 22px; }
#betaDlg .betaNote { margin: 4px 0 0; padding: 14px 16px; border-radius: 14px; border-inline-start: 4px solid #ff8a00;
  background: color-mix(in srgb, #ff8a00 16%, transparent); }
#betaDlg .betaHead { display: block; margin-bottom: 8px; color: #ffb547; font-size: 1.05rem; }
#betaDlg ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
#betaDlg li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; }
#betaDlg .betaAsk { margin: 1.3em 0 0; text-align: center; font-size: 1.15rem; font-weight: 900; color: #ffd166; }
#betaDlg .stars { margin: .5em 0 1.2em; }
#betaDlg .wide { width: 100%; }
/* A phone on its side: the message and the stars side by side, so the button stays on screen. */
@media (max-height: 500px) { #betaDlg { max-width: 760px; padding: 16px 20px; } #betaDlg .betaBody { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; }
  #betaDlg .betaAsk { margin-top: 0; } #betaDlg .stars { margin: .4em 0 .8em; } }
#reportDlg:not(.fb) .fbOnly, #reportDlg.fb .bugOnly { display: none; }
/* The report and feedback form never scrolls, whatever the screen (the owner's ask, 16 Nov 2026): the sheet is never taller than the
   screen, and the message box is the part that stretches or shrinks to fill what is left (never under 64 px). */
dialog#reportDlg { max-height: calc(100dvh - 16px); }
#reportForm { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#reportForm > label.f:first-of-type { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#reportForm > label.f:first-of-type textarea { flex: 1 1 auto; min-height: 64px; height: 160px; resize: none; }
#reportForm > button { flex: none; }
/* A short screen held upright (a small phone): tighter header and spacing. */
@media (max-height: 700px) and (orientation: portrait) {
  #reportDlg header { padding: 8px 12px 8px 16px; }
  #reportDlg header img { width: 30px; height: 30px; }
  #reportDlg header h2 { font-size: 1.15rem; }
  #reportForm > p.big { margin: 8px 0 6px; font-size: .95rem; }
  #reportForm > label.f { margin-bottom: 6px; }
  #reportForm > p:not(.big) { font-size: .78rem; line-height: 1.3; margin-bottom: 6px; }
  #reportShotList:empty { display: none; }
  #reportMsg:empty { margin: 0; min-height: 0; height: 0; overflow: hidden; }
}
/* The report and feedback form on a phone on its side (the owner's ask, 16 Nov 2026): a small header and two columns, the message
   on the left at full height, the rest on the right, so it fits without scrolling. Any short, wide screen (up to 640 px tall, wider
   than tall), so big phones on their side and a browser's phone view get it too (the owner's report, 16 Nov 2026). */
@media (max-height: 640px) and (orientation: landscape) {
  dialog#reportDlg { width: min(900px, calc(100% - 24px)); max-height: calc(100dvh - 16px); }
  #reportDlg header { padding: 6px 12px 6px 16px; }
  #reportDlg header img { width: 28px; height: 28px; }
  #reportDlg header h2 { font-size: 1.1rem; }
  #reportForm { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-content: start; padding: 6px 16px 12px; }
  #reportForm > p.big { grid-column: 1 / -1; margin: 2px 0 6px; font-size: .95rem; }
  #reportForm > label.f:first-of-type { grid-column: 1; grid-row: 2 / span 6; grid-template-rows: auto 1fr; margin-bottom: 0; }
  #reportForm > label.f:first-of-type { min-height: 0; }
  #reportForm > label.f:first-of-type textarea { height: 100%; min-height: 0; resize: none; }   /* sized by the right column, so it adds no height */
  #reportForm > :not(.big, label.f:first-of-type) { grid-column: 2; }
  #reportForm > label.f { margin-bottom: 6px; }
  #reportForm > p { font-size: .8rem; margin-bottom: 6px; }
  #reportShotList:empty { display: none; }
  #reportForm input { min-height: 40px; padding-block: 6px; }
  #reportForm > label.f:first-of-type textarea { height: 100%; }
  #reportForm > label.f > span { line-height: 1.2; }
  #reportForm > p:not(.big) { font-size: .75rem; line-height: 1.3; }
  #reportMsg:empty { margin: 0; min-height: 0; height: 0; overflow: hidden; }
  #reportDlg header .close { width: 38px; height: 38px; min-height: 0; }
  #reportSend { margin-top: 2px; min-height: 44px; padding-block: 8px; }
}
/* Very short screens on their side (under 380 px): the intro goes, the title says it. */
/* There the note moves under the message box and Send sits beside it, so the right column is only email and pictures. */
@media (max-height: 379px) and (orientation: landscape) {
  #reportForm > p.big { display: none; }
  #reportForm > label.f:first-of-type { grid-row: 1 / span 3; }
  #reportForm > label.f:nth-of-type(2) { grid-row: 1; }
  #reportForm > label.f:nth-of-type(3) { grid-row: 2; }
  #reportForm > :is(#reportShotList, #reportMsg) { grid-row: 3; }
  #reportForm > p:not(.big, #reportShotList, #reportMsg) { grid-column: 1; grid-row: 4; margin: 6px 0 0; font-size: .7rem; line-height: 1.25; }
  #reportForm > button { grid-row: 4; align-self: end; }
}

/* Swap control sides (js/swap-sides.js; the owner's ask, 25 Nov 2026): on a touch screen the joystick goes to the bottom
   right (js/input.js draws it there) and THROW, WALL and the power buttons to the bottom left, mirrored, in both languages.
   On a phone held upright the waiting note and the short messages, which sit above the joystick, follow it to the right. */
html.swapSides #roll, html.swapSides[dir=rtl] #roll { inset-inline-end: auto; right: auto; left: max(18px, env(safe-area-inset-left) - 30px); }
html.swapSides #build, html.swapSides[dir=rtl] #build { inset-inline-end: auto; right: auto; left: max(26px, env(safe-area-inset-left) - 30px); }
html.swapSides #coachJoy { left: auto; right: max(36px, env(safe-area-inset-right)); }
html.swapSides #corner { left: auto; right: max(8px, env(safe-area-inset-right)); }   /* the ping, under the stick as before */
@media (max-width: 520px) {
  html.swapSides :is(#wait, #flash), html.swapSides body:has(#roll:not([hidden])) :is(#wait, #flash) { left: auto; right: max(10px, env(safe-area-inset-right)); justify-items: end; }
  html.swapSides #feed { justify-items: end; }
}
/* Every card's button (or a power's two pack buttons) sits at the card's bottom, so a row's buttons line up whatever the
   length of the text above them (the owner's ask, 24 Nov 2026); the cards in a row already share one height. */
:is(.store, #colDlg) .storeGrid li > :is(button, .packs) { margin-top: auto; }
:is(.store, #colDlg) .storeGrid li > :is(small, em):has(+ :is(button, .packs)) { margin-bottom: 6px; }
/* The way to play (the owner's choice, 25 Nov 2026): the name box and the mode row are dark like the bar below them, the row
   showing the mode's picture and name with ⇄; a tap opens the cards in the game's own pop-up (#modeList). */
.home .nameField input { background: var(--navy); color: #fff; box-shadow: 0 3px 0 #051326; }
.home .nameField input::placeholder { color: #9fb6d0; }
.home #nameDice { color: #8cc8ff; }
.home .modeBtn { position: relative; width: 100%; display: flex; align-items: center; min-height: 42px; padding: 0 6px; border: 0; border-radius: 12px;
  background: var(--navy); color: #fff; box-shadow: 0 3px 0 #051326; }
/* The mode's island sticks out of the row's start and top, as if it floats over it (the owner's ask, 25 Nov 2026). */
.home .modeBtn { padding-inline-start: 0; }
.home .modeBtn .modeArt { width: 90px; height: 60px; margin-block: -24px -6px; margin-inline: -14px -10px; position: relative; z-index: 1; filter: drop-shadow(0 4px 4px rgba(0, 10, 40, .35)); }
.home .modeBtn b { flex: 1; font-weight: 800; font-size: 1rem; text-align: center; }
.home .modeBtn .mSwap { width: 2.1em; display: grid; place-items: center; color: #8cc8ff; }
.home .modeBtn .mSwap svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.home .modes { width: min(300px, 100%); align-self: center; }   /* as wide as the name box above it */
/* Flex, not a grid: with Offline switched off the three cards still fill the rows (two, then one in the middle). */
#modeList .gtype { display: flex; flex-wrap: wrap; justify-content: center; }
/* Each card's island rises above its top edge (the room for it is the row's padding-top). */
#modeList .gtype { padding-top: 30px; }
#modeList .gtype button { flex: 0 1 calc(50% - 4px); min-height: 0; padding: 0 8px 12px; border: 2px solid transparent; border-radius: 16px; }
#modeList .gtype button[aria-pressed="true"] { border-color: var(--accent); }
/* One island size and shadow for the mode cards and the Private room tiles. */
#modeList .gtype .modeArt, #pickDlg .pick .modeArt { width: 138px; height: 92px; filter: drop-shadow(0 6px 6px rgba(0, 10, 40, .35)); }
#modeList .gtype .modeArt { margin: -38px auto -2px; }
#modeList .gtype .soonPill { display: none; }
#modeList .gtype [data-mode="room"] { background: #213c62; color: #fff; }
#modeList .gtype [data-mode="room"] small { color: #d3e2f5; }
#modeList .gtype .soon .soonPill { display: block; background: #ffd393; color: #362009; }
/* The Private room pop-up (#pickDlg) is always as wide as the mode cards' and its tiles as big (the owner's ask, 25 Nov 2026). */
/* The New room pop-up too: as wide as the other two, its game-type islands floating above their cards (25 Nov 2026). */
#newDlg .gtype { padding-top: 30px; }
#newDlg .gtype button { min-height: 0; padding: 0 6px 12px; align-content: start; }
#newDlg .gtype .modeArt { width: 100%; max-width: 138px; height: auto; aspect-ratio: 3 / 2; margin: -38px auto -2px; filter: drop-shadow(0 6px 6px rgba(0, 10, 40, .35)); }
@media (min-width: 600px) { #modeList, #pickDlg, #newDlg { max-width: 720px; } #modeList .gtype { flex-wrap: nowrap; } #modeList .gtype button { flex: 1 1 0; } }
@media (max-height: 500px) {
  .home .modeBtn { min-height: 34px; } .home .modeBtn .modeArt { width: 72px; height: 48px; margin-block-start: -18px; }
  #modeList .gtype, #newDlg .gtype { padding-top: 22px; } #modeList .gtype button { padding: 0 6px 8px; }
  #newDlg .gtype .modeArt { max-width: 105px; margin-top: -28px; }
  #modeList .gtype .modeArt, #pickDlg .pick .modeArt { width: 105px; height: 70px; margin-top: -28px; }
  #pickDlg .tiles { padding-top: 22px; }
}
@media (min-width: 760px) and (min-height: 560px) {
  .home .modes { width: 380px; } .home .modeBtn { min-height: 50px; } .home .modeBtn b { font-size: 1.15rem; } .home .modeBtn .modeArt { width: 108px; height: 72px; margin-block-start: -30px; }
}
/* Big screens: bigger cards and islands (the owner's ask, 25 Nov 2026). */
@media (min-width: 1000px) and (min-height: 700px) {
  /* Both grow with the screen, at the same share of its width (72% of 1440 px is the 1040 px the owner OK'd), the islands and
     words with them; never smaller than at 1000 px. --u is 1% of the width, or less on a wide, short screen so it still fits. */
  #modeList, #pickDlg, #newDlg { --u: min(1vw, 1.6vh); }
  #modeList, #pickDlg, #newDlg { max-width: none; width: calc(var(--u) * 72); }
  #modeList .gtype, #pickDlg .tiles, #newDlg .gtype { gap: var(--u); padding-top: calc(var(--u) * 3); }
  #modeList .gtype button, #pickDlg .pick, #newDlg .gtype button { padding: 0 var(--u) calc(var(--u) * 1.5); border-radius: 20px; }
  #newDlg .gtype .modeArt { max-width: none; }
  #modeList .gtype .modeArt, #pickDlg .pick .modeArt, #newDlg .gtype .modeArt { width: calc(var(--u) * 15.3); height: calc(var(--u) * 10.2); margin: calc(var(--u) * -4) auto calc(var(--u) * .3); }
  #modeList h2, #pickDlg h2, #newDlg h2 { font-size: max(1.3rem, calc(var(--u) * 1.78)); }
  #modeList .gtype b, #pickDlg .pick b, #newDlg .gtype b { font-size: max(1.2rem, calc(var(--u) * 1.67)); } #modeList .gtype small, #newDlg .gtype small { font-size: max(.95rem, calc(var(--u) * 1.17)); }
  #pickDlg .joinRow input, #pickDlg .joinRow button { font-size: max(1.1rem, calc(var(--u) * 1.45)); min-height: max(46px, calc(var(--u) * 3.75)); }
}

/* Room dialogs: the content scrolls inside a steady header and action row, including on short landscape screens. */
#newDlg, #roomDlg { width: min(860px, calc(100vw - 24px)); max-width: 860px; max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; border-radius: 22px; }
#newDlg[open], #roomDlg[open] { display: flex; flex-direction: column; }
#newDlg > .head, #roomDlg > .head { flex: none; padding: 16px 22px 10px; }
#newDlg .newBody, #roomDlg > .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 22px 14px; }
#newDlg .newFoot, #roomDlg .roomFoot { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(8, 24, 53, .9); }
#newDlg .newFoot .hint { margin: 0 auto 0 0; }
#newDlg .newFoot .primary { min-width: 210px; }
#roomDlg .roomFoot { justify-content: flex-end; }
#roomDlg .roomFoot button { min-width: 130px; }
#newDlg .roomSectionTitle { margin: 7px 0 8px; color: #d3e6fb; font-size: .85rem; font-weight: 800; letter-spacing: .03em; }
#newDlg .gtype { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 8px 0 6px; }
#newDlg .gtype button { min-width: 0; min-height: 0; padding: 8px 8px 12px; gap: 1px; border: 2px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.055); box-shadow: none; }
#newDlg .gtype button:is([data-teams="1"], [data-castle]) { background: rgba(255,255,255,.055); box-shadow: none; }
#newDlg .gtype .modeArt { width: min(100%, 125px); height: 82px; margin: -10px auto -4px; object-fit: contain; }
#newDlg .gtype b { font-size: clamp(.85rem, 1.5vw, 1.08rem); line-height: 1.18; }
#newDlg .gtype small { font-size: .78rem; line-height: 1.2; }
@property --room-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes roomBorder { to { --room-angle: 360deg; } }
#newDlg .gtype button[aria-pressed="true"] { border: 2px solid transparent; background: linear-gradient(#1b3c70,#1b3c70) padding-box, conic-gradient(from var(--room-angle),#77caff,#b5e9ff,#ffb66c,#77caff) border-box; box-shadow: 0 0 16px rgba(110,184,255,.22); animation: roomBorder 4s linear infinite; }
#newDlg .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; }
#newDlg .roomRange, #roomDlg .roomRange { display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: start; gap: 4px 10px; min-width: 0; color: var(--ink); font-size: .85rem; font-weight: 700; }
#newDlg .roomRange output, #roomDlg .roomRange output { color: #a7d7ff; font-weight: 800; text-align: end; }
#newDlg .roomRange input[type="range"], #roomDlg .roomRange input[type="range"] { grid-column: 1 / -1; width: 100%; height: 34px; min-height: 34px; margin: 2px 0 0; padding: 0; border: 0; background: transparent; appearance: none; cursor: pointer; }
.roomRange input[type="range"]::-webkit-slider-runnable-track { height: 7px; border-radius: 99px; background: linear-gradient(to right,#8cc8ff var(--fill),rgba(255,255,255,.22) var(--fill)); }
.roomRange input[type="range"]::-moz-range-track { height: 7px; border-radius: 99px; background: linear-gradient(to right,#8cc8ff var(--fill),rgba(255,255,255,.22) var(--fill)); }
.roomRange input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11px; border: 2px solid #fff; border-radius: 50%; background: radial-gradient(circle at 30% 25%,#fff 0 24%,#e0f3ff 54%,#98c4e6 100%); box-shadow: 0 2px 8px #081e3d; appearance: none; }
.roomRange input[type="range"]::-moz-range-thumb { width: 25px; height: 25px; border: 2px solid #fff; border-radius: 50%; background: radial-gradient(circle at 30% 25%,#fff 0 24%,#e0f3ff 54%,#98c4e6 100%); box-shadow: 0 2px 8px #081e3d; }
.roomRange input[type="range"]:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }
.roomRange .rangeMarks { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 2px; margin-top: -3px; color: #bfd1e7; font-size: .7rem; font-weight: 500; }
.roomRange .rangeMarks span { min-width: 0; overflow-wrap: anywhere; text-align: center; }
.roomRange .rangeMarks span:first-child { text-align: start; } .roomRange .rangeMarks span:last-child { text-align: end; }
#newSettings .roomSettingName { display: flex; align-items: center; gap: 5px; }
#newSettings .roomHelp { flex: none; width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 50%; font-size: .8rem; }
#newSettings .roomScale { grid-column: 1 / -1; }
#newSettings .roomTip { display: block; margin-top: 5px; color: #bfd1e7; font-size: .78rem; font-weight: 400; }
#newSettings .roomHelp[aria-expanded="true"] { border-color: #83caff; }
#newDlg #layoutStrip { display: flex; gap: 10px; overflow-x: auto; padding: 3px 1px 9px; scroll-snap-type: x proximity; scrollbar-width: none; }
#newDlg #layoutStrip::-webkit-scrollbar { display: none; }
#newDlg .layoutThumb { flex: 0 0 112px; display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 0; padding: 4px 4px 7px; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; background: transparent; color: #dceaff; font-size: .72rem; line-height: 1.2; scroll-snap-align: start; }
#newDlg .layoutThumb canvas { position: static; inset: auto; display: block; width: 100%; height: 62px; border-radius: 7px; object-fit: cover; touch-action: auto; }
#newDlg .layoutThumb[aria-pressed="true"] { border-bottom-color: #83caff; background: rgba(118,181,255,.15); color: #fff; }
#newDlg select[hidden], #newDlg canvas[hidden], #roomDlg select[hidden] { display: none; }
#roomDlg #roomTabs { flex: none; display: flex; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); }
#roomDlg #roomTabs button { min-height: 42px; padding: 8px 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #b9cee8; font-size: .9rem; font-weight: 700; }
#roomDlg #roomTabs button[aria-selected="true"] { border-bottom-color: #83caff; color: #fff; }
#roomDlg #roomMode { margin: 2px 0 0; font-size: .78rem; }
#roomDlg .roomHostGrid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: start; }
#roomDlg .roomHostGrid .roomHead { margin: 0 0 6px; }
#roomDlg .roomHostGrid .stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#roomDlg .roomHostGrid .stepper button { width: 38px; min-height: 38px; }
#roomDlg .roomHostGrid .stepper b { text-align: center; }
#roomDlg .roomHostGrid p { font-size: .76rem; }
#roomRoster { list-style: none; margin: 0; padding: 0; }
#roomRoster li { display: flex; align-items: center; gap: .55em; min-height: 48px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
#roomRoster .dot { width: 2em; height: 2em; flex: none; display: grid; place-items: center; border-radius: 50%; }
#roomRoster .dot img { width: 1.5em; height: 1.5em; }
#roomRoster .flag { flex: none; line-height: 1; }
#roomRoster .flag:empty { display: none; }
#roomRoster .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#roomRoster .pt { margin-inline-start: auto; min-width: 2ch; text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
#roomRoster li.me .nm, #roomRoster .you { color: #bfe0ff; font-weight: 800; }
#roomRoster .you { flex: none; font-size: .8em; }
#roomDlg #roomPaneMe .mList { border: 0; background: transparent; }
#roomDlg #roomPaneMe .mRow { border-block: 0 1px solid var(--line); background: transparent; }
#roomDlg .roomRange select[hidden], #roomDlg [role="tabpanel"][hidden], #roomDlg #roomTabs button[hidden] { display: none; }
@media (max-width: 650px) {
  #newDlg, #roomDlg { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 17px; }
  #newDlg > .head, #roomDlg > .head { padding: 12px 14px 7px; }
  #newDlg .newBody, #roomDlg > .body { padding: 5px 14px 12px; }
  #newDlg .newFoot, #roomDlg .roomFoot { padding: 9px 14px max(10px,env(safe-area-inset-bottom)); }
  #newDlg .newFoot .hint { display: none; } #newDlg .newFoot .primary { min-width: 0; flex: 1; }
  #newDlg .gtype { gap: 5px; }
  #newDlg .gtype button { padding: 5px 3px 7px; }
  #newDlg .gtype .modeArt { width: 100%; height: 58px; margin: -5px auto -3px; }
  #newDlg .gtype small { display: none; }
  #newDlg .row, #roomDlg .roomHostGrid { grid-template-columns: 1fr; gap: 10px; }
  #newDlg .layoutThumb { flex-basis: 100px; }
  #roomDlg #roomTabs { gap: 12px; padding-inline: 14px; }
  #roomDlg #roomTabs button { font-size: .78rem; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #newDlg, #roomDlg { max-height: calc(100dvh - 10px); }
  #newDlg > .head, #roomDlg > .head { padding-block: 7px 3px; }
  #newDlg .newBody, #roomDlg > .body { padding-block: 2px 6px; }
  #newDlg .newFoot, #roomDlg .roomFoot { padding-block: 6px; }
  #newDlg .gtype { padding-block: 2px; }
  #newDlg .gtype .modeArt { height: 48px; margin-top: -5px; }
  #newDlg .row, #roomDlg .roomHostGrid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  #newDlg .roomSectionTitle { margin-block: 4px; }
  #newDlg .layoutThumb canvas { height: 48px; }
  #newDlg .layoutThumb { flex-basis: 92px; }
}
#newSettings.paired .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 650px) {
  #newSettings.paired .row .roomRange {
    grid-template-columns: minmax(0, 1fr);
  }
  @supports (grid-template-rows: subgrid) {
    #newSettings.paired .roomRange { grid-row: span 4; grid-template-rows: subgrid; }
  }
  #newSettings.paired .row output { text-align: start; }
}
@media (prefers-reduced-motion: reduce) { #newDlg .gtype button[aria-pressed="true"] { animation: none; } }

/* New room wizard */
#newDlg [hidden] { display: none; }
#newDlg .newStepCount { margin: 0; color: #a7d7ff; font-size: .78rem; font-weight: 700; }
#newDlg .roomSectionTitle { font-size: 1.05rem; letter-spacing: normal; }
#newDlg .roomSectionTitle:focus { outline: none; }
#newDlg .newFoot .hint { margin: 0; }
#newDlg .newFoot .primary { margin-inline-start: auto; }
#newDlg #layoutStrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; }
#newDlg .layoutThumb { width: 100%; }
#newDlg .layoutThumb canvas { height: auto; aspect-ratio: 4 / 3; }
@media (max-width: 650px) and (orientation: portrait) {
  #newDlg #layoutStrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  #newDlg .layoutThumb canvas { width: min(100%, 70px); height: auto; }
}
