/* css/play.css: the floor. Full-bleed night scene; the controls sit on it as paper cards. */

html, body.play { height: 100%; }
body.play { overflow: hidden; background: var(--night); font-size: 15.5px; }

/* ------------------------------------------------------------ stage */
.stage {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 70%, rgba(255, 182, 41, .14), transparent 70%),
    radial-gradient(40% 30% at 30% 40%, rgba(255, 90, 31, .08), transparent 70%),
    linear-gradient(#121828, #090c14);
}
.stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-poster.is-missing { display: none; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; touch-action: none; }
.stage.is-3d .stage-canvas { opacity: 1; }
/* the 3D canvas is transparent (the sky shows through), so the poster has to fade out under it */
.stage-poster { transition: opacity .8s ease; }
.stage.is-3d .stage-poster { opacity: 0; }
.stage-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(60% 50% at 50% 50%, rgba(255, 182, 41, .45), transparent 70%); }
.stage-flash.go { animation: flash 2.6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ------------------------------------------------------------ top bar */
.bar {
  position: fixed; z-index: 10; top: 12px; left: 16px; right: 16px; height: 60px;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 18px;
  padding: 0 10px 0 12px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r);
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .55);
}
.bar-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.bar-mark { width: 34px; height: 34px; }
.bar-mark.is-missing { display: none; }
.bar-word { font: 900 26px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.bar-mode { display: flex; gap: 8px; align-items: center; }
.bar-bell { justify-self: center; display: flex; align-items: center; gap: 10px; }
.bar-bell .ico { width: 26px; height: 26px; color: var(--orange-ink); }
.bar-bell-t { display: flex; align-items: baseline; gap: 10px; }
.bar-bell-t .num { font-size: 32px; line-height: 1; }
.bar-bell-s { font-size: 11.5px; color: var(--ink-soft); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-bell > div { min-width: 0; }
.bar-bell { min-width: 0; }
.btn.is-wait { --bg: var(--paper-2); --fg: var(--ink-soft); --bd: var(--steel); box-shadow: none; opacity: 1; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.bar-act { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: transparent; min-height: 40px; padding: 0 12px; font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }

.note-strip {
  position: fixed; z-index: 9; top: 84px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: min(640px, calc(100% - 2 * 392px));
  padding: 8px 12px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r);
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, .5);
}
.note-strip p { margin: 0; font-size: 14px; font-weight: 500; }
.note-strip.is-warn { background: var(--amber); }
.note-strip.is-live .stamp { color: var(--teal); }
/* the phone markup, plain everywhere else: the pill and the notice's two halves are just their contents, the chip's
   button is a label that takes no tap, the drawer's close button and the phone extras do not show */
.bar-pill, .note-more, .panels-in, .tab-i { display: contents; }
.bar-bell-at, .note-i, .drawer-x, .t-land, .tab-badge, .qs, .turn { display: none; }
.note-k { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: inherit; pointer-events: none; }

/* ------------------------------------------------------------ panels */
.panels { position: relative; z-index: 5; }
.dock {
  position: fixed; top: 86px; bottom: 16px; width: 372px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 14px; padding: 2px 6px 8px 2px;
}
.dock-l { left: 16px; }
.dock-r { right: 16px; }
.panel { padding: 16px 16px 18px; box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .55); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head .ico { width: 24px; height: 24px; color: var(--ink); }
.panel-title { font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.panel-meta, .panel-head .stamp { margin-left: auto; }
.panel-meta { font-size: 12px; color: var(--ink-soft); letter-spacing: .06em; }
.honest { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--rule-strong); }

/* slots meter */
.slots { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 14px; }
.slots i { width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 1px; }
.slots i.on { background: var(--ink); }

/* quick start */
.quick { background: var(--amber); border: 1.5px solid var(--ink); padding: 12px 12px 14px; margin-bottom: 14px; }
.quick-k { color: var(--ink); margin: 0 0 4px; }
.quick-t { margin: 0 0 10px; font-weight: 500; }

/* shop rows */
.shop { list-style: none; display: grid; gap: 0; }
.shop li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.shop li:first-child { border-top: 0; }
.shop-art { width: 56px; height: 56px; background: var(--night); border-radius: 2px; overflow: hidden; position: relative; }
.shop-art img { width: 100%; height: 100%; object-fit: cover; position: relative; }
.shop-art img.is-missing { display: none; }
.shop-art .ph { position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px/1 var(--display); color: #66708a; }
.shop-name { font: 800 21px/1 var(--display); text-transform: uppercase; }
.shop-spec { font: 500 11.5px/1.45 var(--mono); color: var(--ink-soft); margin-top: 3px; }
.shop-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.shop-price { font: 500 13px/1 var(--mono); white-space: nowrap; }
.shop-buy .btn { min-width: 64px; }
.shop-x { font-size: 11px; color: var(--orange-ink); font-family: var(--mono); text-align: right; max-width: 110px; line-height: 1.3; }
.shop li.is-hover { background: linear-gradient(90deg, rgba(255, 182, 41, .25), transparent); }

.expand { margin-top: 12px; padding: 12px; border: 1.5px dashed var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.expand p { margin: 0; font-size: 14px; }
.expand b { font-weight: 600; }

/* time card */
.timecard { background-color: #F6EFE2; background-image: repeating-linear-gradient(transparent 0 27px, rgba(31, 111, 107, .13) 27px 28px); }
.tc-status { font-weight: 500; margin: 0 0 10px; }
.holes { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); margin-bottom: 14px; min-height: 40px; align-items: center; }
.holes i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; }
.holes i.now { background: var(--orange); }
.holes i.booked { background: var(--ink); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.holes i.carry { background: var(--steel); }
.holes .more { font: 500 11.5px/1 var(--mono); color: var(--ink-soft); }
.holes .none { font: 500 12px/1.2 var(--mono); color: var(--ink-soft); }
.tc-pick { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.stepper { display: flex; align-items: stretch; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--paper); }
.step-b { width: 44px; min-height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.step-b .ico { width: 20px; height: 20px; }
.stepper input { width: 64px; border: 0; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); text-align: center; font: 800 26px/1 var(--display); background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.picks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.picks button { min-height: 44px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--paper); font: 500 14px/1 var(--mono); cursor: pointer; }
.picks button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.tc-cost { margin: 0 0 12px; display: grid; gap: 6px; }
.tc-cost div, .pay-est div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tc-cost dt, .pay-est dt { font-size: 13.5px; color: var(--ink-2); }
.tc-cost dd, .pay-est dd { margin: 0; font-size: 14px; text-align: right; }
.tc-total { font-size: 16px !important; font-weight: 500; }
.tc-go { width: 100%; }
.tc-when { font-size: 11.5px; color: var(--ink-soft); margin: 10px 0 0; letter-spacing: .03em; }

/* payday */
.pay-now { margin-bottom: 10px; }
.pay-now .label { margin: 0; }
.pay-big { margin: 2px 0 0; display: flex; align-items: baseline; gap: 8px; }
.pay-big .num { font-size: 48px; line-height: 1; }
.pay-big .mono { font-size: 14px; }
.pay-est { margin: 0 0 6px; display: grid; gap: 5px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pay-fine { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); margin: 8px 0 12px; }
.crew { margin: 0 0 12px; padding: 10px 12px; background: var(--paper-2); border: 1px dashed var(--ink); }
.crew .label { margin: 0 0 6px; font-size: 10.5px; }
.crew ul { list-style: none; display: grid; gap: 3px; }
.crew li { display: flex; justify-content: space-between; font: 500 12px/1.4 var(--mono); }
.stock-pick { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.stock-pick legend { margin-bottom: 8px; padding: 0; }
.stocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stocks label { position: relative; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 6px; border: 1.5px solid var(--ink); border-radius: var(--r); cursor: pointer; background: var(--paper); font: 500 12.5px/1 var(--mono); }
.stocks label img, .stocks label .ph { width: 24px; height: 24px; border-radius: 50%; background: #fff; flex: none; object-fit: contain; }
.stocks label .ph { background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 9.5px; }
.stocks input { position: absolute; opacity: 0; pointer-events: none; }
.stocks input:checked + label, .stocks label:has(input:checked) { background: var(--ink); color: var(--paper); }
.stocks input:focus-visible + label, .stocks label:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.stocks label.is-off { opacity: .45; text-decoration: line-through; }
.quote { font-size: 12px; line-height: 1.45; color: var(--ink-2); margin: 8px 0 10px; min-height: 2.9em; }
.quote.is-bad { color: var(--orange-ink); }
.pay-btns { display: grid; gap: 8px; }
.paid { margin-top: 12px; }
.paid ul { list-style: none; display: grid; gap: 2px; margin-top: 6px; }
.paid li { display: flex; justify-content: space-between; font: 500 12px/1.5 var(--mono); }

/* ------------------------------------------------------------ summary */
.summary {
  position: fixed; z-index: 6; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: min(600px, calc(100% - 2 * 404px)); padding: 10px 16px 8px;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .55);
}
.summary dl { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.summary div { padding: 0 8px; border-left: 1px solid var(--rule); }
.summary div:first-child { border-left: 0; padding-left: 0; }
.summary dt { font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.summary dd { margin: 2px 0 0; font-size: 28px; line-height: 1; }
.sum-key dd { color: var(--orange-ink); }
.sum-warn { margin: 8px 0 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 500; color: var(--ink); background: var(--amber); padding: 6px 8px; }
.sum-warn .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.sum-unit { font-size: 10.5px; color: var(--ink-soft); margin: 6px 0 0; letter-spacing: .04em; }

/* ------------------------------------------------------------ tabs (phone) */
.tabs { display: none; }

/* ------------------------------------------------------------ dialogs and toast */
.sheet-dlg { padding: 18px; width: min(460px, calc(100% - 24px)); max-height: calc(100% - 24px); color: var(--ink); }
.sheet-dlg::backdrop { background: rgba(9, 12, 20, .62); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dlg-x { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.wallet-list { list-style: none; display: grid; gap: 8px; }
.wallet-list button { width: 100%; justify-content: flex-start; }
.wallet-list img { width: 26px; height: 26px; border-radius: 6px; }
.t-body dl { margin: 0 0 12px; display: grid; gap: 6px; }
.t-body dl div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; }
.t-body dt { font-size: 14px; color: var(--ink-2); }
.t-body dd { margin: 0; font: 500 14px/1.3 var(--mono); text-align: right; }
.t-body .t-total dd { font-size: 17px; }
.t-body p { font-size: 13.5px; color: var(--ink-2); }
.t-body .t-warn { background: var(--amber); padding: 8px 10px; color: var(--ink); font-weight: 500; }
.t-status { min-height: 1.4em; font: 500 13px/1.45 var(--mono); margin: 0 0 12px; overflow-wrap: anywhere; }
.t-status.is-bad { color: var(--orange-ink); }
.t-status.is-ok { color: var(--teal); }
.t-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

.toast {
  position: fixed; z-index: 30; left: 50%; bottom: 120px; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 24px)); padding: 12px 16px;
  background: var(--ink); color: var(--paper); border-radius: var(--r); font-size: 14px; font-weight: 500;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, .5);
}
.toast.is-bad { background: var(--orange); color: var(--ink); }

/* ------------------------------------------------------------ narrower desktop */
@media (max-width: 1240px) and (min-width: 1024px) {
  .dock { width: 330px; }
  .summary { width: calc(100% - 2 * 362px); padding: 8px 10px; }
  .summary dd { font-size: 22px; }
  .note-strip { max-width: calc(100% - 2 * 350px); }
  .bar-bell-s { display: none; }
}

/* ------------------------------------------------------------ phone and tablet: floor on top, sheet below */
@media (max-width: 1023px) {
  body.play { --stage-h: 38svh; --tabs-h: 64px; }
  .stage { bottom: auto; height: var(--stage-h); }
  .bar { top: 8px; left: 8px; right: 8px; height: 52px; grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 6px 0 8px; }
  .bar-word { display: none; }
  .bar-mode { display: none; }
  .bar-bell { justify-self: start; gap: 8px; }
  .bar-bell .ico { width: 22px; height: 22px; }
  .bar-bell-t .label { display: none; }
  .bar-bell-t .num { font-size: 26px; }
  .bar-bell-s { font-size: 10.5px; }
  .seg button { padding: 0 8px; font-size: 11px; min-height: 36px; }
  .bar-act .btn { padding: 0 12px; min-height: 40px; font-size: 14px; }
  .bar-act .btn .ico { display: none; }

  .note-strip { top: calc(var(--stage-h) - 46px); left: 8px; right: 8px; transform: none; max-width: none; padding: 6px 10px; }
  .note-strip p { font-size: 12.5px; line-height: 1.3; }
  .note-strip .stamp { font-size: 10.5px; }

  .summary { top: auto; bottom: auto; position: fixed; top: calc(var(--stage-h) + 0px); left: 0; right: 0; transform: none; width: auto; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; padding: 8px 12px 6px; z-index: 7; }
  .summary dd { font-size: 22px; }
  .summary dt { font-size: 9.5px; }
  .summary div { padding: 0 6px; }
  .sum-unit { display: none; }
  .sum-warn { font-size: 12px; margin-top: 6px; padding: 4px 6px; }

  .panels { position: fixed; z-index: 5; top: calc(var(--stage-h) + var(--sum-h, 58px)); bottom: var(--tabs-h); left: 0; right: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); }
  .dock { display: contents; }
  .panel { display: none; box-shadow: none; border: 0; border-radius: 0; padding: 16px 14px 24px; max-width: 640px; margin: 0 auto; }
  body[data-tab='shop'] .panel[data-panel='shop'],
  body[data-tab='shifts'] .panel[data-panel='shifts'],
  body[data-tab='pay'] .panel[data-panel='pay'] { display: block; }

  .tabs {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink); border-top: 3px solid var(--orange);
  }
  .tabs button { position: relative; border: 0; background: transparent; color: #b9bdc7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; min-height: 44px; }
  .tabs button .ico { width: 22px; height: 22px; }
  .tabs button[aria-pressed='true'] { color: var(--paper); background: var(--ink-2); }
  .tabs button[aria-pressed='true']::before { content: ''; position: absolute; top: -3px; left: 18%; right: 18%; height: 3px; background: var(--amber); }
  .tab-dot { position: absolute; top: 10px; right: calc(50% - 24px); width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
  /* over the floor, never over the panel list and its buttons */
  .toast { bottom: auto; top: calc(var(--stage-h) - 10px); transform: translate(-50%, -100%); width: calc(100% - 24px); }
  .sheet-dlg { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 6px 6px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (max-width: 1023px) and (min-width: 700px) { body.play { --stage-h: 42svh; } }
.w-short { display: none; }
@media (max-width: 640px) {
  .bar-bell-s { display: none; }
  .bar-act { gap: 6px; }
}
@media (max-width: 420px) {
  .w-long { display: none; }
  .w-short { display: inline; }
}
@media (max-width: 350px) {
  .bar-bell .ico { display: none; }
}
@media (max-width: 360px) {
  .bar-act .btn { padding: 0 9px; font-size: 13px; }
  .seg button { padding: 0 6px; font-size: 10px; }
  .summary dd { font-size: 19px; }
  .stocks { grid-template-columns: repeat(2, 1fr); }
  .shop li { grid-template-columns: 44px 1fr auto; gap: 8px; }
  .shop-art { width: 44px; height: 44px; }
}

/* live, before the first read: the panels wait */
.is-loading .panels, .is-loading .summary { opacity: .35; pointer-events: none; }
.shop-art img:not(.is-missing) + .ph { display: none; }

/* ================================================================== sunny skin
   The same look as the landing page: sky behind the yard, white cards with a navy outline and a short hard shadow,
   chunky rounded type, toy-like buttons. Variables first, so everything above picks them up. */
body.play {
  --paper: #FFFDF7;
  --paper-2: #FFF1D6;
  --paper-3: #F3E6CC;
  --ink: #23314D;
  --ink-2: #3B4A6B;
  --ink-soft: #5B6782;
  --orange: #FF6A2B;
  --orange-ink: #D14A12;
  --amber: #FFC93C;
  --teal: #1F8F86;
  --steel: #B9C2D0;
  --rule: rgba(35, 49, 77, .14);
  --rule-strong: rgba(35, 49, 77, .45);
  --display: 'Baloo 2', 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif;
  --text: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
  --r: 16px;
  background: #8FD0FA;
  color: var(--ink);
  font: 600 15.5px/1.5 var(--text);
}
body.play .display, body.play .panel-title, body.play .shop-name, body.play .bar-word { text-transform: none; font-weight: 800; letter-spacing: 0; }
/* no typewriter type in the sunny look: what was mono is Nunito (figures) or Baloo (small meta) */
body.play .mono, body.play .fig { font-family: var(--text); font-weight: 700; letter-spacing: .01em; }
body.play .panel-meta { font: 800 13px/1 var(--display); letter-spacing: .04em; }
body.play .pay-big .mono { font: 800 17px/1 var(--display); }
body.play .label { font: 800 12px/1.3 var(--display); letter-spacing: .06em; color: var(--ink-soft); }
body.play .num { font-family: var(--display); font-weight: 800; }

.stage {
  background:
    radial-gradient(40% 30% at 18% 22%, rgba(255, 255, 255, .55), transparent 70%),
    radial-gradient(36% 26% at 82% 14%, rgba(255, 255, 255, .45), transparent 70%),
    linear-gradient(180deg, #4FAEF0 0%, #8FD0FA 50%, #D6EFFF 100%);
}
.stage-flash { background: radial-gradient(60% 50% at 50% 50%, rgba(255, 220, 120, .55), transparent 70%); }

body.play .card { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 0 var(--ink); }
.bar { border-radius: 18px; box-shadow: 0 5px 0 0 var(--ink); border-width: 3px; }
.panel, .summary { box-shadow: 0 5px 0 0 var(--ink); }
.panel-title { font-size: 28px; }
.bar-word { font-size: 26px; }

body.play .btn {
  min-height: 46px; border: 3px solid var(--bd); border-radius: 14px;
  font: 800 16px/1 var(--display); letter-spacing: .01em;
  box-shadow: 0 4px 0 0 var(--ink);
}
body.play .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 0 var(--ink); }
body.play .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--ink); }
body.play .btn-hot { --bg: var(--amber); --fg: var(--ink); }
body.play .btn-line { --bg: #fff; --fg: var(--ink); box-shadow: 0 4px 0 0 var(--ink); }
body.play .btn-line:hover { background: #fff; --fg: var(--ink); }
body.play .btn-sm { min-height: 42px; border-radius: 12px; font-size: 15px; }
.btn.is-wait { --bg: var(--paper-2); --fg: var(--ink-soft); --bd: var(--ink); font: 800 13px/1 var(--display); letter-spacing: .04em; box-shadow: none; }

/* stamps become stickers */
body.play .stamp {
  -webkit-mask-image: none; mask-image: none; mix-blend-mode: normal;
  border: 2.5px solid var(--ink); border-radius: 10px; padding: 5px 10px 4px;
  font: 800 12px/1 var(--display); letter-spacing: .08em; color: var(--ink); background: #fff;
  transform: rotate(-3deg); box-shadow: 0 2px 0 0 var(--ink);
}
body.play .stamp-orange { background: #FFD7C2; }
body.play .stamp-teal { background: #C8EEE9; }
body.play .stamp-steel { background: #E6EAF1; }
body.play .stamp-ink { background: var(--amber); }

.note-strip { border-width: 3px; border-radius: 14px; box-shadow: 0 4px 0 0 var(--ink); }
.seg { border-width: 2.5px; border-radius: 12px; }
.seg button { font: 800 12px/1 var(--display); letter-spacing: .06em; }

.slots i { border-width: 2px; border-radius: 4px; }
.slots i.on { background: #7CC855; }
.quick { border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 0 var(--ink); }
.shop-art { background: radial-gradient(circle at 50% 70%, #EAF6FF 0 45%, #D6EFFF 46% 100%); border: 2px solid var(--ink); border-radius: 12px; }
.shop-spec { font: 700 12.5px/1.4 var(--text); }
.shop-price { font: 800 15px/1 var(--display); }
.shop-x { font: 700 11.5px/1.3 var(--text); }
.shop li.is-hover { background: linear-gradient(90deg, rgba(255, 201, 60, .3), transparent); border-radius: 10px; }
.expand { border: 2.5px dashed var(--ink); border-radius: 14px; }

.timecard { background-color: #FFFBF0; background-image: repeating-linear-gradient(transparent 0 27px, rgba(31, 143, 134, .12) 27px 28px); }
.holes { border-top-width: 2.5px; border-bottom-width: 2.5px; }
.holes i { border-width: 2px; }
.holes i.booked { background: var(--ink); box-shadow: none; }
.holes .more, .holes .none { font: 700 12px/1.2 var(--text); }
.stepper { border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; }
.stepper input { border-left-width: 2.5px; border-right-width: 2.5px; font-family: var(--display); }
.picks button { border: 2.5px solid var(--ink); border-radius: 12px; font: 800 15px/1 var(--display); box-shadow: 0 3px 0 0 var(--ink); }
.picks button[aria-pressed='true'] { background: var(--amber); color: var(--ink); transform: translateY(2px); box-shadow: 0 1px 0 0 var(--ink); }
.tc-when { font: 700 12px/1.4 var(--text); }

.crew { border: 2px dashed var(--ink); border-radius: 12px; background: var(--paper-2); }
.crew li { font: 700 12.5px/1.4 var(--text); }
.stocks label { border: 2.5px solid var(--ink); border-radius: 12px; font: 800 13px/1 var(--display); box-shadow: 0 2px 0 0 var(--ink); }
.stocks input:checked + label, .stocks label:has(input:checked) { background: var(--amber); color: var(--ink); }
.stocks label .ph { background: var(--paper-2); color: var(--ink); }
.stocks label img.is-dark { background: var(--ink); padding: 3px; }
.paid li { font: 700 12.5px/1.5 var(--text); }

.summary dt { font: 800 11px/1.2 var(--display); letter-spacing: .06em; }
.summary dd { font-family: var(--display); }
.sum-warn { border-radius: 10px; border: 2px solid var(--ink); }

.toast { border-radius: 14px; border: 3px solid var(--ink); background: var(--ink); color: #fff; font: 700 15px/1.4 var(--text); box-shadow: 0 4px 0 0 rgba(35, 49, 77, .5); }
.toast.is-bad { background: var(--amber); color: var(--ink); }
.sheet-dlg { border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 0 var(--ink); }
.sheet-dlg::backdrop { background: rgba(35, 49, 77, .5); }
.t-body dd, .t-status { font-family: var(--text); font-weight: 700; }
.t-body .t-warn { border-radius: 10px; }

@media (max-width: 1023px) {
  .bar { border-radius: 16px; }
  .panels { background: #FFF8EC; }
  /* in the sheet (and the drawer) a panel is the page itself, not a card on it */
  body.play .panels .panel { border: 0; border-radius: 0; box-shadow: none; }
  body.play .summary { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; border-width: 3px 0; }
  .tabs { background: var(--ink); border-top: 4px solid var(--amber); }
  .tabs button { font: 800 12px/1 var(--display); letter-spacing: .06em; }
  .tabs button[aria-pressed='true'] { color: #fff; background: #33456A; }
  .note-strip { border-width: 2.5px; }
}

/* ------------------------------------------------------------ work permit (Time card) */
.permit {
  margin: 0 0 14px; padding: 12px 12px 12px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 0 var(--ink);
}
.permit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.permit-head .ico { width: 22px; height: 22px; flex: none; }
.permit-title { font: 800 21px/1 var(--display); margin: 0; }
.permit-head .stamp { margin-left: auto; }
.permit-lead { margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.permit-play { margin: 0 0 8px; padding: 6px 8px; font-size: 12.5px; line-height: 1.4; background: var(--paper-2); border: 2px dashed var(--ink); border-radius: 10px; }
.permit-rows { margin: 0 0 10px; padding: 8px 0; display: grid; gap: 4px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.permit-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.permit-rows dt { font-size: 13px; color: var(--ink-2); flex: none; }
.permit-rows dd { margin: 0; font: 800 14px/1.3 var(--display); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.permit-pick { display: grid; gap: 6px; margin-bottom: 10px; }
.permit-pick .label { margin: 0; }
.permit-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.permit-picks button {
  min-height: 44px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: 800 16px/1 var(--display); box-shadow: 0 3px 0 0 var(--ink); cursor: pointer;
}
.permit-picks button[aria-pressed='true'] { background: var(--amber); transform: translateY(2px); box-shadow: 0 1px 0 0 var(--ink); }
.permit-to { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.permit-go { width: 100%; flex-direction: column; gap: 3px; padding: 7px 14px; text-align: center; }
.permit-go small { font: 700 12px/1.2 var(--text); letter-spacing: 0; }
.permit-none { margin: 8px 0 0; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--orange-ink); }
.permit-none a { color: var(--ink); font-weight: 800; }
.permit-fine { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.permit.is-flag { animation: permit-flag 1.7s ease-out; }
@keyframes permit-flag {
  0%, 55% { box-shadow: 0 0 0 5px var(--amber), 0 4px 0 0 var(--ink); }
  100% { box-shadow: 0 4px 0 0 var(--ink); }
}
.tc-permit {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 6px 8px;
  font-size: 13px; font-weight: 700; line-height: 1.4; background: var(--amber); border: 2px solid var(--ink); border-radius: 10px;
}
.tc-permit .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ------------------------------------------------------------ top bar: the music toggle (js/music.js styles it), 44 px targets
   Every button in the bar is at least 44 px. On a phone the bar is 56 px; at 560 px and below the Practice / Live
   switch leaves the bar and floats just under its right end, over the sky, so the bell keeps its room. */
body.play .bar-act .btn { min-height: 44px; }
.bar-act .music-btn { min-width: 44px; }
body.play .seg button { min-height: 44px; min-width: 44px; }
@media (max-width: 1023px) {
  .bar { height: 56px; }
  .bar-bell { justify-self: stretch; overflow: hidden; }
  .bar-act .music-btn .ico { display: block; }
  /* the note strip sits on the stage's bottom edge and grows upward, so a long note never covers the summary */
  .note-strip { top: calc(var(--stage-h) - 6px); transform: translateY(-100%); }
}
@media (max-width: 560px) {
  .bar-act .seg {
    position: absolute; top: calc(100% + 8px); right: -3px;
    background: var(--paper); box-shadow: 0 4px 0 0 var(--ink); border-width: 3px;
  }
  .bar-act .seg button { padding: 0 12px; }
}
@media (max-width: 420px) {
  .bar { gap: 6px; padding: 0 5px 0 6px; }
  .bar-act { gap: 5px; }
  .bar-act .music-btn > :not(.ico) { display: none; }
}
@media (max-width: 360px) {
  .bar { gap: 5px; }
  .bar-act { gap: 4px; }
  .bar-mark { width: 30px; height: 30px; }
  .permit { padding: 10px 10px 12px; }
  .permit-rows dt { font-size: 12.5px; }
}

/* ================================================================== a phone: the mode chip
   A touch screen with a short side under 520 px (js/play/phone.js uses the same queries). The long notice no longer
   sits on the yard: a small chip says the mode, a tap opens the words (and the network switch when it is needed). */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px), (pointer: coarse) and (orientation: portrait) and (max-width: 519px) {
  .note-strip, .note-strip.is-warn {
    display: block; max-width: none; padding: 0; gap: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none;
  }
  .note-k {
    gap: 5px; height: 44px; min-width: 44px; padding: 0 9px 0 13px; pointer-events: auto; cursor: pointer;
    background: #FFD7C2; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 0 var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  .note-k:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--ink); }
  body.play .note-k .stamp { padding: 0; border: 0; background: none; box-shadow: none; transform: none; font: 800 12.5px/1 var(--display); letter-spacing: .07em; color: var(--ink); }
  .note-i { display: block; width: 19px; height: 19px; stroke-width: 2.3; }
  .note-strip.is-live .note-k { background: #C8EEE9; }
  .note-strip.is-warn .note-k { background: var(--amber); }
  .note-more { display: none; }
  .note-strip.is-open .note-more {
    display: grid; gap: 10px; position: absolute; left: 0; width: min(330px, calc(100vw - 24px));
    padding: 12px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 0 var(--ink);
    animation: pop-in .18s ease-out both;
  }
  .note-strip p { font-size: 14px; font-weight: 700; line-height: 1.4; }
  .note-strip.is-open [data-note-act] { width: 100%; }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ================================================================== a phone held sideways: the yard and a light HUD
   The yard fills the screen (the sky is the page, the canvas is transparent). Over it, out of its way: the bell pill
   and the mode chip top left, icon buttons top right, a one-row stat strip bottom left, three round action buttons
   bottom right. An action opens its panel as a drawer from the right; the buttons ride along the drawer's left edge
   and the yard slides over to stay in view. Only transforms move; nothing is measured per frame. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px) {
  body.play {
    --sl: max(12px, env(safe-area-inset-left, 0px));
    --sr: max(12px, env(safe-area-inset-right, 0px));
    --st: max(8px, env(safe-area-inset-top, 0px));
    --sb: max(10px, env(safe-area-inset-bottom, 0px));
    --dr: env(safe-area-inset-right, 0px);
    --drawer-w: min(420px, 52vw);
    --act: clamp(48px, 14vh, 56px);
    --ease: cubic-bezier(.2, .8, .2, 1);
  }

  .stage { bottom: 0; height: auto; }
  /* Only the transparent canvas moves (the sky stays). The yard is about 0.94 x the screen height wide with its bottom
     corner in the middle: on the smallest phones it is nudged right so that corner clears the stat strip (about
     294 px from the left), never so far that it meets the action buttons. With a drawer open it moves to the middle
     of what is left of the screen. */
  .stage-canvas {
    transform: translateX(clamp(0px, calc(var(--sl) + 294px - 50vw), calc(50vw - var(--sr) - 74px - 47vh)));
    transition: opacity .8s ease, transform .32s var(--ease);
  }
  body.drawer-open .stage-canvas { transform: translateX(calc((var(--sl) - var(--drawer-w) - var(--dr) - 86px) / 2)); }

  /* top: the bell pill, the chip, the icon buttons */
  .bar {
    top: var(--st); left: var(--sl); right: var(--sr); height: auto;
    display: flex; align-items: flex-start; gap: 8px; padding: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none; pointer-events: none;
  }
  .bar > * { pointer-events: auto; }
  .bar-pill {
    display: flex; align-items: center; gap: 7px; flex: none; height: 50px; padding: 0 16px 0 3px;
    background: #fff; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 0 var(--ink);
  }
  .bar-brand { min-height: 44px; min-width: 44px; justify-content: center; }
  .bar-mark { width: 40px; height: 40px; }
  .bar-word, .bar-mode, .bar-bell > .ico, .bar-bell-t .label, .bar-bell-s { display: none; }
  .bar-bell { justify-self: auto; overflow: visible; gap: 0; }
  .bar-bell-t .num { font-size: 23px; line-height: .95; }
  .bar-bell-at { display: block; margin-top: 2px; font: 800 11px/1 var(--display); letter-spacing: .03em; color: var(--ink-soft); white-space: nowrap; }

  .note-strip { position: relative; top: auto; left: auto; right: auto; transform: none; margin-top: 3px; flex: none; }
  /* the open notice stays clear of the action buttons on the right (the chip starts about 190 px in) */
  .note-strip.is-open .note-more { top: calc(100% + 10px); width: min(330px, calc(100vw - var(--sl) - var(--sr) - 270px)); }

  .bar-act { margin-left: auto; gap: 8px; align-items: center; min-height: 50px; }
  .bar-act .music-btn { order: 1; }
  .bar-act .seg { order: 2; position: static; background: #fff; border-width: 3px; box-shadow: 0 3px 0 0 var(--ink); }
  .bar-act [data-wallet] { order: 3; position: relative; }
  body.play .bar-act .btn { min-height: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 14px; }
  body.play .seg button { min-height: 44px; min-width: 44px; padding: 0 9px; font-size: 11.5px; }
  .bar-act [data-wallet] { width: 44px; }
  .bar-act [data-wallet] .ico { display: block; width: 22px; height: 22px; }
  .bar-act [data-wallet]:not(.is-wait) [data-wallet-text] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.play .bar-act [data-wallet].is-wait { width: auto; padding: 0 10px; font-size: 12px; }
  .bar-act [data-wallet].is-wait .ico { display: none; }
  .bar-act [data-wallet].btn-paper::after {
    content: ''; position: absolute; top: -5px; right: -5px; width: 13px; height: 13px; border-radius: 50%;
    background: #3BB273; border: 2.5px solid var(--ink);
  }

  /* bottom left: the stat strip */
  body.play .summary {
    top: auto; right: auto; left: var(--sl); bottom: var(--sb); transform: none; z-index: 7;
    width: auto; max-width: calc(100vw - var(--sl) - var(--sr) - 90px);
    padding: 5px 2px; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 0 var(--ink);
    transition: opacity .2s ease, visibility 0s;
  }
  .summary dl { display: flex; }
  .summary div, .summary div:first-child { padding: 0 9px; }
  .summary div { border-left: 2px solid var(--rule); }
  .summary div:first-child { border-left: 0; }
  .summary dt { font-size: 9.5px; letter-spacing: .07em; }
  .summary dd { font-size: 19px; margin-top: 1px; }
  .sum-unit { display: none; }
  .sum-warn { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; border: 0; }
  .summary.is-warn { cursor: pointer; }
  .summary.is-warn div:nth-child(2) dd { color: var(--orange-ink); }
  .summary.is-warn div:nth-child(2) dt::after {
    content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 4px; vertical-align: 0; border-radius: 50%;
    background: var(--orange); border: 2px solid var(--ink); animation: dot-pulse 1.6s ease-in-out infinite;
  }

  /* bottom right: Build, Shifts, Pay */
  .tabs {
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    position: fixed; z-index: 13; left: auto; top: auto; right: var(--sr); bottom: var(--sb);
    height: auto; padding: 0; background: none; border: 0;
    transition: transform .32s var(--ease);
  }
  body.drawer-open .tabs { transform: translateX(calc(var(--sr) - var(--drawer-w) - var(--dr) - 10px)); }
  .tabs button, .tabs button[aria-pressed='true'] {
    width: 66px; min-height: 0; padding: 0; gap: 6px; background: none; color: var(--ink);
    text-transform: none; letter-spacing: 0; -webkit-tap-highlight-color: transparent;
  }
  .tabs button[aria-pressed='true']::before { display: none; }
  .tab-i {
    display: grid; place-items: center; width: var(--act); height: var(--act); border-radius: 50%;
    background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 0 var(--ink);
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  }
  .tabs button .ico { width: 26px; height: 26px; stroke-width: 2.3; }
  .tabs button[aria-pressed='true'] .tab-i { background: var(--amber); transform: translateY(2px); box-shadow: 0 2px 0 0 var(--ink); }
  .tabs button:active .tab-i { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--ink); }
  .tab-l { padding: 2px 8px 1px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; font: 800 12px/1.1 var(--display); letter-spacing: .02em; }
  .t-port, .tab-dot { display: none !important; }
  .t-land { display: inline; }
  .tab-badge {
    display: block; position: absolute; top: calc(var(--act) / 2 - 12px); right: calc(100% - 4px);
    padding: 4px 8px 3px; background: var(--amber); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 0 var(--ink);
    font: 800 12.5px/1 var(--display); white-space: nowrap; animation: pop-in .25s ease-out both;
  }
  /* pay too small for a short figure: a dot on the button */
  .tab-badge.is-dot { top: 0; right: 4px; width: 16px; height: 16px; padding: 0; font-size: 0; }

  /* the drawer */
  .panels {
    position: fixed; z-index: 12; top: 0; bottom: 0; right: 0; left: auto;
    width: calc(var(--drawer-w) + var(--dr)); padding: 0 var(--dr) 0 0;
    display: flex; flex-direction: column; overflow: hidden;
    background: #FFF8EC; border-left: 3px solid var(--ink); border-radius: 22px 0 0 22px;
    box-shadow: -5px 0 0 0 rgba(35, 49, 77, .2);
    transform: translateX(calc(100% + 10px)); visibility: hidden;
    transition: transform .32s var(--ease), visibility 0s linear .32s;
  }
  body.drawer-open .panels { transform: none; visibility: visible; transition: transform .32s var(--ease), visibility 0s; }
  .panels-in {
    display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: var(--st) 0 calc(var(--sb) + 8px);
  }
  .panel { padding: 6px 16px 18px; max-width: none; margin: 0; }
  .panel-head { min-height: 44px; margin-bottom: 10px; }
  .panel-title { font-size: 25px; }
  /* the close button: top of the drawer's left edge, in line with the action buttons, moving with them */
  .drawer-x {
    display: grid; place-items: center; position: fixed; z-index: 13; top: var(--st); right: calc(var(--sr) + 11px);
    width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
    background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 3px 0 0 var(--ink);
    opacity: 0; visibility: hidden; -webkit-tap-highlight-color: transparent;
    transition: transform .32s var(--ease), opacity .2s ease, visibility 0s linear .32s;
  }
  body.drawer-open .drawer-x {
    opacity: 1; visibility: visible; transform: translateX(calc(var(--sr) - var(--drawer-w) - var(--dr) - 10px));
    transition: transform .32s var(--ease), opacity .2s ease .08s, visibility 0s;
  }
  body.drawer-open .drawer-x:active { box-shadow: 0 1px 0 0 var(--ink); }
  .drawer-x .ico { width: 20px; height: 20px; stroke-width: 2.6; }
  /* while a drawer is open the chip and the icon buttons wait (the drawer covers that corner anyway) */
  body.drawer-open .note-strip, body.drawer-open .bar-act { visibility: hidden; }

  /* the quick start, once, over the middle of the yard */
  .qs {
    position: fixed; z-index: 11; left: calc(50% + (var(--sl) - var(--sr) - 74px) / 2); top: 50%; transform: translate(-50%, -46%);
    width: min(410px, calc(100vw - var(--sl) - var(--sr) - 74px - 32px));
    display: grid; grid-template-columns: 72px 1fr; gap: 4px 14px; align-items: center;
    padding: 14px 16px 16px; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 0 var(--ink);
    animation: qs-in .45s cubic-bezier(.2, .9, .3, 1.25) both;
  }
  .qs-art { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; border: 2.5px solid var(--ink); background: radial-gradient(circle at 50% 70%, #EAF6FF 0 45%, #D6EFFF 46% 100%); }
  .qs-art.is-missing { visibility: hidden; }
  .qs-k { margin: 0; font: 800 11.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-ink); }
  .qs-h { margin: 3px 0 3px; font: 800 22px/1.05 var(--display); }
  .qs-t { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--ink-2); }
  .qs-btns { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 8px; }
  .qs-btns .btn-hot { flex: 1; padding: 0 12px; }
  .qs-btns .btn-line { padding: 0 14px; }

  /* toasts: top middle of the free yard, never over the buttons or an open drawer */
  .toast {
    top: calc(var(--st) + 62px); bottom: auto; left: calc(50% + (var(--sl) - var(--sr) - 74px) / 2); transform: translateX(-50%);
    width: max-content; max-width: min(440px, calc(100vw - var(--sl) - var(--sr) - 74px - 24px));
    padding: 9px 14px; font-size: 14px; line-height: 1.35;
  }
  body.drawer-open .toast {
    left: calc((var(--sl) + 100vw - var(--drawer-w) - var(--dr) - 86px) / 2);
    max-width: calc(100vw - var(--sl) - var(--drawer-w) - var(--dr) - 86px);
  }

  /* dialogs: centred, the body scrolls, the buttons stay in view */
  .sheet-dlg {
    margin: auto; width: min(560px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 16px);
    border-radius: 18px; padding: 12px 16px 14px;
  }
  .sheet-dlg[open] { display: flex; flex-direction: column; }
  .sheet-dlg .dlg-head { margin-bottom: 6px; flex: none; }
  .sheet-dlg .panel-title { font-size: 22px; }
  /* the ticket is tighter on a short screen, and shows a soft shadow at the edge where more of it is scrolled away */
  .t-body, .wallet-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    background:
      linear-gradient(var(--paper) 30%, rgba(255, 253, 247, 0)) center top,
      linear-gradient(rgba(255, 253, 247, 0), var(--paper) 70%) center bottom,
      radial-gradient(farthest-side at 50% 0, rgba(35, 49, 77, .32), transparent) center top,
      radial-gradient(farthest-side at 50% 100%, rgba(35, 49, 77, .32), transparent) center bottom;
    background-repeat: no-repeat; background-size: 100% 22px, 100% 22px, 100% 12px, 100% 12px;
    background-attachment: local, local, scroll, scroll;
  }
  .t-body dl { gap: 3px; margin-bottom: 8px; }
  .t-body dl div { padding-bottom: 3px; }
  .t-body p { margin: 0 0 6px; font-size: 13px; line-height: 1.4; }
  .t-status, .t-btns, .sheet-dlg .pay-fine { flex: none; }
  .t-status { margin: 6px 0 8px; }
  .t-status:empty { min-height: 0; margin: 2px 0 6px; }
}
/* the shortest sideways phones (320 px): a tighter ticket, so the cost and the honest words fit with the buttons */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 340px) {
  .sheet-dlg { max-height: calc(100% - 8px); padding: 8px 14px 10px; }
  .sheet-dlg .dlg-head { margin-bottom: 0; }
  .sheet-dlg .panel-title { font-size: 19px; }
  .t-body dt, .t-body dd { font-size: 12.5px; }
  .t-body .t-total dd { font-size: 15px; }
  .t-body dl { gap: 2px; margin-bottom: 6px; }
  .t-body dl div { padding-bottom: 2px; }
  .t-body p { font-size: 12.5px; line-height: 1.35; margin-bottom: 4px; }
  .t-btns .btn { min-height: 42px; }
}
/* narrow sideways phones: the drawer leaves no room for the stat strip beside the buttons */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px) and (max-width: 799px) {
  body.drawer-open .summary { opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility 0s linear .15s; }
}
@keyframes qs-in { from { opacity: 0; transform: translate(-50%, -40%) scale(.94); } to { opacity: 1; transform: translate(-50%, -46%); } }
@keyframes dot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* ================================================================== a phone held upright
   The card asks for sideways until the player turns the phone or picks "Play upright instead" (js/play/phone.js);
   then the tabs and the sheet below the yard, with the mode chip on the yard's lower-left corner. */
@media (pointer: coarse) and (orientation: portrait) and (max-width: 519px) {
  html:not(.is-upright) .turn { display: flex; }
  /* toasts under the top bar: the chip, the stats and the sheet stay free */
  .toast { top: calc(max(8px, env(safe-area-inset-top, 0px)) + 66px); transform: translateX(-50%); }
  .note-strip { left: 10px; right: auto; top: calc(var(--stage-h) - 10px); transform: translateY(-100%); }
  .note-strip.is-open .note-more { bottom: calc(100% + 10px); }
}

/* the turn card */
.turn {
  position: fixed; inset: 0; z-index: 40; align-items: center; justify-content: center; overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top, 0px)) 18px max(20px, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(42% 20% at 20% 16%, rgba(255, 255, 255, .6), transparent 70%),
    radial-gradient(38% 16% at 84% 84%, rgba(255, 255, 255, .5), transparent 70%),
    linear-gradient(180deg, #4FAEF0 0%, #8FD0FA 55%, #D6EFFF 100%);
}
.turn-card {
  width: min(340px, 100%); display: grid; justify-items: center; gap: 12px; padding: 16px 20px 12px; text-align: center;
  background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 0 var(--ink);
}
.turn-art { width: 168px; height: 128px; margin-bottom: -4px; overflow: visible; }
.turn-art path, .turn-art circle { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.turn-art .tp-body { fill: #fff; }
.turn-art .tp-screen { fill: #8FD0FA; stroke-width: 3; }
.turn-art .tp-lawn { fill: #7CC855; stroke-width: 2.6; }
.turn-art .tp-house { fill: #FF6A2B; stroke-width: 2.6; }
.turn-art .tp-dot { fill: var(--ink); stroke: none; }
.turn-art .turn-arrow path { stroke: var(--orange-ink); stroke-width: 4.5; }
.turn-phone { transform-box: view-box; transform-origin: 91px 74px; animation: turn-phone 3.4s cubic-bezier(.55, 0, .3, 1) infinite; }
.turn-yard { transform-box: view-box; transform-origin: 91px 74px; animation: turn-yard 3.4s cubic-bezier(.55, 0, .3, 1) infinite; }
.turn-arrow { animation: turn-arrow 3.4s ease-in-out infinite; }
@keyframes turn-phone { 0%, 24% { transform: rotate(0deg); } 46% { transform: rotate(94deg); } 52%, 78% { transform: rotate(90deg); } 96%, 100% { transform: rotate(0deg); } }
@keyframes turn-yard { 0%, 30% { transform: none; } 50%, 78% { transform: rotate(-90deg) scale(1.3); } 92%, 100% { transform: none; } }
@keyframes turn-arrow { 0%, 6% { opacity: 0; } 16%, 40% { opacity: 1; } 50%, 100% { opacity: 0; } }
.turn-h { margin: 0; font: 800 28px/1.05 var(--display); }
.turn-p { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--ink-2); }
.turn-go { width: 100%; }
.turn-up {
  min-height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font: 800 15px/1 var(--display); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px;
}

/* ================================================================== Factory Park (js/play/realm.js)
   A people button opens it: the right dock on desktop, the drawer on a phone held sideways, a fourth tab upright.
   Floors, Feed and Chat are plain lists; what the realm sends is shown as text only. */
.park-btn { position: relative; width: 44px; min-width: 44px; padding: 0 !important; flex: none; }
.bar-act .park-btn .ico { display: block; width: 23px; height: 23px; }
.park-btn.is-off .ico { opacity: .45; }
.park-n {
  position: absolute; top: -8px; right: -8px; min-width: 21px; height: 21px; padding: 0 5px;
  background: var(--amber); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px;
  font: 800 11px/16px var(--display); text-align: center; pointer-events: none;
}
.panel[data-panel='park'] { display: none; }
.park-x { display: none; }
.park-sub { margin: -4px 0 10px; font: 800 13px/1.3 var(--display); letter-spacing: .02em; color: var(--teal); }
.park-sub.is-off { color: var(--ink-soft); }
.park-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.park-tabs button {
  min-height: 44px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: 800 15px/1 var(--display); box-shadow: 0 3px 0 0 var(--ink); cursor: pointer;
}
.park-tabs button[aria-selected='true'] { background: var(--amber); transform: translateY(2px); box-shadow: 0 1px 0 0 var(--ink); }
.park-empty { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }

.pf-legend { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font: 800 11.5px/1 var(--display); letter-spacing: .03em; color: var(--ink-soft); }
.pf-legend .pf-dot:not(:first-child) { margin-left: 8px; }
.park-floors { list-style: none; }
.pf { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--rule); }
.pf:first-child { border-top: 0; }
.pf.is-me { background: linear-gradient(90deg, rgba(255, 201, 60, .22), transparent 80%); border-radius: 10px; }
.pf-dots { display: grid; gap: 4px; justify-items: center; }
.pf-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.pf-dot.is-shift { background: var(--orange); }
.pf-dot.is-online { background: #3BB273; }
.pf-main { min-width: 0; }
.pf-name { display: flex; align-items: center; gap: 6px; font: 800 16px/1.15 var(--display); }
.pf-you { padding: 2px 7px 1px; background: var(--amber); border: 2px solid var(--ink); border-radius: 999px; font: 800 11px/1 var(--display); letter-spacing: .04em; }
.pf-spec { margin-top: 1px; font-size: 12.5px; font-weight: 700; line-height: 1.35; color: var(--ink-soft); }
.pf-go { min-width: 76px; }

.park-feed { list-style: none; }
.pfeed { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; padding: 7px 2px; border-top: 1px solid var(--rule); }
.pfeed:first-child { border-top: 0; }
.pfeed.is-me { background: linear-gradient(90deg, rgba(255, 201, 60, .24), transparent 85%); border-radius: 8px; }
.pfeed-t { font: 800 11.5px/1.3 var(--display); letter-spacing: .02em; color: var(--ink-soft); white-space: nowrap; }
.pfeed-x { font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.pfeed-a { font: 800 12.5px/1.3 var(--display); color: var(--teal); }

.park-chat { list-style: none; display: grid; align-content: start; gap: 7px; max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 4px; }
.park-chat:empty { display: none; }
.pchat { padding: 6px 10px 7px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.pchat.is-me { background: #FFF1D6; }
.pchat-h { display: flex; justify-content: space-between; gap: 8px; font: 800 12px/1.2 var(--display); letter-spacing: .02em; color: var(--ink-soft); }
.pchat.is-me .pchat-who { color: var(--orange-ink); }
.pchat-x { margin: 2px 0 0; font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.chat-form input {
  min-width: 0; min-height: 46px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff;
  font: 700 15px/1.2 var(--text); color: var(--ink);
}
.chat-form .btn { min-width: 76px; }
.chat-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.chat-note.is-bad { color: var(--orange-ink); }
.chat-gate { display: grid; gap: 8px; justify-items: start; margin-top: 12px; }
.chat-fine { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.45; color: var(--ink-soft); }

/* visiting: the banner takes the stat strip's place (your own numbers are not what is on the yard) */
.visit {
  position: fixed; z-index: 7; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: min(600px, calc(100% - 2 * 404px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
}
body.play .visit.card { background: #FFF1D6; }
.visit-t { min-width: 0; flex: 1; }
.visit-h { margin: 0; font: 800 19px/1.1 var(--display); }
.visit-s { margin: 2px 0 0; font-size: 12.5px; font-weight: 700; line-height: 1.35; color: var(--ink-2); }
.visit .btn { flex: none; }
body.is-visiting .summary { display: none; }

/* the ticker: one line of new activity at a time, never in the way (it takes no taps) */
.ticker {
  position: fixed; z-index: 9; top: 146px; left: 50%; transform: translateX(-50%);
  max-width: min(560px, calc(100% - 2 * 404px)); padding: 7px 14px 6px;
  background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 0 var(--ink);
  font: 700 13.5px/1.3 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  animation: pop-in .25s ease-out both; transition: opacity .3s ease;
}
.ticker.is-out { opacity: 0; }

@media (min-width: 1024px) {
  /* desktop: the people button swaps the right dock between your Time card + Payday and the park */
  body.park-open .dock-r { overflow: hidden; }
  body.park-open .dock-r .panel:not([data-panel='park']) { display: none; }
  body.park-open .panel[data-panel='park'] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .park-x { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  body.park-open .park-pane:not([hidden]) { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
  body.park-open .park-chat { flex: 1 1 auto; max-height: none; }
  body.park-open .park-pane[data-park-pane='chat'] { overflow: hidden; }
}
@media (max-width: 1240px) and (min-width: 1024px) {
  .visit { width: calc(100% - 2 * 362px); }
  .ticker { max-width: calc(100% - 2 * 350px); }
}
@media (max-width: 1023px) {
  /* the sheet: Park is a fourth tab; the bar keeps its room */
  .park-btn { display: none; }
  .tabs { grid-template-columns: repeat(4, 1fr); }
  body[data-tab='park'] .panel[data-panel='park'] { display: block; }
  body.play .panels .panel[data-panel='park'] { background: transparent; }
  .tab-n {
    position: absolute; top: 6px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    background: var(--amber); color: var(--ink); border: 2px solid var(--ink); font: 800 10.5px/15px var(--display); text-align: center;
  }
  .visit { left: 10px; right: 10px; bottom: auto; top: calc(var(--stage-h) - 10px); transform: translateY(-100%); width: auto; z-index: 9; }
  body.is-visiting .summary { display: block; }
  body.is-visiting .note-strip { visibility: hidden; }
  .ticker { top: 72px; max-width: calc(100% - 24px); }
}
@media (pointer: coarse) and (orientation: portrait) and (max-width: 519px) {
  .ticker { top: calc(var(--stage-h) - 10px); left: auto; right: 10px; transform: translateY(-100%); max-width: calc(100% - 196px); }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px) {
  /* sideways: the people button joins the icons top right; the park opens in the drawer */
  .park-btn { display: inline-flex; order: 0; }
  .tabs .tab-park { display: none; }
  body.play .bar-act .park-btn { padding: 0; }
  .park-chat { max-height: calc(100vh - 250px); min-height: 90px; }
  .panel[data-panel='park'] .panel-head { margin-bottom: 6px; }
  body.play .visit, body.play .visit.card {
    left: var(--sl); right: auto; top: auto; bottom: var(--sb); transform: none; width: auto;
    max-width: calc(100vw - var(--sl) - var(--sr) - 96px); padding: 8px 10px 8px 14px; z-index: 7;
    border-radius: 16px; box-shadow: 0 4px 0 0 var(--ink);
  }
  body.is-visiting .summary { display: none; }
  body.is-visiting .note-strip { visibility: visible; }
  body.drawer-open .note-strip { visibility: hidden; }
  .visit-h { font-size: 17px; }
  .ticker {
    top: auto; left: var(--sl); right: auto; bottom: calc(var(--sb) + 66px); transform: none;
    max-width: calc(100vw - var(--sl) - var(--sr) - 96px); font-size: 13px;
  }
  body.drawer-open .ticker { max-width: calc(100vw - var(--sl) - var(--drawer-w) - var(--dr) - 96px); }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px) and (max-width: 799px) {
  body.drawer-open .visit { opacity: 0; visibility: hidden; }
}
/* with the Practice / Live switch up, a narrow sideways phone's mode chip keeps only its info icon */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 519px) and (max-width: 640px) {
  body.has-seg .note-k { padding: 0; justify-content: center; width: 44px; }
  body.has-seg .note-k .stamp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* phones: stat labels no smaller than 10.5 px; the home dial a full tap target */
@media (max-width: 1023px) {
  body.play .summary dt { font-size: 10.5px; letter-spacing: .04em; }
  .bar-brand { min-width: 44px; min-height: 44px; justify-content: center; }
}
