  :root {
    --felt: #0f5132; --felt-dark: #0b3d26; --rail: #4a2c1a; --cream: #f7f2e7; --gold: #e6b84c;
    --red: #d9534f; --green: #3fb97a; --ink: #14161a; --muted: #b9c7bf; --card: rgba(0,0,0,.28);
    --c1: #f1efe6; --c5: #d33a2f; --c25: #2e9e5b; --c100: #111114; --c500: #7b3fa0; --c1000: #F5CE1B;
    --c5000: #7a4a2a; --c10000: #8DC63F; --c25000: #1f9a8a; --c100000: #2d6cdf; --c500000: #e07b1a; --c1000000: #9C7420;
    --c10000000: #E0458F; --c50000000: #1F2D73; --c100000000: #7C8793; --c1000000000: #8B1C2C;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 70%, var(--felt-edge, #06261a) 100%);
    color: var(--cream); min-height: 100vh; -webkit-tap-highlight-color: transparent;
  }
  /* Nothing on the page is selectable text except inputs, codes and the log: a held button or a tapped chip must never
     highlight a word and pop the selection menu (Chrome on Android). Controls also skip the double-tap zoom delay. */
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, select, .code, .log, .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
  button, .stack, .chip, .seg, .tab, .switch, .picks button, .lnav button { touch-action: manipulation; }
  button {
    font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: .65rem 1rem;
    background: var(--gold); color: var(--ink); font-weight: 700; transition: transform .08s, filter .15s;
  }
  button:hover:not(:disabled) { filter: brightness(1.08); }
  button:active:not(:disabled) { transform: translateY(1px); }
  button:disabled { opacity: .4; cursor: not-allowed; }
  button.secondary { background: rgba(255,255,255,.12); color: var(--cream); }
  button.danger { background: var(--red); color: #fff; }
  button.go { background: var(--green); color: #06261a; }
  input {
    font: inherit; padding: .6rem .8rem; border-radius: 10px; border: 2px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.3); color: var(--cream); outline: none; width: 100%;
  }
  input:focus { border-color: var(--gold); }
  .wrap { max-width: 980px; margin: 0 auto; padding: 14px; }
  h1 { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
  .sub { color: var(--muted); margin: 0 0 1rem; font-size: .95rem; }
  .hint { color: var(--muted); font-size: .85rem; min-height: 1.2em; }
  .muted { color: var(--muted); font-size: .85rem; }
  code { background: rgba(0,0,0,.3); padding: 0 .3em; border-radius: 4px; }

  .tabs { display: flex; background: rgba(0,0,0,.3); border-radius: 12px; padding: 4px; gap: 4px; margin-top: 10px; }
  .tab { flex: 1; background: transparent; color: var(--muted); padding: .6rem; }
  .tab.active { background: var(--gold); color: var(--ink); }
  .money { position: relative; }
  .money::after { content: "chips"; position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .78rem; pointer-events: none; }
  .money input { padding-right: 3.4rem; }
  /* Two self-hosted faces (public/fonts, with their licences): Permanent Marker for the logo and the big buttons, Lilita One for the small text. */
  @font-face { font-family: "Permanent Marker"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/PermanentMarker-Regular.woff2") format("woff2"); }
  @font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/LilitaOne-Regular.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/LilitaOne-Regular-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  /* Three more self-hosted faces (SIL OFL, licences in public/fonts) for the account screens: Nunito 800 for small status text, JetBrains Mono for codes and the admin console's values, Inter for the admin console. */
  @font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/Nunito-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/Nunito-800-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/fonts/JetBrainsMono.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/fonts/JetBrainsMono-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  @font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/Inter.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
  @font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/Inter-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
  :root { --nunito: "Nunito", "Lilita One", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; --inter: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  :root { --ink2: #1B1206; --lob-yellow: #FFD93B; --lob-bg: radial-gradient(circle at 50% 30%, #1A8A4C 0%, #0D5A31 75%); --marker: "Permanent Marker", "Comic Sans MS", cursive; --lilita: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif; }
  /* ---------- profile pictures, the account sheet, the daily loop ---------- */
  .avw { position: relative; display: inline-block; width: 1em; height: 1em; font-size: 28px; vertical-align: middle; flex: 0 0 auto; }
  .avw.sm { font-size: 22px; } .avw.md { font-size: 40px; } .avw.lg { font-size: 76px; }
  .av { display: grid; place-items: center; border-radius: 50%; width: 100%; height: 100%; font-size: .58em; line-height: 1; overflow: hidden; background: #9aa3a8; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); user-select: none; -webkit-user-select: none; }
  .av svg, .av img { width: 100%; height: 100%; display: block; object-fit: cover; }
  .avw .hat { position: absolute; left: 50%; top: -.4em; transform: translateX(-50%) rotate(-12deg); font-size: .62em; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
  .avw .hat svg { width: 1.25em; height: .9em; display: block; }
  .avw .held { position: absolute; right: -.3em; bottom: -.12em; font-size: .5em; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
  /* the ladder level at the tables: your "Level 50" pill laid over the line under your name (the line keeps its own height), and the other player's number under their picture on the strip (the picture moves up to make room, the strip doesn't move) */
  .line.lvline { position: relative; overflow: visible; }
  .lvpill { position: absolute; left: 0; top: 0; bottom: 0; box-sizing: border-box; display: inline-flex; align-items: center; background: #FFD23F; border: 2px solid #1B1206; border-radius: 999px; padding: 0 7px; font: 11px/1 var(--lilita); color: var(--ink2); white-space: nowrap; box-shadow: none; } /* (exactly the line's height, border included: the panels clip anything past the line, which cut the top and bottom borders off when it was 24 px) */
  .avw.lvup { transform: translateY(-6px); }
  .avw .lvnum { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 16px; min-width: 22px; padding: 0 5px; background: #FFD23F; border: 2px solid #1B1206; border-radius: 999px; font: 11px/1 var(--lilita); color: var(--ink2); white-space: nowrap; pointer-events: none; }
  /* titles: bold italic, coloured by rarity tier (or per letter for an event title); the owner's is black with a gold edge */
  .ttl { display: inline-block; max-width: 100%; font-size: .74rem; color: #9CA3AF; font-style: italic; font-weight: 800; letter-spacing: .02em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .ttl.blk { display: block; margin-top: 1px; }
  .ttl.r-owner { color: #000; -webkit-text-stroke: .5px #FBBF24; paint-order: stroke fill; text-shadow: 0 0 6px rgba(251,191,36,.85), 0 0 1px #FBBF24, 0 0 2px #FBBF24; }
  .player.strip .line .ttl { max-width: 11em; font-size: .78rem; }
  .notices { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
  .notice { position: relative; display: flex; align-items: center; gap: 12px; background: #0B3D22; border: 4px solid var(--ink2); border-radius: 18px; padding: 10px 14px 10px 10px; box-shadow: 0 5px 0 var(--ink2), 0 10px 30px rgba(0,0,0,.45); animation: slidein .35s ease-out; pointer-events: auto; touch-action: pan-y; transition: transform .18s ease, opacity .18s ease; }
  .notice .nico { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; background: #F5B83D; border: 3px solid var(--ink2); border-radius: 12px; font-size: 22px; font-style: normal; line-height: 1; } .notice .nico svg { width: 24px; height: 24px; } .notice .ntx { flex: 1 1 auto; min-width: 0; } /* (old-sheets-new-style.md §5: a chunky card, a tile coloured by kind with the title's emoji, the title in Lilita gold) */
  .notice .nx { display: none; position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: var(--cream); font-size: 1rem; line-height: 1; place-items: center; }
  body.kb .notice .nx { display: grid; } body.kb .notice { padding-right: 40px; }
  .notice b { display: block; font: 18px/1.15 var(--lilita); font-weight: 400; color: #FFD23F; } .notice span { display: block; margin-top: 2px; font: 800 14px/1.3 var(--nunito); color: #D6F2E0; }
  .notice.n-task .nico, .notice.n-challenge .nico { background: #7ED957; } .notice.n-achievement .nico { background: #F5B83D; }
  .notice.n-item .nico { background: #3FA9F5; }
  @keyframes slidein { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
  .toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: max-content; background: #E8505B; color: #fff; padding: 12px 22px; border: 4px solid var(--ink2); border-radius: 999px; box-shadow: 0 5px 0 var(--ink2), 0 10px 30px rgba(0,0,0,.4); font: 17px/1.2 var(--lilita); font-weight: 400; text-shadow: 2px 2px 0 var(--ink2), -1px -1px 0 var(--ink2), 1px -1px 0 var(--ink2), -1px 1px 0 var(--ink2); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; max-width: 90vw; text-align: center; }
  .toast.ok { background: #7ED957; color: var(--ink2); text-shadow: none; } /* (good news green with ink text, a problem red with white outlined text) */
  .toast.show { opacity: 1; }
  .parsedamt { display: block; width: 100%; text-align: right; color: var(--gold); font-size: .78rem; margin-top: 3px; min-height: 0; }
  .notice.n-energy .nico { background: #FFE45C; }
  .notice.n-bingo .nico { background: #F5B83D; }
  /* Reduce motion (Settings → Accessibility, or the phone's setting: body.rm, util.js applyComfort): each area's stylesheet ends with its own body.rm rules; these two fades are the shared replacements for a slide or a pop */
  @keyframes rmfade { from { opacity: 0; } }
  @keyframes rmfadeout { to { opacity: 0; } }
  body.rm .notice { animation: rmfade .2s ease-out; } /* (a notice fades in where it lands, no drop) */
