:root {
  color-scheme: light dark;
  --bg: #fbf4e4; --surface: #fffdf7; --well: #f4ead4; --text: #24190d; --muted: #6a5a43; --line: rgba(60, 40, 10, 0.13);
  --accent: #c4432a; --accent-text: #a93a22; --gold: #b07a0a; --good: #2b7a3c; --bad: #b3362d; --roll: #ffd23f; --roll-text: #2a1c02;
  --ca-accent: #c4432a; /* the accounts SDK's sheets and chip */
  --chrome: #1f4a28; /* the page round the board while a game is played (the world's own) */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --bg: #14161f; --surface: #1d202c; --well: #262a38; --text: #f1eee7; --muted: #b0a993; --line: rgba(255, 255, 255, 0.12); --accent: #e2654a; --accent-text: #ff9c80; --gold: #f2c45a; --good: #7fd68e; --bad: #ff8d84; }
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; --bg: #14161f; --surface: #1d202c; --well: #262a38; --text: #f1eee7; --muted: #b0a993; --line: rgba(255, 255, 255, 0.12); --accent: #e2654a; --accent-text: #ff9c80; --gold: #f2c45a; --good: #7fd68e; --bad: #ff8d84; }
* { box-sizing: border-box; }
/* no double-tap zoom on iOS: js/touch-guard.js adds the same rule plus a JS
   fallback; this copy covers Safari before 16.4 under the strict CSP */
:where(html, body, body *) { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: calc(100dvh / var(--ca-zoom, 1)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* in a Shared Space the call rests in a strip at the top: nothing of the game is under it */
  padding: calc(env(safe-area-inset-top) + var(--ca-space-top, 0px)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: background-color 0.35s;
}
/* a game page: no text selection or long-press callouts anywhere, HUD and
   menus included; form fields and long text (the rules) opt back in */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input[type='text'], textarea, [contenteditable], .prose p, .prose li { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- the bar ---- */
.bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 16px; min-height: 54px; flex: none; }
/* the SDK's brand at the left (§4.1); in a game the pause menu and the game's line (its world, size
   and who plays) follow it; the tools and the chip at the right end */
.bar > .sub { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; font-weight: 600; opacity: 0.88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar > .ca-end { margin-left: auto; }
/* a phone in a game: the line needs the room, the brand keeps its mark and icon */
@media (max-width: 699.98px) { body.playing #app-brand .ca-brand-name { display: none; } }
body.playing { background: var(--chrome); color: #fff; }

/* ---- the first screen ---- */
.home { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 20px 20px; }
/* (centred while it fits, from the top once it does not) */
.home > :first-child { margin-top: auto; }
.home > :last-child { margin-bottom: auto; }
.hero { position: relative; width: min(100%, 460px); aspect-ratio: 1.89; flex: none; border-radius: 24px; overflow: hidden;
  box-shadow: 0 22px 40px -26px rgba(60, 30, 0, 0.7); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tagline { margin: 0; max-width: 34ch; text-align: center; text-wrap: balance; color: var(--muted); font-size: 15.5px; }
.worlds { width: min(100%, 460px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.world { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 84px; padding: 8px 4px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 6px 18px -14px rgba(0, 0, 0, 0.4); transition: box-shadow 0.2s, border-color 0.2s, transform 0.12s; }
.world canvas { width: 100%; max-width: 86px; aspect-ratio: 1.89; height: auto; border-radius: 8px; display: block; }
.world[aria-checked='true'] { border-color: transparent; box-shadow: 0 0 0 2.5px var(--accent), 0 10px 24px -14px rgba(160, 50, 20, 0.6); }
.world:active, .day:active { transform: scale(0.97); }
.day { grid-column: 1 / -1; flex-direction: row; min-height: 58px; padding: 8px 14px 8px 8px; text-align: left; gap: 12px; }
.day canvas { width: 76px; flex: none; }
.day .card-main b { font-size: 15px; }
.world-hint { margin: -2px 0 0; width: min(100%, 460px); min-height: 2.6em; text-align: center; text-wrap: balance; color: var(--muted); font-size: 13.5px; line-height: 1.3; }
.home-stats { width: min(100%, 460px); display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 16px; background: var(--well); padding: 8px 4px; }
.home-stats div { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.home-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.home-stats span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.home-actions { width: min(100%, 460px); display: flex; flex-direction: column; gap: 10px; }
.home-links { display: flex; justify-content: center; width: min(100%, 460px); }
.link-btn { flex: 1 1 auto; min-height: 44px; padding: 0 6px; font-size: clamp(13px, calc(3.9vw / var(--ca-zoom, 1)), 16px); white-space: nowrap; border: 0; background: none; color: var(--accent-text); font-weight: 700; border-radius: 12px; cursor: pointer; }
.card-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px 10px 16px; text-align: left; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.35); }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-main small { color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-btn:active, .btn:active, .seg button:active { transform: scale(0.975); }

.btn { min-height: 46px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; transition: transform 0.12s, opacity 0.2s, background-color 0.2s; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---- the game ---- */
.game { flex: 1; min-height: 0; display: grid; grid-template: 'plates' auto 'stage' 1fr 'controls' auto / 1fr; }
.plates { grid-area: plates; display: flex; gap: 8px; padding: 0 10px 8px; justify-content: center; min-width: 0; }
.plate { position: relative; flex: 1 1 0; max-width: 240px; min-width: 0; display: grid; grid-template: 'pic nm' auto 'pic at' auto / auto minmax(0, 1fr); align-items: center; column-gap: 8px; padding: 5px 12px 5px 6px; border-radius: 16px; background: rgba(0, 0, 0, 0.26); color: #fff; line-height: 1.2; transition: box-shadow 0.25s, background-color 0.25s; }
.plate.turn { background: rgba(0, 0, 0, 0.42); box-shadow: 0 0 0 2.5px var(--roll), 0 0 22px rgba(255, 210, 63, 0.35); }
.plate .pic { grid-area: pic; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; overflow: hidden; }
.pawn-pic { width: var(--px, 40px); height: var(--px, 40px); display: block; }
.plate .nm { grid-area: nm; align-self: end; font-size: 14px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .at { grid-area: at; align-self: start; font-size: 12.5px; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.plate.away .pic, .plate.away .nm { opacity: 0.5; }
.say { position: absolute; left: 50%; top: 100%; z-index: 3; transform: translate(-50%, 6px); max-width: min(calc(78vw / var(--ca-zoom, 1)), 260px); padding: 6px 12px; border-radius: 14px; background: #fff6c9; color: #2a2206; font-weight: 700; font-size: 13.5px; line-height: 1.25; text-align: center; pointer-events: none; animation: say 2.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5); width: max-content; }
.say::before { content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes say { 0% { opacity: 0; transform: translate(-50%, -4px) scale(0.7); } 10% { opacity: 1; transform: translate(-50%, 6px) scale(1); } 86% { opacity: 1; transform: translate(-50%, 6px) scale(1); } 100% { opacity: 0; transform: translate(-50%, 2px) scale(0.96); } }
.stage { grid-area: stage; min-height: 0; min-width: 0; position: relative; margin: 0 6px; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop { position: absolute; left: var(--x); top: var(--y); font-weight: 850; font-size: 26px; color: #fff6c9; white-space: nowrap; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.6); animation: pop 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.pop.down { color: #ffd0d0; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); } 16% { opacity: 1; transform: translate(-50%, -64%) scale(1.14); } 28% { transform: translate(-50%, -70%) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1); } }
.controls { grid-area: controls; display: flex; align-items: center; gap: 14px; padding: 8px 16px 12px; }
.roll-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.status { margin: 0; min-height: 2.5em; font-size: 15px; font-weight: 700; line-height: 1.25; display: flex; align-items: flex-end; }
.btn.roll { min-height: 60px; font-size: 21px; font-weight: 850; letter-spacing: 0.01em; background: var(--roll); color: var(--roll-text); border-radius: 18px; box-shadow: 0 5px 0 #c99400, 0 14px 24px -12px rgba(0, 0, 0, 0.6); }
.btn.roll:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #c99400, 0 8px 18px -12px rgba(0, 0, 0, 0.6); }
.btn.roll:disabled { opacity: 1; background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.86); box-shadow: none; }
.btn.roll.go { animation: nudge 1.8s ease-in-out 0.6s infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-3px) scale(1.02); } 86% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .btn.roll.go { animation: none; } }

/* the die: a cube of six faces */
.die { --s: 64px; flex: none; width: calc(var(--s) + 20px); height: calc(var(--s) + 20px); display: grid; place-items: center; perspective: 420px; border-radius: 22px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35); }
.cube { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(var(--rx, -18deg)) rotateY(var(--ry, 24deg)); }
.cube.tumble { transition: transform var(--ms, 760ms) cubic-bezier(0.18, 0.9, 0.28, 1.04); }
.face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; border-radius: 18%; background: radial-gradient(circle at 30% 25%, #ffffff, #f1ece0 70%, #ddd4c0); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.08), inset 0 -4px 8px rgba(0, 0, 0, 0.08); backface-visibility: hidden; }
.face .pip { width: 72%; height: 72%; margin: auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a4b3a, #1c140b); }
.die[data-colour='0'] .face .pip { background: radial-gradient(circle at 35% 30%, #ff7d73, #a8161d); }
.die[data-colour='1'] .face .pip { background: radial-gradient(circle at 35% 30%, #7eaaff, #163a8f); }
.die[data-colour='2'] .face .pip { background: radial-gradient(circle at 35% 30%, #ffcf55, #8d5f00); }
.die[data-colour='3'] .face .pip { background: radial-gradient(circle at 35% 30%, #6fdc9b, #0e5a35); }
.f1 { transform: translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f2 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die.rolling { animation: shake 0.76s ease-out; }
.die.landed .cube { animation: land 0.32s ease-out; }
@keyframes shake { 0% { transform: none; } 15% { transform: translateY(-6px) rotate(-4deg); } 35% { transform: translateY(2px) rotate(3deg); } 60% { transform: translateY(-2px); } 100% { transform: none; } }
@keyframes land { 0% { scale: 1.12; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .die.rolling, .die.landed .cube { animation: none; } }

/* wide screens: the board on the left, the players and the die beside it */
@media (min-aspect-ratio: 6/5) and (min-width: 600px) {
  .game { grid-template: 'stage plates' auto 'stage controls' 1fr / 1fr minmax(230px, 30%); padding-bottom: 12px; }
  .plates { flex-direction: column; justify-content: flex-start; padding: 4px 14px 0 6px; gap: 8px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  .plate { flex: none; max-width: none; padding-block: 7px; }
  .controls { align-items: flex-end; align-self: end; flex-direction: column; padding: 10px 14px 4px 6px; }
  .controls .die { --s: 76px; align-self: center; }
  .roll-col { width: 100%; }
  .status { justify-content: center; text-align: center; align-items: center; }
  .stage { margin: 0 4px 0 10px; }
}
@media (max-height: 520px) and (min-aspect-ratio: 6/5) {
  .bar { min-height: 44px; padding-block: 0; }
  .plate { padding-block: 3px; }
  .plate .pic { width: 30px; height: 30px; }
  .controls { flex-direction: row; align-items: center; gap: 10px; }
  .controls .die { --s: 48px; }
  .status { font-size: 13px; min-height: 2.4em; }
  .btn.roll { min-height: 50px; font-size: 19px; }
}
/* a phone upright with three or four players: compact plates in two rows */
@media (max-width: 520px) {
  .plates:has(.plate:nth-child(3)) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .plates:has(.plate:nth-child(3)) .plate { max-width: none; padding-block: 3px; }
  .plates:has(.plate:nth-child(3)) .pic { width: 32px; height: 32px; }
  .die { --s: 54px; }
}
@media (max-height: 640px) and (max-aspect-ratio: 6/5) {
  .controls { padding-block: 4px 8px; }
  .status { min-height: 1.3em; font-size: 14px; }
  .btn.roll { min-height: 52px; }
  .die { --s: 48px; }
}

/* ---- sheets ---- */
.sheet { border: 0; padding: 0; border-radius: 24px; width: min(calc(94vw / var(--ca-zoom, 1)), 440px); max-height: min(calc(100dvh / var(--ca-zoom, 1) - 20px), 700px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.12); }
@keyframes sheet { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.sheet.wide { width: min(calc(94vw / var(--ca-zoom, 1)), 560px); }
.sheet.narrow { width: min(calc(94vw / var(--ca-zoom, 1)), 370px); }
.sheet::backdrop { background: rgba(10, 8, 4, 0.55); }
.sheet h2 { margin: 0; padding: 20px 22px 6px; font-size: 21px; letter-spacing: -0.01em; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding-right: 10px; }
.sheet-head h2 { flex: 1; min-width: 0; padding-bottom: 8px; }
.x { width: 44px; height: 44px; margin-top: 8px; flex: none; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.x:active { transform: scale(0.92); }
.sheet h3 { margin: 16px 0 8px; font-size: 13px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sheet .lead { margin: 0; padding: 0 22px 10px; color: var(--muted); flex: none; text-align: center; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 22px 14px; }
.sheet-body.stack { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; padding-bottom: 22px; }
.sheet-foot { flex: none; display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 16px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1 1 0; min-height: 52px; font-size: 17px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 4px 4px; border-radius: 12px; border: 0; background: var(--well); font-weight: 700; font-size: 14.5px; line-height: 1.15; cursor: pointer; transition: transform 0.12s, background-color 0.18s, color 0.18s; }
.seg button[aria-pressed='true'] { background: var(--accent); color: #fff; }
.hint { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.row small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.row-btn { width: 100%; border-width: 0 0 1px; border-color: var(--line); border-style: solid; background: none; text-align: left; cursor: pointer; }
.row select { min-height: 42px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 31px; margin: 0; border-radius: 16px; background: color-mix(in srgb, var(--muted) 45%, transparent); position: relative; cursor: pointer; transition: background-color 0.2s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(19px); }
.version { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* the players of a new game */
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 16px; background: var(--well); }
.seat .pic { width: 40px; height: 40px; display: grid; place-items: center; }
.seat input { min-width: 0; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; }
.seat .me { font-weight: 750; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .char { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; padding: 0 12px; border: 0; border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.seat .char span { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.seat .char b, .seat .char small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .char small { color: var(--muted); font-size: 12px; }
.seat .tools { display: flex; gap: 4px; }
.seat .kind, .seat .rm { min-height: 44px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; }
.seat .rm { color: var(--muted); display: grid; place-items: center; padding: 0; }
.btn.add { width: 100%; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }

.prose { font-size: 15.5px; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose h4 { margin: 16px 0 6px; font-size: 15.5px; }
.prose .pic-row { display: flex; justify-content: center; margin: 4px 0 12px; }
.prose .pic-row canvas { width: min(100%, 340px); height: auto; border-radius: 14px; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rows li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 12px 8px 10px; border-radius: 16px; background: var(--well); }
.rows li.win { box-shadow: inset 0 0 0 2px var(--gold); }
.rows .place { font-weight: 850; font-size: 17px; min-width: 1.4em; text-align: center; color: var(--muted); }
.rows .win .place { color: var(--gold); }
.rows .pic { width: 36px; height: 36px; display: grid; place-items: center; }
.rows .nm { font-weight: 750; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.rows .sq { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
#end h2 { text-align: center; padding-bottom: 4px; }
.trophy { display: flex; justify-content: center; padding: 22px 0 0; flex: none; }
.trophy canvas { width: 84px; height: 84px; animation: hop 1.2s cubic-bezier(0.3, 1.6, 0.5, 1) 0.2s 2; }
@keyframes hop { 0%, 100% { transform: none; } 30% { transform: translateY(-14px) scale(1.04, 0.97); } 55% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .trophy canvas { animation: none; } }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 68px; padding: 8px 4px; border-radius: 14px; background: var(--well); text-align: center; }
.stat b { font-size: 21px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.sheet > .tabs, .sheet-body > .tabs { margin: 0 0 8px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 30; transform: translateX(-50%); max-width: min(92%, 420px); padding: 10px 16px; border-radius: 14px; background: rgba(28, 22, 14, 0.94); color: #fff; font-size: 14.5px; font-weight: 650; text-align: center; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6); animation: toast 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px) scale(0.96); } }
@media (max-height: 640px) {
  .sheet h3 { margin: 10px 0 6px; }
  .sheet h2 { padding-top: 14px; }
  .x { margin-top: 4px; }
  .sheet-foot { padding-block: 10px 12px; }
  .tagline { display: none; }
  .hero { width: min(100%, 340px); }
}
@media (max-height: 500px) {
  .hero, .world-hint { display: none; }
  .home { gap: 8px; }
  .world { min-height: 50px; }
  .sheet { max-height: calc(100dvh / var(--ca-zoom, 1) - 8px); }
  .sheet h2 { padding: 8px 22px 0; font-size: 18px; }
  .sheet-head h2 { padding-bottom: 0; }
  .x { margin-top: 2px; height: 40px; }
  .sheet h3 { margin: 6px 0 4px; font-size: 12px; }
  .sheet .lead { padding-bottom: 6px; }
  .sheet-foot { padding-block: 6px 8px; }
  .sheet-foot .btn { min-height: 46px; }
  .trophy { padding-top: 8px; }
  .trophy canvas { width: 56px; height: 56px; }
  .sheet-body.stack { gap: 6px; padding-block: 6px 12px; }
}

/* cloud-apps bar 1.30.0 */
:root { --ca-brand-icon-w: 89px; } /* the brand's width with the icon alone (the mark, the divider, the app's icon) */
.ca-start { display: flex; align-items: center; flex: 0 100 auto; min-width: min(var(--ca-brand-icon-w), 100%); }
.ca-brand { display: flex; align-items: center; min-width: 0; height: 40px; color: inherit; font-family: inherit; }
.ca-brand a { display: flex !important; align-items: center !important; box-sizing: border-box !important; color: inherit !important; text-decoration: none !important; border-radius: 12px !important; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.ca-brand-home { flex: none !important; justify-content: center !important; width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 0 0 -5px !important; }
.ca-brand-home img { display: block !important; width: 30px !important; height: 30px !important; margin: 0 !important; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.ca-brand-sep { flex: none; display: block; width: 1.5px; height: 18px; margin: 0 4px; border-radius: 1px; background: currentColor; opacity: .22; transform: rotate(18deg); }
.ca-brand-app { flex: 0 1 auto !important; min-width: 44px !important; height: 40px !important; padding: 0 9px 0 5px !important; margin: 0 !important; }
.ca-brand-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 9px; min-width: 0; height: 40px; overflow: hidden; }
.ca-brand-in img { flex: none; display: block !important; width: 30px !important; height: 30px !important; margin: 5px 0 !important; border-radius: 8px; }
.ca-brand[data-ca-icon] .ca-brand-name { display: none !important; }
.ca-brand[data-ca-icon] .ca-brand-app { padding-right: 5px !important; }
.ca-brand-name { display: block; height: 40px; margin: 0 !important; padding: 0 !important; line-height: 40px !important; white-space: nowrap; font-family: var(--ca-brand-font, inherit); font-size: 17px !important; font-weight: 700; letter-spacing: -.015em; color: inherit; text-shadow: var(--ca-brand-shadow, none); }
@media (hover: hover) { .ca-brand a:hover { background-color: color-mix(in srgb, currentColor 7%, transparent); } .ca-brand-home:hover img { transform: rotate(-6deg) scale(1.06); } }
.ca-brand a:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: -3px; }
.ca-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-width: 0; }
.ca-tools { display: flex; align-items: center; gap: 6px; }
.ca-tools[hidden] { display: none !important; }
.ca-tool { position: relative; flex: none; display: inline-grid; place-items: center !important; box-sizing: border-box !important; width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; margin: 0; border-radius: 50% !important;
  border: 1px solid var(--ca-tool-line, color-mix(in srgb, currentColor 16%, transparent)) !important; background: var(--ca-tool-bg, color-mix(in srgb, currentColor 6%, transparent)) !important; color: var(--ca-tool-ink, inherit) !important;
  font: inherit; line-height: 0 !important; letter-spacing: 0; text-decoration: none !important; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .12s ease; }
.ca-tool[hidden] { display: none !important; }
.ca-tool::before { content: ""; position: absolute; inset: -4px; }
.ca-tool svg { display: block; width: 20px !important; height: 20px !important; margin: 0 !important; pointer-events: none; }
.ca-tool svg[hidden] { display: none !important; }
@media (hover: hover) { .ca-tool:hover { background: var(--ca-tool-hover, color-mix(in srgb, currentColor 13%, transparent)) !important; } }
.ca-tool:active { transform: scale(.94); }
.ca-tool:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: 2px; }
.ca-tool-talk { color: var(--ca-accent, #4f6bff) !important; border-color: color-mix(in srgb, var(--ca-accent, #4f6bff) 50%, transparent) !important; background: color-mix(in srgb, var(--ca-accent, #4f6bff) 13%, transparent) !important; }
.ca-tool .ca-tlive { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.ca-tool-talk.ca-new::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: ca-bar-ring 1.2s ease-out 2; }
@keyframes ca-bar-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ca-accent, #4f6bff) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
.ca-tool .ca-tcount, .ca-tool .ca-tunread { position: absolute; right: -5px; display: grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0; pointer-events: none; }
.ca-tool .ca-tcount { bottom: -5px; background: #1f9d55; }
.ca-tool .ca-tunread { top: -5px; background: #e5484d; }
@media (max-width: 599.98px), (max-height: 499.98px) { .ca-tools-app { display: none !important; } }
.ca-end[data-ca-cramped] .ca-tools-app { display: none !important; }
.ca-end[data-ca-tight] .ca-tool-friends { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ca-tool, .ca-brand a, .ca-brand-home img { transition: none; } .ca-tool-talk.ca-new::after { animation: none; } }
/* end of the cloud-apps bar */
/* ---- cloud-apps: big screens (App Standard §6.5) — written by `cloud-apps vendor-sdk`; do not edit ---- */
/* Past 1584 × 990 the page is laid out at about 1440 × 900 and zoomed to fill the screen; viewport
   units in this file are divided by --ca-zoom. cloud-kit.js turns it off where the engine has no
   standard zoom (html[data-ca-zoom="off"]). */
@media (min-width: 1585px) and (min-height: 991px) { :root { --ca-zoom: 1.1; } }
@media (min-width: 1656px) and (min-height: 1035px) { :root { --ca-zoom: 1.15; } }
@media (min-width: 1728px) and (min-height: 1080px) { :root { --ca-zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1125px) { :root { --ca-zoom: 1.25; } }
@media (min-width: 1872px) and (min-height: 1170px) { :root { --ca-zoom: 1.3; } }
@media (min-width: 1945px) and (min-height: 1215px) { :root { --ca-zoom: 1.35; } }
@media (min-width: 2016px) and (min-height: 1260px) { :root { --ca-zoom: 1.4; } }
@media (min-width: 2088px) and (min-height: 1305px) { :root { --ca-zoom: 1.45; } }
@media (min-width: 2160px) and (min-height: 1350px) { :root { --ca-zoom: 1.5; } }
@media (min-width: 2232px) and (min-height: 1395px) { :root { --ca-zoom: 1.55; } }
@media (min-width: 2304px) and (min-height: 1440px) { :root { --ca-zoom: 1.6; } }
@media (min-width: 2376px) and (min-height: 1485px) { :root { --ca-zoom: 1.65; } }
@media (min-width: 2448px) and (min-height: 1530px) { :root { --ca-zoom: 1.7; } }
@media (min-width: 2520px) and (min-height: 1575px) { :root { --ca-zoom: 1.75; } }
@media (min-width: 2592px) and (min-height: 1620px) { :root { --ca-zoom: 1.8; } }
@media (min-width: 2664px) and (min-height: 1665px) { :root { --ca-zoom: 1.85; } }
@media (min-width: 2736px) and (min-height: 1710px) { :root { --ca-zoom: 1.9; } }
@media (min-width: 2808px) and (min-height: 1755px) { :root { --ca-zoom: 1.95; } }
@media (min-width: 2880px) and (min-height: 1800px) { :root { --ca-zoom: 2; } }
@media (min-width: 2952px) and (min-height: 1845px) { :root { --ca-zoom: 2.05; } }
@media (min-width: 3024px) and (min-height: 1890px) { :root { --ca-zoom: 2.1; } }
@media (min-width: 3096px) and (min-height: 1935px) { :root { --ca-zoom: 2.15; } }
@media (min-width: 3169px) and (min-height: 1981px) { :root { --ca-zoom: 2.2; } }
@media (min-width: 3240px) and (min-height: 2025px) { :root { --ca-zoom: 2.25; } }
@media (min-width: 3312px) and (min-height: 2070px) { :root { --ca-zoom: 2.3; } }
@media (min-width: 3384px) and (min-height: 2115px) { :root { --ca-zoom: 2.35; } }
@media (min-width: 3456px) and (min-height: 2160px) { :root { --ca-zoom: 2.4; } }
@media (min-width: 3529px) and (min-height: 2205px) { :root { --ca-zoom: 2.45; } }
@media (min-width: 3600px) and (min-height: 2250px) { :root { --ca-zoom: 2.5; } }
@media (min-width: 3672px) and (min-height: 2295px) { :root { --ca-zoom: 2.55; } }
@media (min-width: 3744px) and (min-height: 2340px) { :root { --ca-zoom: 2.6; } }
@media (min-width: 3816px) and (min-height: 2385px) { :root { --ca-zoom: 2.65; } }
@media (min-width: 3889px) and (min-height: 2430px) { :root { --ca-zoom: 2.7; } }
@media (min-width: 3960px) and (min-height: 2475px) { :root { --ca-zoom: 2.75; } }
@media (min-width: 4032px) and (min-height: 2520px) { :root { --ca-zoom: 2.8; } }
@media (min-width: 4104px) and (min-height: 2565px) { :root { --ca-zoom: 2.85; } }
@media (min-width: 4176px) and (min-height: 2610px) { :root { --ca-zoom: 2.9; } }
@media (min-width: 4248px) and (min-height: 2655px) { :root { --ca-zoom: 2.95; } }
@media (min-width: 4320px) and (min-height: 2700px) { :root { --ca-zoom: 3; } }
@media (min-width: 4392px) and (min-height: 2745px) { :root { --ca-zoom: 3.05; } }
@media (min-width: 4464px) and (min-height: 2790px) { :root { --ca-zoom: 3.1; } }
@media (min-width: 4536px) and (min-height: 2835px) { :root { --ca-zoom: 3.15; } }
@media (min-width: 4608px) and (min-height: 2880px) { :root { --ca-zoom: 3.2; } }
@media (min-width: 4680px) and (min-height: 2925px) { :root { --ca-zoom: 3.25; } }
@media (min-width: 4752px) and (min-height: 2970px) { :root { --ca-zoom: 3.3; } }
@media (min-width: 4824px) and (min-height: 3015px) { :root { --ca-zoom: 3.35; } }
@media (min-width: 4896px) and (min-height: 3060px) { :root { --ca-zoom: 3.4; } }
@media (min-width: 4968px) and (min-height: 3105px) { :root { --ca-zoom: 3.45; } }
@media (min-width: 5040px) and (min-height: 3150px) { :root { --ca-zoom: 3.5; } }
@media (min-width: 5112px) and (min-height: 3195px) { :root { --ca-zoom: 3.55; } }
@media (min-width: 5184px) and (min-height: 3240px) { :root { --ca-zoom: 3.6; } }
@media (min-width: 5256px) and (min-height: 3285px) { :root { --ca-zoom: 3.65; } }
@media (min-width: 5328px) and (min-height: 3330px) { :root { --ca-zoom: 3.7; } }
@media (min-width: 5400px) and (min-height: 3375px) { :root { --ca-zoom: 3.75; } }
@media (min-width: 5472px) and (min-height: 3420px) { :root { --ca-zoom: 3.8; } }
@media (min-width: 5544px) and (min-height: 3465px) { :root { --ca-zoom: 3.85; } }
@media (min-width: 5616px) and (min-height: 3510px) { :root { --ca-zoom: 3.9; } }
@media (min-width: 5688px) and (min-height: 3555px) { :root { --ca-zoom: 3.95; } }
@media (min-width: 5760px) and (min-height: 3600px) { :root { --ca-zoom: 4; } }
@media (min-width: 5832px) and (min-height: 3645px) { :root { --ca-zoom: 4.05; } }
@media (min-width: 5904px) and (min-height: 3690px) { :root { --ca-zoom: 4.1; } }
@media (min-width: 5977px) and (min-height: 3736px) { :root { --ca-zoom: 4.15; } }
@media (min-width: 6048px) and (min-height: 3780px) { :root { --ca-zoom: 4.2; } }
@media (min-width: 6120px) and (min-height: 3825px) { :root { --ca-zoom: 4.25; } }
@media (min-width: 6192px) and (min-height: 3870px) { :root { --ca-zoom: 4.3; } }
@media (min-width: 6264px) and (min-height: 3915px) { :root { --ca-zoom: 4.35; } }
@media (min-width: 6337px) and (min-height: 3961px) { :root { --ca-zoom: 4.4; } }
@media (min-width: 6408px) and (min-height: 4005px) { :root { --ca-zoom: 4.45; } }
@media (min-width: 6480px) and (min-height: 4050px) { :root { --ca-zoom: 4.5; } }
@media (min-width: 6552px) and (min-height: 4095px) { :root { --ca-zoom: 4.55; } }
@media (min-width: 6624px) and (min-height: 4140px) { :root { --ca-zoom: 4.6; } }
@media (min-width: 6697px) and (min-height: 4185px) { :root { --ca-zoom: 4.65; } }
@media (min-width: 6768px) and (min-height: 4230px) { :root { --ca-zoom: 4.7; } }
@media (min-width: 6840px) and (min-height: 4275px) { :root { --ca-zoom: 4.75; } }
@media (min-width: 6912px) and (min-height: 4320px) { :root { --ca-zoom: 4.8; } }
@media (min-width: 6984px) and (min-height: 4365px) { :root { --ca-zoom: 4.85; } }
@media (min-width: 7057px) and (min-height: 4410px) { :root { --ca-zoom: 4.9; } }
@media (min-width: 7128px) and (min-height: 4455px) { :root { --ca-zoom: 4.95; } }
@media (min-width: 7200px) and (min-height: 4500px) { :root { --ca-zoom: 5; } }
@media (min-width: 1585px) and (min-height: 991px) {
  html { zoom: var(--ca-zoom, 1); }
  html[data-ca-zoom='off'] { --ca-zoom: 1 !important; }
}
/* ---- end of big screens ---- */
