/* Saltwind on GamesGarden: the DOM shell over the canvas sea (garden.css tokens only).
   Views (set on <html data-view> by src/shell.js every frame from swView() in js/95-touch.js):
   shell = the start screen, sea = any canvas screen, result = a finished lane, run = an Endless / Weekly log.
   html.sw-atsea = sailing (the only screen that needs landscape on a phone). */

:root {
  /* safe areas: UI only, never the sea. js/95-touch.js reads these to keep the thumb controls clear of the notch. */
  --sw-sat: env(safe-area-inset-top, 0px);
  --sw-sar: env(safe-area-inset-right, 0px);
  --sw-sab: env(safe-area-inset-bottom, 0px);
  --sw-sal: env(safe-area-inset-left, 0px);
}
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--gg-cream); }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }

/* the sea: CSS alone decides its size (fixed, inset 0, so notch, home bar, URL bar changes and rotation all stay
   covered); js/00-core.js only matches the backing store to this box. No letterbox colour anywhere. */
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }

/* ============================================================ start screen */
.sw-shell {
  position: fixed; inset: 0; z-index: 20; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; font-family: var(--gg-font-body); color: var(--gg-ink);
}
/* the notch and home bar pad the content, never the page: the app bar rule still runs edge to edge */
.sw-shell .gg-wrap { padding-left: max(var(--gg-gutter), var(--sw-sal)); padding-right: max(var(--gg-gutter), var(--sw-sar)); }
html[data-view]:not([data-view="shell"]) .sw-shell { display: none; }
.sw-shell .gg-appbar { padding-top: var(--sw-sat); background: var(--gg-cream); }
.sw-shell .gg-btn { -webkit-user-select: none; user-select: none; }
.sw-helpbtn { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-lg); }
.sw-chip { display: inline-flex; min-width: 0; }
.sw-chip:empty { display: none; }

.sw-start { display: grid; gap: 28px; padding-top: 8px; padding-bottom: calc(32px + var(--sw-sab)); animation: gg-rise var(--gg-dur-lg) var(--gg-ease-out) both; }
.sw-start__copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.sw-intro { display: grid; gap: 10px; }
.sw-intro h1 { margin: -4px 0 0; }
.sw-intro .gg-lede { margin: 0; }
.sw-start__art { display: none; }

/* the hero is a window: no background, the live canvas sea is painted into its rect underneath */
.sw-hero { position: relative; height: clamp(150px, 24vh, 210px); border: var(--gg-border); border-radius: var(--gg-r-lg); box-shadow: var(--gg-shadow-lg); background: transparent; pointer-events: none; }

.sw-voyage { display: grid; gap: 10px; padding: 18px; box-shadow: var(--gg-shadow); }
.sw-voyage__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sw-voyage__head .gg-eyebrow { margin: 0; }
.sw-rankpill { font-size: 13px; font-weight: 800; }
.sw-voyage__big { margin: 0; font-size: var(--gg-text-md); font-weight: 700; color: var(--gg-ink-2); }
.sw-voyage__big b { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-2xl); color: var(--gg-ink); letter-spacing: -.02em; margin: 0 2px; }
.sw-voyage__sub { margin: 0; font-size: var(--gg-text-sm); color: var(--gg-ink-3); font-weight: 600; }

.sw-bar { position: relative; height: 12px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-pill); background: var(--gg-sand); overflow: hidden; }
.sw-bar > i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--gg-green-600); border-right: 2px solid var(--gg-ink); transition: width var(--gg-dur-xl) var(--gg-ease-out); }
.sw-bar > i[style*="--p: 0%"] { border-right: 0; }

.sw-doors { display: grid; gap: 12px; }
.sw-door { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; box-shadow: var(--gg-shadow); border-radius: var(--gg-r-md); }
.sw-door__icon { width: 48px; height: 48px; border: var(--gg-border); border-radius: 14px; display: grid; place-items: center; background: var(--gg-green-100); }
.sw-door__icon svg { width: 30px; height: 30px; }
.sw-door__icon--sea { background: #CFE6FF; }
.sw-door__icon--butter { background: var(--gg-butter-100); }
.sw-door__icon--lav { background: var(--gg-lavender-100); }
.sw-door__icon--pink { background: var(--gg-pink-100); }
.sw-door__text { min-width: 0; display: grid; gap: 2px; }
.sw-door__title { margin: 0; font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-lg); line-height: 1.1; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-door__sub { margin: 0; font-size: 13px; line-height: 1.35; color: var(--gg-ink-2); font-weight: 600; }
.sw-door__sub b { color: var(--gg-ink); }
.sw-door__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sw-door .gg-btn--sm { padding-inline: 16px; }
.sw-door.is-locked { background: var(--gg-sand); box-shadow: var(--gg-shadow-sm); }
.sw-door.is-locked .sw-door__icon { filter: grayscale(1); opacity: .55; }
.sw-door.is-locked .sw-door__title { color: var(--gg-ink-2); }
.sw-door .gg-btn:disabled { opacity: .55; }
.sw-lock { display: inline-flex; width: 18px; height: 18px; }
.sw-streak { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px 1px 4px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-pill); background: var(--gg-butter); font-family: var(--gg-font-body); font-size: 13px; font-weight: 800; letter-spacing: 0; }
.sw-streak[hidden] { display: none; }
.sw-streak svg { width: 16px; height: 16px; }

.sw-harbour { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.sw-harbour__btn { gap: 8px; }
.sw-harbour__btn .sw-ic { display: inline-flex; width: 22px; height: 22px; }
.sw-harbour__btn .sw-ic svg { width: 22px; height: 22px; }
.sw-gold { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; padding: 2px 9px 2px 5px; border-radius: var(--gg-r-pill); background: var(--gg-butter); color: var(--gg-ink); border: 2px solid var(--gg-ink); font-size: 13px; font-weight: 800; }
.sw-gold:empty { display: none; }
.sw-gold svg { width: 16px; height: 16px; }

.sw-tip { display: grid; grid-template-columns: 36px minmax(0, 1fr) 44px; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--gg-butter-100); box-shadow: var(--gg-shadow-sm); border-radius: var(--gg-r-md); }
.sw-tip[hidden] { display: none; }
.sw-tip p { margin: 0; font-size: var(--gg-text-sm); line-height: 1.35; color: var(--gg-ink-2); }
.sw-tip p b { color: var(--gg-ink); }
.sw-tip__icon svg { width: 32px; height: 32px; display: block; }

/* small phones: the app bar keeps the sprout, drops the word, so chip + 4 buttons fit at 360 */
@media (max-width: 479.98px) {
  .sw-appbar .gg-wordmark > span { display: none; }
  .sw-appbar .gg-appbar__actions { gap: 6px; }
}
@media (min-width: 560px) {
  .sw-doors { grid-template-columns: 1fr 1fr; }
  .sw-door { grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; }
  .sw-door > .gg-btn, .sw-door__btns { grid-column: 1 / -1; justify-self: stretch; }
  .sw-door > .gg-btn { width: 100%; }
  .sw-door__btns { justify-content: stretch; }
  .sw-door__btns .gg-btn { flex: 1; }
}
/* desk: two columns like Pot Shot, the sea big and sticky on the right */
@media (min-width: 900px) {
  .sw-start { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 44px; padding-top: 16px; align-items: start; }
  .sw-start__copy { max-width: 540px; }
  .sw-start__copy > .sw-hero { display: none; }
  .sw-start__art { display: block; position: sticky; top: 24px; }
  .sw-hero--desk { height: min(600px, calc(100dvh - 140px)); min-height: 360px; border-radius: var(--gg-r-xl); box-shadow: var(--gg-shadow-xl); }
}
/* phones on their side (844x390, 667x375, 932x430): a short wide screen. Title + voyage side by side, sea on top of
   the right column, the doors in a row of two underneath. Everything scrolls; nothing is clipped. */
@media (orientation: landscape) and (max-height: 520px) {
  .sw-shell .gg-appbar__in { min-height: 52px; }
  .sw-start { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 6px; }
  .sw-start__art { display: none; }
  .sw-start__copy { max-width: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .sw-intro { grid-column: 1; grid-row: 1; align-content: start; gap: 6px; }
  .sw-intro h1 { font-size: 44px; }
  .sw-intro .gg-lede { font-size: var(--gg-text-sm); }
  .sw-start__copy > .sw-hero { display: block; grid-column: 2; grid-row: 1 / span 2; height: auto; min-height: 150px; }
  .sw-voyage { grid-column: 1; grid-row: 2; padding: 12px 14px; gap: 6px; }
  .sw-voyage__big b { font-size: var(--gg-text-xl); }
  .sw-voyage .gg-btn--lg { min-height: 52px; padding-block: 10px; }
  .sw-tip, .sw-doors, .sw-harbour { grid-column: 1 / -1; }
  .sw-doors { grid-template-columns: 1fr 1fr; }
  .sw-door { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: none; align-items: center; }
  .sw-door > .gg-btn, .sw-door__btns { grid-column: auto; justify-self: end; }
  .sw-door > .gg-btn { width: auto; }
  .sw-door__icon { width: 44px; height: 44px; }
}

/* ============================================================ result card (lane won / lost, Endless, Weekly) */
.sw-res {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: max(12px, var(--sw-sat)) max(12px, var(--sw-sar)) max(12px, var(--sw-sab)) max(12px, var(--sw-sal));
  font-family: var(--gg-font-body); color: var(--gg-ink);
}
.sw-res[hidden] { display: none; }
.sw-res__card {
  margin: auto; width: min(520px, 100%); display: grid; gap: 14px; padding: 20px 20px 18px; background: var(--gg-paper);
  border: var(--gg-border); border-radius: var(--gg-r-xl); box-shadow: var(--gg-shadow-xl);
  animation: gg-rise var(--gg-dur-lg) var(--gg-ease-spring) both;
}
.sw-res__a, .sw-res__b { display: grid; gap: 12px; align-content: start; min-width: 0; }
.sw-res .gg-eyebrow { margin: 0; }
.sw-res__head { display: flex; align-items: center; gap: 14px; }
.sw-res__title { margin: 0; font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-3xl); line-height: 1; letter-spacing: -.03em; }
.sw-res__line { margin: 6px 0 0; color: var(--gg-ink-2); font-size: var(--gg-text-sm); font-weight: 600; line-height: 1.35; }
.sw-res__line:empty { display: none; }
.sw-res__line .sw-near { display: block; margin-top: 4px; color: var(--gg-ink); font-weight: 700; }
.sw-medal { flex: none; width: 68px; height: 68px; display: grid; place-items: center; }
.sw-medal[hidden] { display: none; }
.sw-medal svg { width: 68px; height: 68px; }

.sw-res__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.sw-res__stats:has(.is-best) { margin-top: 6px; }
.sw-res__stats:empty, .sw-res__gain:empty { display: none; }
.sw-stat { position: relative; padding: 8px 10px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-cream); display: grid; gap: 2px; min-width: 0; }
.sw-stat span { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--gg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-stat b { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-xl); line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-stat.is-best { background: var(--gg-lime-100); padding-top: 14px; }
.sw-stat em { position: absolute; top: -11px; right: 8px; white-space: nowrap; font-style: normal; font-size: 13px; font-weight: 800; color: var(--gg-green-700); background: var(--gg-lime); border: 1.5px solid var(--gg-ink); border-radius: var(--gg-r-pill); padding: 0 6px; line-height: 1.35; }
.sw-res__gain { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-gain { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: var(--gg-border); border-radius: var(--gg-r-pill); background: var(--gg-butter); box-shadow: var(--gg-shadow-sm); font-weight: 800; font-size: var(--gg-text-sm); }
.sw-gain--xp { background: var(--gg-lavender-100); }
.sw-gain b { font-family: var(--gg-font-display); font-size: var(--gg-text-lg); font-variant-numeric: tabular-nums; }
.sw-gain svg { width: 20px; height: 20px; }
.sw-res__rank p { margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--gg-ink-3); }
.sw-res__rank p b { color: var(--gg-ink); font-size: var(--gg-text-sm); }
.sw-res__unlocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sw-res__unlocks[hidden] { display: none; }
.sw-res__unlocks li { display: flex; align-items: center; gap: 8px; font-size: var(--gg-text-sm); font-weight: 700; line-height: 1.3; }
.sw-res__unlocks li svg { width: 22px; height: 22px; flex: none; }
.sw-res__unlocks li small { font-size: 13px; color: var(--gg-ink-3); font-weight: 700; }
.sw-res__unlocks li.is-up { color: var(--gg-green-700); }
.sw-res__log { border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-butter-100); padding: 0; }
.sw-res__log[hidden] { display: none; }
.sw-res__log summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; font-size: var(--gg-text-sm); font-weight: 700; }
.sw-res__log summary::-webkit-details-marker { display: none; }
.sw-res__log summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2.5px solid var(--gg-ink); border-bottom: 2.5px solid var(--gg-ink); transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--gg-dur-sm) var(--gg-ease-out); flex: none; }
.sw-res__log[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.sw-res__log summary .sw-ic, .sw-res__log summary .sw-ic svg { width: 20px; height: 20px; display: inline-flex; flex: none; }
.sw-res__log p { margin: 0; padding: 0 14px 12px; font-size: var(--gg-text-sm); line-height: 1.45; color: var(--gg-ink-2); }
.sw-res__log kbd { font: inherit; font-weight: 800; padding: 0 5px; border: 1.5px solid var(--gg-ink); border-radius: 6px; background: var(--gg-paper); }
.sw-c-r { color: #C2185B; font-weight: 700; } .sw-c-g { color: var(--gg-green-700); font-weight: 700; } .sw-c-y { color: #8A5A00; font-weight: 700; } .sw-c-c { color: #1D5FA8; font-weight: 700; }

.sw-res__gg { display: grid; gap: 8px; }
.sw-res__gg[hidden] { display: none; }
.sw-res__gg:empty { display: none; }
.sw-res__gg.ggp-moment { margin: 0; }
.sw-res__double { justify-self: center; gap: 8px; }
.sw-res__double svg { width: 22px; height: 22px; flex: none; }
.sw-res__actions { display: grid; gap: 10px; }
.sw-res__actions .gg-row { justify-content: center; gap: 10px; }
.sw-res__actions .gg-row .gg-btn { flex: 1; }

/* phones in portrait: a little tighter so a full win (medals, colours, logbook, name row, ad offer) fits 390x844 */
@media (orientation: portrait) and (max-width: 520px) {
  .sw-res__card { gap: 10px; padding: 16px 16px 14px; }
  .sw-res__a, .sw-res__b { gap: 10px; }
  .sw-medal, .sw-medal svg { width: 58px; height: 58px; }
}
/* desk and short landscape screens: two columns, everything fits without scrolling at 1440x900, 844x390 and 667x375 */
@media (min-width: 900px) and (min-height: 600px) {
  .sw-res__card { width: min(880px, 100%); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; padding: 24px; }
  .sw-res__title { font-size: 44px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .sw-res { padding-top: max(8px, var(--sw-sat)); padding-bottom: max(8px, var(--sw-sab)); }
  .sw-res__card { width: min(820px, 100%); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; row-gap: 10px; padding: 12px 16px; border-radius: var(--gg-r-lg); box-shadow: var(--gg-shadow-lg); }
  .sw-res__a, .sw-res__b { gap: 8px; }
  .sw-res__title { font-size: 32px; }
  .sw-res__line { margin-top: 4px; font-size: 13px; }
  .sw-medal, .sw-medal svg { width: 50px; height: 50px; }
  .sw-stat { padding: 4px 9px; }
  .sw-stat b { font-size: var(--gg-text-lg); }
  .sw-gain { padding: 3px 10px 3px 6px; }
  .sw-gain b { font-size: var(--gg-text-md); }
  .sw-res__unlocks { gap: 2px; }
  .sw-res__unlocks li { font-size: 13px; }
  .sw-res__unlocks li svg { width: 18px; height: 18px; }
  .sw-res__log summary { min-height: 40px; padding-block: 4px; }
  .sw-res__gg.ggp-moment { padding: 6px 10px; gap: 4px 10px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; display: flex; }
  .sw-res__gg .ggp-moment__line { font-size: 13px; }
  .sw-res__gg .ggp-moment__pts b { font-size: 24px; }
  .sw-res__actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: stretch; }
  .sw-res__actions .gg-btn--lg { min-height: 48px; padding: 6px 12px; font-size: var(--gg-text-md); }
  .sw-res__actions .gg-row .gg-btn { height: 100%; }
}
@media (orientation: landscape) and (max-height: 400px) {
  .sw-res__line .sw-near { display: none; }
  .sw-res .gg-eyebrow { display: none; }
}

/* Endless Waters: the "Free tow" refund pill, bottom centre while you sail on */
.sw-tow { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--sw-sab)); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.sw-tow[hidden] { display: none; }
.sw-tow svg { width: 22px; height: 22px; flex: none; }

/* the placeholder ad card (src/ads.js) */
.sw-ad { z-index: 96; }
.sw-ad__card { display: grid; gap: 12px; justify-items: center; text-align: center; }
.sw-ad__title { font-size: 22px; }
.sw-ad__box { position: relative; width: 150px; height: 150px; display: grid; place-items: center; border: var(--gg-border); border-radius: var(--gg-r-lg); background: var(--gg-green-100); }
.sw-ad__ring { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
.sw-ad__n { font-family: var(--gg-font-display); font-weight: 800; font-size: 48px; line-height: 1; }
.sw-ad__note { font-size: 14px; color: var(--gg-ink-2); max-width: 30ch; }

/* ============================================================ rotate prompt: phones in portrait, on any canvas screen (sea, chart, Shipyard, log) */
#rotate { display: none; }
@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  html[data-view="sea"] #rotate {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 50; padding: 24px; background: var(--gg-cream);
  }
  html[data-view="sea"] #c,
  html[data-view="sea"] #hud,
  html[data-view="sea"] #help,
  html[data-view="sea"] .sw-tow { visibility: hidden; }
}
.sw-rotate { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 320px; padding: 26px 22px 22px; font-family: var(--gg-font-body); }
.sw-rotate__art { width: 128px; height: 128px; }
.sw-rotate__phone { transform-origin: 60px 54px; transform-box: view-box; animation: sw-turn calc(2600ms * var(--gg-time)) var(--gg-ease-in-out) infinite; }
.sw-rotate__arrow { animation: sw-arrow calc(2600ms * var(--gg-time)) ease-in-out infinite; }
.sw-rotate__title { margin: 4px 0 0; font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-xl); letter-spacing: -.01em; }
.sw-rotate__sub { margin: 0 0 8px; font-size: var(--gg-text-sm); color: var(--gg-ink-2); font-weight: 600; }
@keyframes sw-turn { 0%, 25% { transform: rotate(0deg); } 55%, 85% { transform: rotate(90deg); } 100% { transform: rotate(0deg); } }
@keyframes sw-arrow { 0%, 20% { opacity: 1; } 40%, 90% { opacity: 0; } 100% { opacity: 1; } }

/* ============================================================ in-play HUD (drawHUD fills the ids) */
#hud {
  position: fixed; z-index: 10; top: calc(12px + var(--sw-sat)); left: calc(14px + var(--sw-sal)); max-width: min(560px, 46vw);
  font-family: var(--gg-font-body); font-size: 14px; line-height: 1.45; font-weight: 600; color: var(--gg-ink);
  background: var(--gg-paper); border: var(--gg-border); border-radius: var(--gg-r-md); box-shadow: var(--gg-shadow);
  padding: 8px 14px 9px; pointer-events: none;
}
#hud b { font-weight: 800; font-variant-numeric: tabular-nums; }
#hud #spd, #hud #hdg, #hud #wnd { font-variant-numeric: tabular-nums; }
#lvl { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-md); letter-spacing: -.01em; line-height: 1.2; margin-bottom: 2px; }
.sw-hud__k { font-size: 13px; font-weight: 700; color: var(--gg-ink-3); }
.sw-hud__nav { display: flex; flex-wrap: wrap; column-gap: 14px; }
#pos { font-weight: 800; display: inline-block; text-transform: lowercase; }
#pos::first-letter { text-transform: uppercase; }
#obj { font-weight: 700; }
#hull { letter-spacing: 1px; }
#shipname { color: var(--gg-ink-3); }
#help {
  position: fixed; z-index: 10; bottom: calc(12px + var(--sw-sab)); left: calc(14px + var(--sw-sal)); max-width: calc(100vw - 260px);
  font-family: var(--gg-font-body); font-size: 13px; font-weight: 700; color: var(--gg-ink-2);
  background: var(--gg-paper); border: var(--gg-border); border-radius: var(--gg-r-pill); box-shadow: var(--gg-shadow-sm); padding: 6px 14px;
}
.bad { color: #C2185B !important; } .ok { color: var(--gg-green-700) !important; } .mid { color: #8A5A00 !important; }
.en { color: #C2185B; font-weight: 800; } .is { color: #8A5A00; font-weight: 700; } .wn { color: #1D5FA8; }
/* phones: one compact chip, 13 px floor, clear of the notch; the thumb controls replace the key-hint bar */
body.touch #help { display: none !important; }
body.touch #hud { font-size: 13px; line-height: 1.3; padding: 5px 10px 6px; border-radius: 12px; box-shadow: var(--gg-shadow-sm); max-width: min(330px, 40vw);
  top: calc(6px + var(--sw-sat)); left: calc(6px + var(--sw-sal)); }
body.touch #hud #lvl { font-size: 14px; margin: 0; }
body.touch #hud .sw-hud__i--deg { display: none; }
body.touch #hud #hullrow { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sw-start, .sw-res__card { animation: none; }
  .sw-rotate__phone { animation: none; transform: rotate(90deg); }
  .sw-rotate__arrow { animation: none; }
}
