/* Lava Leap — the page round the canvas: title, HUD, sheets. The volcano
   itself is drawn on the canvas (js/render.js). */
:root {
  color-scheme: light;
  --bg: #2a1440;
  --surface: #fffaf5;
  --surface-2: #f6ebe2;
  --text: #2a1730;
  --muted: #6b5468;
  --line: rgba(60, 20, 40, 0.12);
  --accent: #c9410c;
  --accent-2: #a3300a;
  --accent-soft: #ffe2d2;
  --accent-text: #a8340b;
  --good: #217a45;
  --gold: #e8a512;
  --glass: rgba(255, 250, 245, 0.84);
  --glass-line: rgba(255, 255, 255, 0.6);
  --hud-text: #ffffff;
  --shadow: 0 18px 50px -20px rgba(40, 10, 30, 0.55);
  --ca-accent: #c9410c; /* the accounts SDK's sheets and chip */
  --radius: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --surface: #22152e;
    --surface-2: #2c1d3a;
    --text: #f6ecf4;
    --muted: #b9a6bd;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #c9410c;
    --accent-soft: #4a2230;
    --accent-text: #ffb38a;
    --good: #6fd99a;
    --glass: rgba(34, 21, 46, 0.86);
    --glass-line: rgba(255, 255, 255, 0.1);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --surface: #22152e;
  --surface-2: #2c1d3a;
  --text: #f6ecf4;
  --muted: #b9a6bd;
  --line: rgba(255, 255, 255, 0.12);
  --accent-soft: #4a2230;
  --accent-text: #ffb38a;
  --good: #6fd99a;
  --glass: rgba(34, 21, 46, 0.86);
  --glass-line: rgba(255, 255, 255, 0.1);
}

* { 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%; height: 100%; overflow: hidden; background: var(--bg); }
body {
  margin: 0; height: 100%; overflow: hidden; position: fixed; inset: 0;
  background: var(--bg); color: var(--text);
  font: 16px/1.45 ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* a game page: no text selection or long-press callouts anywhere, HUD and
   menus included; form fields and long text (the Help sheet) opt back in */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable], .help p, .help li { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
i[data-icon] { display: inline-flex; }
:focus-visible { outline: 3px solid #ffb02e; outline-offset: 2px; }

/* ------------------------------------------------------------ the stage */
.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.field { position: fixed; inset: 0; touch-action: none; display: none; }
.mode-play .field { display: block; }

/* ------------------------------------------------------------ title */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  pointer-events: none;
  /* the brand in the light theme's ink in both themes: the title's sky behind it stays a bright day
     sky; the bar's tools in the game's glass with its own ink (App Standard §4.1) */
  color: #2a1730;
  --ca-tool-bg: var(--glass); --ca-tool-line: var(--glass-line); --ca-tool-ink: var(--text);
}
.topbar > * { pointer-events: auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--text);
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.5); cursor: pointer;
}
.icon-btn .ic { width: 22px; height: 22px; }
.mode-play .topbar, .mode-play .home { display: none; }

.home {
  position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center;
  padding: calc(64px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  pointer-events: none;
}
.brand { display: flex; flex-direction: column; align-items: center; line-height: 0.86; margin-top: calc(2vh / var(--ca-zoom, 1)); text-align: center; }
.brand-a, .brand-b {
  font-weight: 900; letter-spacing: -0.02em; color: #fff7ec;
  text-shadow: 0 3px 0 #c9410c, 0 6px 0 #7a2410, 0 14px 30px rgba(60, 10, 20, 0.55);
}
.brand-a { font-size: clamp(40px, calc(13vw / var(--ca-zoom, 1)), 76px); }
.brand-b { font-size: clamp(54px, calc(18vw / var(--ca-zoom, 1)), 104px); color: #ffd23a; }
.long-b .brand-b { font-size: clamp(44px, calc(14vw / var(--ca-zoom, 1)), 92px); }
.home-room { flex: 1; min-height: 120px; }
.home-panel {
  pointer-events: auto; width: min(100%, 440px);
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 26px; padding: 14px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
html[data-ca-lite] .home-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.stat { text-align: center; padding: 6px 4px; border-radius: 14px; background: var(--surface-2); min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.stat small { display: block; font-size: 10.5px; line-height: 1.15; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: 0.03em; overflow-wrap: break-word; hyphens: auto; }
.stat b { font-size: 18px; font-weight: 900; white-space: nowrap; }
.home-actions { display: flex; flex-direction: column; gap: 8px; }
.row-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.big-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-align: left; cursor: pointer; transition: transform 0.12s ease;
}
.big-btn:active { transform: scale(0.97); }
.big-btn .ic { width: 26px; height: 26px; color: var(--accent-text); }
.big-btn span { display: flex; flex-direction: column; min-width: 0; }
.big-btn b { font-size: 17px; font-weight: 850; line-height: 1.15; }
.big-btn small { font-size: 12.5px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* (its line as tall as its letters: the two lines sit in the middle) */
.big-btn.primary { background: linear-gradient(180deg, #c9410c, #a3300a); color: #fff; border-color: transparent; min-height: 66px; box-shadow: 0 10px 24px -12px rgba(160, 40, 10, 0.9); }
.big-btn.primary b { font-size: 20px; }
.big-btn.primary small { color: rgba(255, 255, 255, 0.95); }
.big-btn.primary .ic { color: #ffe08a; width: 30px; height: 30px; }
.big-btn.ghost { background: transparent; min-height: 48px; justify-content: center; }
.big-btn.ghost span { flex-direction: row; }

/* narrow phones: the two side by side stack their icon over the words */
@media (max-width: 380px) {
  .row-btns .big-btn { flex-direction: column; text-align: center; gap: 2px; padding: 8px 6px; }
  .row-btns .big-btn span { align-items: center; max-width: 100%; }
  .row-btns .big-btn b { font-size: 16px; }
  .row-btns .big-btn small { max-width: 100%; }
  .big-btn .ic { width: 24px; height: 24px; }
}
/* short screens: the logo gives way, the panel stays whole */
@media (max-height: 640px) {
  .home { padding-top: calc(58px + var(--safe-t)); }
  .brand-a { font-size: clamp(30px, calc(9vw / var(--ca-zoom, 1)), 52px); }
  .brand-b { font-size: clamp(40px, calc(12vw / var(--ca-zoom, 1)), 70px); }
  .home-stats { margin-bottom: 8px; }
  .big-btn { min-height: 50px; padding: 8px 12px; }
  .big-btn.primary { min-height: 56px; }
  .big-btn.ghost { min-height: 44px; }
}
@media (max-height: 560px) {
  .home-room { min-height: 40px; }
  .brand { margin-top: 0; }
}
/* sideways phones: the panel on the right, the logo and the dino on the left */
@media (orientation: landscape) and (max-height: 500px) {
  .home { flex-direction: row; align-items: center; justify-content: space-between; padding-top: calc(56px + var(--safe-t)); gap: 12px; }
  .brand { align-self: flex-start; margin: 0 0 0 calc(4vw / var(--ca-zoom, 1)); }
  .brand-a { font-size: 34px; }
  .brand-b { font-size: 46px; }
  .home-room { display: none; }
  .home-panel { width: min(calc(52vw / var(--ca-zoom, 1)), 380px); max-height: calc(calc(100dvh / var(--ca-zoom, 1)) - 64px - var(--safe-t) - var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; padding: 10px; }
  .home-stats { margin-bottom: 8px; }
  .stat b { font-size: 15px; }
  .big-btn { min-height: 46px; padding: 6px 12px; }
  .big-btn.primary { min-height: 50px; }
  .big-btn small { display: none; }
  .row-btns .big-btn { justify-content: center; text-align: center; }
  .row-btns .big-btn > i { display: none; } /* (the icon's holder too: no gap is left beside the words) */
}

/* ------------------------------------------------------------ the HUD */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; display: none; color: var(--hud-text); }
.mode-play .hud { display: block; }
.hud-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
}
.hud-l { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hud-c { text-align: center; text-shadow: 0 2px 0 rgba(60, 10, 30, 0.6), 0 3px 12px rgba(0, 0, 0, 0.45); }
.height { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.score { font-size: 15px; font-weight: 800; opacity: 0.95; margin-top: 2px; }
.hud-r { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.hud-btn { pointer-events: auto; background: rgba(30, 10, 30, 0.42); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.hearts { display: flex; gap: 4px; align-items: center; }
.hearts .h {
  width: 22px; height: 20px; display: block;
  background: radial-gradient(circle at 30% 30%, #ffb3c8 0 18%, transparent 19%), #ff4f7e;
  -webkit-mask: var(--heart) center / contain no-repeat; mask: var(--heart) center / contain no-repeat;
  filter: drop-shadow(0 2px 0 rgba(60, 10, 30, 0.6));
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hearts .h.off { opacity: 0.28; transform: scale(0.8); background: #ffffff; }
:root { --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21S1 14 1 7a5.5 5.5 0 0 1 11-1.5A5.5 5.5 0 0 1 23 7c0 7-11 14-11 14z'/%3E%3C/svg%3E"); }
.hearts .sh { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e6f6ff; background: radial-gradient(circle at 34% 32%, #ffffff 0 16%, rgba(190, 232, 255, 0.75) 22%, rgba(90, 170, 255, 0.55) 72%); display: block; margin-left: 2px; box-shadow: 0 2px 0 rgba(60, 10, 30, 0.45); }
.powers { display: flex; gap: 6px; flex-wrap: wrap; max-width: 150px; }
.pw { position: relative; width: 32px; height: 32px; display: block; border-radius: 50%; }
.pw canvas { width: 28px; height: 28px; position: absolute; left: 2px; top: 2px; }
.pw::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#ffffff calc(var(--p, 1) * 360deg), rgba(255, 255, 255, 0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 13px, #000 14px); mask: radial-gradient(circle, transparent 13px, #000 14px);
}
.chain {
  font-weight: 900; font-size: 18px; color: #2a1200; background: linear-gradient(180deg, #ffe066, #ffb02e);
  padding: 2px 10px; border-radius: 999px; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.5);
}
.chain.pop { animation: pop 0.35s ease; }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.hud-goals { position: absolute; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); display: flex; gap: 6px; }
.hg {
  display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px;
  padding: 3px 9px; border-radius: 999px; background: rgba(30, 10, 30, 0.5); color: #fff;
}
.hg .ic { width: 15px; height: 15px; }
.hg.done { background: rgba(33, 122, 69, 0.85); }
.hud-world { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }

.tip {
  position: fixed; z-index: 3; left: 16px; right: 16px; width: fit-content; margin: 0 auto; bottom: calc(18% + var(--safe-b));
  display: flex; align-items: center; gap: 12px; pointer-events: none;
  background: rgba(30, 10, 30, 0.6); color: #fff; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 999px;
  animation: tipIn 0.4s ease both; max-width: calc(100% - 32px); text-align: center;
}
.tip.out { animation: tipOut 0.3s ease both; }
.tip-l, .tip-r { color: #ffd23a; animation: nudge 1s ease-in-out infinite alternate; }
.tip-r { animation-direction: alternate-reverse; }
@keyframes nudge { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes tipIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes tipOut { to { opacity: 0; transform: translateY(10px); } }

.banner {
  position: fixed; z-index: 3; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-shadow: 0 3px 0 rgba(60, 10, 30, 0.6), 0 6px 20px rgba(0, 0, 0, 0.5);
}
.banner::before {
  content: ''; position: absolute; left: 0; right: 0; top: -40px; bottom: -40px; z-index: -1;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--wash, #ff8a4a) 45%, transparent), transparent);
}
.banner small { font-size: 13px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; }
.banner strong { font-size: clamp(28px, calc(9vw / var(--ca-zoom, 1)), 44px); font-weight: 900; line-height: 1.05; }
.banner span { font-size: 16px; font-weight: 800; color: #ffe066; }
.banner.on { animation: banner 2.8s ease both; }
@keyframes banner { 0% { opacity: 0; transform: scale(0.85); } 12% { opacity: 1; transform: scale(1.04); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.flash.hit { background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 40, 60, 0.55)); }
.flash.burn { background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 110, 20, 0.7)); }
.flash.on { animation: flash 0.5s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.toast {
  position: fixed; z-index: 6; left: 12px; right: 12px; width: fit-content; max-width: calc(100% - 24px); margin: 0 auto;
  top: calc(118px + var(--safe-t)); padding: 10px 16px; border-radius: 16px;
  background: rgba(30, 14, 36, 0.92); color: #fff; font-weight: 750; font-size: 15px; text-align: center;
  opacity: 0; transform: translateY(-8px); transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none;
}
.mode-home .toast { top: auto; bottom: calc(24px + var(--safe-b)); }
.toast.on { opacity: 1; transform: none; }

/* ------------------------------------------------------------ sheets */
.sheet {
  border: 0; padding: 0; color: var(--text); background: var(--surface);
  width: min(100%, 460px); max-width: 100%; max-height: min(calc(88dvh / var(--ca-zoom, 1)), 760px);
  border-radius: 26px; box-shadow: var(--shadow); overflow: hidden;
  display: none; flex-direction: column;
}
.sheet[open] { display: flex; animation: sheetIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
.sheet.closing { animation: sheetOut 0.16s ease both; }
.sheet::backdrop { background: rgba(20, 6, 20, 0.5); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(16px); } }
@media (max-width: 560px) {
  .sheet { margin: auto 0 0; width: 100%; border-radius: 26px 26px 0 0; max-height: calc(calc(92dvh / var(--ca-zoom, 1)) - var(--safe-t)); }
  .sheet .sheet-body { padding-bottom: calc(18px + var(--safe-b)); }
}
.sheet.small-sheet { width: min(100%, 400px); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 21px; font-weight: 900; flex: 1; min-width: 0; letter-spacing: -0.01em; }
.head-note { font-size: 13px; font-weight: 800; color: var(--accent-text); white-space: nowrap; }
.close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; }
/* flex-basis auto, never 0%: a modal <dialog> is fit-content tall between inset 0 and 0, and
   WebKit (every iPhone browser) resolves a 0% basis there to 0 — the end sheet shrank to its
   36 px of padding. From its content height the body still shrinks under max-height and scrolls. */
.sheet-body { padding: 4px 20px 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.sheet h3 { font-size: 15px; font-weight: 900; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.row small.block { font-weight: 550; font-size: 13px; line-height: 1.3; margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.btn {
  min-height: 48px; padding: 0 16px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(180deg, #c9410c, #a3300a); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; }
.link-btn { background: none; border: 0; padding: 10px 0; color: var(--accent-text); font-weight: 800; text-decoration: underline; cursor: pointer; min-height: 44px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.row.last { border-bottom: 0; }
.row > span:first-child { font-weight: 750; min-width: 0; }
.version { color: var(--muted); font-size: 13px; }
select { font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); min-height: 44px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 13px; padding: 3px; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.seg button { border: 0; background: transparent; padding: 0 11px; min-height: 38px; border-radius: 10px; font-weight: 750; font-size: 14px; cursor: pointer; color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--surface); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.35); color: var(--accent-text); }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background 0.2s; margin: 0; }
.switch::after { content: ''; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin: 4px 0 12px; overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: transparent; min-height: 40px; border-radius: 11px; font-weight: 800; font-size: 14px; cursor: pointer; padding: 0 10px; white-space: nowrap; color: var(--text); }
.tabs button[aria-selected='true'] { background: var(--surface); color: var(--accent-text); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.35); }
.board-host { min-height: 120px; }

/* pause */
.pause-height { font-size: 26px; font-weight: 900; margin: 0 0 8px; text-align: center; }
.pause-quick { display: flex; gap: 8px; justify-content: center; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 750; cursor: pointer; }
.chip-btn[aria-pressed='false'] { opacity: 0.65; }

/* the end of a climb */
.result .sheet-body { padding-top: 18px; }
.end-head { text-align: center; }
.end-dino { width: 96px; height: 96px; display: block; margin: -6px auto 0; animation: hop 1.2s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-10px); } }
.end-head h2 { margin: 2px 0 0; font-size: 26px; font-weight: 900; }
.end-sub { margin: 2px 0 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.end-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.end-nums > div { background: var(--surface-2); border-radius: 18px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.end-nums small { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.end-nums b { font-size: 30px; font-weight: 900; line-height: 1.1; }
.end-nums em { font-style: normal; font-weight: 900; font-size: 12px; color: #fff; background: var(--good); border-radius: 999px; padding: 2px 8px; margin: 4px auto 0; animation: pop 0.5s ease 0.3s both; }
:root[data-theme='dark'] .end-nums em { color: #0d2016; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .end-nums em { color: #0d2016; } }
.end-stars { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.end-stars .star .ic { width: 40px; height: 40px; fill: var(--line); stroke: none; }
.end-stars .star.on .ic { fill: var(--gold); animation: starIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) var(--d, 0s) both; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.end-goals, .brief-goals, .goal-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.end-goals li, .brief-goals li { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.end-goals li.ok { color: var(--text); }
.end-goals li.ok .ic { color: var(--good); }
.brief-goals .ic { fill: var(--line); stroke: none; width: 22px; height: 22px; }
.brief-goals .ic.on { fill: var(--gold); }
.brief-goals li { color: var(--text); font-size: 15px; }
.brief-what { font-weight: 750; margin: 0; }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 0; }
.end-stats > div { text-align: center; }
.end-stats dt { color: var(--accent-text); display: flex; justify-content: center; }
.end-stats dd { margin: 2px 0 0; font-weight: 850; font-size: 15px; }
.end-news { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.end-news p { margin: 0; display: flex; gap: 8px; align-items: center; font-weight: 750; font-size: 14px; background: var(--accent-soft); color: var(--text); border-radius: 13px; padding: 8px 12px; }
.end-news .ic { color: var(--accent-text); }

/* missions */
.mworld h3 { margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.mworld h3::before { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--wc, #7ed36a); flex: none; }
.w-foothills { --wc: #5cc46b; }
.w-ash { --wc: #e0703c; }
.w-caves { --wc: #8a6bff; }
.w-gorge { --wc: #3fc6b4; }
.w-chimney { --wc: #e8453c; }
.w-sky { --wc: #c48aff; }
.mgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mcard {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 15px; min-height: 76px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; min-width: 0;
}
.mcard b { font-size: 20px; font-weight: 900; line-height: 1; }
.mcard small { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.mcard.done { border-color: color-mix(in srgb, var(--wc) 60%, transparent); }
.mcard.locked { background: transparent; border-style: dashed; }
.mcard.locked small { color: var(--muted); }
.mcard.locked > .ic { width: 20px; height: 20px; color: var(--muted); }
.mcard.locked .mstars { opacity: 0.6; }
.mstars { display: flex; gap: 1px; }
.mstars .ic { width: 13px; height: 13px; fill: var(--line); stroke: none; }
.mstars .ic.on { fill: var(--gold); }

/* the wardrobe */
.wardrobe-dino { width: 120px; height: 120px; display: block; margin: 0 auto; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.wcard { position: relative; border: 2px solid var(--line); background: var(--surface-2); border-radius: 16px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-width: 0; }
.wcard canvas { width: 56px; height: 56px; }
.wcard small { font-size: 12px; font-weight: 750; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.wcard.on { border-color: var(--accent); background: var(--accent-soft); }
.wcard.locked canvas { filter: saturate(0.45) brightness(0.9); opacity: 0.55; }
.wcard .lock { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; color: var(--muted); }

/* results */
.friend-cards { display: flex; flex-direction: column; gap: 6px; }
.friend-card { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 6px 10px; }
.friend-card canvas { width: 46px; height: 46px; flex: none; }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-text b { font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-text small { color: var(--muted); font-weight: 700; }
.records { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.records > div { background: var(--surface-2); border-radius: 13px; padding: 8px 10px; min-width: 0; }
.records dt { font-size: 12px; color: var(--muted); font-weight: 750; }
.records dd { margin: 0; font-weight: 900; font-size: 17px; }
.goal-list li { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: var(--surface-2); border-radius: 13px; padding: 8px 10px; }
.goal-list li > .ic { grid-row: 1 / 3; color: var(--muted); width: 22px; height: 22px; }
.goal-list li.ok > .ic { color: var(--good); }
.gl-text { display: flex; flex-direction: column; min-width: 0; }
.gl-text b { font-weight: 800; font-size: 14px; }
.gl-text small { color: var(--muted); font-size: 12px; font-weight: 650; }
.gl-n { font-size: 12px; color: var(--muted); font-weight: 750; white-space: nowrap; }
.goal-list .bar { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.goal-list .bar b { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); border-radius: 3px; }
.goal-list li.ok .bar b { background: var(--good); }

/* help */
.help p, .help li { line-height: 1.5; }
.help ul { padding-left: 20px; margin: 0; }
.gallery { display: flex; flex-direction: column; gap: 8px; }
.gcard { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.gcard canvas { width: 48px; height: 48px; flex: none; }
.gcard b { font-weight: 850; }
.gcard p { margin: 0; font-size: 14px; color: var(--muted); }

/* challenge */
.ch-desc { font-weight: 750; font-size: 16px; }
.friend-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(40dvh / var(--ca-zoom, 1)); overflow-y: auto; overscroll-behavior: contain; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.friend-row .name { flex: 1; min-width: 0; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-weight: 900; flex: none; overflow: hidden; }
.confirm-text { font-weight: 800; font-size: 17px; text-align: center; margin: 4px 0 16px; }

/* the landing page's live demo */
.demo-canvas { width: 100%; height: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* 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 ---- */
