/* Refillit UI — mono: solid white surfaces floating over the 3D scene, near-black ink, black
   primary actions and pill tabs, big soft radii. Colour is kept for meaning only (stars, coins,
   staff abilities, good/bad states) so the café itself stays the colourful part of the screen.
   Phones (≤760px): panels and the character card become one bottom sheet at a time. */
@font-face {
  font-family: 'Refillit UI';
  src: url('../../assets/fonts/ui.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Refillit Display';
  src: url('../../assets/fonts/display.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --font: 'Refillit UI', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --font-display: 'Refillit Display', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --ink: #111111;
  --ink-soft: #6e6e73;
  --ink-faint: #a1a1a6;
  --surface: #ffffff;
  --fill: #f4f4f5;          /* rows, tiles, inactive tabs */
  --fill-2: #ebebed;        /* hover / tracks */
  --line: #e7e7ea;
  --accent: #111111;        /* primary actions are black */
  --accent-2: #2a2a2d;
  --accent-ink: #111111;
  --green: #1f9d55;
  --red: #e5484d;
  --gold: #f5a524;
  --shadow: 0 10px 30px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);
  --cell: var(--fill);
  --cell-hover: var(--fill-2);
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; background: #ededed; font-family: var(--font); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#view.dragging { cursor: grabbing; }
#view.building { cursor: crosshair; }
#ui { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
#ui > * { pointer-events: auto; }
.ico { display: inline-block; vertical-align: middle; flex: none; }
.glyph { overflow: visible; }
button { font-family: inherit; color: inherit; touch-action: manipulation; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #4c9ffe; outline-offset: 3px; }

/* ---------- surfaces ---------- */
.glass, .card, .chip, #buildbanner { position: relative; background: var(--surface); box-shadow: var(--shadow-sm); border: 0; }
.card { border-radius: 28px; padding: 18px; color: var(--ink); box-shadow: var(--shadow); }
.grabber { display: none; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--ink);
  background: var(--fill); cursor: pointer; white-space: nowrap; line-height: 1;
  transition: transform .15s ease, background .15s, color .15s;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.95); }
.btn .glyph { color: currentColor; }
.btn.primary { color: #fff; background: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: #c4262c; background: #fdeeee; }
.btn.danger:hover { background: #fbdcdc; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13.5px; gap: 5px; }
.btn.icon { width: 46px; min-width: 46px; height: 46px; padding: 0; }
.row .btn:not(.primary):not(.danger), .scard .btn:not(.primary):not(.danger), .tile .btn:not(.primary):not(.danger), .bitem .btn, .toggle .btn:not(.switch) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.row .btn:not(.primary):not(.danger):hover, .scard .btn:not(.primary):not(.danger):hover, .tile .btn:not(.primary):not(.danger):hover { background: #fafafa; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn[disabled], .btn.disabled { opacity: .35; cursor: not-allowed; transform: none; }
.xbtn { width: 36px; min-width: 36px; padding: 0 !important; }

/* ---------- top HUD ---------- */
#hud { position: absolute; top: calc(12px + var(--sat)); left: 50%; max-width: calc(100vw - var(--sal) - var(--sar) - 24px); transform: translateX(-50%); display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 16px 0 10px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
#hud .num { min-width: 36px; text-align: left; font-variant-numeric: tabular-nums; }
.lvl-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 110px; }
.lvl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.lvl-top .muted { font-size: 11.5px; }
.pbar { position: relative; height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.pbar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--ink); transition: width .3s; }
.pbar.gold > i { background: var(--gold); }
.pbar.green > i { background: var(--green); }
.pbar.orange > i { background: #f07a2a; }
.pbar.red > i { background: var(--red); }
.stars { display: inline-flex; gap: 0; align-items: center; cursor: pointer; }
.rating { cursor: pointer; }
.rating .star-one { display: none; }
.clock { font-size: 15px; display: flex; flex-direction: column; line-height: 1.08; }
.clock small { white-space: nowrap; font-family: var(--font); font-size: 10px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
#gift { cursor: pointer; padding: 0 11px; animation: wiggle 1.6s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-7deg) scale(1.06); } 20% { transform: rotate(7deg) scale(1.06); } 30% { transform: rotate(0); } }
.rating-tip { position: absolute; top: calc(70px + var(--sat)); left: 50%; translate: -50% 0;   /* not transform: the pop-in animation owns that */ width: 290px; font-size: 13px; display: none; z-index: 5; }
.rating-tip.show { display: block; animation: popin .25s ease-out; }
.rgrid { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 10px 10px; align-items: center; margin: 10px 0 8px; font-weight: 600; }
.rgrid .rpct { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }

/* brand chip: café badge + name + level */
.brand { padding: 0 18px 0 5px; gap: 10px; }
.brand .badge-c { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); }
.brand .badge-c .ico { width: 24px; height: 24px; }
.brand .badge-c b { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font: 700 9.5px var(--font-display); color: var(--ink); background: #fff; border-radius: 99px; padding: 1px 6px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.brand .bname { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .lvl-wrap { min-width: 150px; }
.lvl-top .bname { min-width: 0; }
.lvl-top .muted { flex: none; white-space: nowrap; }

/* ---------- floating round buttons ----------
   One size and spacing for all of them: the left column (daily goal, friends) and the right column
   (camera) start at the same height; the skills button sits on the tab bar's centre line. */
#ui { --hb: 46px; --hg: 10px; --ht: calc(76px + var(--sat)); --hl: calc(14px + var(--sal)); --hr: calc(14px + var(--sar)); --hbot: calc(23px + var(--sab)); }
#questbtn, #friendsbtn, #abtoggle { position: absolute; width: var(--hb); height: var(--hb); min-width: var(--hb); padding: 0; justify-content: center; border-radius: 50%; cursor: pointer; }

/* daily goal: a checklist button with a progress ring; the card pops out beside it */
#questbtn { top: var(--ht); left: var(--hl);
  background: radial-gradient(closest-side, #fff 82%, transparent 84%), conic-gradient(var(--ink) var(--p, 0%), var(--fill-2) 0); }
#questbtn .glyph { color: var(--ink); }
#questbtn.on { background: var(--ink); }
#questbtn.on .glyph { color: #fff; }
#questbtn.done { background: radial-gradient(closest-side, #fff 82%, transparent 84%), var(--green); }
#questbtn.on, #questbtn.on.done { background: var(--ink); }
.qb-badge { position: absolute; right: -6px; bottom: -4px; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--ink); color: #fff;
  font: 700 10px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px #fff; font-variant-numeric: tabular-nums; }
#questbtn.done .qb-badge { background: var(--green); }
#quest:not(.show) { visibility: hidden; opacity: 0; transform: translateY(-6px); pointer-events: none; }
#quest { position: absolute; top: var(--ht); left: calc(var(--hl) + var(--hb) + var(--hg)); width: 236px; display: flex; transition: opacity .18s, transform .18s; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 24px; cursor: default; }
#quest .q-ico { width: 42px; height: 42px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--fill); }
#quest .q-ico .ico { width: 30px; height: 30px; }
#quest .q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#quest .q-text { font-family: var(--font-display); font-weight: 650; font-size: 13.5px; line-height: 1.15; }
#quest .q-row { display: flex; align-items: center; gap: 8px; }
#quest .q-row .pbar { flex: 1; }
#quest .q-n { font-weight: 700; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#quest .q-reward { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 11.5px; color: var(--ink-soft); }
#quest.done .q-text { color: var(--green); }
#quest.done .q-ico { animation: wiggle 1.8s ease-in-out infinite; }

/* friends: under the daily goal */
#friendsbtn { top: calc(var(--ht) + var(--hb) + var(--hg)); left: var(--hl); }
#friendsbtn .glyph { color: var(--ink); }
#friendsbtn:hover { background: var(--fill); }
#friendsbtn.active { background: var(--ink); }
#friendsbtn.active .glyph { color: #fff; }
#friendsbtn .badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font: 700 10.5px var(--font); box-shadow: 0 0 0 2px #fff; }
/* ---------- camera controls: the right column ---------- */
#camctl { position: absolute; top: var(--ht); right: var(--hr); display: flex; flex-direction: column; gap: var(--hg); }
#camctl .btn { width: var(--hb); min-width: var(--hb); height: var(--hb); padding: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); }
#camctl .btn:hover { background: var(--fill); }
/* the side panel opens over this corner on wide screens: the camera buttons step aside */
#ui.has-panel #camctl { display: none; }

/* ---------- staff skills: a button that folds the dock out above it ---------- */
#abtoggle { left: var(--hl); bottom: var(--hbot); }
#abtoggle .glyph { color: var(--ink); }
#abtoggle:hover { background: var(--fill); }
#abtoggle.open { background: var(--ink); }
#abtoggle.open .glyph { color: #fff; }
/* something is ready to fire: a gold ring round the folded button (a box-shadow, so it stays round) */
#abtoggle.ready:not(.open) { box-shadow: var(--shadow-sm), 0 0 0 2.5px #f5b51b; animation: abpulse-gold 2.2s ease-in-out infinite; }
@keyframes abpulse-gold { 50% { box-shadow: var(--shadow-sm), 0 0 0 2.5px #f5b51b, 0 0 14px #f5b51b; } }
#abilities { position: absolute; left: var(--hl); bottom: calc(var(--hbot) + var(--hb) + var(--hg)); display: flex; flex-direction: column-reverse; gap: 8px; }
#abilities:not(.open) { display: none; }
.ability { position: relative; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 2px transparent; transition: transform .2s ease, box-shadow .3s; }
.ability:hover { transform: scale(1.05); }
.ability:active { transform: scale(.92); }
.ability .ab-face { position: absolute; inset: 5px; width: 44px !important; height: 44px !important; border-radius: 50%; }
.ability .ab-cd { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(transparent var(--p, 0%), rgba(17,17,17,.38) 0); }
.ability .ab-glyph { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--c); box-shadow: 0 0 0 2px #fff; }
.ability .ab-glyph .glyph { color: #fff; }
.ability.ready { box-shadow: var(--shadow-sm), 0 0 0 2.5px var(--c); animation: abpulse 2.2s ease-in-out infinite; }
@keyframes abpulse { 50% { box-shadow: var(--shadow-sm), 0 0 0 2.5px var(--c), 0 0 14px var(--c); } }
.ability.active { box-shadow: 0 0 0 3px var(--c), 0 0 20px var(--c); animation: none; }
.ability.active .ab-face { animation: abspin .6s linear infinite; }
@keyframes abspin { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.ability.locked .ab-face, .ability.tired .ab-face { filter: grayscale(1) opacity(.55); }
.ability.locked .ab-glyph { background: #9a9aa0; }
.ab-row { display: flex; align-items: center; gap: 6px; }
.ability.kit { width: 42px; height: 42px; }
.ability.kit .kit-glyph { position: absolute; inset: 0; display: grid; place-items: center; }
.ability.kit .kit-glyph .glyph { color: var(--c); }
.ability.kit.locked .kit-glyph .glyph, .ability.kit.tired .kit-glyph .glyph { color: #a1a1a6; }
.ability.kit.active .ab-face, .ability.kit.active { animation: none; }
.ability.windup { animation: abwind .18s ease-in-out infinite alternate; }
@keyframes abwind { from { box-shadow: 0 0 0 3px var(--c), 0 0 10px var(--c); transform: scale(1.04); } to { box-shadow: 0 0 0 4px #fff, 0 0 26px var(--c); transform: scale(1.12); } }

/* ---------- ability cut-in ---------- */
#cutin { position: absolute; left: 0; top: 38%; display: flex; align-items: center; gap: 12px; padding: 10px 26px 10px 14px; pointer-events: none;
  border-radius: 0 999px 999px 0; opacity: 0; transform: translateX(-110%); background: var(--surface); box-shadow: var(--shadow), inset 4px 0 0 var(--c, #111); }
#cutin.show { animation: cutin 1.7s cubic-bezier(.2,1,.3,1) forwards; }
@keyframes cutin {
  0% { opacity: 0; transform: translateX(-110%); }
  14% { opacity: 1; transform: translateX(0); }
  80% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-30px); }
}
#cutin .ci-face { position: relative; width: 52px; height: 52px; }
#cutin .ci-portrait { width: 52px !important; height: 52px !important; border-radius: 50%; background: var(--fill); box-shadow: 0 0 0 3px var(--c); }
#cutin .ab-glyph { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: 0 0 0 2px #fff; }
#cutin .ab-glyph .glyph { color: #fff; }
#cutin .ci-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
#cutin .ci-text b { max-width: min(56vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
#cutin .ci-text span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }

/* ---------- toolbar: black capsule tab bar ---------- */
#toolbar { position: absolute; bottom: calc(14px + var(--sab)); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: #111; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.tool { position: relative; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border-radius: 50%; color: rgba(255,255,255,.6); background: transparent; }
.tool:hover { background: rgba(255,255,255,.08); color: #fff; }
.tool .glyph { color: currentColor; }
.tool.active { color: #111; background: #fff; }
.tool .badge { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 10px; font-size: 10.5px; font-weight: 700; padding: 0 5px; box-shadow: 0 0 0 2px #111; }

/* ---------- side panel (desktop) / bottom sheet (phones) ---------- */
#panel { position: absolute; top: calc(76px + var(--sat)); right: calc(14px + var(--sar)); bottom: calc(96px + var(--sab)); width: min(430px, calc(100vw - var(--sal) - var(--sar) - 28px)); display: flex; flex-direction: column; padding: 18px 18px 12px;
  transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; transition: transform .38s cubic-bezier(.2,.9,.3,1), opacity .2s; }
#panel.open { transform: none; opacity: 1; pointer-events: auto; }
.panel-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.panel-head h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 750; font-size: 24px; letter-spacing: -.03em; flex: 1; color: var(--ink); }
.panel-head .ico { width: 30px; height: 30px; }
.panel-body { overflow-y: auto; overflow-x: hidden; flex: 1; padding: 2px 6px 4px 2px; margin: 0 -8px 0 -2px; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.18) transparent; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#scrim { position: absolute; inset: 0; display: none; background: rgba(0,0,0,.18); }

/* pill tabs: the active one is solid black */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; min-height: 34px; padding: 0 14px; background: var(--fill); color: var(--ink-soft); }
.tab:hover { background: var(--fill-2); color: var(--ink); }
.tab.on, .tab.on:hover { background: var(--ink); color: #fff; }
/* segmented tabs: equal columns that always fit, the count in small type under the name */
.tabs.seg { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); overflow: visible; }
.tabs.seg .tab { flex-direction: column; justify-content: center; gap: 0; min-height: 46px; padding: 4px 4px; line-height: 1.15; }
.tabs.seg .tab span, .tabs.seg .tab small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs.seg .tab small { font-size: 11px; font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 20px; background: var(--cell); transition: background .15s; }
.row.locked { opacity: .5; }
/* rows whose description runs the full width under the portrait, so a wide button never squeezes it */
.row.split { flex-wrap: wrap; row-gap: 4px; }
.row.split > .btn, .row.split > .pill { flex: none; white-space: nowrap; }
.row-full { flex: 1 0 100%; padding-left: 60px; min-width: 0; }
.row-full .bmsg { white-space: nowrap; }
.row-full.flat { padding-left: 0; }
/* sub-view header: back button and the title on one line */
.subhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; }
.subhead .btn { flex: none; }
.subhead b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* pantry: equal columns instead of a ragged run of chips */
.ings.pantry { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
.ings.pantry .ing { justify-content: center; padding: 3px 8px 3px 4px; }
/* tile buttons share a row when they fit and stack at equal width when they don't */
.tile .btnrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); width: 100%; }
.tile .btnrow .btn { width: 100%; white-space: nowrap; }
.row.split.dish .row-full { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
/* a row of pills / small buttons that stays on one line */
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; margin: 2px 0; }
.chips > * { flex: none; white-space: nowrap; }
.seg { white-space: nowrap; }
.seg-dot { opacity: .6; }
.sklist.flush .sk { padding-left: 0; padding-right: 0; }
.row .grow { flex: 1; min-width: 0; }
.row h3 { margin: 0 0 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 650; font-size: 15.5px; letter-spacing: -.015em; }
.row.current { box-shadow: inset 0 0 0 2px var(--ink); }
.muted { color: var(--ink-soft); font-size: 13px; font-weight: 500; line-height: 1.4; text-wrap: pretty; }   /* no one-character last lines */
/* Chinese may break between any two characters, so a word or a number + unit can split. Prose breaks at
   punctuation and spaces instead; a clause too long for the line still breaks (overflow-wrap). */
.muted, .note, .sk-desc, .away-note { word-break: keep-all; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 3px; background: var(--surface); border-radius: 99px; padding: 2px 9px 2px 4px; font-weight: 650; font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); }
.btn.primary .pill { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.btn.danger .pill { background: rgba(255,255,255,.6); }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.section-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 20px 4px 10px; letter-spacing: -.02em; color: var(--ink); }
.ings { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ing { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; background: var(--surface); border-radius: 99px; padding: 1px 8px 1px 2px; box-shadow: inset 0 0 0 1px var(--line); }
.ing.done { background: #e7f6ed; color: #17703d; box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 20px; background: var(--cell); }
.tile b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 650; font-size: 14.5px; }
.skill { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 2px 0; flex-wrap: nowrap; min-width: 0; }
.skill > span:not(.skill-stars) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-stars { flex: none; }
.skill .xp { flex: 1 1 0; min-width: 0; max-width: 140px; height: 5px; }   /* the bar gives way before the title does */
.skill-stars { display: inline-flex; gap: 0; }
/* staff cards: a compact header you tap to open the full skill list and the actions */
.stat-strip { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.stat-strip .pill { white-space: nowrap; padding: 4px 11px 4px 6px; font-size: 13px; }
.stat-strip .btn.xbtn { margin-left: auto; width: 36px; height: 36px; min-height: 36px; border-radius: 50%; }
.note { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--fill); font-size: 13.5px; font-weight: 500; line-height: 1.55; color: var(--ink-soft); }
.scard { margin-bottom: 8px; border-radius: 20px; background: var(--cell); }
.scard-head { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 20px; background: none; text-align: left; font: inherit; color: inherit; }
button.scard-head { cursor: pointer; }
.scard-head .portrait { width: 56px; height: 56px; }
@media (max-width: 360px) { .scard-head { gap: 10px; } .scard-head .portrait { width: 46px !important; height: 46px !important; } .scard-title { gap: 6px; } .row-full { padding-left: 58px; } }
.scard-head .grow { flex: 1; min-width: 0; }
.scard-title { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 2px; }
.scard-title b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 650; font-size: 15.5px; letter-spacing: -.015em; }
.scard-title .pill { flex: none; margin-left: auto; white-space: nowrap; }
.scard-status { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.scard-status .task { flex: 0 1 auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-status .pbar { flex: 1; min-width: 40px; }
.scard-chev { flex: none; align-self: center; display: grid; color: var(--ink-faint); transition: transform .2s; }
.scard.open .scard-chev { transform: rotate(90deg); }
.scard-body { padding: 0 12px 12px; }
.scard-acts { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-top: 8px; }
.scard-acts .btn { flex: none; white-space: nowrap; }
.scard-acts .push { margin-left: auto; }
.acts-label { flex: none; min-width: 40px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.sk-dots { display: flex; gap: 6px; margin-top: 7px; }
.sk-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.sk-dot .glyph, .sk-ico .glyph { color: var(--c); }
.meta { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* skills: icon | name + how it fires, description under the name on one shared left edge */
.sklist { display: flex; flex-direction: column; gap: 2px; }
.sk { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 8px 10px; border-radius: 14px; }
.sk-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.sk-name { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 28px; }
.sk-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; color: var(--ink); }
.sk-tag { flex: none; white-space: nowrap; padding: 2px 8px; border-radius: 99px; background: var(--fill); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.sk.cast { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.sk.cast .sk-tag { background: var(--surface); color: var(--ink); }
.sk.bad .sk-tag { background: #fdeee4; color: #b4541c; }
.sk-desc { grid-column: 2; margin-top: 1px; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.abil { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; margin: 3px 0; color: var(--ink-soft); }
.abil .glyph { color: var(--c); flex: none; }
.abil b { color: var(--ink); white-space: nowrap; font-weight: 650; }
.abil span { line-height: 1.35; }
.portrait { width: 64px; height: 64px; flex: none; border-radius: 18px; background: var(--surface); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; transition: transform .15s; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2.5px var(--ink); }
.orow { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; margin: 10px 0; font-weight: 600; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper span { min-width: 72px; text-align: center; text-transform: capitalize; font-weight: 650; }
.plot { position: relative; }
.plot .plot-thumb { display: block; margin: -4px 0 2px; }
input[type=range] { width: 100%; accent-color: var(--ink); }
input[type=text], input[type=email], input[type=password] { font-family: inherit; font-weight: 600; font-size: 16px; padding: 12px 16px; border-radius: 16px; border: 0; background: var(--fill); color: var(--ink); width: 100%; outline: none; }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus { box-shadow: 0 0 0 2px var(--ink); }
.toggle { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin: 6px 0; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--cell); }
kbd { background: var(--surface); border-radius: 6px; padding: 1px 6px; box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); font-family: inherit; font-weight: 700; font-size: 12px; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; padding: 0; min-height: 0; cursor: pointer; border: 0; background: #d4d4d8; transition: background .25s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s ease; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(20px); }
.decor-score { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 20px; background: var(--ink); color: #fff; margin-bottom: 10px; font-weight: 650; }
.decor-score .grow { flex: 1; }
.decor-score .pbar { background: rgba(255,255,255,.2); }
.thumb-slot { width: 64px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--surface); }
.thumb-slot canvas { max-width: 60px; max-height: 52px; }
.stock { font-size: 12px; margin: 2px 0; }
.stock.low { color: #c46a12; font-weight: 650; }
.stock.out { color: #c4262c; font-weight: 650; }

/* ---------- build tray ---------- */
#buildbar { position: absolute; left: 50%; bottom: calc(14px + var(--sab)); transform: translate(-50%, 140%); transition: transform .35s cubic-bezier(.2,.9,.3,1); width: min(980px, calc(100vw - var(--sal) - var(--sar) - 20px)); }
#buildbar.open { transform: translate(-50%, 0); }
#buildbar .card { padding: 12px 14px 10px; border-radius: 28px; }
.bb-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.bb-top .tabs { margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.bb-top .tabs::-webkit-scrollbar { display: none; }
.bb-top .tab { flex: none; }
.bb-top .grow { flex: 1; }
.bb-top .done { flex: none; }
.bb-top .fold { flex: none; width: 34px; min-width: 34px; padding: 0; }
.bb-top .fold .glyph { transform: rotate(-90deg); }   /* the back arrow, pointing down: fold the tray */
.bb-fold { display: flex; align-items: center; gap: 10px; }
.bb-fold .grow { min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-fold .bad { color: #c4262c; }
.bb-items { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.18) transparent; overscroll-behavior-x: contain; }
.bitem { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 8px; border-radius: 20px; background: var(--cell);
  cursor: pointer; font-weight: 600; font-size: 12px; text-align: center; transition: background .15s, box-shadow .15s; }
.bitem span:first-of-type { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 650; font-size: 12.5px; line-height: 1.15; }
.bitem:hover { background: var(--cell-hover); }
.bitem.sel { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink); }
.bitem.locked { opacity: .45; }
.bitem.charm { cursor: default; justify-content: center; background: var(--ink); color: #fff; }
.bitem.charm .pill { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.pill.hung { background: var(--ink); color: #fff; box-shadow: none; padding: 2px 9px; }
.pill.hung .glyph { color: #fff; }
.bitem canvas { width: 62px; height: 48px; }
/* placement / selection action bar: name on the left, big round buttons on the right */
.bb-act { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 6px 6px 6px 16px; border-radius: 99px; background: var(--fill); }
.bb-act-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bb-act-name b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-act-name .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-act .btn.icon { background: var(--surface); box-shadow: var(--shadow-sm); }
.bb-act .btn.icon.ghost { background: transparent; box-shadow: none; }
.bb-act .btn.primary.icon { background: var(--ink); color: #fff; }
.bb-act .btn.danger { min-height: 46px; }
.bb-msg { margin-top: 4px; }
.bmsg { display: inline-block; font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; background: var(--fill); color: var(--ink-soft); }
.bmsg.bad { background: #fdeeee; color: #c4262c; }
.bmsg.good { background: #e7f6ed; color: #17703d; }
.bmsg.warn { background: #fff4e0; color: #8a5a00; }
#buildbanner { position: absolute; top: calc(72px + var(--sat)); left: 50%; max-width: calc(100vw - var(--sal) - var(--sar) - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); display: none; align-items: center; gap: 6px; pointer-events: none;
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 99px; background: #111; color: #fff; }
#buildbanner .glyph { color: #fff; }
#buildbanner.show { display: inline-flex; }

/* folded tray while an item is being placed: one line, so the café stays in view */
.bb-mini { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: 24px; max-width: 560px; margin: 0 auto; }
.bb-mini .thumb-slot { width: 52px; height: 46px; background: var(--fill); }
.bb-mini .thumb-slot canvas { max-width: 48px; max-height: 42px; }
.bb-mini b { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.bb-mini .muted { font-size: 12.5px; margin-top: 2px; }
.bb-mini .muted.bad { color: #c4262c; font-weight: 600; }
.bb-mini .btn { flex: none; }

/* rotate · place · cancel (or rotate · move · sell) floating under the item in the scene */
/* build mode: a ring of buttons centred on the item (positions set in ui.js renderGhostCtl) */
#ghostctl { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; will-change: transform; z-index: 3; }
#ghostctl.show { display: block; }
#ghostctl > * { position: absolute; transform: translate(-50%, -50%); }
#ghostctl > .gc-label { left: 0; top: -116px; }
.gc-label { max-width: 240px; padding: 5px 12px; border-radius: 99px; background: #111; color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-sm); }
.gc-label.bad { background: #c4262c; }
.gc-btn { width: 48px; height: 48px; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: #fff; color: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.1); transition: transform .15s; }
.gc-btn:active { transform: scale(.9); }
#ghostctl > .gc-btn:active { transform: translate(-50%, -50%) scale(.9); }
.gc-btn .glyph { color: currentColor; }
.gc-btn.ok { width: 58px; height: 58px; background: #111; color: #fff; }
.gc-btn.ok.off { background: #9a9aa0; }
.gc-btn.sell { width: auto; padding: 0 16px; border-radius: 99px; font: 600 13.5px var(--font); color: #c4262c; white-space: nowrap; }

/* ---------- info card ---------- */
#info { position: absolute; left: calc(14px + var(--sal)); top: calc(146px + var(--sat)); width: 270px; display: none; padding: 16px; border-radius: 28px; }
#info.show { display: block; animation: popin .25s ease-out; }
@keyframes popin { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.info-head { display: flex; gap: 12px; align-items: center; }
.info-head h3 { margin: 0; font-family: var(--font-display); font-weight: 750; font-size: 20px; letter-spacing: -.03em; }

/* ---------- toasts & modals ---------- */
#toasts { position: absolute; top: calc(76px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 6; }
.toast { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 99px; animation: toastin .3s ease-out; max-width: calc(100vw - var(--sal) - var(--sar) - 28px); text-align: center;
  background: #111; color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.toast.bad { background: #c4262c; }
.toast.good { background: #111; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toastin { from { transform: translateY(-12px); opacity: 0; } }
#modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.4); z-index: 7; padding: 12px; }
#modal.show { display: flex; }
#modal .card { width: min(420px, 100%); max-height: calc(100% - 24px); overflow-y: auto; text-align: center; animation: popin .3s ease-out; padding: 24px 20px 20px; border-radius: 32px; }
#modal .card > .btn.primary, #celebrate .card > .btn.primary { width: 100%; min-height: 52px; font-size: 16px; }
.big-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.035em; margin: 6px 0 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 14px 0; }   /* 9 or 6 stats: always full rows */
.stat { min-width: 0; background: var(--cell); border-radius: 16px; padding: 8px 4px; font-weight: 600; }
.stat b { display: block; white-space: nowrap; font-family: var(--font-display); font-weight: 750; font-size: 17px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.stat .ico { width: 22px; height: 22px; }
.hero-ico { display: flex; justify-content: center; }
.card.away { max-width: 440px; }
.away-note { margin: 6px 0; padding: 8px 12px; border-radius: 14px; background: var(--fill); font-weight: 500; font-size: 13px; line-height: 1.5; text-align: left; }
.away-note.warn { background: #fff4e0; color: #7a4a00; }
.away-note .ing { margin: 0 3px; }
#celebrate { position: absolute; top: calc(84px + var(--sat)); left: 50%; translate: -50% 0; width: min(340px, calc(100vw - 24px)); text-align: center; display: none; z-index: 6; }
#celebrate.show { display: block; animation: popin .35s ease-out; }
#celebrate .card { border-radius: 32px; }
#celebrate .big-title { font-size: 26px; }

/* ---------- debug ---------- */
#debug { position: absolute; left: 80px; bottom: 96px; width: 300px; padding: 14px; border-radius: 24px; display: none; font-size: 13px; }
#debug.show { display: block; }
#debug .btn { min-height: 28px; font-size: 12px; padding: 0 10px; }
#debug label { display: flex; gap: 6px; align-items: center; font-weight: 600; margin: 4px 0; }

/* ---------- loading ---------- */
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; transition: opacity .5s; background: #f4f4f5; }
#loading.hide { opacity: 0; pointer-events: none; }
.load-card { text-align: center; padding: 34px 44px 28px; }
.load-cup { position: relative; width: 124px; height: 112px; margin: 0 auto 6px; }
.load-cup .steam { position: absolute; left: 22px; top: -6px; width: 60px; height: 40px; display: flex; justify-content: space-between; }
.load-cup .steam i { width: 6px; height: 30px; border-radius: 8px; background: linear-gradient(180deg, transparent, rgba(17,17,17,.25)); opacity: 0; animation: steam 2.2s ease-in-out infinite; }
.load-cup .steam i:nth-child(2) { animation-delay: .5s; height: 38px; } .load-cup .steam i:nth-child(3) { animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(14px) scaleY(.6); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px) scaleY(1.1) translateX(5px); } }
.load-cup .cup { position: absolute; left: 6px; top: 34px; width: 84px; height: 62px; border-radius: 8px 8px 38px 38px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 3px #111; }
.load-cup .cup::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(8% + var(--p, 0%) * .72); background: #111; transition: height .25s; }
.load-cup .handle { position: absolute; left: 87px; top: 44px; width: 30px; height: 34px; border: 6px solid #111; border-left: 0; border-radius: 0 20px 20px 0; }
.load-cup .saucer { position: absolute; left: 0; top: 96px; width: 108px; height: 6px; border-radius: 6px; background: #111; }
.load-title { font-family: var(--font-display); font-size: 44px; font-weight: 800; letter-spacing: -.045em; color: #111; }
.load-title em { font-style: normal; color: #a1a1a6; }
.load-tag { font-weight: 600; color: var(--ink-soft); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; margin-top: 2px; }
.load-bar { width: 240px; height: 4px; margin: 22px auto 12px; border-radius: 99px; background: #e4e4e7; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: #111; border-radius: 99px; transition: width .2s; }
.load-msg { font-weight: 500; font-size: 13.5px; color: var(--ink-soft); }

/* the start screen: sign in to an existing café, or start as a guest (ui/welcome.js), inside the loading card */
#loading.choosing { overflow-y: auto; align-items: safe center; padding: 16px 0 calc(16px + var(--sab)); }
#loading.choosing .load-card { padding: 20px 16px; width: min(380px, 100%); }
.start-pane { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; text-align: left; animation: popin .35s ease-out; }
.start-pane .btn { width: 100%; min-height: 52px; justify-content: center; gap: 10px; font-size: 15.5px; }
.start-guest { font-size: 16.5px !important; }
.start-google, .start-email { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.start-google:hover, .start-email:hover { background: #fafafa; }
.start-or { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.start-or::before, .start-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.start-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); text-align: center; margin-top: 4px; }
.start-err { color: #c0392b; font-size: 13px; font-weight: 600; text-align: center; }
.start-err:empty { display: none; }
.start-head { display: flex; align-items: center; gap: 10px; }
.start-head b { font-family: var(--font-display); font-size: 17px; }
.start-pane .start-back { width: 38px; min-width: 38px; min-height: 38px; padding: 0; flex: none; border-radius: 50%; }
.start-form { display: flex; flex-direction: column; gap: 10px; }
.start-form input { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); min-height: 50px; }
.start-form input:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.start-pane .start-back { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.start-pane .linkish { align-self: center; }
/* short screens (phones held sideways): the cup steps aside so the choices fit */
@media (max-height: 560px) {
  #loading.choosing .load-cup, #loading.choosing .load-tag { display: none; }
  #loading.choosing .load-title { font-size: 34px; }
  #loading.choosing .start-pane { margin-top: 14px; }
}

/* desktop build mode: the camera buttons step up above the build tray */

/* ---------- tablets & small laptops ---------- */
@media (max-width: 760px) {
  #hud { gap: 6px; transform: translateX(-50%) scale(.9); transform-origin: top center; }
  .tool { width: 48px; height: 48px; }
  #toolbar { padding: 5px; }
  /* phones: the same columns, a little tighter; the skills button sits just above the tab bar */
  #ui { --hb: 44px; --ht: calc(58px + var(--sat)); --hl: calc(10px + var(--sal)); --hr: calc(10px + var(--sar)); --hbot: calc(88px + var(--sab)); }
  #ui.has-panel #camctl { display: flex; }
  .ability { width: 50px; min-width: 50px; height: 50px; }
  .ability .ab-face { inset: 4px; width: 42px !important; height: 42px !important; }
  .ability.kit { width: 44px; min-width: 44px; height: 44px; }

  /* one bottom sheet at a time, sitting above the tab bar so switching tabs still works */
  #panel, #info { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); width: auto; top: auto; bottom: calc(84px + var(--sab)); border-radius: 28px; }
  #panel { height: min(68dvh, calc(100dvh - 170px - var(--sat) - var(--sab))); min-height: 220px; padding: 6px 16px 10px; transform: translateY(calc(100% + 120px)); }
  #panel.open { transform: none; }
  #info { max-height: calc(100dvh - 170px - var(--sat) - var(--sab)); overflow-y: auto; padding: 6px 16px 16px; }
  #info.show { animation: sheetin .3s cubic-bezier(.2,.9,.3,1); }
  @keyframes sheetin { from { transform: translateY(40px); opacity: 0; } }
  .grabber { display: block; width: 40px; height: 5px; border-radius: 9px; background: #d4d4d8; margin: 4px auto 10px; flex: none; }
  .panel-head h2 { font-size: 22px; }
  #ui.has-sheet #scrim { display: block; }
  #ui.has-sheet #abilities, #ui.has-sheet #abtoggle, #ui.has-sheet #quest, #ui.has-sheet #questbtn, #ui.has-sheet #camctl, #ui.has-sheet #friendsbtn { display: none; }
  /* bigger touch targets inside sheets */
  .btn.small { min-height: 44px; }
  .tab { min-height: 44px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: none; }
}
/* ---------- phones ---------- */
@media (max-width: 600px) {
  /* One row: coins · café · rating · clock · gift. The café name is what gives way when it is tight. */
  #hud { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); top: calc(8px + var(--sat)); width: auto; max-width: none; transform: none; display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 4px; }
  #hud > * { flex: none; }
  #hud .chip { min-width: 0; font-size: 14px; height: 40px; padding: 0 9px 0 6px; gap: 4px; }
  #hud .chip > .ico { width: 20px; height: 20px; }
  #hud .num { min-width: 0; }
  #hud #gift { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  #hud .brand { flex: 0 1 auto; min-width: 0; padding: 0 10px 0 4px; gap: 7px; }
  .brand .badge-c { width: 30px; height: 30px; }
  .brand .badge-c .ico { width: 20px; height: 20px; }
  .brand .badge-c b { font-size: 9px; padding: 0 5px; bottom: -5px; }
  #hud .clock small, #hud .lvl-top span:last-child { display: none; }
  .brand .bname { max-width: 96px; font-size: 13px; }
  .lvl-wrap, .brand .lvl-wrap { min-width: 44px; flex: 1 1 auto; gap: 4px; }
  /* rating: one star and the number */
  #hud .stars { display: none; }
  #hud .rating .star-one { display: inline-block; }
  #quest { width: min(220px, calc(100vw - var(--sal) - var(--sar) - 16px - var(--hb) - var(--hg))); padding: 6px 12px 6px 6px; border-radius: 20px; }
  #quest .q-ico { width: 34px; height: 34px; border-radius: 12px; }
  #quest .q-ico .ico { width: 24px; height: 24px; }
  #quest .q-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
  #toasts, #buildbanner { top: calc(58px + var(--sat)); }
  #celebrate { top: calc(62px + var(--sat)); }
  #buildbanner { font-size: 12px; white-space: nowrap; }
  .rating-tip { top: calc(56px + var(--sat)); width: calc(100vw - var(--sal) - var(--sar) - 16px); }
  /* The six primary actions fit without wrapping even on a 320px phone. */
  #toolbar { left: 50%; right: auto; max-width: calc(100vw - var(--sal) - var(--sar) - 12px); transform: translateX(-50%); justify-content: space-between; gap: 4px; overflow: hidden; }
  /* build tray hugs the bottom edge on phones */
  #buildbar { width: 100vw; bottom: 0; }
  #buildbar .card { border-radius: 28px 28px 0 0; padding: 10px calc(12px + var(--sar)) calc(10px + var(--sab)) calc(12px + var(--sal)); }
  .bitem { width: 84px; }
  .bitem canvas { width: 56px; height: 44px; }
}
/* below ~420px the café name does not fit in the single HUD row: keep the badge and the level bar */
@media (max-width: 420px) {
  #hud .brand .bname { display: none; }
  #hud .brand { flex: none; }
  #hud .brand .lvl-wrap { min-width: 40px; width: 40px; flex: none; }
}
/* narrow phones (≤360px): smaller tabs keep a gutter on both sides of the tab bar */
@media (max-width: 360px) {
  .tool { width: 44px; height: 44px; }
  #toolbar { gap: 2px; }
  #hud { gap: 3px; }
  #hud .chip { padding-right: 7px; }
  /* the café chip shrinks to its level badge */
  #hud .brand { width: 40px; padding: 0; justify-content: center; }
  #hud .brand .lvl-wrap { display: none; }
}
/* Short landscape phones need one compact HUD row and a shallow sheet. */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 960px) {
  #hud { left: 50%; right: auto; top: calc(4px + var(--sat)); width: max-content; max-width: none; display: flex; flex-wrap: nowrap; gap: 5px; transform: translateX(-50%) scale(.78); transform-origin: top center; }
  #hud .brand .lvl-wrap { min-width: 84px; }
  #ui { --hbot: calc(66px + var(--sab)); }
  /* too short for the skills to fold out upwards: they open sideways from the button */
  #abilities { bottom: var(--hbot); left: calc(var(--hl) + var(--hb) + var(--hg)); flex-direction: row; }
  #toolbar { bottom: calc(6px + var(--sab)); }
  #panel, #info { bottom: calc(66px + var(--sab)); }
  #panel { height: calc(100dvh - 78px - var(--sat) - var(--sab)); min-height: 0; }
  #info { max-height: calc(100dvh - 78px - var(--sat) - var(--sab)); }
  #toasts, #buildbanner, #celebrate { top: calc(58px + var(--sat)); }
}
@media (prefers-reduced-motion: reduce) {
  #gift, #quest.done .q-ico, .ability.ready { animation: none; }
}

/* ---------------- account (settings + sign-in cards) ---------------- */
.account-form { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; text-align: left; }
.account-form .err { color: #c0392b; font-size: 13px; font-weight: 600; min-height: 1em; }
.account-links { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.account-links .btn { width: 100%; justify-content: center; }
.linkish { background: none; border: 0; padding: 4px; color: var(--ink-soft); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* ---------------- friends ---------------- */
.avatar { flex: none; border-radius: 50%; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.avatar .avatar-img { width: 100% !important; height: 100% !important; border-radius: 0; background: none; transform: translateY(6%) scale(1.12); }
.hearts { display: inline-flex; gap: 1px; vertical-align: -2px; }
.hearts .ico.off { opacity: .22; filter: grayscale(1); }
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-width: 0; letter-spacing: .08em; }
.friend-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .1em; padding: 8px 12px; border-radius: 12px; background: var(--fill); flex: 1; text-align: center; }
.friend-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.muted.small { font-size: 12px; margin-top: 2px; }
.avatar-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-opt { padding: 3px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar-opt.on { box-shadow: 0 0 0 2.5px var(--ink); }

/* ---------------- visiting a friend's café: their banner instead of your HUD and tools ---------------- */
#ui.visiting #hud, #ui.visiting .rating-tip, #ui.visiting #questbtn, #ui.visiting #quest, #ui.visiting #abilities, #ui.visiting #toolbar,
#ui.visiting #panel, #ui.visiting #info, #ui.visiting #friendsbtn, #ui.visiting #abtoggle, #ui.visiting #scrim, #ui.visiting #buildbar, #ui.visiting #ghostctl, #ui.visiting #buildbanner { display: none !important; }
#visitbar { position: absolute; top: calc(12px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px;
  width: min(520px, calc(100vw - 28px)); padding: 10px 12px 12px 10px; border-radius: 24px; }
#visitbar .vb-top { display: flex; align-items: center; gap: 12px; }
#visitbar .vb-top .grow { min-width: 0; }
#visitbar b { font-family: var(--font-display); font-size: 16px; letter-spacing: -.02em; }
#visitbar .vb-back { flex: none; }
/* the three ways to help, each with what is left today */
#visitbar .vb-help { display: flex; gap: 6px; }
.help-act { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; padding: 0 10px; background: var(--fill); }
.help-act:hover { background: var(--fill-2); }
.help-act > span:not(.help-n) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-act .help-n { flex: none; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; }
.help-act.done { color: var(--ink-faint); }
.help-act.done .help-n { background: var(--green); }
.help-act.done .help-n .glyph { color: #fff; }
/* toasts move to the bottom while visiting (the tab bar is hidden there), so they never sit on the banner */
#ui.visiting #toasts { top: auto; bottom: calc(84px + var(--sab)); flex-direction: column-reverse; }
/* phones and tablets: the tab bar is hidden while visiting, so the camera buttons move down there, clear of the banner whatever its height */
@media (max-width: 760px) {
  #ui.visiting #camctl { top: auto; bottom: calc(22px + var(--sab)); flex-direction: row; }
}
@media (max-width: 600px) {
  #visitbar { left: 8px; right: 8px; width: auto; transform: none; top: calc(8px + var(--sat)); }
  #visitbar .vb-top { flex-wrap: wrap; row-gap: 8px; }
  #visitbar .vb-top .grow { flex: 1 1 0; }
  #visitbar .vb-back { order: -1; flex: none; margin-left: auto; position: absolute; right: 10px; top: 10px; width: 40px; padding: 0; justify-content: center; }
  #visitbar .vb-back span { display: none; }
  #visitbar .vb-top { padding-right: 48px; }
}
/* narrow phones: the label goes under the icon and count, so all three still say what they do */
@media (max-width: 420px) {
  .help-act { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 2px 6px; padding: 6px 4px; min-height: 52px; border-radius: 16px; }
  .help-act > span:not(.help-n) { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; font-size: 12.5px; }
}

/* ---------- help cards (feed a snack, send ingredients) and the card about friends who helped ---------- */
#modal .help-card { text-align: left; }
#modal .help-card .big-title, #modal .help-card > .muted { text-align: center; }
.help-card .section-title { margin: 14px 2px 8px; font-size: 15px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 16px; background: var(--fill); font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.pick-row:hover { background: var(--fill-2); }
.pick-row.on { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.pick-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pick-row b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-face { width: 44px !important; height: 44px !important; border-radius: 50%; background: var(--surface); flex: none; }
.pick-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.pick-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 6px 10px; border: 0; border-radius: 16px; background: var(--fill); font: inherit; color: inherit; cursor: pointer; }
.pick-tile:hover { background: var(--fill-2); }
.pick-tile.on { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.pick-tile b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tile .pbar { width: 80%; height: 5px; }
.pick-snacks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pick-snack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: 16px; background: var(--fill); font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.pick-snack .ps-name { font-size: 12.5px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-snack.on { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.pick-snack[disabled] { opacity: .4; cursor: not-allowed; }
.gift-row .stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.gift-row .stepper .btn { width: 34px; min-width: 34px; padding: 0; justify-content: center; font-size: 18px; }
.gift-row .stepper b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.gift-total { text-align: center; margin: 10px 0 0; }
/* the buttons stay at the bottom of the card while its list scrolls */
.help-btns { position: sticky; bottom: -20px; margin: 14px -20px -20px; padding: 10px 20px 20px; display: flex; gap: 8px; background: var(--surface); box-shadow: 0 -8px 16px -12px rgba(0,0,0,.18); }
.help-btns .btn { flex: 1 1 0; min-width: 0; min-height: 48px; justify-content: center; }
.help-btns .btn.primary { flex: 2 1 0; }
.btn.busy { opacity: .6; cursor: progress; }
.helped-block { margin: 10px 0 0; padding: 10px 12px; border-radius: 16px; background: var(--fill); text-align: left; }
.helped-block > b { display: block; margin-bottom: 4px; }
.helped-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.4; margin: 3px 0; }
.helped-line > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#modal .helped > .btn.primary { margin-top: 14px; }
/* the cover while switching cafés */
#visitcover { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: #f4f4f5;
  opacity: 0; transition: opacity .32s ease; pointer-events: auto; }
#visitcover.show { opacity: 1; }
#visitcover .vc-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; text-align: center; transform: translateY(8px); transition: transform .45s cubic-bezier(.2,.9,.3,1); }
#visitcover.show .vc-card { transform: none; }
#visitcover .vc-face { margin-bottom: 10px; animation: vc-hop 1.1s ease-in-out infinite; }
#visitcover .vc-face .avatar { box-shadow: 0 10px 24px rgba(0,0,0,.12); }
#visitcover .vc-title { font-family: var(--font-display); font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
#visitcover .vc-sub { font-size: 14px; color: var(--ink-soft); }
#visitcover .vc-dots { display: flex; gap: 6px; margin-top: 14px; }
#visitcover .vc-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: .2; animation: vc-dot 1.2s ease-in-out infinite; }
#visitcover .vc-dots i:nth-child(2) { animation-delay: .2s; } #visitcover .vc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes vc-hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-10px); } 60% { transform: translateY(0) scale(1.03, .97); } }
@keyframes vc-dot { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #visitcover .vc-face, #visitcover .vc-dots i { animation: none; } }

/* ---------- feed the whole team: the confirmation card ---------- */
.feedall { gap: 4px; }
.feed-card { text-align: left !important; display: flex; flex-direction: column; gap: 12px; }
.feed-card .big-title, .feed-card > .muted { text-align: center; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--fill); }
.feed-row > b { flex: none; min-width: 64px; font-size: 13px; }
.feed-row.total { justify-content: space-between; }
.feed-items { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.feed-items .ing { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.feed-btns { display: flex; gap: 8px; }
.feed-btns .btn { flex: 1; min-height: 48px; justify-content: center; }

/* ---------- trouble alerts (under the HUD, between the round buttons) ---------- */
#alerts { position: absolute; top: var(--ht); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2 * (var(--hl) + var(--hb) + var(--hg))); display: flex; flex-direction: column; align-items: stretch; gap: 6px; pointer-events: none; z-index: 3; }
#alerts .alert { pointer-events: auto; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 14px 7px 7px; border: 0; border-radius: 99px; cursor: pointer; text-align: left;
  background: #e5484d; color: #fff; box-shadow: var(--shadow-sm), 0 0 0 3px rgba(229, 72, 77, .25); animation: alertpulse 1.1s ease-in-out infinite; }
#alerts .alert.sent { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--c); animation: none; }
#alerts .al-ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; }
#alerts .alert.sent .al-ico { background: var(--c); }
#alerts .alert.sent .al-ico .glyph { color: #fff; }
#alerts .al-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
#alerts .al-text b { font-size: 13.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#alerts .al-text small { font-size: 11.5px; font-weight: 600; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes alertpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.building #alerts { display: none; }

/* ---------- Training tab ---------- */
.club { margin: 10px 0; padding: 12px; border-radius: 20px; background: color-mix(in srgb, var(--c) 7%, var(--fill)); }
.club-head { display: flex; align-items: center; gap: 10px; }
.club-head h3 { margin: 0 0 2px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.club-head > .pill { flex: none; white-space: nowrap; }
.club-head > .pill.live { background: var(--c); color: #fff; box-shadow: none; padding: 2px 9px; }
.club-sub { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 12.5px; color: var(--ink-soft); }
.club-sub b { color: var(--c); }
.club-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--c); }
.club-ico .glyph { color: var(--c); }
.club-ico.big { width: 54px; height: 54px; border-radius: 18px; background: var(--c); box-shadow: none; }
.club-ico.big .glyph { color: #fff; }
.club-ico.big.off { background: var(--fill-2); }
.club-ico.big.off .glyph { color: var(--ink-soft); }
.club-desc { margin: 8px 2px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.club-staff { display: flex; flex-direction: column; gap: 6px; }
.club-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 16px; background: var(--surface); }
.club-row .portrait { flex: none; border-radius: 50%; background: var(--fill); }
.club-row b.grow { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-row .btn { flex: none; white-space: nowrap; }
.pill.learned { flex: none; background: var(--c); color: #fff; box-shadow: none; padding: 3px 10px 3px 6px; white-space: nowrap; }
.pill.learned .glyph { color: #fff; }
.club .bmsg { margin-top: 8px; }
.sk.club { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.sk.club .sk-tag { background: var(--surface); color: var(--ink); }

/* ---------- tryout card (mini-games) ---------- */
#modal .card.tryout { width: min(380px, 100%); padding: 18px 16px 16px; }
.tryout-hero { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; margin-bottom: 4px; }
.tryout-hero .portrait { border-radius: 50%; background: var(--fill); }
.tryout-hero .club-ico.big { margin-left: -16px; box-shadow: 0 0 0 3px #fff; }
.tryout .how { margin: 12px 0; padding: 10px 12px; border-radius: 14px; background: var(--fill); font-size: 13.5px; line-height: 1.5; text-align: left; word-break: keep-all; overflow-wrap: anywhere; }
.tryout .feed-btns { margin-top: 10px; }
.tryout-title { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; font-family: var(--font-display); font-weight: 750; font-size: 17px; }
.tryout-title .glyph { color: var(--c); }
.tryout-stage { position: relative; width: 100%; max-width: 340px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #bfe3f2; touch-action: none; cursor: pointer; }
.tryout-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tryout-hud { pointer-events: none; }
.tryout-act { width: 100%; min-height: 56px; margin-top: 10px; justify-content: center; font-size: 18px; gap: 8px; touch-action: none; }
.tryout-act .glyph { color: #fff; }
.tryout-feet { display: flex; gap: 10px; margin-top: 10px; }
.tryout-foot { flex: 1; min-height: 76px; justify-content: center; gap: 6px; font-size: 18px; font-weight: 750; border-radius: 22px; background: var(--fill); touch-action: none; transition: transform .06s, background .06s; }
.tryout-foot.hit { animation: foothit .14s ease-out; }
@keyframes foothit { 0% { transform: scale(.93); background: var(--fill-2); } 100% { transform: scale(1); } }
.tryout-title { position: relative; }
.tryout-x { position: absolute; right: 0; top: 50%; translate: 0 -50%; width: 32px; height: 32px; min-width: 32px; padding: 0; justify-content: center; border-radius: 50%; background: var(--fill); }

/* Touch screens turn, zoom and move the view with two fingers, so the rotate / recenter buttons only get in the way */
@media (hover: none) and (pointer: coarse) {
  #camctl { display: none !important; }
}
