/* One Shot (/play.html): only loaded on this page. Uses the site's colour tokens from style.css. */

/* The game's own colours, light and dark. The page uses the site's tokens (style.css);
   these are for the things on the 3D picture. In dark mode the course is shown at dusk
   (game.js), so the stage, loading screen and pills match an evening sky.
   Keep the two dark blocks the same. */
:root {
  --os-sky-top: #7dbfe9; --os-sky-mid: #c8e6f1; --os-sky-low: #e4f3ee; --os-lawn-a: #b2dc86; --os-lawn-b: #9fd174;
  --os-stage-line: rgb(13 80 50 / 8%);
  --os-load-top: #7dbfe9; --os-load-mid: #c8e6f1; --os-load-low: #e4f3ee; --os-load-ink: #18392b; --os-bar-bg: rgb(255 255 255 / 85%);
  --os-pill-bg: rgb(255 255 255 / 92%); --os-pill-solid: #ffffff; --os-pill-line: rgb(255 255 255 / 70%);
  --os-pill-shadow: 0 1px 2px rgb(13 60 35 / 12%), 0 4px 14px rgb(13 60 35 / 16%);
  --os-msg-bg: rgb(255 255 255 / 95%);
  --os-win-b: #1b8556;   /* white text on the "in" message: 4.6:1 or better across the gradient */
  --os-putt-top: #23915f; --os-putt-edge: #0f5134; --os-putt-line: rgb(255 255 255 / 90%);
  --os-gentle: #137a46; --os-tricky: #c22a35; --os-fiendish: #b42318;
  /* the Swag screen: tokens (gold) and the three bags */
  --sw-gold-bg: #faeeda; --sw-gold-ink: #633806; --sw-gold: #d9a21b;
  --sw-em-bg: #eaf3de; --sw-em-ink: #27500a; --sw-em: #3b8a1e;
  --sw-ru-bg: #fcebeb; --sw-ru-ink: #791f1f; --sw-ru: #c0353a;
  --sw-di-bg: #e6f1fb; --sw-di-ink: #0c447c; --sw-di: #2f7fcf;
}
:root[data-theme="dark"] {
  --os-sky-top: #2b3f73; --os-sky-mid: #8b7fa8; --os-sky-low: #d6a08e; --os-lawn-a: #4f7a45; --os-lawn-b: #456c3c;
  --os-stage-line: rgb(255 255 255 / 7%);
  --os-load-top: #1f2d52; --os-load-mid: #45467a; --os-load-low: #9c7286; --os-load-ink: #f1f4f2; --os-bar-bg: rgb(255 255 255 / 22%);
  --os-pill-bg: rgb(23 32 25 / 90%); --os-pill-solid: #172019; --os-pill-line: rgb(228 236 230 / 16%);
  --os-pill-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 35%);
  --os-msg-bg: rgb(23 32 25 / 94%);
  --os-putt-top: #22895a; --os-putt-edge: #0b3a25; --os-putt-line: rgb(228 236 230 / 55%);
  --os-gentle: #4fd08f; --os-tricky: #ff9a9f; --os-fiendish: #ff7a6b;
  --sw-gold-bg: #3a3018; --sw-gold-ink: #f0d48a; --sw-gold: #e8b93a;
  --sw-em-bg: #1d2f1b; --sw-em-ink: #b9e08f; --sw-em: #7cc556;
  --sw-ru-bg: #3a1d20; --sw-ru-ink: #ffb8b4; --sw-ru: #f0727a;
  --sw-di-bg: #15283c; --sw-di-ink: #a6d0f7; --sw-di: #66a8ec;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --os-sky-top: #2b3f73; --os-sky-mid: #8b7fa8; --os-sky-low: #d6a08e; --os-lawn-a: #4f7a45; --os-lawn-b: #456c3c;
    --os-stage-line: rgb(255 255 255 / 7%);
    --os-load-top: #1f2d52; --os-load-mid: #45467a; --os-load-low: #9c7286; --os-load-ink: #f1f4f2; --os-bar-bg: rgb(255 255 255 / 22%);
    --os-pill-bg: rgb(23 32 25 / 90%); --os-pill-solid: #172019; --os-pill-line: rgb(228 236 230 / 16%);
    --os-pill-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 35%);
    --os-msg-bg: rgb(23 32 25 / 94%);
    --os-putt-top: #22895a; --os-putt-edge: #0b3a25; --os-putt-line: rgb(228 236 230 / 55%);
    --os-gentle: #4fd08f; --os-tricky: #ff9a9f; --os-fiendish: #ff7a6b;
    --sw-gold-bg: #3a3018; --sw-gold-ink: #f0d48a; --sw-gold: #e8b93a;
    --sw-em-bg: #1d2f1b; --sw-em-ink: #b9e08f; --sw-em: #7cc556;
    --sw-ru-bg: #3a1d20; --sw-ru-ink: #ffb8b4; --sw-ru: #f0727a;
    --sw-di-bg: #15283c; --sw-di-ink: #a6d0f7; --sw-di: #66a8ec;
  }
}

/* On this page the site header scrolls away with the page, so it never covers the game. */
body[data-kind="play"] .site-header { position: static; top: auto; }
html:has(body[data-kind="play"]) { scroll-padding-top: 0; }

.play-page { padding: 16px 0 40px; }
.os-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-bottom: 10px; }
.play-page h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: 0; }
.play-page .lede { margin: 0; flex: 1 1 320px; }

.os-game { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px 12px; scroll-margin-top: 8px; }
.os-game:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.os-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 4px 8px; }
.os-top h2 { font-size: 1.15rem; margin: 0; }
/* the try count: a small green chip on the right */
.os-tries { margin: 0; padding: 1px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; }
/* the music switch: a small pill beside the try count (the game's own controls, not on the picture) */
.os-top-r { display: flex; align-items: center; gap: 8px; }
.os-music { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px 2px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 700; font-size: .95rem; line-height: 1; cursor: pointer; }
.os-music[hidden] { display: none; }
.os-music svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.os-music .om-off { display: none; }
.os-music[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.os-music[aria-pressed="false"] .om-off { display: inline; }
.os-music:hover { border-color: var(--brand); }
.os-music:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.os-music:active { transform: translateY(1px); }
/* the Swag button: the same pill as Music; filled while its screen is open; dimmed while a shot is moving */
.os-swag-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.os-swag-btn:disabled { opacity: .5; cursor: default; }
.os-swag-btn:disabled:hover { border-color: var(--line); }
.os-swag-btn:disabled:active { transform: none; }
/* the music volume: a short slider beside the switch, shown while the music is on */
.os-vol { width: 96px; height: 44px; margin: 0; padding: 0; background: transparent; accent-color: var(--brand); cursor: pointer; }
.os-vol[hidden] { display: none; }
.os-vol:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 999px; }

/* the day's level (Gentle / Tricky / Fiendish), a small pill after the title */
.os-level { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: color-mix(in srgb, currentColor 9%, transparent); }
.os-level-gentle { color: var(--os-gentle); }
.os-level-tricky { color: var(--os-tricky); }
.os-level-fiendish { color: var(--os-fiendish); }
.os-level-special { color: #fff; background: #b42318; border-color: #b42318; }

/* The whole game (title, picture, controls, message) fits in one screen:
   the picture takes what is left after the controls. */
/* the sky colours match the 3D sky (game.js, day or dusk), so there is no flash while it starts */
.os-stage { position: relative; width: 100%; height: 60vh; height: clamp(240px, calc(100svh - 210px), 640px); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, var(--os-sky-top) 0%, var(--os-sky-mid) 48%, var(--os-sky-low) 62%, var(--os-lawn-a) 62%, var(--os-lawn-b) 100%); box-shadow: inset 0 0 0 1px var(--os-stage-line); }
@media (max-width: 900px) { .os-stage { height: clamp(220px, calc(100svh - 235px), 620px); } }
@media (max-width: 640px) { .os-stage { height: clamp(200px, calc(100svh - 270px), 560px); } }
#os-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }

#os-canvas.hide-cursor { cursor: none; }

.os-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 800; color: var(--os-load-ink); text-align: center; padding: 0 16px;
  background: linear-gradient(180deg, var(--os-load-top) 0%, var(--os-load-mid) 55%, var(--os-load-low) 100%); font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-size: 1.1rem; }
.os-loading[hidden] { display: none; }
.os-bar { width: min(240px, 70%); height: 10px; border-radius: 99px; background: var(--os-bar-bg); overflow: hidden; box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / 15%); }
.os-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--lvl-beginner)); transition: width .2s; }

/* Everything that sits on the picture shares one look: frosted pills (white, or the dark
   surface in dark mode) with a soft shadow, in the site's heading font. (No backdrop blur: it costs too much on phones.) */
.os-over, .os-aim-read, .os-msg, .os-hint { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; box-shadow: var(--os-pill-shadow); }
.os-over { position: absolute; top: 10px; right: 10px; min-height: 40px; padding: 0 16px 2px; border-radius: 99px; border: 1px solid var(--os-pill-line);
  background: var(--os-pill-bg); color: var(--brand); font-weight: 700; font-size: 1rem; line-height: 1; cursor: pointer; }
.os-over:hover { background: var(--os-pill-solid); }
.os-over:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.os-over:active { transform: translateY(1px); }
.os-over[aria-pressed="true"] { background: var(--brand-fill); color: var(--brand-ink); border-color: var(--brand-fill); }
.os-over[hidden] { display: none; }
.os-skip { top: auto; bottom: 10px; }

/* messages sit at the bottom of the picture, above the controls */
.os-msg { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 24px); text-align: center;
  background: var(--os-msg-bg); color: var(--text); font-weight: 700; font-size: 1.08rem; line-height: 1.25; padding: 8px 18px 9px; border-radius: 16px; }
.os-msg:empty { display: none; }
.os-msg.win { background: linear-gradient(135deg, var(--brand-fill), var(--os-win-b)); color: var(--brand-ink); box-shadow: 0 0 0 3px rgb(172 214 83 / 55%), 0 6px 22px rgb(var(--shadow-rgb) / 30%); }
.os-msg .os-tip { display: block; margin-top: 2px; font-family: "Nunito", system-ui, sans-serif; font-weight: 600; font-size: .92rem; color: var(--muted); }
.os-msg.win .os-tip { color: var(--brand-ink); opacity: .92; }
.os-skip:not([hidden]) ~ .os-msg { bottom: 60px; }
@media (prefers-reduced-motion: no-preference) {
  .os-msg:not(:empty) { animation: os-pop .28s cubic-bezier(.2, 1.4, .4, 1); }
  .os-msg.win:not(:empty) { animation: os-pop .4s cubic-bezier(.2, 1.6, .4, 1); }
  .os-hint:not([hidden]) { animation: os-fade .5s ease-out; }
}
@keyframes os-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.94); } }
@keyframes os-fade { from { opacity: 0; } }

.os-aim-read { position: absolute; left: 10px; top: 10px; margin: 0; padding: 0 14px 2px; min-height: 40px; display: flex; align-items: center; gap: 6px; border-radius: 99px;
  background: var(--os-pill-bg); color: var(--text); font-weight: 700; font-size: .95rem; line-height: 1; font-variant-numeric: tabular-nums; pointer-events: none; }
/* a small target ring before the aim read-out */
.os-aim-read::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--brand); box-shadow: inset 0 0 0 2px var(--os-pill-solid), inset 0 0 0 5px var(--brand); }
.os-power { position: absolute; width: 16px; height: 68px; border-radius: 99px; background: var(--os-pill-bg); border: 2px solid var(--os-putt-line); box-shadow: 0 4px 14px rgb(var(--shadow-rgb) / 22%); overflow: hidden; display: flex; align-items: flex-end; pointer-events: none; }
.os-power[hidden] { display: none; }
.os-power span { display: block; width: 100%; height: 0; border-radius: 99px; background: linear-gradient(0deg, var(--lvl-beginner), var(--lvl-manageable), var(--lvl-challenging), var(--lvl-tough)); }
.os-hint { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 24px); text-align: center; padding: 7px 16px 8px; border-radius: 16px; background: var(--brand-fill); color: var(--brand-ink); font-weight: 700; font-size: 1rem; line-height: 1.25; pointer-events: none; }
.os-hint[hidden] { display: none; }

.os-after { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 10px; }
.os-share-box { font: inherit; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; flex: 1 1 260px; max-width: 520px; background: var(--surface); color: var(--text); }
.os-share-box[hidden] { display: none; }
.os-stats { margin: 0; color: var(--muted); font-weight: 600; }
.os-stats:empty { display: none; }
.os-on-hole { margin: 8px 4px 0; color: var(--muted); font-size: .95rem; }
.os-noscript { margin: 10px 4px 0; color: var(--danger); font-weight: 600; }
.os-ready .os-noscript { display: none; }
.os-help { margin-top: 24px; }
.os-help h2 { font-size: 1.3rem; }

.os-debug { margin-top: 12px; padding: 10px; border: 2px dashed var(--lvl-challenging); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.os-debug pre { color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 8px; flex-basis: 100%; margin: 0; max-height: 240px; overflow: auto; font-size: .8rem; white-space: pre-wrap; }

@media (max-width: 640px) {
  .play-page { padding-top: 6px; }
  .os-head { margin-bottom: 4px; }
  .os-head .lede { display: none; }
  .play-page h1 { font-size: 1.3rem; }
  .os-game { padding: 6px 8px 8px; margin: 0 -8px; }
  .os-top { margin: 0 4px 4px; flex-wrap: nowrap; }
  .os-music { padding: 0; width: 44px; }
  .os-music span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .os-vol { width: 64px; }
  .os-top-r { gap: 6px; }
  .os-top h2 { font-size: 1rem; }
  .os-stage { height: clamp(180px, calc(100svh - var(--os-chrome, 290px)), 560px); }
  .os-top { margin-bottom: 6px; }
}
/* small phones: the title, Music, the volume, Swag and the try count still share one row
   (the title wraps first; then the volume slider gives a little, down to 30px) */
@media (max-width: 400px) {
  .os-top { gap: 8px; }
  .os-top h2 { flex-shrink: 100; }
  .os-top-r { gap: 4px; min-width: 0; }
  .os-vol { flex: 0 1 52px; width: 52px; min-width: 30px; }
  .os-tries { padding: 1px 8px; }
}

/* Phones on their side: the picture fills the height. */
@media (orientation: landscape) and (max-height: 540px) {
  .play-page { padding-top: 6px; }
  .os-head .lede { display: none; }
  .os-stage { height: calc(100vh - 64px); height: calc(100svh - 64px); min-height: 200px; }
  .os-game { padding: 6px 8px 8px; }
  .os-top { margin-bottom: 4px; }
}

/* Touch screens only (the page adds .touch-ui for a coarse pointer or a first touch):
   a "Hold to putt" button on the picture, bottom right (thumb side, clear of the ball),
   in the site's main button colours. Dragging on the course only aims. */
.os-putt { display: none; }
.touch-ui .os-putt { position: absolute; right: 12px; bottom: 16px; display: flex; align-items: center; justify-content: center;
  min-width: 140px; min-height: 58px; padding: 0 22px; border: 2px solid var(--os-putt-line); border-radius: 999px;
  background: linear-gradient(180deg, var(--os-putt-top), var(--brand-fill)); color: var(--brand-ink); font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-size: 1.12rem; font-weight: 800;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 var(--os-putt-edge), 0 8px 18px rgb(var(--shadow-rgb) / 30%); }
/* holding: the button is pressed in and turns lime while the power builds */
.touch-ui .os-putt.holding { background: linear-gradient(180deg, #c3e36f, var(--accent)); color: var(--on-bright); transform: translateY(3px); box-shadow: 0 1px 0 #6f8f2a, 0 4px 10px rgb(var(--shadow-rgb) / 25%); }
.touch-ui .os-putt:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.touch-ui .os-skip { right: auto; left: 10px; }
/* on a phone the messages sit near the top, clear of the button, the hedgehog and the ball */
.touch-ui .os-msg { top: 54px; bottom: auto; }
.touch-ui .os-skip:not([hidden]) ~ .os-msg { bottom: auto; }

/* ---------- The Swag screen (swag.js): a hub (tokens, the swag code and two big buttons) and two popups, Mystery bags
   and the Locker. The hub sits over the picture: on a computer at the top right, with the hedgehog close up on the left
   (game.js moves the picture's middle into the free part); on a phone as a sheet along the bottom, with the hedgehog
   above it. A popup takes the hub's place, wider for the locker; on a phone it fills the screen. The game's own pills
   are hidden while the screen is open. */
.os-stage.swag-open :is(.os-over, .os-aim-read, .os-hint, .os-msg, .os-power, .os-putt) { display: none; }
.os-swag { position: absolute; z-index: 3; top: 10px; right: 10px; width: min(410px, calc(50% - 10px)); max-height: calc(100% - 20px); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--os-pill-shadow);
  font-size: var(--fs-2); line-height: 1.4; }
.os-swag[hidden] { display: none; }
.os-swag.under { visibility: hidden; }   /* a popup is open over it */
:is(.os-swag, .os-sw-dlg) :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:is(.os-swag, .os-sw-dlg) :is(h3, h4, .os-sw-reveal):focus { outline: none; }   /* focus is put on these for screen readers: no ring */
.os-sw-head, .os-sw-dhead { display: flex; align-items: center; gap: 10px; }
:is(.os-sw-head, .os-sw-dhead) h3 { flex: 1; margin: 0; font-size: var(--fs-4); }
.os-sw-tokens { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 2px 12px 3px 8px; border-radius: 999px; background: var(--sw-gold-bg); color: var(--sw-gold-ink);
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-sw-tokens svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.os-sw-x { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: -6px -10px -6px -4px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; }
.os-sw-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.os-sw-x:hover { background: var(--surface-2); color: var(--text); }
.os-sw-earn { margin: 2px 0 10px; color: var(--muted); font-size: var(--fs-1); }
.os-sw-small { display: block; margin: 4px 0 0; color: var(--muted); font-size: var(--fs-1); }
.os-sw-small:empty { display: none; }
.os-sw-h { margin: 14px 0 6px; font-size: var(--fs-3); }
.os-sw-odds { margin: 0 0 10px; }   /* how a bag picks, at the top of Mystery bags */
.os-sw-below { margin: -6px 0 10px; }   /* why the tokens are below zero */

/* small pill buttons, like the Music button */
.os-sw-btn, .os-sw-open { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px 2px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--brand); font: inherit; font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 700; line-height: 1; cursor: pointer; }
.os-sw-btn:hover, .os-sw-open:hover { border-color: var(--brand); }
.os-sw-btn:active, .os-sw-open:active { transform: translateY(1px); }
.os-sw-btn[hidden] { display: none; }
:is(.os-swag, .os-sw-dlg) [aria-disabled="true"] { opacity: .55; cursor: default; }
:is(.os-swag, .os-sw-dlg) [aria-disabled="true"]:hover { border-color: var(--line); }
:is(.os-swag, .os-sw-dlg) [aria-disabled="true"]:active { transform: none; }

/* the hub's two big buttons: Bags (one little golf bag) and the Locker */
.os-sw-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 12px; }
.os-sw-big { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; min-height: 124px; padding: 10px 8px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface) 85%); color: var(--text);
  font: inherit; text-align: center; cursor: pointer; box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 8%); }
.os-sw-big:hover { border-color: var(--brand); }
.os-sw-big:active { transform: translateY(1px); }
.os-sw-bigart { display: flex; align-items: flex-end; justify-content: center; height: 62px; margin-bottom: 4px; }
.os-sw-bigart .os-sw-sack { width: 32px; height: 58px; }
.os-sw-bigt { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-size: var(--fs-4); font-weight: 800; line-height: 1.15; color: var(--brand); }
.os-sw-bigs { font-size: var(--fs-1); line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.os-sw-lockr { width: 34px; height: 50px; }
.os-sw-lockr .lk-body { fill: var(--brand-fill); }
.os-sw-lockr .lk-door { fill: color-mix(in srgb, var(--brand-fill) 82%, #ffffff); stroke: #000; stroke-opacity: .18; stroke-width: .8; }
.os-sw-lockr .lk-vent { fill: none; stroke: #000; stroke-opacity: .3; stroke-width: 1.6; stroke-linecap: round; }
.os-sw-lockr .lk-handle { fill: var(--sw-gold); }
.os-sw-lockr .lk-plate { fill: #fffaf0; stroke: #000; stroke-opacity: .25; stroke-width: .6; }

/* the swag code, the line about keeping it safe and "Use a different code" */
.os-sw-code { padding: 8px 12px 6px; border-radius: 12px; background: var(--surface-2); }
.os-sw-coderow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin: 0; }
.os-sw-coderow[hidden] { display: none; }
.os-sw-codev { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--fs-3); font-weight: 700; letter-spacing: .04em; white-space: nowrap; user-select: all; }
.os-sw-codev.masked { user-select: none; }
.os-sw-codebtns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
#os-sw-status { color: var(--text); font-weight: 600; }
.os-sw-other summary { display: flex; align-items: center; gap: 8px; width: max-content; min-height: 44px; color: var(--brand); font-weight: 700; cursor: pointer; list-style: none; }
.os-sw-other summary::-webkit-details-marker { display: none; }
.os-sw-other summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.os-sw-other[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.os-sw-form { padding-bottom: 6px; }
.os-sw-form label { display: block; margin-bottom: 2px; font-size: var(--fs-1); font-weight: 700; }
.os-sw-formrow { display: flex; gap: 8px; }
.os-sw-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  font: inherit; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
.os-sw-form input::placeholder { color: var(--muted); opacity: .7; }

/* the popups: a header that stays put (the title, and the close button at the top right) over a body that scrolls */
.os-sw-dlg { position: absolute; z-index: 4; top: 10px; right: 10px; bottom: 10px; width: min(430px, calc(50% - 10px)); display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--os-pill-shadow); font-size: var(--fs-2); line-height: 1.4; }
.os-sw-dlg[hidden] { display: none; }
.os-sw-lockd { width: min(600px, calc(66% - 10px)); }
.os-sw-dhead { flex: none; padding: 10px 16px 9px; border-bottom: 1px solid var(--line); }
.os-sw-lcount { margin: 0; font-variant-numeric: tabular-nums; }
.os-sw-dbody { position: relative; flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 12px 16px 16px; }
.os-sw-dbody > [hidden] { display: none; }

/* the bags (gold: os-sw-crown; Super rare: an opal) and the rarities' gem colours */
.os-sw-emerald { --b-bg: var(--sw-em-bg); --b-ink: var(--sw-em-ink); --b: var(--sw-em); }
.os-sw-ruby { --b-bg: var(--sw-ru-bg); --b-ink: var(--sw-ru-ink); --b: var(--sw-ru); }
.os-sw-diamond { --b-bg: var(--sw-di-bg); --b-ink: var(--sw-di-ink); --b: var(--sw-di); }
.os-sw-crown { --b-bg: var(--sw-gold-bg); --b-ink: var(--sw-gold-ink); --b: var(--sw-gold); }
.os-sw-super { --b-bg: var(--sw-di-bg); --b-ink: var(--sw-di-ink); --b: #a066e0; }
.os-sw-bags { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.os-sw-bag { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--b-bg); color: var(--b-ink); }
.os-sw-sack { flex: none; width: 30px; height: 54px; overflow: visible; }
.os-sw-binfo { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.os-sw-bact { display: flex; flex-direction: column; align-items: center; flex: none; max-width: 40%; text-align: center; }
/* the golf bag drawing (swag.js SACK): the tier colours the body and the gem; the rest is the same for every bag */
.os-sw-sack .sk-body { fill: var(--b); stroke: var(--b-ink); stroke-opacity: .4; stroke-width: .7; stroke-linejoin: round; }
.os-sw-emerald .sk-body { fill: #8fc79a; fill: color-mix(in srgb, var(--b) 55%, #dff3e2); }   /* the pale mint of the old bag */
.os-sw-sack .sk-hi { fill: none; stroke: #fff; stroke-opacity: .4; stroke-width: 2; stroke-linecap: round; }
.os-sw-sack .sk-sh { fill: none; stroke: #000; stroke-opacity: .13; stroke-width: 2.6; stroke-linecap: round; }
.os-sw-sack .sk-pipe { fill: none; stroke: #fff8e8; stroke-opacity: .8; stroke-width: .8; stroke-linecap: round; }
.os-sw-sack .sk-pocket { fill: #000; fill-opacity: .13; stroke: #fff8e8; stroke-opacity: .6; stroke-width: .7; stroke-linejoin: round; }
.os-sw-sack .sk-grom { fill: #000; fill-opacity: .4; }
.os-sw-sack .sk-white { fill: #fbf9f2; stroke: #000; stroke-opacity: .25; stroke-width: .6; }
.os-sw-sack .sk-rim { fill: var(--sw-gold); stroke: #000; stroke-opacity: .2; stroke-width: .5; }
.os-sw-sack .sk-foot { fill: #2b2b2e; }
.os-sw-sack .sk-strap-o { fill: none; stroke: #000; stroke-opacity: .4; stroke-width: 4; stroke-linecap: round; }
.os-sw-sack .sk-strap { fill: none; stroke: #f7f1e3; stroke-width: 2.6; stroke-linecap: round; }
.os-sw-sack .sk-string { fill: none; stroke: #fff8e8; stroke-width: .7; stroke-linecap: round; }
.os-sw-sack .sk-card { fill: #fffaf0; stroke: #000; stroke-opacity: .35; stroke-width: .6; }
.os-sw-sack .sk-gem { fill: var(--b); stroke: #000; stroke-opacity: .4; stroke-width: .5; stroke-linejoin: round; }
.os-sw-sack .sk-shaft { fill: none; stroke: #6c747b; stroke-width: 1.1; stroke-linecap: round; }
.os-sw-sack .sk-wood { fill: #c0742a; stroke: #6b3a12; stroke-width: .6; }
.os-sw-sack .sk-w2 { fill: #2f6f97; stroke: #173f5a; }
.os-sw-sack .sk-w3 { fill: #9b5424; }
.os-sw-sack .sk-wood-line { fill: none; stroke: #6b3a12; stroke-opacity: .55; stroke-width: .5; stroke-linecap: round; }
.os-sw-sack .sk-iron { fill: #d3d8dd; stroke: #747c83; stroke-width: .6; stroke-linejoin: round; }
.os-sw-sack .sk-clubs { transform-origin: 20px 22px; }
.os-sw-sack .sk-tag { transform-origin: 15px 22.5px; }
.os-sw-bag.done .os-sw-sack { opacity: .45; }
.os-sw-bn { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 800; line-height: 1.25; }
.os-sw-bs { font-size: var(--fs-1); line-height: 1.3; }
.os-sw-open { min-width: 84px; border-color: currentColor; color: var(--b-ink); }
.os-sw-open:hover { border-color: currentColor; background: var(--b-bg); }
.os-sw-dlg .os-sw-open[aria-disabled="true"]:hover { border-color: currentColor; background: var(--surface); }
.os-sw-why { margin-top: 2px; font-size: var(--fs-1); font-weight: 700; line-height: 1.25; }
.os-sw-why:empty { display: none; }

/* opening a bag: a big golf bag rocks on its base with the clubs rattling, then the clubs jump up out of it */
.os-sw-reveal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100%; padding: 26px 0 18px; color: var(--b-ink); }
.os-sw-revart { line-height: 0; padding: 18px 40px 0; border-radius: 50%; background: radial-gradient(closest-side, var(--b-bg), transparent); }
.os-sw-revart .os-sw-sack { width: 74px; height: 134px; }
.os-sw-reveal.big .os-sw-sack { width: 86px; height: 156px; }
.os-sw-got { margin: 0; font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-weight: 700; font-size: var(--fs-3); }
@media (prefers-reduced-motion: no-preference) {
  .os-sw-reveal.shake .os-sw-revart svg { transform-origin: 50% 94%; animation: sw-shake var(--sh, .8s) ease-in-out; }
  .os-sw-reveal.shake .sk-clubs { animation: sw-rattle var(--sh, .8s) ease-in-out; }
  .os-sw-reveal.lv2.shake .os-sw-revart svg { animation-name: sw-shake-hard; }
  .os-sw-reveal.lv2.shake .os-sw-revart { animation: sw-build var(--sh) ease-in both; }
  .os-sw-reveal.shown .os-sw-revart svg { transform-origin: 50% 94%; animation: sw-burst var(--bu, .45s) ease-out; }
  .os-sw-reveal.shown .sk-clubs { animation: sw-clubs var(--bu, .45s) cubic-bezier(.2, .9, .3, 1) both; --j: -12px; }
  .os-sw-reveal.lv1.shown .sk-clubs { --j: -15px; }
  .os-sw-reveal.big.shown .sk-clubs { --j: -18px; }
  .os-sw-reveal.lv2.shown .sk-clubs { --j: -20px; }
  .os-sw-reveal.shown .sk-tag { animation: sw-tag var(--bu, .45s) ease-out; }
}
@keyframes sw-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-7deg); } 30% { transform: rotate(6deg); } 45% { transform: rotate(-5deg); } 60% { transform: rotate(4deg); } 78% { transform: rotate(-2deg); } }
@keyframes sw-rattle { 0%, 100% { transform: translateY(0) rotate(0); } 15% { transform: translateY(-3px) rotate(-3deg); } 32% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-4px) rotate(-2deg); } 68% { transform: translateY(0) rotate(2deg); } 84% { transform: translateY(-2px) rotate(-1deg); } }
@keyframes sw-shake-hard { 0%, 100% { transform: rotate(0); } 8% { transform: rotate(-4deg); } 20% { transform: rotate(9deg); } 34% { transform: rotate(-8deg); } 48% { transform: rotate(7deg); } 60% { transform: rotate(-6deg); } 72% { transform: rotate(5deg); } 86% { transform: rotate(-3deg); } }
@keyframes sw-build { from { transform: scale(1); opacity: .6; } to { transform: scale(1.45); opacity: 1; } }
@keyframes sw-burst { 40% { transform: scale(1.1, .93); } }
@keyframes sw-clubs { 0% { transform: translateY(0); } 60% { transform: translateY(var(--j, -12px)) rotate(2deg); } 100% { transform: translateY(var(--j, -12px)) rotate(2deg); opacity: 0; } }
@keyframes sw-tag { 25% { transform: rotate(14deg); } 55% { transform: rotate(-9deg); } 80% { transform: rotate(4deg); } }

/* the prize card: the piece's picture in a burst of light (rays turning slowly behind it, a soft glow, confetti and
   sparkles), then its tier, its name and the buttons. Bigger and longer for Diamond, biggest for the 80th piece (gold).
   With reduced motion: the same card, still (no rays turning, no confetti, no sparkles) */
.os-sw-prize { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; padding: 4px 0 4px; }
.os-sw-pstage { position: relative; display: grid; place-items: center; width: 220px; height: 220px; margin: 0 auto 4px; }
.os-sw-prize.lv1:not(.big) .os-sw-pstage { width: 234px; height: 234px; }
.os-sw-prize.big .os-sw-pstage { width: 248px; height: 248px; }
.os-sw-prize.huge .os-sw-pstage { width: 268px; height: 268px; }
.os-sw-rays, .os-sw-glow, .os-sw-flash { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.os-sw-flash { inset: -25%; opacity: 0; background: radial-gradient(closest-side, #fff 0%, rgb(205 230 255 / 75%) 38%, transparent 100%); }
.os-sw-prize.lv2 .os-sw-rays { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--b) 48%, transparent) 0deg 7deg, transparent 7deg 20deg); }
.os-sw-rays { inset: -12%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--b) 30%, transparent) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(closest-side, #000 30%, transparent 100%); mask: radial-gradient(closest-side, #000 30%, transparent 100%); }
.os-sw-prize.huge .os-sw-rays { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--sw-gold) 45%, transparent) 0deg 7deg, transparent 7deg 16deg); }
.os-sw-glow { inset: 12%; background: radial-gradient(closest-side, color-mix(in srgb, var(--b) 40%, var(--surface)) 0%, color-mix(in srgb, var(--b-bg) 70%, transparent) 55%, transparent 100%); }
.os-sw-ppic { position: relative; display: grid; place-items: center; width: 72%; aspect-ratio: 1; }
.os-sw-ppic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgb(var(--shadow-rgb) / 22%)); }
.os-sw-ppic img[hidden] { display: none; }
.os-sw-ppic img:not([hidden]) + .os-sw-q { display: none; }
.os-sw-q { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--b); opacity: .7; }
.os-sw-confetti, .os-sw-pstage .os-sw-stars { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.os-sw-confetti i { position: absolute; left: -4px; top: -6px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; background: var(--b); }
.os-sw-confetti .c1 { background: var(--sw-gold); } .os-sw-confetti .c2 { background: #acd653; }
.os-sw-confetti .c3 { background: #f6f5ee; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); } .os-sw-confetti .c4 { background: color-mix(in srgb, var(--b) 60%, #ffffff); border-radius: 50%; width: 9px; height: 9px; }
.os-sw-prize:not(.big):not(.lv1) .os-sw-confetti i:nth-child(n+25), .os-sw-prize.lv1:not(.big) .os-sw-confetti i:nth-child(n+37) { display: none; }
.os-sw-prize.big:not(.huge) .os-sw-confetti i:nth-child(n+37) { display: none; }
.os-sw-pstage .os-sw-stars i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; opacity: 0; background: var(--sw-gold); transform: translate(var(--x), var(--y));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.os-sw-prize.big .os-sw-pstage .os-sw-stars i { width: 16px; height: 16px; left: -8px; top: -8px; }
.os-sw-prize:not(.big) .os-sw-pstage .os-sw-stars i:nth-child(n+9), .os-sw-prize.lv0:not(.big) .os-sw-pstage .os-sw-stars i:nth-child(n+5) { display: none; }
.os-sw-pstage .os-sw-stars i:nth-child(1) { --x: -88px; --y: -46px; } .os-sw-pstage .os-sw-stars i:nth-child(2) { --x: 84px; --y: -62px; }
.os-sw-pstage .os-sw-stars i:nth-child(3) { --x: -70px; --y: 58px; } .os-sw-pstage .os-sw-stars i:nth-child(4) { --x: 92px; --y: 40px; }
.os-sw-pstage .os-sw-stars i:nth-child(5) { --x: 6px; --y: -98px; } .os-sw-pstage .os-sw-stars i:nth-child(6) { --x: -100px; --y: 6px; }
.os-sw-pstage .os-sw-stars i:nth-child(7) { --x: 40px; --y: 92px; } .os-sw-pstage .os-sw-stars i:nth-child(8) { --x: 104px; --y: -6px; }
.os-sw-pstage .os-sw-stars i:nth-child(9) { --x: -48px; --y: -100px; } .os-sw-pstage .os-sw-stars i:nth-child(10) { --x: 62px; --y: -102px; }
.os-sw-pstage .os-sw-stars i:nth-child(11) { --x: -112px; --y: 52px; } .os-sw-pstage .os-sw-stars i:nth-child(12) { --x: -26px; --y: 108px; }
.os-sw-ptier { display: inline-block; margin: 0; padding: 1px 10px 2px; border-radius: 999px; background: var(--b-bg); color: var(--b-ink); border: 1px solid color-mix(in srgb, var(--b) 45%, transparent);
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif; font-size: var(--fs-1); font-weight: 800; letter-spacing: .03em; }
.os-sw-pname { margin: 6px 0 0; font-size: var(--fs-5); line-height: 1.2; }
.os-sw-prize:not(.big) .os-sw-pname { font-size: 1.375rem; }
.os-sw-pnote { margin: 2px 0 0; }
.os-sw-pbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.os-sw-pbtns .os-sw-wear { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink); }
.os-sw-pbtns .os-sw-wear[aria-disabled="true"] { background: var(--surface); border-color: var(--line); color: var(--brand); opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .os-sw-prize.go .os-sw-rays { animation: sw-in .5s ease-out both, sw-spin 20s linear; }   /* one slow turn, then still */
  .os-sw-prize.lv2.go .os-sw-rays { animation: sw-in .4s ease-out both, sw-spin 9s linear; }
  .os-sw-prize.go .os-sw-glow { animation: sw-in .4s ease-out both; }
  .os-sw-prize:is(.lv1, .lv2).go .os-sw-glow { animation: sw-in .4s ease-out both, sw-pulse 1.2s .4s ease-in-out 2; }
  .os-sw-prize.lv2.go .os-sw-flash { animation: sw-flash 1.2s ease-out both; }
  .os-sw-prize.go .os-sw-ppic { animation: sw-ppop .6s cubic-bezier(.2, 1.5, .4, 1) both; }
  .os-sw-prize.big.go .os-sw-ppic { animation-duration: .8s; }
  .os-sw-prize.go :is(.os-sw-ptier, .os-sw-pname, .os-sw-pnote, .os-sw-crowned, .os-sw-pbtns) { animation: sw-up .4s .25s ease-out both; }
  .os-sw-prize.lv1.go .os-sw-ptier { animation: sw-tagbounce .55s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
  .os-sw-prize.lv2.go .os-sw-ptier { animation: sw-tagbounce .8s .5s cubic-bezier(.2, 1.7, .4, 1) both; }
  .os-sw-prize.go .os-sw-confetti i { animation: sw-conf 1.5s var(--t) cubic-bezier(.15, .7, .4, 1) both; }
  .os-sw-prize.big.go .os-sw-confetti i { animation-duration: 2.1s; }
  .os-sw-prize.huge.go .os-sw-confetti i { animation-duration: 2.7s; }
  .os-sw-prize.go .os-sw-pstage .os-sw-stars i { animation: sw-twinkle 1.1s ease-in-out 2 both; }
  .os-sw-prize.big.go .os-sw-pstage .os-sw-stars i { animation-iteration-count: 4; }
  .os-sw-prize.huge.go .os-sw-pstage .os-sw-stars i { animation-iteration-count: 7; }
  .os-sw-prize.go .os-sw-pstage .os-sw-stars i:nth-child(3n+1) { animation-delay: .2s; }
  .os-sw-prize.go .os-sw-pstage .os-sw-stars i:nth-child(3n+2) { animation-delay: .5s; }
}
@media (prefers-reduced-motion: reduce) {
  .os-sw-confetti, .os-sw-pstage .os-sw-stars { display: none; }
}
@keyframes sw-spin { to { transform: rotate(1turn); } }
@keyframes sw-in { from { opacity: 0; transform: scale(.6); } }
@keyframes sw-ppop { 0% { transform: scale(.25) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes sw-pulse { 50% { transform: scale(1.22); opacity: .85; } }
@keyframes sw-flash { 0% { opacity: 0; transform: scale(.3); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes sw-tagbounce { 0% { opacity: 0; transform: translateY(-14px) scale(.4); } 60% { opacity: 1; transform: translateY(0) scale(1.18); } 100% { transform: scale(1); } }
@keyframes sw-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes sw-conf { 0% { transform: translate(0, 0) rotate(0) scale(.5); opacity: 0; } 6% { opacity: 1; }
  30% { transform: translate(var(--x), var(--y)) rotate(calc(var(--r) * .4)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--x) * 1.3), calc(var(--y) + 160px)) rotate(var(--r)) scale(.9); opacity: 0; } }
@keyframes sw-twinkle { 0%, 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.2) rotate(0); } 50% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1) rotate(45deg); } }
/* the 80th piece: the crown */
.os-sw-crowned { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sw-gold-bg); color: var(--sw-gold-ink); }
.os-sw-crowned[hidden] { display: none; }
.os-sw-crowned p { margin: 0 0 6px; }
.os-sw-crowned .os-sw-btn { color: var(--sw-gold-ink); border-color: currentColor; }

/* the locker: a grid of tiles per kind of piece (Default, the 10 pieces, and the crown on the hats). Found pieces show
   their picture and name and can be chosen (the one worn is marked); pieces still to find are locked, a "?" in the
   tier's colour */
.os-sw-lnote { margin: 0 0 4px; }
.os-sw-cat { margin-top: 16px; content-visibility: auto; contain-intrinsic-size: auto 400px; }   /* kinds out of view aren't drawn until scrolled to (a light first paint) */
.os-sw-cathead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.os-sw-cathead .os-sw-h { margin: 0; }
.os-sw-cathead .os-sw-small { margin: 0; font-variant-numeric: tabular-nums; }
.os-sw-wearing { margin: 0 0 8px; }
.os-sw-wearing span { color: var(--text); font-weight: 700; }
.os-sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 13px 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.os-sw-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 5px 5px 8px;
  border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: center; cursor: pointer; }
.os-sw-tile:hover { border-color: var(--line); }
.os-sw-tile input { position: absolute; top: 8px; left: 8px; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.os-sw-tile:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.os-sw-pic { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 9px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--b-bg, var(--surface)) 90%, var(--surface)) 55%, transparent 100%); }
.os-sw-pic img { width: 100%; height: 100%; object-fit: contain; }
.os-sw-pic img[hidden] { display: none; }
/* the tier, a small gem in the corner of a found piece's picture */
.os-sw-tile:not(.locked):not(.os-sw-def) .os-sw-pic::after { content: ""; position: absolute; right: 4px; top: 4px; width: 9px; height: 9px; background: var(--b);
  clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%); }
.os-sw-tn { display: flex; flex-direction: column; align-items: center; font-size: var(--fs-1); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.os-sw-ts { font-weight: 600; color: var(--muted); }
.os-sw-trytag { margin-top: 2px; padding: 0 6px 1px; border-radius: 999px; background: var(--sw-gold-bg); color: var(--sw-gold-ink); font-size: .75rem; font-weight: 800; }
.os-sw-none { width: 42%; height: 42%; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; opacity: .7; }
/* the piece being worn: a green frame and a "Wearing" mark */
.os-sw-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.os-sw-tile.on::before { content: "Wearing"; position: absolute; z-index: 1; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 7px 1px; border-radius: 999px;
  background: var(--brand-fill); color: var(--brand-ink); font-size: .6875rem; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.os-sw-tile.locked { cursor: default; background: var(--b-bg); color: var(--b-ink); }
.os-sw-tile.locked:hover { border-color: transparent; }
.os-sw-tile.locked .os-sw-pic { background: radial-gradient(closest-side, color-mix(in srgb, var(--b) 18%, transparent) 60%, transparent 100%); }
.os-sw-tile.locked .os-sw-q { color: var(--b); opacity: .85; font-size: 2.2rem; }
.os-sw-tile.locked .os-sw-tn { font-weight: 600; }
.os-sw-tile.locked .os-sw-ts { color: inherit; opacity: .8; }
.os-sw-tile.locked .os-sw-lock { width: 30%; height: 30%; margin: 0; color: var(--b-ink); }
.os-sw-lock { width: 16px; height: 16px; margin-right: 5px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 640px) {
  .os-swag { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 62%; padding: 10px 14px 16px; border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .os-sw-earn { margin-bottom: 8px; }
  .os-sw-big { min-height: 96px; padding: 8px 6px 10px; }
  .os-sw-bigart { height: 46px; margin-bottom: 2px; }
  .os-sw-bigart .os-sw-sack { width: 25px; height: 45px; }
  .os-sw-lockr { width: 27px; height: 40px; }
  /* a popup fills the screen, its close button at the top right; the page behind doesn't scroll */
  .os-sw-dlg, .os-sw-lockd { position: fixed; inset: 0; z-index: 80; width: auto; height: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .os-sw-dhead { padding: 8px 14px 8px 16px; }
  .os-sw-dbody { padding: 12px 14px 24px; }
  .os-sw-grid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); }
  html.os-sw-modal, html.os-sw-modal body { overflow: hidden; }
}

/* ---------- Buttons, option 3 (owner, 22 Oct 2026): the same buttons as the rest of the site. 3px corners instead of pills, weight 600,
   the one main action in each place filled Golf Green with a "->" after the label, every other button a pale grey-green block with no outline
   (brand-soft with green text on hover), small chips 3px, text boxes 4px. Fonts stay. The site's own --btn-* tokens are used (fallbacks keep
   this file right on its own). Kept round: the close X and the volume slider (icon-only / a slider; a square would look wrong). */
.os-music, .os-over, .os-sw-btn, .os-sw-open, .os-game .btn { border-radius: var(--btn-r, 3px); font-weight: 600; }
.os-music, .os-sw-btn, .os-sw-open { border-color: transparent; background: var(--surface-2); color: var(--text); }
.os-music:hover, .os-sw-btn:hover, .os-sw-open:hover { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.os-music:active, .os-sw-btn:active, .os-sw-open:active { background: color-mix(in srgb, var(--brand-soft), var(--btn-mix, #000) 12%); }
.os-music[aria-pressed="true"], .os-swag-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.os-swag-btn:disabled:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.os-sw-btn { padding: 0 var(--btn-px, 22px) 2px; }
:is(.os-swag, .os-sw-dlg) [aria-disabled="true"]:hover { border-color: transparent; background: var(--surface-2); color: var(--text); }
.os-sw-dlg .os-sw-open[aria-disabled="true"]:hover { border-color: transparent; background: var(--surface); color: var(--b-ink); }
/* the main action: Golf Green with an arrow (Load, Wear it now, Share) */
.os-sw-btn#os-sw-load, .os-sw-pbtns .os-sw-wear, .os-game .btn.primary { background: var(--brand-fill); border-color: transparent; color: var(--brand-ink); }
.os-sw-btn#os-sw-load:hover, .os-sw-pbtns .os-sw-wear:hover, .os-game .btn.primary:hover { background: color-mix(in srgb, var(--brand-fill), var(--btn-mix, #000) 18%); color: var(--brand-ink); }
.os-sw-btn#os-sw-load:active, .os-sw-pbtns .os-sw-wear:active, .os-game .btn.primary:active { background: color-mix(in srgb, var(--brand-fill), var(--btn-mix, #000) 32%); }
.os-sw-btn#os-sw-load::after, .os-sw-pbtns .os-sw-wear::after, .os-game .btn.primary::after { content: "\2192"; content: "\2192" / ""; font-size: 1.1em; margin-left: 8px; }
.os-sw-pbtns .os-sw-wear[aria-disabled="true"] { background: var(--surface-2); border-color: transparent; color: var(--muted); }
.os-sw-pbtns .os-sw-wear[aria-disabled="true"]::after { content: none; }
/* the site's .btn, inside the game (Share my result, Play again (test)) */
.os-game .btn { min-height: var(--btn-h, 46px); padding: 0 var(--btn-px, 22px); }
.os-game .btn.ghost { background: var(--surface-2); border-color: transparent; color: var(--text); }
.os-game .btn.ghost:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
/* on the picture: still frosted so they read over the scenery, with 3px corners and a 44px touch target */
.os-over { min-height: 44px; border-color: var(--os-pill-line); color: var(--text); }
.os-over:hover { background: var(--os-pill-solid); color: var(--brand); }
.os-over[aria-pressed="true"], .os-over[aria-pressed="true"]:hover { background: var(--brand-fill); color: var(--brand-ink); border-color: var(--brand-fill); }
.touch-ui .os-putt { border-radius: var(--btn-r, 3px); font-weight: 600; }
/* Open: a block in the bag's own colour (on the bag's tinted row) */
.os-sw-open { background: var(--surface); color: var(--b-ink); }
.os-sw-open:hover { background: color-mix(in srgb, var(--surface), var(--b-ink) 12%); color: var(--b-ink); }
.os-sw-crowned .os-sw-btn { color: var(--sw-gold-ink); border-color: transparent; background: var(--surface); }
/* the hub's two big buttons and the locker tiles */
.os-sw-big { border-color: transparent; border-radius: var(--btn-r, 3px); background: var(--surface-2); box-shadow: none; }
.os-sw-big:hover { border-color: transparent; background: var(--brand-soft); }
.os-sw-other summary { padding: 0 var(--btn-px, 22px); border-radius: var(--btn-r, 3px); background: var(--surface-2); font-weight: 600; }
.os-sw-other summary:hover { background: var(--brand-soft); }
.os-sw-tile { border-radius: var(--btn-r, 3px); }
.os-sw-pic { border-radius: 2px; }
/* chips and small tags */
.os-tries, .os-level, .os-sw-tokens, .os-sw-ptier, .os-sw-trytag, .os-sw-tile.on::before { border-radius: var(--btn-r, 3px); }
.os-sw-tile.on::before { font-weight: 600; }
/* text boxes */
.os-share-box, .os-sw-form input { border-radius: var(--field-r, 4px); }
/* inside the swag-code box (already pale grey-green) the buttons are white blocks, so they still show */
.os-sw-code .os-sw-btn, .os-sw-other summary { background: var(--surface); }
.os-sw-code .os-sw-btn:hover, .os-sw-other summary:hover { background: var(--brand-soft); }
.os-sw-code .os-sw-btn#os-sw-load { background: var(--brand-fill); }
.os-sw-code .os-sw-btn#os-sw-load:hover { background: color-mix(in srgb, var(--brand-fill), var(--btn-mix, #000) 18%); }
.os-aim-read { border-radius: var(--btn-r, 3px); }
