/* Party theme: chunky outlined display type, bright primaries, raised "press-down" buttons. */
:root {
  color-scheme: light;
  --ink: #1d1747;
  --ink-soft: #4a4470;
  --sky: #2f9bff;
  --night: #2a1d66;
  --red: #ff3b3b;
  --blue: #1f6fe5;
  --green: #2fc24a;
  --yellow: #ffd21f;
  --orange: #ff8a1f;
  --cream: #fff7e0;
  --panel: #ffffff;
  --panel-tint: #f3f1ff;
  --avatar-outline: var(--ink);
  --display: "Lilita One", "Nunito", ui-rounded, system-ui, sans-serif;
  --pop: 0 8px 0 var(--ink);
  --pop-sm: 0 5px 0 var(--ink);
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  background: var(--sky);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--sky);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 9px, transparent 10px);
  background-size: 56px 56px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }

/* Shared display-type treatment */
h1, h2, h3, .brand, .eyebrow, .button, .tab-bar a, .count-badge, .throw-score, .next-step strong,
.game-symbol, .game-card small, .detail-symbol, .x01-score strong, .x01-dart strong, .x01-queue-player > strong,
.x01-round, .bar-best strong,
.x01-overline, .x01-sidebar-heading strong, .x01-dart span, .lineup-slot-copy small, .character-choice,
.profile-tile-name, .game-ready-icon, .x01-queue-order {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.01em;
}
h1, h2, h3 { margin-top: 0; line-height: 0.95; text-transform: uppercase; }
p { margin-top: 0; }

.site-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(100%, 1280px); min-height: 100dvh; margin: auto; }

/* Header */
.site-header { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: 2.9rem; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand > span:last-child { display: inline-block; transform: rotate(-2deg); -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.brand-icon { display: block; width: 58px; height: 58px; flex: 0 0 auto; }
.brand-icon svg { display: block; width: 100%; height: 100%; }
.header-right { display: flex; align-items: center; gap: 10px; }

.connection-pill { display: inline-flex; min-height: 60px; align-items: center; gap: 10px; padding: 0 8px 0 20px; border: 4px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); box-shadow: var(--pop-sm); font-size: 1.1rem; font-weight: 900; white-space: nowrap; }
.connection-pill:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.connection-pill #connectionText { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.connection-action { padding: 8px 14px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-size: 1.1rem; font-weight: 400; }
.connection-pill[data-state="connected"] .connection-action { background: var(--panel-tint); }
.connection-pill i { width: 18px; height: 18px; flex: 0 0 auto; border: 3px solid var(--ink); border-radius: 50%; background: #aaa6c4; }
.connection-pill[data-state="connected"] i { background: var(--green); }
.connection-pill[data-state="connecting"] i { background: var(--yellow); animation: blink 1s infinite; }
.connection-pill[data-state="error"] i { background: var(--red); }

main { min-width: 0; padding: 4px 32px 24px; }
.view { animation: enter 220ms ease-out; }
.view-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.view-heading h1 { margin: 0; color: #fff; font-size: clamp(2.6rem, 5.4vw, 4.4rem); -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; }
.view-heading .eyebrow { margin: 0 0 6px; }
.eyebrow { display: inline-block; margin: 0; padding: 6px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 1.1rem; letter-spacing: 0.05em; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.connect-note { margin: -4px 0 18px; padding: 14px 18px; border: 4px solid var(--ink); border-radius: 20px; background: var(--yellow); color: var(--ink); font-size: 1.05rem; }

/* Buttons */
.button { display: inline-flex; min-height: 70px; align-items: center; justify-content: center; gap: 10px; padding: 0 28px; border: 5px solid var(--ink); border-radius: 24px; box-shadow: var(--pop); color: var(--ink); font-size: 1.9rem; line-height: 1; text-transform: uppercase; white-space: nowrap; transition: transform 80ms ease, box-shadow 80ms ease; }
.button:not(:disabled):active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.button-primary { background: var(--yellow); }
.button-quiet { background: #fff; }
.button-icon { display: inline-grid; width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.button-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 0 var(--ink)); }
.button-danger { background: var(--red); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.button:disabled { box-shadow: 0 3px 0 var(--ink); }

/* Home */
.home-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); gap: 28px; }
.surface { min-width: 0; border: 5px solid var(--ink); border-radius: 40px; background: var(--panel); box-shadow: var(--pop); }
.board-surface { position: relative; min-height: 0; padding: 22px; background: var(--cream); }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.surface-heading h2 { margin: 6px 0 0; font-size: 2.3rem; }
.board-surface .surface-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mini-badge, .count-badge, .preview-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 1.5rem; white-space: nowrap; }
.board-content { display: grid; place-items: center; padding-top: 6px; }
.board-graphic { width: min(100%, 440px, calc(100dvh - 380px)); }
.board-graphic svg { display: block; width: 100%; aspect-ratio: 1; }
/* Home fills exactly one screen: the board sizes to its panel and "Let's play!" sits just above the tab bar. */
.site-shell:has(#homeView:not([hidden])) { height: 100dvh; min-height: 0; }
.site-shell:has(#homeView:not([hidden])) main { display: flex; flex-direction: column; min-height: 0; padding-bottom: 4px; }
#homeView:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#homeView .home-layout { flex: 1; min-height: 0; padding-bottom: 12px; }
#homeView .board-surface { display: flex; flex-direction: column; min-height: 0; }
#homeView .board-content { flex: 1; min-height: 0; }
#homeView .board-graphic { width: auto; max-width: min(100%, 460px); height: 100%; max-height: 460px; aspect-ratio: 1; }
#homeView .board-graphic svg { height: 100%; }
#homeView .recent-surface { overflow: hidden; }
.dartboard-surround { fill: var(--ink); stroke: var(--ink); stroke-width: 2; }
.dartboard-face { fill: var(--ink); stroke: none; }
.dartboard-number { fill: #fff; font-family: var(--display); font-size: 25px; pointer-events: none; }
.dart-segment { stroke: var(--ink); stroke-width: 1.2; transition: fill 150ms ease; }
.dart-segment-single.dart-segment-even { fill: #2a2266; }
.dart-segment-single.dart-segment-odd { fill: var(--cream); }
.dart-segment-band.dart-segment-even, .dart-segment-ib { fill: var(--red); }
.dart-segment-band.dart-segment-odd, .dart-segment-ob { fill: var(--green); }
.dart-segment.is-recent-hit { animation: board-hit 1.4s ease-out; }

.home-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 26px; min-width: 0; }
.recent-surface { min-height: 0; padding: 22px 24px; }
.recent-list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.recent-list li { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 18px 8px 8px; border-radius: 22px; background: var(--panel-tint); }
.recent-list li:nth-child(3n+1) { background: #ffe9e9; }
.recent-list li:nth-child(3n+2) { background: #e3f8e6; }
.recent-list li:nth-child(3n) { background: #e3eeff; }
.recent-list .empty-copy { display: block; min-height: 0; padding: 18px; background: var(--panel-tint) !important; color: var(--ink-soft); font-size: 1.15rem; line-height: 1.4; }
.throw-main { display: flex; min-width: 0; align-items: center; gap: 14px; }
.throw-icon { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 4px solid var(--ink); border-radius: 16px; background: var(--yellow); color: var(--ink); font-size: 1.6rem; font-weight: 900; }
.throw-main span:last-child { overflow: hidden; font-size: 1.4rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.throw-score { color: var(--ink); font-size: 3rem; line-height: 1; white-space: nowrap; }

.next-step { display: flex; min-height: 124px; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 28px 12px 34px; border: 5px solid var(--ink); border-radius: 36px; background: var(--red); box-shadow: var(--pop); color: #fff; text-align: left; transition: transform 80ms ease, box-shadow 80ms ease; }
.next-step:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.next-step span:first-child { display: grid; gap: 6px; }
.next-step small { display: none; }
.next-step strong { font-size: clamp(2.2rem, 4.2vw, 4rem); white-space: nowrap; line-height: 0.95; text-transform: uppercase; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; }
.next-arrow { display: grid; width: 72px; height: 72px; flex: 0 0 auto; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 2.2rem; line-height: 1; }

/* Game catalog */
/* Horizontal carousel of whole pages (3 cards on an iPad); dots below show the page count. */
.games-grid { --carousel-gap: 40px; --carousel-inset: 18px; --per-page: 3; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per-page) - 1) * var(--carousel-gap)) / var(--per-page)); gap: var(--carousel-gap); margin: -14px calc(-1 * var(--carousel-inset)) 0; padding: 14px var(--carousel-inset) 26px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--carousel-inset); scrollbar-width: none; }
.games-grid::-webkit-scrollbar { display: none; }
.games-grid .game-card:nth-child(3n+1) { scroll-snap-align: start; scroll-snap-stop: always; }
/* The game list fills the screen between the heading and the tab bar; cards stretch to that height. */
.site-shell:has(#gamesView:not([hidden]) #gamesGrid:not([hidden])) { height: 100dvh; min-height: 0; }
.site-shell:has(#gamesView:not([hidden]) #gamesGrid:not([hidden])) main { display: flex; flex-direction: column; min-height: 0; }
#gamesView:has(#gamesGrid:not([hidden])) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#gamesView:has(#gamesGrid:not([hidden])) .games-grid { flex: 1; grid-template-rows: minmax(0, 1fr); align-items: center; min-height: 300px; }
#gamesView:has(#gamesGrid:not([hidden])) .game-card { height: 100%; max-height: 440px; }
/* Just enough bottom room for the cards' drop shadow; the tab bar sits right below. */
.site-shell:has(#gamesView:not([hidden]) #gamesGrid:not([hidden])) main { padding-bottom: 4px; }
#gamesView:has(#gamesGrid:not([hidden])) .games-grid { padding-bottom: 14px; }
.carousel-arrows { display: flex; gap: 14px; }
.carousel-arrow { display: grid; width: 72px; height: 72px; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: var(--pop); color: var(--ink); transition: transform 80ms ease, box-shadow 80ms ease; }
.carousel-arrow svg { width: 30px; height: 30px; }
.carousel-arrow:not(:disabled):active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.carousel-arrow:disabled { background: #fff; opacity: 0.55; }
.game-card { display: flex; flex-direction: column; gap: 16px; min-width: 0; height: auto; padding: 22px; border: 5px solid var(--ink); border-radius: 40px; background: var(--game-color); box-shadow: var(--pop); color: var(--ink); text-align: left; transition: transform 120ms ease, box-shadow 80ms ease; }
.game-card:nth-child(3n+1) { transform: rotate(-1.5deg); }
.game-card:nth-child(3n+2) { transform: rotate(1deg); }
.game-card:nth-child(3n) { transform: rotate(-1deg); }
.game-card:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.game-card-top { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; }
.game-card small { align-self: flex-start; padding: 7px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 1.15rem; letter-spacing: 0.05em; text-transform: uppercase; }
.game-symbol { display: grid; width: 104px; height: 104px; flex: 0 0 auto; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font-size: 3.6rem; line-height: 1; }
.game-symbol.is-number { font-size: 2.4rem; }
.game-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 14px; min-height: 0; }
.game-card-top, .game-card-bottom { flex-shrink: 0; }
.game-card h2 { margin: 0; color: #fff; font-size: clamp(2.6rem, 4.2vw, 3.6rem); -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; }
.game-card p { flex: 1; min-height: 0; overflow: hidden; margin: 0; padding: 12px 16px; border-radius: 22px; background: #fff; color: var(--ink); font-size: 1.12rem; line-height: 1.28; }
.game-card-bottom { display: flex; min-height: 70px; align-items: center; justify-content: center; gap: 10px; border-radius: 22px; background: var(--ink); }
.game-card-bottom small { align-self: auto; padding: 0; background: none; color: var(--yellow); font-size: 2.3rem; letter-spacing: 0.02em; }
.game-card-arrow { color: var(--yellow); font-size: 1.8rem; }

/* Game detail + lineup */
.game-detail { display: grid; gap: 20px; max-width: 1180px; padding: 26px; }
.detail-back { display: inline-flex; min-height: 60px; align-items: center; justify-self: start; gap: 8px; padding: 0 22px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; }
.detail-back:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
/* Lineup: a top bar with every action, then a panel of player tiles that fills the rest of the screen. */
.game-detail:has(.lineup-panel) { display: flex; flex-direction: column; gap: 16px; max-width: none; padding: 0; border: 0; background: transparent; box-shadow: none; }
.site-shell:has(.lineup-panel) { height: 100dvh; min-height: 0; }
.site-shell:has(.lineup-panel) main { display: flex; flex-direction: column; min-height: 0; padding-bottom: 20px; }
#gamesView:has(.lineup-panel) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#gamesView:has(.lineup-panel) .game-detail { flex: 1; min-height: 0; }
.lineup-top { display: flex; flex-shrink: 0; align-items: center; gap: 14px; }
.lineup-top .game-detail-heading { flex: 1; min-width: 0; }
.lineup-top .detail-back { flex-shrink: 0; padding: 0 16px; white-space: nowrap; }
.lineup-rules span { display: grid; width: 32px; height: 32px; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 1.3rem; }
@media (max-width: 1100px) { .lineup-top .detail-symbol { display: none; } }
.lineup-top .game-detail-heading > div { min-width: 0; }
.lineup-top h2 { overflow: hidden; color: #fff; font-size: clamp(2rem, 3.6vw, 3.2rem); text-overflow: ellipsis; white-space: nowrap; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; padding: 0.1em 0.16em; margin-inline: -0.16em; }
.lineup-top .detail-symbol { width: 72px; height: 72px; font-size: 1.9rem; }
.lineup-resume { background: var(--yellow); }
.lineup-start { flex-shrink: 0; min-width: 170px; min-height: 72px; background: var(--green); color: #fff; font-size: 2.4rem; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.lineup-panel { display: flex; flex: 1; flex-direction: column; gap: 16px; min-height: 0; padding: 18px 22px 22px; border: 5px solid var(--ink); border-radius: 36px; background: #fff; box-shadow: var(--pop); }
#gamesView:has(#gameDetail:not([hidden])) > .view-heading { display: none; }
.game-detail p.eyebrow { color: #fff; font-size: 1.1rem; line-height: 1.2; }
.game-detail-heading { display: flex; align-items: center; gap: 18px; }
.detail-symbol { display: grid; width: 96px; height: 96px; flex: 0 0 auto; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: var(--game-color); color: var(--ink); font-size: 2.6rem; }
.game-detail-heading .eyebrow { margin-bottom: 8px; }
.game-detail h2 { margin: 0; font-size: clamp(2.8rem, 5vw, 4rem); }
.game-detail p { margin: 0; color: var(--ink); font-size: 1.15rem; line-height: 1.45; }
.lineup-header { display: flex; flex-shrink: 0; align-items: center; gap: 14px; }
.lineup-header h3 { flex: 1; margin: 0; font-size: 2.4rem; }
.lineup-count { padding: 8px 16px; border-radius: 999px; background: var(--panel-tint); color: var(--ink); font-size: 1.15rem; font-weight: 900; white-space: nowrap; }
.lineup-stepper { display: flex; align-items: center; gap: 4px; padding: 4px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: var(--pop-sm); }
.lineup-stepper button { width: 52px; height: 52px; border: 0; border-radius: 14px; background: var(--panel-tint); color: var(--ink); font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.lineup-stepper button:not(:disabled):active { background: var(--yellow); }
.lineup-stepper strong { min-width: 44px; font-family: var(--display); font-size: 2rem; font-weight: 400; text-align: center; }
.lineup-edit { min-height: 60px; background: var(--panel-tint); box-shadow: none; }
/* 1-4 players: one row of big tiles; 5-8: two rows of smaller tiles. */
.lineup-slots { display: grid; flex: 1; grid-template-columns: repeat(var(--cols, 4), minmax(0, 260px)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); justify-content: center; gap: 18px; min-height: 0; padding: 4px 4px 10px; }
.lineup-slots:not(.is-crowded) { grid-template-rows: minmax(0, 340px); align-content: center; }
.lineup-slot { position: relative; display: flex; min-width: 0; min-height: 0; border: 5px solid var(--ink); border-radius: 32px; background: var(--player-color); box-shadow: var(--pop); }
.lineup-slot:not(.is-filled) { border: 5px dashed var(--ink); background: rgba(255, 255, 255, 0.55); box-shadow: none; }
.lineup-slot-pick { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px 12px; border: 0; border-radius: 28px; background: transparent; color: var(--ink); text-align: center; }
.lineup-slot-avatar, .ready-player > span:first-child { display: grid; width: clamp(64px, 14vh, 120px); height: clamp(64px, 14vh, 120px); flex: 0 1 auto; overflow: hidden; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: #fff; color: var(--player-color); font-family: var(--display); font-size: 3.4rem; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.lineup-slot:not(.is-filled) .lineup-slot-avatar { border-style: dashed; background: transparent; color: var(--ink); -webkit-text-stroke: 0; font-size: 4rem; }
.lineup-slot-avatar img, .ready-player img { width: 100%; height: 100%; object-fit: cover; }
.ready-player > span:first-child { width: 56px; height: 56px; border-width: 4px; font-size: 1.6rem; -webkit-text-stroke: 5px var(--ink); }
.lineup-slot-copy { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.lineup-slot-copy small { position: absolute; top: 10px; left: 10px; padding: 2px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font-size: 1rem; }
.lineup-slot-copy strong { max-width: 100%; overflow: hidden; color: #fff; font-family: var(--display); font-size: 2.2rem; font-weight: 400; line-height: 1.1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.lineup-slot:not(.is-filled) .lineup-slot-copy strong { color: var(--ink); font-size: 1.5rem; -webkit-text-stroke: 0; }
.lineup-slot-edit { padding: 5px 14px; border-radius: 999px; background: rgba(29, 23, 71, 0.85); color: #fff; font-size: 0.95rem; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.lineup-slot-remove { position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); font-size: 1.8rem; line-height: 1; }
/* Crowded (5-8 players): shorter tiles, smaller avatar and name, no "Change" pill. */
.lineup-slots.is-crowded .lineup-slot-pick { gap: 6px; padding: 12px 10px 10px; }
.lineup-slots.is-crowded .lineup-slot-avatar { width: clamp(52px, 10vh, 92px); height: clamp(52px, 10vh, 92px); font-size: 2.6rem; -webkit-text-stroke: 7px var(--ink); }
.lineup-slots.is-crowded .lineup-slot:not(.is-filled) .lineup-slot-avatar { font-size: 3rem; -webkit-text-stroke: 0; }
.lineup-slots.is-crowded .lineup-slot-copy strong { font-size: 1.8rem; -webkit-text-stroke: 7px var(--ink); }
.lineup-slots.is-crowded .lineup-slot-edit { display: none; }
.lineup-slots.is-crowded .lineup-slot-remove { width: 40px; height: 40px; font-size: 1.5rem; }
.lineup-empty { grid-column: 1 / -1; padding: 20px; border: 4px dashed var(--ink); border-radius: 20px; font-size: 1.15rem; }
/* How-to-play pop-up */
.rules-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 28px; overflow-y: auto; border: 6px solid var(--ink); border-radius: 40px; background: #fff; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); color: var(--ink); }
/* In-game confirm: a tilted warning sign over a big question, with the safe choice first. */
.confirm-dialog { width: min(560px, calc(100% - 24px)); padding: 54px 30px 28px; overflow: visible; border: 6px solid var(--ink); border-radius: 40px; background: #fff; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); color: var(--ink); text-align: center; }
.confirm-dialog[open] { animation: confirm-pop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); }
.confirm-dialog::backdrop { background: rgba(29, 23, 71, 0.72); backdrop-filter: blur(6px); }
.confirm-dialog-icon { position: absolute; top: -44px; left: 50%; display: grid; width: 84px; height: 84px; place-items: center; border: 6px solid var(--ink); border-radius: 26px; background: var(--yellow); box-shadow: 0 6px 0 var(--ink); color: var(--ink); font-family: var(--display); font-size: 3.4rem; transform: translateX(-50%) rotate(-8deg); }
.confirm-dialog .eyebrow { margin: 0 0 8px; }
.confirm-dialog h2 { margin: 0 0 12px; font-size: clamp(2.4rem, 5vw, 3.2rem); }
.confirm-dialog-message { margin: 0 auto 24px; max-width: 32ch; font-size: 1.25rem; font-weight: 800; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.confirm-dialog-actions .button { flex: 1 1 200px; min-height: 64px; padding: 0 18px; font-size: 1.6rem; }
@keyframes confirm-pop { from { opacity: 0; transform: scale(0.8) rotate(-2deg); } }
.rules-dialog::backdrop { background: rgba(29, 23, 71, 0.72); backdrop-filter: blur(6px); }
.rules-dialog .profile-dialog-heading h2 { font-size: 2.6rem; }
.rules-list { display: grid; gap: 12px; margin: 0 0 24px; padding: 0; counter-reset: rule; list-style: none; }
.rules-list li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px; border-radius: 20px; background: var(--panel-tint); font-size: 1.35rem; font-weight: 800; line-height: 1.35; counter-increment: rule; }
.rules-list li::before { content: counter(rule); display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-family: var(--display); font-size: 1.3rem; }
.game-ready-icon { display: grid; width: 84px; height: 84px; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: var(--green); color: #fff; font-size: 2.6rem; }
.ready-lineup { display: flex; flex-wrap: wrap; gap: 12px; }
.ready-player { display: inline-flex; min-height: 68px; align-items: center; gap: 10px; padding: 5px 18px 5px 5px; border: 4px solid var(--ink); border-radius: 999px; background: #fff; font-size: 1.3rem; font-weight: 900; }
.detail-placeholder { padding: 18px; border: 4px dashed var(--ink); border-radius: 20px; font-size: 1.15rem; }

/* Character picker + dialogs */
dialog { color: var(--ink); }
.character-dialog, .profile-dialog, .pixel-dialog { max-height: calc(100dvh - 24px); padding: 28px; overflow-y: auto; border: 6px solid var(--ink); border-radius: 40px; background: #fff; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); }
.character-dialog { width: min(980px, calc(100% - 24px)); }
.profile-dialog, .pixel-dialog { width: min(860px, calc(100% - 24px)); }
.character-dialog::backdrop, .profile-dialog::backdrop, .pixel-dialog::backdrop { background: rgba(29, 23, 71, 0.72); backdrop-filter: blur(6px); }
.profile-dialog-heading, .pixel-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.profile-dialog-heading .eyebrow, .pixel-dialog-heading .eyebrow { margin: 0 0 10px; }
.profile-dialog-heading h2, .pixel-dialog-heading h2 { margin: 0; font-size: 3rem; }
.profile-close, .pixel-close { width: 64px; height: 64px; flex: 0 0 auto; border: 4px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); font-size: 2.4rem; line-height: 1; }
.profile-close:active, .pixel-close:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.character-choice { display: grid; justify-items: center; align-content: center; gap: 10px; min-width: 0; min-height: 210px; padding: 18px 10px; border: 5px solid var(--ink); border-radius: 32px; background: var(--player-color); box-shadow: var(--pop); color: #fff; font-size: 1.9rem; line-height: 1.05; text-align: center; text-transform: uppercase; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.character-choice:not(:disabled):active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.character-choice:disabled { opacity: 0.4; }
.character-choice-avatar { display: grid; width: min(100%, 116px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: #fff; color: var(--player-color); font-size: 3.4rem; }
.character-choice-avatar img { width: 100%; height: 100%; object-fit: cover; }
.character-choice small { padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-family: "Nunito", sans-serif; font-size: 0.9rem; font-weight: 900; -webkit-text-stroke: 0; }
.character-manage { margin-top: 22px; }
/* Dart Survivors' hero picker */
/* Dart Survivors' Collection and Bestiary: a pop-up with tabs and cards. */
.book-dialog { width: min(980px, calc(100% - 24px)); height: calc(100dvh - 24px); max-height: 900px; padding: 24px 24px 0; display: none; flex-direction: column; border: 6px solid var(--ink); border-radius: 40px; background: #fff; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); color: var(--ink); }
.book-dialog[open] { display: flex; animation: confirm-pop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); }
.book-dialog::backdrop { background: rgba(29, 23, 71, 0.72); backdrop-filter: blur(6px); }
.book-dialog .profile-dialog-heading h2 { font-size: 2.6rem; }
.book-tabs { display: flex; gap: 8px; padding: 4px 2px 12px; overflow-x: auto; flex: none; }
.book-tab { flex: none; padding: 8px 16px; border: 4px solid var(--ink); border-radius: 999px; background: var(--panel-tint); box-shadow: var(--pop-sm); color: var(--ink); font-family: var(--display); font-size: 1.15rem; white-space: nowrap; }
.book-tab.is-active { background: var(--yellow); }
.book-tab:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.book-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px 24px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.book-card { padding: 14px; border: 4px solid var(--ink); border-radius: 24px; background: var(--cream); box-shadow: var(--pop-sm); }
.book-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.book-card header .survivors-icon { width: 40px; height: 40px; flex: none; }
.book-card header strong { display: block; font-family: var(--display); font-size: 1.45rem; line-height: 1.05; }
.book-card header small { font-weight: 800; color: var(--ink-soft); }
.book-owned { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 900; }
.book-levels { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.book-levels li { display: grid; grid-template-columns: 46px 1fr; gap: 6px; font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
.book-levels b { align-self: start; padding: 1px 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 0.8rem; text-align: center; }
.book-levels li.is-owned b { background: var(--green); }
.book-note { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.9rem; font-weight: 800; }
.book-legend { margin: 0 0 12px; }
.book-tagline { margin: 0 0 10px; font-family: var(--display); font-size: 1.4rem; }
.book-role { margin-bottom: 18px; }
.book-role h3 { margin: 0; font-family: var(--display); font-size: 1.6rem; text-transform: capitalize; }
.book-role > .book-note { margin: 0 0 8px; }
.book-monsters { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.book-monster { display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border: 4px solid var(--ink); border-radius: 20px; background: radial-gradient(circle at 34px 50%, #7fd06a 0 26px, var(--panel-tint) 27px); }
.book-monster.is-boss { background: radial-gradient(circle at 34px 50%, #ff8a6a 0 26px, #fff0e8 27px); }
.book-sprite { flex: none; width: 56px; aspect-ratio: 20 / 19; }
.book-sprite .sv-arena { width: 100%; height: 100%; }
.book-monster strong { display: block; font-family: var(--display); font-size: 1.2rem; line-height: 1.05; }
.book-monster small { font-weight: 900; color: var(--ink-soft); }
.book-monster p { margin: 2px 0 0; font-size: 0.85rem; font-weight: 800; line-height: 1.2; }
.book-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.9rem; font-weight: 900; }
.book-rules p { margin: 0 0 12px; font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.hero-dialog { width: min(820px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 28px; overflow-y: auto; border: 6px solid var(--ink); border-radius: 40px; background: #fff; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); }
.hero-dialog[open] { animation: confirm-pop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); }
.hero-dialog::backdrop { background: rgba(29, 23, 71, 0.72); backdrop-filter: blur(6px); }
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.hero-choice { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; padding: 10px 10px 14px; border: 5px solid var(--ink); border-radius: 28px; background: radial-gradient(circle at 50% 42%, #7fd06a 0 34%, #3f8f3a 70%); box-shadow: var(--pop); color: #fff; text-align: center; }
.hero-choice:nth-child(6n+2) { background: radial-gradient(circle at 50% 42%, #7fc8ec 0 34%, #2f6fa8 70%); }
.hero-choice:nth-child(6n+3) { background: radial-gradient(circle at 50% 42%, #ffe08a 0 34%, #c88a1a 70%); }
.hero-choice:nth-child(6n+4) { background: radial-gradient(circle at 50% 42%, #ffa36a 0 34%, #b8402a 70%); }
.hero-choice:nth-child(6n+5) { background: radial-gradient(circle at 50% 42%, #c79cff 0 34%, #5a3a9a 70%); }
.hero-choice:nth-child(6n+6) { background: radial-gradient(circle at 50% 42%, #d8dce8 0 34%, #5a6478 70%); }
.hero-choice:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.hero-choice:focus-visible, .hero-choice.is-last { outline: 5px solid var(--yellow); outline-offset: 3px; }
.hero-choice-sprite { display: block; width: min(100%, 150px); aspect-ratio: 20 / 19; }
.hero-choice-sprite .sv-arena { width: 100%; height: 100%; }
.hero-choice strong { font-family: var(--display); font-size: 1.9rem; line-height: 1; text-transform: uppercase; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.hero-choice em { font-size: 1rem; font-style: normal; font-weight: 900; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.hero-choice-weapon { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 10px 2px 4px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.85rem; font-weight: 900; }
.hero-choice-weapon .survivors-icon { width: 22px; height: 22px; }
.hero-choice small { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.8rem; font-weight: 900; }
@media (max-width: 560px) {
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero-choice strong { font-size: 1.5rem; }
}

/* In-game shared chrome */
.has-live-301 > .view-heading { display: none; }
/* Setup and game screens have their own back buttons, so the tab bar never covers their actions. */
.site-shell:has(#gameDetail:not([hidden])) .tab-bar { display: none; }
/* Game screens give the header's height back to play; the board connection moves into Settings. */
.site-shell:has(.has-live-301:not([hidden])) { grid-template-rows: minmax(0, 1fr) auto; }
.site-shell:has(.has-live-301:not([hidden])) .site-header { display: none; }
.site-shell:has(.has-live-301:not([hidden])) main { padding-top: 16px; padding-bottom: 18px; }
.site-shell:has(.has-live-301:not([hidden])) .toast { top: 24px; }
.game-settings summary .game-settings-dot { width: 16px; height: 16px; flex: 0 0 auto; border: 3px solid var(--ink); border-radius: 50%; background: #aaa6c4; }
.game-settings-dot[data-state="connected"] { background: var(--green); }
.game-settings-dot[data-state="connecting"] { background: var(--yellow); animation: blink 1s infinite; }
.game-settings-dot[data-state="error"] { background: var(--red); }
.game-settings-version { margin: 2px 4px 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 900; text-align: right; }
.game-settings-panel .connection-pill.game-settings-board { justify-content: space-between; width: 100%; min-height: 56px; padding: 0 8px 0 14px; border-radius: 18px; box-shadow: none; font-size: 1rem; text-align: left; text-transform: none; }
.game-detail.is-playing-301, .game-detail.is-playing-bar, .game-detail.is-playing-bomber, .game-detail.is-playing-boardwalk, .game-detail.is-playing-golf, .game-detail.is-playing-survivors, .game-detail.is-playing-riders { max-width: none; gap: 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
/* Game screens are exactly one screen tall: top bar, panels that take the leftover space, then the buttons. */
.site-shell:has(.has-live-301:not([hidden])) { height: 100dvh; min-height: 0; }
.site-shell:has(.has-live-301:not([hidden])) main { display: flex; flex-direction: column; min-height: 0; }
#gamesView.has-live-301 { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.game-detail.is-playing-301, .game-detail.is-playing-bar, .game-detail.is-playing-bomber, .game-detail.is-playing-boardwalk, .game-detail.is-playing-golf, .game-detail.is-playing-survivors, .game-detail.is-playing-riders { flex: 1; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.x01-layout, .bar-layout, .bomber-layout, .boardwalk-layout, .golf-layout, .survivors-layout, .riders-layout { min-height: 0; }
.x01-topbar, .x01-heading, .x01-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.x01-topbar { position: relative; min-height: 64px; }
.x01-title { display: flex; flex: 1; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.x01-title h2 { margin: 0; color: #fff; font-size: clamp(2.6rem, 4.6vw, 3.8rem); -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; }
.x01-title span { padding: 8px 16px; border: 4px solid var(--ink); border-radius: 16px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-size: 1.6rem; white-space: nowrap; }
.game-settings { position: relative; z-index: 5; }
.game-settings summary { display: inline-flex; min-height: 60px; align-items: center; gap: 8px; padding: 0 20px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); cursor: pointer; font-family: var(--display); font-size: 1.6rem; list-style: none; text-transform: uppercase; }
.game-settings summary::-webkit-details-marker { display: none; }
.game-settings-panel { position: absolute; top: calc(100% + 12px); right: 0; display: grid; gap: 10px; width: min(320px, calc(100vw - 36px)); padding: 16px; border: 5px solid var(--ink); border-radius: 26px; background: #fff; box-shadow: var(--pop); }
.game-settings-panel button { min-height: 60px; padding: 0 16px; border: 4px solid var(--ink); border-radius: 18px; background: var(--panel-tint); color: var(--ink); font-family: var(--display); font-size: 1.4rem; text-align: left; text-transform: uppercase; }
.game-settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px; color: var(--ink); font-size: 1.15rem; font-weight: 900; }
.game-settings-toggle input { width: 28px; height: 28px; flex: 0 0 auto; accent-color: var(--green); }
/* Per-game options sit above the shared toggles in the Settings menu. */
.game-options { display: grid; gap: 8px; margin: 0; padding: 10px 12px 4px; border: 4px solid var(--ink); border-radius: 20px; background: var(--panel-tint); }
.game-options legend { padding: 2px 12px; border-radius: 10px; background: var(--ink); color: var(--yellow); font-family: var(--display); font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.game-options-label { font-size: 1rem; font-weight: 900; }
.boardwalk-speed-readout { margin-left: 6px; color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
/* Right-to-left so sliding right shortens the step: right is faster. */
.boardwalk-speed { width: 100%; min-height: 44px; margin: 0; direction: rtl; accent-color: var(--ink); cursor: pointer; }
.game-options-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.game-options-hint { margin-top: -2px; color: var(--ink-soft); font-size: 0.85rem; font-weight: 800; }
.game-options-pill input { position: absolute; opacity: 0; pointer-events: none; }
.game-options-pill span { display: inline-grid; min-height: 44px; place-items: center; padding: 0 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--display); font-size: 1.15rem; text-transform: uppercase; cursor: pointer; }
.game-options-pill input:checked + span { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }
.game-options-pill input:focus-visible + span { outline: 4px solid var(--yellow); outline-offset: 2px; }
.game-settings-panel { max-height: calc(100dvh - 140px); overflow-y: auto; }
.x01-heading .eyebrow { margin: 0 0 2px; }
.x01-heading h2 { margin: 0; font-size: 2.4rem; }
.x01-round { padding: 8px 14px; border-radius: 999px; background: var(--yellow); font-size: 1.2rem; white-space: nowrap; }

.x01-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.9fr); gap: 26px; }
.x01-layout.is-solo { grid-template-columns: 1fr; }
.x01-layout.is-solo .x01-score { justify-content: center; }
.x01-current, .x01-sidebar, .bomber-board-panel { min-width: 0; border: 5px solid var(--ink); border-radius: 44px; box-shadow: var(--pop); }
.x01-current { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 24px 28px 26px; background-color: var(--player-color); background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 7px, transparent 8px); background-size: 44px 44px; }
.x01-current-header { display: flex; align-items: center; gap: 20px; min-width: 0; }
.x01-avatar { display: grid; width: 60px; height: 60px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: var(--player-color); color: #fff; font-family: var(--display); font-size: 1.8rem; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.x01-avatar.is-large { width: 112px; height: 112px; border-width: 6px; background: #fff; color: var(--player-color); font-size: 3.6rem; -webkit-text-stroke: 10px var(--ink); }
.x01-avatar img { width: 100%; height: 100%; object-fit: cover; }
.x01-overline { display: inline-block; padding: 6px 14px; border-radius: 12px; background: var(--ink); color: var(--yellow); font-size: 1.2rem; letter-spacing: 0.05em; }
.x01-current-header h3 { overflow: hidden; margin: 10px 0 0; color: #fff; font-size: clamp(2.8rem, 5.6vw, 4.6rem); text-overflow: ellipsis; white-space: nowrap; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; padding-bottom: 8px; }
.x01-score { display: flex; flex: 1; align-items: center; justify-content: center; gap: 18px; }
.x01-score strong { color: #fff; font-size: clamp(6rem, 25vh, 18rem); line-height: 0.85; -webkit-text-stroke: 22px var(--ink); paint-order: stroke fill; }
.x01-score span { align-self: flex-end; margin-bottom: 30px; color: #fff; font-family: var(--display); font-size: 2.4rem; text-transform: uppercase; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; }
.x01-status { align-self: center; min-height: 0; padding: 10px 22px; border: 4px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 1.3rem; font-weight: 900; text-align: center; }
.x01-status:empty { display: none; }
.x01-status.is-bust { background: var(--red); color: #fff; animation: throb 0.9s ease-in-out 3; }
.x01-status.is-finished { background: var(--yellow); }
.x01-darts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.x01-dart { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; min-height: 100px; padding: 10px 20px; border: 5px dashed #fff; border-radius: 26px; background: rgba(29, 23, 71, 0.22); color: #fff; }
.x01-dart.is-thrown { border: 4px solid var(--ink); background: #fff; box-shadow: var(--pop-sm); color: var(--ink); }
.x01-dart span { grid-column: 1 / -1; font-size: 1rem; letter-spacing: 0.08em; }
.x01-dart strong { font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1; }
.x01-dart small { justify-self: end; font-family: var(--display); font-size: 1.4rem; white-space: nowrap; }
.x01-dart:not(.is-thrown) small { font-family: inherit; font-size: 1rem; font-weight: 900; opacity: 0.9; }

.x01-sidebar { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; gap: 14px; padding: 22px; background: #fff; }
.x01-sidebar-heading .x01-overline { background: none; padding: 0; color: var(--ink); font-size: 1.8rem; letter-spacing: 0.01em; white-space: nowrap; }
.x01-sidebar-heading strong { padding: 6px 12px; border-radius: 999px; background: var(--panel-tint); font-size: 1.1rem; }
.x01-queue { display: grid; align-content: start; gap: 12px; min-height: 0; overflow-y: auto; padding: 2px; }
.x01-queue-player { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 84px; padding: 10px 16px 10px 10px; border-radius: 24px; background: color-mix(in srgb, var(--player-color), #fff 82%); }
.x01-queue-player .x01-avatar { width: 52px; height: 52px; }
/* List order already shows who is next; the number stays for screen readers. */
.x01-queue-order { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.x01-queue-name { min-width: 0; flex: 1; overflow: hidden; font-family: var(--display); font-size: 1.9rem; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.x01-queue-player > strong { margin-left: auto; color: var(--ink); font-size: 3rem; line-height: 1; }
.x01-solo { margin: 10px 0; font-size: 1.15rem; }

.x01-controls { display: grid; gap: 12px; }
.x01-finish-control { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 16px; padding: 10px 12px 10px 24px; border: 5px solid var(--ink); border-radius: 32px; background: var(--yellow); box-shadow: var(--pop); color: var(--ink); font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 2.2rem); }
.x01-finish-control > span { min-width: 0; }
.x01-finish-control .button-primary { flex-shrink: 0; min-height: 62px; background: var(--green); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.x01-action-row, .x01-demo-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.x01-action-row > .button:last-child { min-width: 280px; margin-left: auto; }
.x01-demo-tools label { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--display); font-size: 1.4rem; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.x01-demo-tools select { max-width: 200px; min-height: 60px; padding: 0 12px; border: 4px solid var(--ink); border-radius: 18px; background: #fff; color: var(--ink); font-size: 1.1rem; font-weight: 900; -webkit-text-stroke: 0; }

/* Bar: sunburst plaque for the bar, current player + meter, and a strip of player chips */
.bar-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 26px; }
.bar-plaque { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; border: 5px solid var(--ink); border-radius: 44px; background: repeating-conic-gradient(from 0deg at 50% 52%, var(--yellow) 0deg 12deg, #ffc400 12deg 24deg); box-shadow: var(--pop); text-align: center; }
.bar-plaque-label { padding: 8px 22px; border-radius: 16px; background: var(--ink); color: #fff; font-family: var(--display); font-size: 2rem; letter-spacing: 0.05em; }
.bar-plaque-value { color: #fff; font-family: var(--display); font-size: clamp(7rem, 26vh, 18rem); font-weight: 400; line-height: 0.85; -webkit-text-stroke: 22px var(--ink); paint-order: stroke fill; }
.bar-plaque-by { display: inline-flex; max-width: 100%; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border: 4px solid var(--ink); border-radius: 999px; background: #fff; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.bar-plaque-by:not(:has(.x01-avatar)) { padding: 8px 18px; }
.bar-plaque-by .x01-avatar { width: 46px; height: 46px; border-width: 3px; font-size: 1.3rem; -webkit-text-stroke: 4px var(--ink); }
.bar-plaque-rule { padding: 8px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.85); font-size: 1.1rem; font-weight: 900; }
.bar-side { display: flex; min-width: 0; flex-direction: column; gap: 20px; }
.x01-current.bar-current { flex: 1; min-height: 0; gap: 12px; padding: 20px 24px; }
.bar-current .x01-avatar.is-large { width: 96px; height: 96px; font-size: 3rem; }
.bar-current .x01-current-header h3 { font-size: clamp(2.6rem, 4.6vw, 3.8rem); }
.bar-current .x01-dart { min-height: 0; padding-block: 8px; }
.bar-current .x01-status { padding: 6px 16px; font-size: 1.1rem; }
.bar-current .x01-dart strong { font-size: clamp(2rem, 3vw, 2.5rem); }
.bar-current-name { flex: 1; min-width: 0; }
.bar-best { display: grid; flex-shrink: 0; justify-items: end; gap: 2px; text-align: right; }
.bar-best span { color: #fff; font-family: var(--display); font-size: 1.15rem; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.bar-best strong { color: var(--yellow); font-size: clamp(3.4rem, 9vh, 5.4rem); line-height: 0.9; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; }
.bar-best small { margin-top: 2px; padding: 2px 10px; border-radius: 999px; background: rgba(29, 23, 71, 0.6); color: #fff; font-size: 0.95rem; font-weight: 900; }
.bar-meter { padding: 8px 16px; border-radius: 24px; background: #fff; }
.bar-meter-labels { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 900; letter-spacing: 0.06em; }
.bar-meter-track { height: 24px; margin-top: 6px; overflow: hidden; border: 4px solid var(--ink); border-radius: 999px; background: #e3e1f2; }
.bar-meter-track span { display: block; height: 100%; border-right: 4px solid var(--ink); border-radius: 0; background: var(--yellow); transition: width 300ms ease; }
.bar-meter.is-passed .bar-meter-track span { border-right: 0; background: var(--green); }
.bar-players { display: grid; flex-shrink: 0; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 12px; margin: -16px -4px -10px; padding: 16px 4px 10px; overflow-x: auto; scrollbar-width: none; }
.bar-players::-webkit-scrollbar { display: none; }
.bar-player { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 2px; min-width: 0; min-height: 72px; padding: 8px 10px 4px; border: 4px solid var(--ink); border-radius: 24px; background: #fff; box-shadow: var(--pop-sm); }
.bar-player .x01-avatar { width: 34px; height: 34px; border-width: 3px; font-size: 1.05rem; -webkit-text-stroke: 4px var(--ink); }
.bar-player-name { grid-column: 1 / -1; min-width: 0; text-align: center; }
.bar-player-name { overflow: hidden; font-family: var(--display); font-size: 1.45rem; line-height: 1.05; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.bar-player small { color: #1b8a2e; font-size: 0.85rem; font-weight: 900; letter-spacing: 0.04em; }
.bar-player.is-current, .bar-player.is-winner { background: var(--yellow); }
.bar-player.is-current small, .bar-player.is-winner small { color: var(--ink); }
.bar-player.is-out { background: #cfcbe3; box-shadow: none; }
.bar-player.is-out .x01-avatar, .bar-player.is-out .bar-player-name { opacity: 0.5; }
.bar-player-stamp { position: absolute; top: -14px; right: -4px; padding: 2px 12px; border: 3px solid var(--ink); border-radius: 12px; background: var(--red); color: #fff; font-family: var(--display); font-size: 1.5rem; transform: rotate(10deg); }

/* Mad Bomber: night stage */
body:has(.is-playing-bomber:not([hidden])) {
  background-color: var(--night);
  background-image: radial-gradient(circle, rgba(255, 210, 31, 0.22) 2.5px, transparent 3.5px), radial-gradient(circle, rgba(255, 255, 255, 0.1) 9px, transparent 10px);
  background-size: 90px 90px, 56px 56px;
  background-position: 20px 30px, 0 0;
}
.is-playing-bomber .x01-title h2 { color: var(--red); }
.bomber-layout { display: grid; grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr); gap: 22px; }
.bomber-board-panel { display: grid; justify-items: center; gap: 8px; padding: 14px; overflow: hidden; background: #3b2d8f; }
/* Bombs still ticking on the left, bombs defused on the right, as matching pills. */
.bomber-board-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.bomber-board-title .bomber-pill { padding: 3px 14px; border-width: 4px; box-shadow: var(--pop-sm); font-size: 1.1rem; -webkit-text-stroke: 5px var(--ink); }
.bomber-board-title .bomber-pill b { font-size: 1.7rem; }
/* The board fills whatever height its panel has left, staying square. */
/* One column as wide as the panel: an auto column grew to the board's height (via its aspect
   ratio) and pushed the board out of the panel on tall or narrow screens. The SVG keeps the board
   round and centred inside whatever box it gets. */
.bomber-board-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 0; }
.bomber-board { justify-self: center; width: 100%; max-width: 440px; height: 100%; min-height: 0; aspect-ratio: 1; }
.bomber-board svg { display: block; width: 100%; height: 100%; aspect-ratio: 1; }
.bomber-board .dart-segment:not(.is-custom) { opacity: 0.35; }
.bomber-board .dart-segment.is-custom { fill: var(--section-color); stroke: var(--ink); animation: bomber-pulse 1.8s ease-in-out infinite; }
.bomber-board .dart-segment.is-defusing { animation: bomber-defuse 1.4s ease-out forwards; }
.bomber-board .dartboard-number:not(.is-bomb) { opacity: 0.5; }
.bomber-board .dartboard-number.is-bomb { fill: var(--bomb-color); font-size: 32px; stroke: var(--ink); stroke-width: 6px; paint-order: stroke fill; }
.bomber-board svg[role="group"] .dart-segment { cursor: pointer; }

/* The blast range: the bomb tech in the middle, the bombs in their numbers' wedges (bomber-pixel.js). */
.x01-current.bomber-current { gap: 10px; padding: 12px 18px 16px; }
.bomber-current > * { flex-shrink: 0; }
.bomber-current > .bomber-arena-frame { position: relative; flex: 1 1 0; min-height: 160px; overflow: hidden; border: 4px solid var(--ink); border-radius: 24px; background: #8a6a3e; }
/* The player's avatar and name, bombs defused and the size of the next wave, over the top of the map. */
.bomber-hud { position: absolute; top: 8px; right: 10px; left: 10px; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; pointer-events: none; }
.bomber-hud .x01-avatar { flex-shrink: 0; width: 30px; height: 30px; border-width: 2px; font-size: 1rem; -webkit-text-stroke: 3px var(--ink); }
/* Padding gives the outline room: the box clips (for the ellipsis), and the stroke spills past the letters. */
.bomber-hud-name { overflow: hidden; margin: -4px -2px; padding: 4px 4px; line-height: 1.2; color: #fff; font-family: var(--display); font-size: 1.2rem; text-overflow: ellipsis; white-space: nowrap; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.bomber-pill { flex-shrink: 0; padding: 2px 10px; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 var(--ink); color: #fff; font-family: var(--display); font-size: 0.95rem; text-transform: uppercase; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.bomber-pill b { font-size: 1.25rem; font-weight: 400; }
.bomber-pill.is-active { background: var(--red); }
.bomber-pill.is-defused { background: var(--green); }
.bomber-pill.is-wave { margin-left: auto; background: var(--red); }
.golf-stamp.bomber-stamp { --stamp-color: var(--red); height: 58%; font-size: clamp(2rem, 3.6vw, 3rem); }
.golf-stamp.bomber-stamp.is-delayed { animation-delay: 1.1s; }

/* Arena drawing (SVG, in art pixels) */
.mb-wedge { opacity: 0.14; }
.mb-wedge.is-light { fill: #fff6dc; }
.mb-wedge.is-dark { fill: #2a1a08; }
.mb-line { fill: none; stroke: #fff6dc; stroke-width: 0.6; opacity: 0.4; }
.mb-bomb-wedge { opacity: 0.3; }
.mb-bomb-wedge.is-new { fill: #ffffff; }
.mb-bomb-wedge.is-warning { fill: #ffe600; }
.mb-bomb-wedge.is-critical { fill: #ff2020; opacity: 0.4; animation: mb-wedge-alarm 0.6s steps(2, jump-none) infinite; }
.mb-bomb-wedge.is-landing { animation: mb-wedge-land 0.4s ease-out both; }
.mb-label { fill: #fff; font-family: var(--display); font-size: 11px; text-anchor: middle; dominant-baseline: central; stroke: var(--ink); stroke-width: 3px; paint-order: stroke fill; }
.mb-label.is-new, .mb-label.is-warning, .mb-label.is-critical { font-size: 14px; }
.mb-label.is-warning { fill: #ffe600; }
.mb-label.is-critical, .mb-label.is-boom { fill: #ff4a4a; }
.mb-shadow { fill: rgba(40, 22, 6, 0.4); }
/* Bombs: a new one sits calm, a warning rocks on its base, a critical one shakes and flashes red. */
.mb-rock { transform-box: fill-box; transform-origin: 50% 100%; }
.mb-bomb.is-warning .mb-rock { animation: mb-rock 1.1s ease-in-out infinite; }
.mb-bomb.is-critical .mb-rock, .mb-rock.is-panic { animation: mb-shake 0.18s linear infinite; }
.mb-hot { animation: sv-frame-a 0.5s linear infinite; }
.mb-spark { transform-box: fill-box; transform-origin: center; animation: mb-spark 0.5s ease-in-out infinite; }
.mb-spark .sv-frame-a, .mb-spark .sv-frame-b { animation-duration: 0.3s; }
.mb-bomb.is-warning .mb-spark { animation-duration: 0.3s; }
.mb-bomb.is-critical .mb-spark, .mb-rock.is-panic .mb-spark { animation-duration: 0.15s; scale: 1.4; }
/* A new wave drops out of the sky, squashes as it lands, and kicks up dust. */
.mb-drop { animation: mb-drop 0.65s cubic-bezier(0.5, 0, 0.75, 0) both; }
.mb-shadow.is-dropping { transform-box: fill-box; transform-origin: center; animation: mb-shadow-in 0.45s ease-in both; }
.mb-dust { fill: #f0dcae; opacity: 0; animation: mb-dust 0.6s ease-out both; }
.mb-thud { fill: #fff; font-family: var(--display); font-size: 9px; text-anchor: middle; stroke: var(--ink); stroke-width: 2.5px; paint-order: stroke fill; opacity: 0; animation: mb-pop-text 0.8s ease-out both; }
.mb-thump { animation: mb-thump 0.35s linear; }
/* A dart's blast, and defused bombs popping. */
.mb-blast { fill: #62ffd0; opacity: 0; animation: mb-blast 0.9s ease-out both; }
.mb-bull-pulse { fill: none; stroke: #62ffd0; stroke-width: 4; transform-box: fill-box; transform-origin: center; opacity: 0; animation: mb-bull-pulse 0.7s ease-out both; }
.mb-zap { stroke: #bffff0; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 2px #62ffd0); opacity: 0; animation: mb-zap 0.5s ease-out both; }
.mb-defused { transform-box: fill-box; transform-origin: 50% 100%; animation: mb-defused 0.9s ease-in both; }
.mb-sparkle { fill: #62ffd0; opacity: 0; animation: mb-sparkle 0.8s ease-out 0.35s both; }
.mb-defused-text { fill: #62ffd0; font-family: var(--display); font-size: 8px; text-anchor: middle; stroke: var(--ink); stroke-width: 2.5px; paint-order: stroke fill; opacity: 0; animation: mb-pop-text 1.2s ease-out 0.2s both; }
/* The bomb tech bobs; hops when a bomb is defused; sits sooty and dazed once one goes off. */
.mb-tech-body { animation: mb-bob 1s steps(2, jump-none) infinite; }
.mb-tech.is-cheering .mb-tech-body { animation: mb-hop 0.5s ease-out 2; }
.mb-tech.is-out .mb-tech-body { animation: none; }
.mb-tech-clean { animation: mb-hide 0.01s linear both; }
.mb-tech-sooty { animation: mb-show 0.01s linear both; }
.mb-dizzy-star { fill: var(--yellow); animation: mb-dizzy 1s linear infinite; }
/* Ka-boom: the bomb panics, then a fireball, debris, a white flash and a crater. */
.mb-fuse-out { animation: mb-hide 0.01s linear 0.35s both; }
.mb-fireball { transform-box: fill-box; transform-origin: center; opacity: 0; animation: mb-fireball 0.9s ease-out both; }
.mb-fireball.is-outer { fill: #ff4a1a; }
.mb-fireball.is-inner { fill: #ffb21f; }
.mb-fireball.is-core { fill: #fff6c0; }
.mb-debris { fill: #2a2236; opacity: 0; animation: mb-debris 0.8s cubic-bezier(0.2, 0.7, 0.4, 1) both; }
.mb-boom-text { fill: var(--yellow); font-family: var(--display); font-size: 13px; text-anchor: middle; stroke: var(--ink); stroke-width: 3.5px; paint-order: stroke fill; opacity: 0; animation: mb-pop-text 1.4s ease-out both; }
.mb-crater { fill: #3a2814; }
.mb-crater-core { fill: #1e140a; }
.mb-crater-in { animation: mb-show 0.01s linear both; }
.mb-smoke { fill: rgba(70, 64, 70, 0.55); transform-box: fill-box; transform-origin: center; opacity: 0; animation: mb-smoke 1.8s ease-out infinite; }
.mb-flash { fill: #fff; opacity: 0; pointer-events: none; animation: mb-flash 0.5s ease-out both; }
@keyframes bomber-pulse { 50% { opacity: 0.8; } }
@keyframes bomber-defuse { 0% { opacity: 1; fill: #ffffff; } 45% { opacity: 1; fill: #62ffd0; } 100% { opacity: 0; fill: #62ffd0; } }
@keyframes mb-wedge-alarm { 50% { opacity: 0.15; } }
@keyframes mb-wedge-land { from { opacity: 0; } 30% { opacity: 0.7; } }
@keyframes mb-rock { 0%, 100% { rotate: -9deg; } 50% { rotate: 9deg; } }
@keyframes mb-shake { 0%, 100% { translate: 0 0; rotate: 0deg; } 25% { translate: -0.6px 0; rotate: -4deg; } 75% { translate: 0.6px 0; rotate: 4deg; } }
@keyframes mb-spark { 50% { scale: 1.3; } }
@keyframes mb-drop { 0% { transform: translateY(-190px); } 69% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; } 78% { transform: translateY(0) scale(1.3, 0.7); } 89% { transform: translateY(-3px) scale(0.92, 1.08); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes mb-shadow-in { from { scale: 0.2; opacity: 0.2; } }
@keyframes mb-dust { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)) scale(0.4); } }
@keyframes mb-pop-text { 0% { opacity: 0; transform: translateY(4px) scale(0.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 70% { opacity: 1; transform: translateY(-4px) scale(1); } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes mb-thump { 0%, 100% { transform: none; } 20% { transform: translateY(2.5px); } 45% { transform: translateY(-1px); } 70% { transform: translateY(0.5px); } }
@keyframes mb-blast { 15% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes mb-bull-pulse { 0% { opacity: 1; scale: 0.15; } 100% { opacity: 0; scale: 1; } }
@keyframes mb-zap { 10%, 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mb-defused { 0%, 30% { filter: brightness(1); transform: none; opacity: 1; } 40% { filter: brightness(0) invert(1) sepia(1) hue-rotate(120deg) saturate(4); transform: scale(1.15); opacity: 1; } 100% { filter: brightness(0) invert(1); transform: scale(1.6, 0.2); opacity: 0; } }
@keyframes mb-sparkle { 0% { opacity: 1; transform: translate(0, -10px); } 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)); } }
@keyframes mb-bob { 50% { transform: translateY(-1px); } }
@keyframes mb-hop { 40% { transform: translateY(-6px); } }
@keyframes mb-hide { to { opacity: 0; } }
@keyframes mb-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes mb-dizzy { 0% { transform: translate(-6px, 0); } 25% { transform: translate(0, -2px); } 50% { transform: translate(6px, 0); } 75% { transform: translate(0, 2px); } 100% { transform: translate(-6px, 0); } }
@keyframes mb-fireball { 0% { opacity: 1; scale: 0.1; } 30% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.25; } }
@keyframes mb-debris { 0% { opacity: 1; transform: translate(0, -6px); } 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)) rotate(200deg); } }
@keyframes mb-smoke { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px) scale(1.8); } }
@keyframes mb-flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }

/* Player roster */
.view-heading .button-primary { min-height: 72px; font-size: 1.8rem; }
.profile-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: start; gap: 24px; }
.profile-tile { display: grid; justify-items: center; align-content: center; gap: 14px; min-width: 0; min-height: 230px; padding: 20px 12px; border: 5px solid var(--ink); border-radius: 32px; background: var(--player-color); box-shadow: var(--pop); color: #fff; text-align: center; transition: transform 80ms ease, box-shadow 80ms ease; }
.profile-tile:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.profile-tile-avatar { display: grid; width: min(100%, 124px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 5px solid var(--ink); border-radius: 50%; background: #fff; color: var(--player-color); font-family: var(--display); font-size: 3.8rem; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; }
.profile-tile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-tile-name { max-width: 100%; overflow: hidden; font-size: 2rem; line-height: 1.1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; padding-bottom: 4px; }
.profile-card { display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(260px, 1.1fr); gap: 24px; min-height: 400px; }
.profile-visual { display: grid; align-content: center; justify-items: center; gap: 16px; min-width: 0; padding: 20px; border: 5px solid var(--ink); border-radius: 32px; background-color: var(--player-color); background-image: radial-gradient(circle, rgba(255, 255, 255, 0.18) 7px, transparent 8px); background-size: 44px 44px; }
.avatar { display: grid; width: clamp(140px, 18vw, 200px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 6px solid var(--ink); border-radius: 50%; background: #fff; color: var(--player-color); font-family: var(--display); font-size: clamp(3.6rem, 6vw, 5.4rem); -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pixel-art-image { image-rendering: pixelated; }
.profile-art-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.profile-art-actions button, .upload-label { min-height: 56px; padding: 0 18px; border: 4px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); font-size: 1.1rem; font-weight: 900; }
.upload-label { position: relative; display: inline-grid; overflow: hidden; place-items: center; cursor: pointer; }
.upload-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-label:focus-within { outline: 4px solid var(--yellow); outline-offset: 3px; }
.profile-fields { display: grid; align-content: center; gap: 18px; }
.profile-fields label { display: grid; gap: 8px; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.profile-fields input[type="text"] { width: 100%; min-height: 68px; padding: 0 18px; border: 4px solid var(--ink); border-radius: 20px; outline: none; background: #fff; color: var(--ink); font-family: var(--display); font-size: 2rem; text-transform: none; }
.profile-fields input[type="text"]:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--yellow); }
.profile-fields input[type="color"] { width: 100%; height: 68px; padding: 6px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; }
.profile-save-note { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.profile-empty { display: grid; grid-column: 1 / -1; min-height: 360px; align-content: center; justify-items: center; gap: 14px; border: 6px dashed #fff; border-radius: 36px; background: rgba(29, 23, 71, 0.28); color: #fff; text-align: center; }
.profile-empty strong { font-family: var(--display); font-size: 3rem; font-weight: 400; text-transform: uppercase; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; }
.profile-empty p { max-width: 380px; margin: 0; font-size: 1.3rem; }

/* Pixel editor */
.pixel-editor-subtitle { margin: 8px 0 0; color: var(--ink-soft); font-size: 1.1rem; }
.pixel-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 0.85fr); align-items: start; gap: 24px; margin: 20px 0; }
.pixel-canvas-wrap { display: grid; min-width: 0; place-items: center; padding: 12px; border: 4px solid var(--ink); border-radius: 24px; background: var(--panel-tint); }
#pixelCanvas { display: block; width: min(100%, 360px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 6px; background-color: #c8d2cf; background-image: conic-gradient(#e0e9e5 25%, transparent 0 50%, #e0e9e5 0 75%, transparent 0); background-size: 15px 15px; image-rendering: pixelated; touch-action: none; }
.pixel-controls { display: grid; gap: 18px; }
.pixel-controls fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pixel-controls legend, .pixel-color-label { margin-bottom: 8px; font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; }
.pixel-button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pixel-button-row button, .pixel-clear { min-height: 54px; padding: 0 14px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: var(--pop-sm); color: var(--ink); font-size: 1.05rem; font-weight: 900; }
.pixel-button-row button[aria-pressed="true"] { background: var(--yellow); }
.pixel-color-label { display: grid; gap: 6px; margin: 0; }
#pixelColor { width: 100%; height: 60px; padding: 5px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; }
.pixel-clear { justify-self: start; }
.pixel-tip { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.4; }
.pixel-save-error { margin: 0 0 12px; color: #c01818; font-size: 1.05rem; }
.pixel-dialog-actions { display: flex; justify-content: flex-end; gap: 14px; }

/* Tab bar */
.tab-bar { position: sticky; bottom: 0; z-index: 3; background: linear-gradient(to bottom, rgba(47, 155, 255, 0), var(--sky) 28%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 14px 32px max(22px, env(safe-area-inset-bottom)); }
.tab-bar { pointer-events: none; }
.tab-bar a { pointer-events: auto; display: flex; min-height: 84px; align-items: center; justify-content: center; gap: 14px; border: 5px solid var(--ink); border-radius: 28px; background: #fff; box-shadow: var(--pop); color: var(--ink); font-size: 2.2rem; text-decoration: none; text-transform: uppercase; transition: transform 80ms ease, box-shadow 80ms ease; }
/* Boardwalk: seaside stage, a plank deck for the board, a sunny walker, wooden walls */
body:has(.is-playing-boardwalk:not([hidden])) {
  background-color: #16b3a6;
  background-image: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.22) 0 10px, transparent 11px), radial-gradient(circle, rgba(255, 255, 255, 0.12) 9px, transparent 10px);
  background-size: 64px 34px, 56px 56px;
}
.is-playing-boardwalk .x01-title h2 { color: var(--yellow); }
.boardwalk-layout { display: grid; grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr); gap: 26px; }
.boardwalk-board-panel { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 18px; border: 5px solid var(--ink); border-radius: 44px; background-color: #c98a4b; background-image: repeating-linear-gradient(90deg, transparent 0 58px, rgba(29, 23, 71, 0.55) 58px 62px), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 14px); box-shadow: var(--pop); overflow: hidden; }
.boardwalk-board-panel.is-popped { animation: boardwalk-shake 0.5s ease-in-out 2; }
/* The SVG keeps itself square and centered, so the box can just fill the deck. */
.boardwalk-board { width: 100%; max-width: 480px; height: 100%; min-height: 0; }
.boardwalk-board svg { display: block; width: 100%; height: 100%; }
.boardwalk-board .dart-segment { transition: fill 250ms ease, opacity 250ms ease; }
.boardwalk-board .dart-segment:not([data-walk]), .boardwalk-board .dart-segment[data-walk=""] { opacity: 0.32; }
.boardwalk-board .dart-segment.is-custom { fill: var(--section-color); stroke: var(--ink); }
.boardwalk-board .dart-segment[data-walk="wall"] { stroke-width: 3; }
.boardwalk-board .dart-segment[data-walk="walker"] { animation: boardwalk-glow 1.1s ease-in-out infinite; }
.boardwalk-board .dart-segment[data-walk="popped"] { animation: boardwalk-pop 0.9s ease-out forwards; }
.boardwalk-board .dart-segment.is-selected { stroke: var(--ink); }
.boardwalk-board svg[role="group"] .dart-segment { cursor: pointer; }
.boardwalk-board .dartboard-number { transition: font-size 200ms ease, opacity 200ms ease; }
.boardwalk-board .dartboard-number[data-walk=""] { opacity: 0.45; }
.boardwalk-board .dartboard-number[data-walk="wall"] { fill: #f3c48a; font-size: 28px; stroke: var(--ink); stroke-width: 6px; paint-order: stroke fill; }
.boardwalk-board .dartboard-number[data-walk="walker"], .boardwalk-board .dartboard-number[data-walk="popped"] { fill: var(--yellow); font-size: 36px; stroke: var(--ink); stroke-width: 7px; paint-order: stroke fill; }
.boardwalk-board .dartboard-number[data-walk="popped"] { fill: var(--red); }
.boardwalk-stamp { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 62%; aspect-ratio: 1; color: #fff; font-family: var(--display); font-size: clamp(2.6rem, 7vw, 5rem); line-height: 0.9; text-align: center; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; pointer-events: none; transform: translate(-50%, -50%) rotate(-8deg); animation: boardwalk-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.boardwalk-stamp::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--stamp-color, var(--red)); clip-path: polygon(50.0% 0.0%, 59.3% 15.2%, 75.0% 6.7%, 75.5% 24.5%, 93.3% 25.0%, 84.8% 40.7%, 100.0% 50.0%, 84.8% 59.3%, 93.3% 75.0%, 75.5% 75.5%, 75.0% 93.3%, 59.3% 84.8%, 50.0% 100.0%, 40.7% 84.8%, 25.0% 93.3%, 24.5% 75.5%, 6.7% 75.0%, 15.2% 59.3%, 0.0% 50.0%, 15.2% 40.7%, 6.7% 25.0%, 24.5% 24.5%, 25.0% 6.7%, 40.7% 15.2%); filter: drop-shadow(0 0 0 var(--ink)); }
.boardwalk-stamp.is-pop { --stamp-color: var(--red); }
.boardwalk-stamp.is-perfect { --stamp-color: var(--green); font-size: clamp(2rem, 5vw, 3.6rem); }
.boardwalk-stamp.is-strikes { --stamp-color: var(--orange); font-size: clamp(1.8rem, 4.4vw, 3.2rem); }
.boardwalk-stamp.is-banked { --stamp-color: var(--green); font-size: clamp(3rem, 8vw, 5.6rem); }
.boardwalk-pace { position: absolute; top: 14px; left: 14px; padding: 4px 14px; border: 4px solid var(--ink); border-radius: 999px; background: #fff; font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; }
.boardwalk-pace.is-max { background: var(--red); color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; animation: throb 0.9s ease-in-out infinite; }
.boardwalk-tap-hint { position: absolute; bottom: 14px; left: 50%; padding: 6px 16px; transform: translateX(-50%); border: 4px solid var(--ink); border-radius: 999px; background: #fff; font-size: 1rem; font-weight: 900; white-space: nowrap; }
.x01-current.boardwalk-current { gap: 10px; padding: 20px 24px 18px; }
/* Only the dart log may shrink (and scroll); everything else keeps its height so text never spills. */
.boardwalk-current > * { flex-shrink: 0; }
.boardwalk-current .x01-status { padding: 6px 18px; font-size: 1.1rem; }
.boardwalk-current .x01-avatar.is-large { width: 96px; height: 96px; font-size: 3rem; }
.boardwalk-current .x01-current-header h3 { font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
.boardwalk-total { display: grid; flex-shrink: 0; justify-items: end; text-align: right; }
.boardwalk-total strong { color: var(--yellow); font-family: var(--display); font-size: clamp(3.4rem, 9vh, 5.4rem); font-weight: 400; line-height: 0.9; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; }
.boardwalk-total span { color: #fff; font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.boardwalk-cage-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; }
.boardwalk-cage, .boardwalk-worth { display: grid; justify-items: center; align-content: center; padding: 8px 12px; border: 4px solid var(--ink); border-radius: 26px; background: #fff; box-shadow: var(--pop-sm); }
.boardwalk-cage span, .boardwalk-worth span { font-size: 0.95rem; font-weight: 900; letter-spacing: 0.08em; }
.boardwalk-cage strong, .boardwalk-worth strong { font-family: var(--display); font-size: clamp(2.6rem, 7vh, 4rem); font-weight: 400; line-height: 1; }
.boardwalk-cage.is-popped { background: var(--red); color: #fff; }
.boardwalk-worth { background: var(--yellow); color: #fff; }
.boardwalk-worth span { color: var(--ink); }
.boardwalk-worth strong { -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; }
.boardwalk-worth { position: relative; }
.boardwalk-worth.is-doubled { background: var(--orange); }
.boardwalk-double { position: absolute; top: -28px; right: -24px; display: grid; width: 50px; height: 50px; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: var(--red); box-shadow: 0 4px 0 var(--ink); color: #fff; font-family: var(--display); font-size: 1.5rem; font-style: normal; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; transform: rotate(12deg); animation: boardwalk-double-in 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.boardwalk-strikes.is-cleared { animation: boardwalk-cleared 0.8s ease-out; }
.boardwalk-dart.is-reset { background: var(--green); color: #fff; }
.boardwalk-dart.is-double { background: var(--orange); color: #fff; }
@keyframes boardwalk-double-in { from { opacity: 0; transform: rotate(-40deg) scale(0.2); } }
@keyframes boardwalk-cleared { 0% { background: var(--green); box-shadow: 0 0 0 0 rgba(47, 194, 74, 0.8); } 100% { box-shadow: 0 0 0 18px rgba(47, 194, 74, 0); } }
.boardwalk-strikes { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 26px; background: rgba(29, 23, 71, 0.22); }
.boardwalk-strike { display: grid; width: 52px; height: 52px; place-items: center; border: 4px dashed #fff; border-radius: 50%; color: transparent; font-family: var(--display); font-size: 2rem; }
.boardwalk-strike.is-struck { border: 4px solid var(--ink); background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--ink); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.boardwalk-strike.is-new { animation: boardwalk-stamp 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
/* Room for three rows of chips before it scrolls. */
.boardwalk-current > .boardwalk-darts { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 40px; max-height: 128px; overflow-y: auto; padding: 2px; }
.boardwalk-dart { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--display); font-size: 1.4rem; line-height: 1; }
.boardwalk-dart small { font-family: inherit; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.06em; }
.boardwalk-dart.is-wall { background: #f3c48a; }
.boardwalk-dart.is-strike { background: #e3e1f2; color: var(--ink-soft); }
.boardwalk-dart.is-pop { background: var(--red); color: #fff; }
.boardwalk-darts-empty { align-self: center; padding: 6px 14px; border-radius: 999px; background: rgba(29, 23, 71, 0.35); color: #fff; font-size: 1rem; font-weight: 900; }
/* The race never shrinks; the dart log above it scrolls instead. */
.boardwalk-race { display: grid; flex: 0 0 auto; gap: 4px; margin-top: auto; padding: 6px 12px; border-radius: 22px; background: #fff; }
.boardwalk-racer { display: grid; grid-template-columns: auto minmax(0, 1fr) 3ch; align-items: center; gap: 10px; }
.boardwalk-racer .x01-avatar { width: 34px; height: 34px; border-width: 3px; font-size: 1.1rem; -webkit-text-stroke: 4px var(--ink); }
.boardwalk-racer-track { height: 20px; overflow: hidden; border: 3px solid var(--ink); border-radius: 999px; background: #e3e1f2; }
.boardwalk-racer-track span { display: block; height: 100%; background: var(--player-color); transition: width 400ms ease; }
.boardwalk-racer strong { font-family: var(--display); font-size: 1.6rem; font-weight: 400; text-align: right; }
.boardwalk-racer.is-current .boardwalk-racer-track, .boardwalk-racer.is-winner .boardwalk-racer-track { box-shadow: 0 0 0 3px var(--yellow); }
@keyframes boardwalk-glow { 50% { filter: brightness(1.35) drop-shadow(0 0 6px #fff27a); } }
@keyframes boardwalk-pop { 0% { fill: #fff; transform-origin: 200px 200px; transform: scale(1); } 30% { fill: #fff27a; transform: scale(1.06); } 100% { fill: var(--red); transform: scale(1); } }
@keyframes boardwalk-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(0.2); } }
.boardwalk-strike.is-new { animation-name: boardwalk-strike-in; }
@keyframes boardwalk-strike-in { from { transform: scale(0.2) rotate(-30deg); } }
@keyframes boardwalk-shake { 25% { transform: translateX(-8px) rotate(-1deg); } 75% { transform: translateX(8px) rotate(1deg); } }

/* Golf: the target board on the left; the player, the hole (sideways), the three shots and the card on the right */
.golf-layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); gap: 26px; }
.golf-board-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 8px; min-width: 0; min-height: 0; padding: 18px; border: 5px solid var(--ink); border-radius: 44px; background-color: #3c9a4a; background-image: repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 255, 255, 0.07) 44px 88px); box-shadow: var(--pop); overflow: hidden; }
.golf-board { width: 100%; max-width: 480px; height: 100%; min-height: 0; }
.golf-board svg { display: block; width: 100%; height: 100%; }
/* Its own row above the board, so it never covers the numbers. */
.golf-hole-card { justify-self: start; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; padding: 6px 14px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: var(--pop-sm); }
/* The hole takes the height left between the player and the shots. */
.golf-current > .golf-course-frame { position: relative; flex: 1 1 0; min-height: 110px; overflow: hidden; border: 4px solid var(--ink); border-radius: 24px; background: #2b6620; }
.golf-course-frame svg { display: block; width: 100%; height: 100%; }
.golf-hole-svg.is-pixel { image-rendering: pixelated; }
.golf-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Under the board: just the shot in play, as wide as the board. */
.golf-shots.is-single { grid-template-columns: 1fr; justify-self: stretch; width: 100%; max-width: 480px; margin-inline: auto; }
.golf-shots.is-single .golf-shot { min-height: 52px; padding: 6px 12px; transform: none; }
.golf-shots.is-single .golf-zone i { height: 30px; font-size: 1.1rem; }
.golf-shot-label small { font-size: 0.8rem; opacity: 0.7; }
.golf-stamp { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; height: 96%; aspect-ratio: 1; color: #fff; font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 0.95; text-align: center; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; pointer-events: none; transform: translate(-50%, -50%) rotate(-8deg); animation: boardwalk-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.is-playing-golf .x01-title h2 { color: #b5f08a; }
.golf-hole-card strong { font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.golf-hole-card span { padding: 2px 10px; border-radius: 10px; background: var(--ink); color: var(--yellow); font-family: var(--display); font-size: 1.1rem; }
.golf-hole-card small { grid-column: 1 / -1; font-size: 0.85rem; font-weight: 900; }
.golf-target { transform-box: fill-box; transform-origin: center; animation: golf-target 1.2s ease-in-out infinite; }
/* The ball's flight is driven frame by frame from play.js; at rest a holed ball is out of sight. */
.golf-ball.is-holed { opacity: 0; }
.golf-hole-svg.is-animating .golf-trail-new, .golf-hole-svg.is-animating .golf-splash.is-new { visibility: hidden; }
.golf-flag.is-waving path { transform-box: fill-box; transform-origin: left center; animation: golf-wave 0.6s ease-in-out infinite; }
.golf-splash { animation: golf-splash 1s ease-out both; transform-box: fill-box; transform-origin: center; }
.golf-stamp::before { content: ""; position: absolute; inset: 8%; z-index: -1; background: var(--stamp-color); clip-path: polygon(50.0% 0.0%, 59.3% 15.2%, 75.0% 6.7%, 75.5% 24.5%, 93.3% 25.0%, 84.8% 40.7%, 100.0% 50.0%, 84.8% 59.3%, 93.3% 75.0%, 75.5% 75.5%, 75.0% 93.3%, 59.3% 84.8%, 50.0% 100.0%, 40.7% 84.8%, 25.0% 93.3%, 24.5% 75.5%, 6.7% 75.0%, 15.2% 59.3%, 0.0% 50.0%, 15.2% 40.7%, 6.7% 25.0%, 24.5% 24.5%, 25.0% 6.7%, 40.7% 15.2%); }
/* The burst is clip-path cut, so its ink outline and drop shadow come from filters on the stamp:
   four zero-blur shadows trace the edge, then one offset down matches the app's raised "pop". */
.golf-stamp { filter: drop-shadow(3px 0 0 var(--ink)) drop-shadow(-3px 0 0 var(--ink)) drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 -3px 0 var(--ink)) drop-shadow(0 6px 0 var(--ink)); }
.golf-stamp.is-under { --stamp-color: var(--yellow); }
.golf-stamp.is-par { --stamp-color: var(--sky); }
.golf-stamp.is-over { --stamp-color: var(--ink-soft); }
.x01-current.golf-current { gap: 10px; padding: 18px 22px; }
.golf-current > * { flex-shrink: 0; }
.golf-current .x01-avatar.is-large { width: 68px; height: 68px; font-size: 2.2rem; -webkit-text-stroke: 7px var(--ink); }
.golf-current .x01-current-header h3 { margin-top: 0; padding-bottom: 4px; font-size: clamp(2rem, 3.4vw, 2.8rem); }
.golf-total { display: grid; flex-shrink: 0; justify-items: end; text-align: right; }
.golf-total strong { color: var(--yellow); font-family: var(--display); font-size: clamp(2.8rem, 7vh, 4.2rem); font-weight: 400; line-height: 0.9; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; }
.golf-total span { color: #fff; font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.golf-board .dart-segment:not(.is-custom) { opacity: 0.3; }
.golf-board .dart-segment.is-custom { fill: var(--section-color); stroke: var(--ink); }
.golf-board .dart-segment[data-effect="pulse"] { animation: boardwalk-glow 0.9s ease-in-out infinite; }
.golf-board svg[role="group"] .dart-segment { cursor: pointer; }
.golf-board .dartboard-number { opacity: 0.45; }
.golf-board .dartboard-number[data-golf="zone"] { opacity: 1; }
.golf-board .dartboard-number[data-golf="pin"] { opacity: 1; fill: var(--yellow); font-size: 34px; stroke: var(--ink); stroke-width: 7px; paint-order: stroke fill; }
.golf-shot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 8px; min-height: 44px; padding: 4px 8px; border: 4px solid var(--ink); border-radius: 18px; background: rgba(255, 255, 255, 0.55); }
.golf-shot.is-current { background: var(--yellow); box-shadow: var(--pop-sm); transform: translateX(-4px); }
.golf-shot.is-done { background: #fff; }
.golf-shot-label { font-family: var(--display); font-size: 1.15rem; line-height: 1.1; text-transform: uppercase; }
.golf-shot small { font-size: 0.95rem; font-weight: 900; }
.golf-shot-delta { margin-left: auto; line-height: 1; font-family: var(--display); font-size: 1.7rem; font-weight: 400; }
.golf-shot-delta.is-under { color: #1b8a2e; }
.golf-shot-delta.is-over { color: var(--red); }
.golf-shot-delta.is-rolling { animation: blink 0.8s steps(2) infinite; }
/* Zone chips get their own line under the shot name so the column can be narrow. */
/* A zone is one outlined bar split into equal sections; the pin's section is gold. Nothing is
   scaled, so sections can't overlap however many numbers the zone has. */
.golf-zone { display: flex; flex-basis: 100%; flex-wrap: nowrap; overflow: hidden; border: 3px solid var(--ink); border-radius: 10px; background: var(--ink); gap: 2px; }
.golf-zone i { display: grid; flex: 1 1 0; min-width: 0; height: 24px; place-items: center; padding: 0 1px; background: #8bdc5c; color: var(--ink); font-family: var(--display); font-size: 0.95rem; font-style: normal; }
.golf-zone i.is-pin { background: var(--yellow); box-shadow: inset 0 -3px 0 rgba(29, 23, 71, 0.25); }
.golf-card-wrap { min-height: 0; margin-top: auto; overflow: auto; border-radius: 20px; background: #fff; }
.golf-card { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: var(--display); font-size: 1.1rem; text-align: center; }
.golf-card th, .golf-card td { height: 30px; padding: 1px 4px; font-weight: 400; }
.golf-card thead th { color: var(--ink-soft); font-size: 0.95rem; }
.golf-card .golf-card-par { color: var(--ink-soft); font-size: 0.95rem; border-bottom: 3px solid var(--panel-tint); }
.golf-card thead th:first-child { width: 52px; }
.golf-card thead th:last-child { width: 52px; }
.golf-card .x01-avatar { width: 30px; height: 30px; border-width: 3px; font-size: 0.9rem; -webkit-text-stroke: 3px var(--ink); }
.golf-card .is-current { background: color-mix(in srgb, var(--yellow), #fff 55%); }
.golf-card tr.is-current th, .golf-card tr.is-winner th { background: color-mix(in srgb, var(--player-color), #fff 70%); }
.golf-card-total { font-size: 1.3rem; }
.golf-score { display: inline-grid; min-width: 26px; height: 26px; place-items: center; }
.golf-score.is-birdie { border: 2px solid var(--ink); border-radius: 50%; }
.golf-score.is-eagle { border: 2px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); background: var(--yellow); }
.golf-score.is-bogey { border: 2px solid var(--ink); border-radius: 3px; }
.golf-score.is-double { border: 2px solid var(--ink); border-radius: 3px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
/* Chip & Putt reuses Golf's screen; its zone chips fade outward from the pin by band. */
.chip-putt-zone i.is-Y { background: var(--yellow); }
.chip-putt-zone i.is-G { background: #3fbf4a; }
.chip-putt-zone i.is-LG { background: #a8e878; }
.chip-putt-zone i.is-R { background: #ff5a5a; }
/* An out zone is still thrown at, but can't sink: chips are struck through and the board dims. */
.chip-putt-zone.is-out i { opacity: 0.6; text-decoration: line-through; text-decoration-thickness: 2px; }
.golf-board.is-out .dart-segment.is-custom { opacity: 0.55; }
.chip-putt-later { flex-basis: 100%; font-size: 0.9rem; font-weight: 900; opacity: 0.7; }
.is-playing-chip-putt .x01-title h2 { color: var(--orange); }
@keyframes golf-target { 50% { transform: scale(1.08); opacity: 0.75; } }
@keyframes golf-wave { 50% { transform: scaleX(0.8) skewY(6deg); } }
@keyframes golf-splash { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.4); opacity: 0.5; } }

.tab-bar a:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.tab-bar a[aria-current="page"] { background: var(--yellow); }
.tab-icon { display: block; width: 38px; height: 38px; }
.tab-icon svg { display: block; width: 100%; height: 100%; }

.toast { position: fixed; z-index: 5; left: 50%; top: 96px; max-width: min(560px, calc(100vw - 36px)); padding: 16px 26px; transform: translate(-50%, -16px) rotate(-1deg); border: 5px solid var(--ink); border-radius: 26px; background: var(--yellow); box-shadow: var(--pop); color: var(--ink); font-family: var(--display); font-size: 1.7rem; opacity: 0; pointer-events: none; text-align: center; transition: 180ms ease; }
.toast.is-visible { transform: translate(-50%, 0) rotate(-1deg); opacity: 1; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes throb { 50% { transform: scale(1.05) rotate(-2deg); } }
@keyframes board-hit { 0%, 30% { fill: #fff27a; filter: brightness(1.4); } 100% { filter: none; } }

/* Outlined names get cut off with "…" when too long; that clipping box also cuts the
   stroke unless it has room inside, so pad it and pull it back into place. */
.character-choice-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Name boxes span their card or chip, so the shrink-to-fit script measures the real space. */
.profile-tile-name, .lineup-slot-copy, .lineup-slot-copy strong, .character-choice-name { width: 100%; text-align: center; }
.profile-tile-name, .character-choice-name { justify-self: stretch; }
.x01-current-header > div:not(.bar-best) { flex: 1; min-width: 0; }
.x01-current-header h3, .x01-queue-name, .bar-player-name, .profile-tile-name, .lineup-slot-copy strong, .throw-main span:last-child, .character-choice-name {
  padding: 0.1em 0.16em;
  margin-inline: -0.16em;
}
.x01-current-header h3 { margin-top: 4px; }

/* Short landscape screens (iPad mini, Safari with toolbars): tighten game screens so the buttons stay on screen. */
@media (max-height: 780px) and (min-width: 761px) {
  .game-detail.is-playing-301, .game-detail.is-playing-bar, .game-detail.is-playing-bomber, .game-detail.is-playing-boardwalk, .game-detail.is-playing-golf, .game-detail.is-playing-survivors, .game-detail.is-playing-riders { gap: 12px; }
  .x01-topbar { min-height: 54px; }
  .x01-topbar .detail-back, .game-settings summary { min-height: 52px; }
  .x01-current { padding: 16px 20px; gap: 10px; }
  .x01-current.bar-current { padding: 14px 20px; gap: 10px; }
  .x01-avatar.is-large { width: 84px; height: 84px; font-size: 2.7rem; -webkit-text-stroke: 8px var(--ink); }
  .bar-current .x01-avatar.is-large { width: 66px; height: 66px; font-size: 2.1rem; -webkit-text-stroke: 7px var(--ink); }
  .x01-overline { padding: 4px 10px; font-size: 1rem; }
  .x01-current-header h3 { margin-top: 2px; font-size: clamp(2.2rem, 4vw, 3.4rem); }
  .x01-dart { min-height: 0; padding-block: 6px; }
  .bar-plaque { gap: 8px; padding: 16px; }
  .bar-meter-track { height: 20px; }
  .bar-player { min-height: 60px; padding-top: 6px; }
  .bomber-board-panel { gap: 6px; padding: 12px; }
  .x01-current.boardwalk-current { padding: 14px 20px; gap: 8px; }
  .boardwalk-current .x01-avatar.is-large { width: 66px; height: 66px; font-size: 2.1rem; -webkit-text-stroke: 7px var(--ink); }
  .boardwalk-strike { width: 44px; height: 44px; }
  .boardwalk-board-panel { padding: 12px; }
  .button { min-height: 60px; font-size: 1.6rem; }
  .view-heading { margin-bottom: 12px; }
  .view-heading h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); }
  .carousel-arrow { width: 60px; height: 60px; }
  .game-card { gap: 10px; padding: 16px; }
  .game-symbol { width: 76px; height: 76px; font-size: 2.6rem; }
  .game-symbol.is-number { font-size: 1.8rem; }
  .game-card h2 { font-size: clamp(2.2rem, 3.8vw, 3rem); }
  .game-card-bottom { min-height: 56px; }
  .game-card-bottom small { font-size: 1.9rem; }
  .tab-bar { padding-top: 10px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .tab-bar a { min-height: 70px; font-size: 1.9rem; }
  .home-side { gap: 16px; }
  .recent-surface { padding: 16px 20px; }
  .recent-list { gap: 8px; margin-top: 10px; }
  .recent-list li { min-height: 58px; }
  .throw-icon { width: 46px; height: 46px; }
  .throw-score { font-size: 2.4rem; }
  .next-step { min-height: 92px; }
}

@media (max-width: 1000px) {
  .games-grid { --per-page: 2; }
  .games-grid .game-card:nth-child(3n+1) { scroll-snap-align: none; }
  .games-grid .game-card:nth-child(2n+1) { scroll-snap-align: start; scroll-snap-stop: always; }
  .profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .x01-layout { grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.8fr); }
}

@media (max-width: 760px) {
  .site-header { min-height: 72px; padding: 10px 16px; }
  .brand { font-size: 2rem; }
  .brand-icon { width: 42px; height: 42px; }
  main { padding: 6px 16px 22px; }
  .view-heading { align-items: start; flex-direction: column; gap: 14px; }
  .heading-actions { justify-content: start; }
  .home-layout, .x01-layout, .bomber-layout, .bar-layout, .boardwalk-layout, .golf-layout, .survivors-layout, .riders-layout { grid-template-columns: 1fr; }
  .games-grid { --carousel-gap: 28px; --carousel-inset: 12px; --per-page: 1; }
  .games-grid .game-card { scroll-snap-align: start; }
  .carousel-arrow { width: 60px; height: 60px; }
  .board-surface { min-height: auto; }
  .board-graphic { width: min(100%, 440px); }
  .game-card { height: 400px; }
  .lineup-slots, .lineup-slots:not(.is-crowded) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 200px; overflow-y: auto; }
  .lineup-top, .lineup-header { flex-wrap: wrap; }
  .character-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x01-current { min-height: 0; }
  .x01-score strong { font-size: 8rem; -webkit-text-stroke: 16px var(--ink); }
  .x01-action-row > .button:last-child { min-width: 0; margin-left: 0; }
  .x01-topbar { flex-wrap: wrap; }
  .bomber-board { width: min(100%, 320px); height: auto; }
  .bomber-current > .bomber-arena-frame { flex: none; height: 70vw; }
  .boardwalk-board { width: min(100%, 320px); height: auto; aspect-ratio: 1; }
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-card { grid-template-columns: 1fr; min-height: auto; }
  .pixel-editor-layout { grid-template-columns: 1fr; }
  .pixel-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-bar { gap: 12px; padding-inline: 12px; }
  .tab-bar a { min-height: 70px; font-size: 1.5rem; }
}

@media (max-width: 460px) {
  .connection-pill { min-height: 52px; padding: 0 6px 0 12px; font-size: 0.85rem; }
  .connection-pill #connectionText { max-width: 90px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; padding: 0 10px; font-size: 1.3rem; }
  .profile-grid, .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .character-dialog, .profile-dialog, .pixel-dialog { padding: 18px; }
  .pixel-controls { grid-template-columns: 1fr; }
  .pixel-dialog-actions .button { flex: 1; padding-inline: 10px; }
  .tab-bar a { flex-direction: column; gap: 2px; font-size: 1.1rem; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* Compact player header: every game's avatar, name and score about 15% smaller, with less room
   above, to give the playing area more height. Kept last so it wins over each game's sizes. */
.x01-current { padding-top: 18px; }
.x01-current.bar-current, .x01-current.boardwalk-current { padding-top: 14px; }
.x01-current.golf-current { padding-top: 12px; }
.x01-current-header h3 { margin-top: 2px; }
.x01-avatar.is-large { width: 96px; height: 96px; font-size: 3.1rem; -webkit-text-stroke: 9px var(--ink); }
.bar-current .x01-avatar.is-large, .boardwalk-current .x01-avatar.is-large { width: 80px; height: 80px; font-size: 2.5rem; -webkit-text-stroke: 8px var(--ink); }
.golf-current .x01-avatar.is-large { width: 58px; height: 58px; font-size: 1.9rem; -webkit-text-stroke: 6px var(--ink); }
.x01-current-header h3 { font-size: clamp(2.4rem, 4.8vw, 3.9rem); }
.bar-current .x01-current-header h3 { font-size: clamp(2.2rem, 3.9vw, 3.2rem); }
.boardwalk-current .x01-current-header h3 { font-size: clamp(2rem, 3.7vw, 3rem); }
.golf-current .x01-current-header h3 { font-size: clamp(1.7rem, 2.9vw, 2.4rem); }
.bar-best strong, .boardwalk-total strong { font-size: clamp(2.9rem, 7.6vh, 4.6rem); }
.golf-total strong { font-size: clamp(2.4rem, 6vh, 3.6rem); }
@media (max-height: 780px) and (min-width: 761px) {
  .x01-current { padding-top: 12px; }
  .x01-current.bar-current, .x01-current.boardwalk-current, .x01-current.golf-current { padding-top: 10px; }
  .x01-avatar.is-large { width: 72px; height: 72px; font-size: 2.3rem; -webkit-text-stroke: 7px var(--ink); }
  .bar-current .x01-avatar.is-large, .boardwalk-current .x01-avatar.is-large { width: 56px; height: 56px; font-size: 1.8rem; -webkit-text-stroke: 6px var(--ink); }
  .golf-current .x01-avatar.is-large { width: 52px; height: 52px; font-size: 1.7rem; }
  .x01-current-header h3 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
}

/* Dart Survivors: a night-sky stage; the mini board and darts on the left, the pixel arena and HUD on the right */
body:has(.is-playing-survivors:not([hidden])) {
  background-color: #1f1a4a;
  background-image: radial-gradient(circle, rgba(170, 120, 255, 0.3) 2.5px, transparent 3.5px), radial-gradient(circle, rgba(255, 255, 255, 0.08) 9px, transparent 10px);
  background-size: 90px 90px, 56px 56px;
  background-position: 20px 30px, 0 0;
}
.is-playing-survivors .x01-title h2 { color: #c9a8ff; font-size: clamp(1.9rem, 3.2vw, 2.7rem); white-space: nowrap; }
.survivors-layout { display: grid; grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr); gap: 22px; }
.survivors-board-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-items: center; gap: 8px; min-width: 0; min-height: 0; padding: 14px; overflow: hidden; border: 5px solid var(--ink); border-radius: 44px; background: #2a1d66; box-shadow: var(--pop); }
.survivors-board-title { display: flex; align-items: center; gap: 10px; }
.survivors-board-title .x01-overline { background: #fff; color: var(--ink); }
.survivors-board-title strong { display: grid; min-width: 46px; height: 46px; place-items: center; padding: 0 8px; border: 4px solid var(--ink); border-radius: 999px; background: #8a4dff; color: #fff; font-family: var(--display); font-size: 1.7rem; font-weight: 400; }
.survivors-biting { padding: 4px 12px; border: 3px solid var(--ink); border-radius: 999px; background: var(--red); color: #fff; font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; animation: throb 0.9s ease-in-out infinite; }
.survivors-board { width: 100%; max-width: 440px; height: 100%; min-height: 0; }
.survivors-board svg { display: block; width: 100%; height: 100%; }
.survivors-board .dart-segment:not(.is-custom) { opacity: 0.3; }
.survivors-board .dart-segment.is-custom { fill: var(--section-color); stroke: var(--ink); }
.survivors-board .dart-segment[data-effect="pulse"] { animation: boardwalk-glow 0.9s ease-in-out infinite; }
.survivors-board svg[role="group"] .dart-segment { cursor: pointer; }
.survivors-board .dartboard-number { opacity: 0.45; }
.survivors-board .dartboard-number[data-threat="near"] { opacity: 1; }
.survivors-board .dartboard-number[data-threat="gem"] { opacity: 1; fill: #4fd8ff; }
.survivors-board .dartboard-number[data-threat="boss"] { opacity: 1; fill: #ff8a5a; font-size: 34px; stroke: var(--ink); stroke-width: 7px; paint-order: stroke fill; }
.survivors-board .dartboard-number[data-frozen="true"] { opacity: 1; fill: #bfefff; }
.survivors-board .dartboard-number[data-threat="chest"] { opacity: 1; fill: #ff4fd8; font-size: 30px; stroke: var(--ink); stroke-width: 6px; paint-order: stroke fill; }
.survivors-board .dartboard-number[data-threat="bite"] { opacity: 1; fill: var(--red); font-size: 32px; stroke: var(--ink); stroke-width: 6px; paint-order: stroke fill; }
.survivors-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; color: #fff; font-size: 0.95rem; font-weight: 900; }
.survivors-legend span { display: inline-flex; align-items: center; gap: 6px; }
.survivors-legend span::before { content: ""; width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--chip); }
/* Three darts a round, or up to five with the Duplicator Ring. */
.survivors-darts { display: grid; grid-template-columns: repeat(var(--darts, 3), minmax(0, 1fr)); gap: 8px; width: 100%; }
.survivors-darts.is-many { gap: 5px; }
.survivors-darts.is-many .survivors-dart strong { font-size: 1.3rem; }
.survivors-darts.is-many .survivors-dart small { font-size: 0.7rem; }
.survivors-dart { position: relative; display: grid; justify-items: center; min-width: 0; padding: 6px 6px; border: 4px dashed rgba(255, 255, 255, 0.5); border-radius: 18px; color: #fff; }
.survivors-dart.is-thrown { border: 4px solid var(--ink); background: #fff; box-shadow: var(--pop-sm); color: var(--ink); }
.survivors-dart.is-kill { background: var(--yellow); }
/* The Duplicator Ring fired this dart's weapons twice. */
.survivors-dart.is-echo::after { content: "×2"; position: absolute; top: -10px; right: -6px; padding: 0 6px; border: 3px solid var(--ink); border-radius: 10px; background: #c060ff; color: #fff; font-family: var(--display); font-size: 0.95rem; transform: rotate(8deg); }
.survivors-dart span { font-size: 0.75rem; letter-spacing: 0.08em; }
/* Thor's Ton: a dart that brought a hammer down, and the round's score toward the next one. */
.survivors-dart.is-ton { background: linear-gradient(#ffe98a, #ffc21f); }
.survivors-dart.is-ton::before { content: "🔨"; position: absolute; top: -12px; left: -6px; font-size: 1.1rem; transform: rotate(-20deg); }
/* Mirror Shot: where the dart's ghost landed. */
.survivors-mirror { display: block; color: #8a4dff; font-family: "Nunito", sans-serif; font-size: 0.7rem; font-style: normal; font-weight: 900; line-height: 1.1; }
.survivors-ton { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 2px 8px; width: 100%; padding: 4px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #2a2266; box-shadow: var(--pop-sm); color: #fff; }
.survivors-ton .survivors-icon { grid-row: span 2; width: 24px; height: 24px; image-rendering: pixelated; }
.survivors-ton span { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; opacity: 0.8; }
.survivors-ton strong { grid-row: span 2; justify-self: end; color: var(--yellow); font-family: var(--display); font-size: 1.8rem; font-weight: 400; line-height: 1; }
.survivors-ton small { grid-column: 2; font-size: 0.8rem; font-weight: 900; }
.survivors-ton.is-done { background: #6a3a00; }
.survivors-dart strong { font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.survivors-dart small { overflow: hidden; max-width: 100%; font-size: 0.85rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }

.x01-current.survivors-current { gap: 10px; padding: 12px 18px 16px; }
.survivors-current > * { flex-shrink: 0; }

/* Header: the player's avatar, then health and XP as matching bars, then the kill count. */
/* The player's avatar and thin health and XP bars, over the top of the map. */
.survivors-header { position: absolute; top: 8px; right: 10px; left: 10px; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; pointer-events: none; }
.survivors-header .x01-avatar { flex-shrink: 0; width: 28px; height: 28px; border-width: 2px; font-size: 0.95rem; -webkit-text-stroke: 3px var(--ink); }
.survivors-icon { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.survivors-current > .survivors-arena-frame { position: relative; flex: 1 1 0; min-height: 160px; overflow: hidden; border: 4px solid var(--ink); border-radius: 24px; background: #2c6427; }
/* Until the zone's ground and sprites have loaded the map stays hidden on a dark frame, then fades in. */
.survivors-arena-frame.is-loading { background: #1d1747; }
.survivors-arena-frame.is-loading .sv-arena { opacity: 0; }
.survivors-arena-frame.is-revealed .sv-arena { animation: survivors-arena-in 0.35s ease-out; }
@keyframes survivors-arena-in { from { opacity: 0; } }
.sv-arena { display: block; width: 100%; height: 100%; }
.survivors-meter { position: relative; flex: 1 1 120px; min-width: 90px; height: 24px; overflow: hidden; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 2px 0 var(--ink); }
.survivors-meter > span { display: block; height: 100%; transition: width 0.5s ease; }
.survivors-meter.is-hp { background: #3a1020; }
.survivors-meter.is-hp > span { background: linear-gradient(#ff8a8a, #e0242c); }
.survivors-meter.is-xp { background: #10183a; }
.survivors-meter.is-xp > span { background: linear-gradient(#6ac4ff, #2f6fe5); }
.survivors-meter b, .survivors-meter small, .survivors-meter .survivors-icon { position: absolute; top: 50%; transform: translateY(-50%); }
.survivors-meter b, .survivors-meter small { color: #fff; font-family: var(--display); font-weight: 400; line-height: 1; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.survivors-meter b { left: 8px; font-size: 1rem; }
.survivors-meter small { right: 8px; font-size: 0.9rem; }
.survivors-meter .survivors-icon { left: 4px; width: 16px; height: 16px; filter: drop-shadow(0 1px 0 var(--ink)); }
/* Thor's Ton's double XP, on the XP bar while it's coming or on. */
.survivors-xp-boost { position: absolute; top: 50%; left: 50%; color: var(--yellow); font-family: var(--display); font-size: 0.85rem; font-style: normal; line-height: 1; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; transform: translate(-50%, -50%); animation: survivors-xp-boost 0.9s ease-in-out infinite; }
@keyframes survivors-xp-boost { 50% { color: #ffffff; } }
/* The player's statuses, on the HP bar: poisoned (rounds left) and bound. */
.survivors-meter .survivors-status { position: absolute; top: 50%; color: #fff; font-family: var(--display); font-size: 0.85rem; font-style: normal; line-height: 1; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; transform: translate(-50%, -50%); }
.survivors-meter .survivors-status.is-poison { left: 42%; color: #a8ff6a; }
.survivors-meter .survivors-status.is-bound { left: 62%; color: #d8c0ff; }
/* A dart lost to a bind. */
.survivors-dart.is-bound { border: 4px solid var(--ink); background: #3a2a6a; color: #d8c0ff; }
/* Four weapon slots (squares) and four passive slots (circles) across the bottom. */
/* Weapon (square) and passive (round) slots, small, over the bottom corners of the map: weapons
   on the left, passives on the right, clear of the ring guides in the middle. */
.survivors-hud { position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; pointer-events: none; }
.survivors-slots { display: flex; gap: 6px; }
.survivors-slot { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border: 2px dashed rgba(255, 255, 255, 0.45); border-radius: 9px; background: rgba(16, 10, 50, 0.35); }
.survivors-slot.is-filled { border: 3px solid var(--ink); background: var(--cream); box-shadow: 0 2px 0 var(--ink); }
.survivors-slot.is-passive { border-radius: 50%; }
.survivors-slot .survivors-icon { width: 22px; height: 22px; }
.survivors-slot small { position: absolute; right: -6px; bottom: -6px; display: grid; min-width: 17px; height: 17px; place-items: center; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-family: var(--display); font-size: 0.7rem; font-weight: 400; }
.survivors-status { color: #fff; font-family: var(--display); font-size: 1.4rem; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
/* "You died!": a banner over the middle of the arena that arrives a second after the bones, and
   goes away on a tap so the final board can be looked over. */
.survivors-died { position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; gap: 4px; padding: 12px 26px 10px; border: 5px solid var(--ink); border-radius: 22px; background: var(--red); box-shadow: 0 6px 0 var(--ink); color: #fff; text-align: center; cursor: pointer; transform: translate(-50%, -50%) rotate(-4deg); animation: survivors-died-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.survivors-died.is-delayed { animation-delay: 2.3s; }
.survivors-died b { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; line-height: 1; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.survivors-died small { font-size: 0.85rem; font-weight: 900; }
.survivors-died small:last-child { opacity: 0.8; font-size: 0.75rem; }
@keyframes survivors-died-in { from { visibility: hidden; opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(0.5); } }

/* Arena drawing (SVG, in art pixels) */
.sv-arena image { image-rendering: pixelated; }
.sv-band { opacity: 0.16; }
.sv-band.is-red { fill: #ff3b3b; }
.sv-band.is-green { fill: #2fc24a; }
.sv-line { fill: none; stroke: #fff; stroke-width: 0.6; opacity: 0.35; }
.sv-line.is-spawn { stroke-dasharray: 2 2; opacity: 0.22; }
.sv-danger { fill: #ff3b3b; opacity: 0.3; animation: sv-danger 0.9s ease-in-out infinite; }
.sv-label { fill: #fff; font-family: var(--display); font-size: 10px; text-anchor: middle; dominant-baseline: central; stroke: var(--ink); stroke-width: 3px; paint-order: stroke fill; }
.sv-label.is-danger { fill: #ff6a6a; font-size: 12px; }
.sv-shadow { fill: rgba(10, 20, 10, 0.4); }
.sv-hp-back { fill: var(--ink); }
.sv-hp-fill { fill: #ff3b3b; }
.sv-hp-fill.is-elite { fill: var(--yellow); }
.sv-hp-fill.is-brute { fill: #ff8a1f; }
/* The boss: a pulsing red glow; its health shows in the bar across the top of the arena. */
.sv-boss { filter: drop-shadow(0 0 2px #ff3b3b); animation: sv-boss 1.4s ease-in-out infinite; }
@keyframes sv-boss { 50% { filter: drop-shadow(0 0 5px #ff3b3b) drop-shadow(0 0 1px #fff); } }
/* Elites: a pulsing white glow around their outline. */
.sv-elite { filter: drop-shadow(0 0 1.5px #fff); animation: sv-elite 1.2s ease-in-out infinite; }
/* Chests bob and glint once they can be opened; opening one throws out golden rays. */
.sv-chest.is-ready { animation: sv-chest 0.9s ease-in-out infinite; }
.sv-chest-open { opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-chest-open 0.7s ease-out; }
.sv-ray { stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; opacity: 0; animation: sv-fade 0.8s ease-out; }
/* Two-frame walk cycles; each sprite sets its own speed and phase inline. */
.sv-frame-a { animation: sv-frame-a 0.5s linear infinite; }
.sv-frame-b { animation: sv-frame-b 0.5s linear infinite; }
.sv-bob { animation: sv-bob 0.84s ease-in-out infinite; }
.sv-gem { animation: sv-bob 1.6s ease-in-out infinite; }
/* The player's death: the hero topples after the last bites land, and a skull on a pile of bones
   drops into its place. */
.sv-hero-falls { transform-box: fill-box; transform-origin: 50% 100%; animation: sv-hero-falls 0.45s ease-in calc(var(--rt, 0s) + 1.2s) forwards; }
.sv-bones.is-new { transform-box: fill-box; transform-origin: 50% 100%; animation: sv-bones-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) calc(var(--rt, 0s) + 1.5s) backwards; }
/* After a dart: the whip's lash or the nova, white hit flashes, kills popping, damage numbers. */
.sv-slash { fill: #fff; opacity: 0; animation: sv-slash-wash 0.45s ease-out; }
/* The whip's crescent sweeps out along the number, then fades. */
.sv-whip { opacity: 0; animation: sv-whip 0.4s ease-out; }
.sv-nova { fill: rgba(140, 220, 255, 0.35); stroke: #dff6ff; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-nova 0.6s ease-out; }
.sv-hit-flash { opacity: 0; animation: sv-fade 0.35s ease-out; }
.sv-splash { fill: #bfe2ff; opacity: 0; animation: sv-fade 0.5s ease-out; }
/* Pentagram: a red flash over the board and a glowing star that spins in from the centre. */
.sv-penta-flash { fill: #ff3b3b; opacity: 0; animation: sv-penta-flash 0.7s ease-out; }
.sv-pentagram { fill: none; stroke: #ff6a6a; stroke-linejoin: round; filter: drop-shadow(0 0 3px #ff3b3b); opacity: 0; transform-box: view-box; transform-origin: 0 0; animation: sv-pentagram 0.9s ease-out; }
.sv-pentagram polygon { fill: rgba(255, 59, 59, 0.12); }
@keyframes sv-penta-flash { 0% { opacity: 0.3; } 100% { opacity: 0; } }
@keyframes sv-pentagram { 0% { opacity: 0; transform: scale(0.3) rotate(-72deg); } 30% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
/* Clock Lancet: an icy wash on frozen numbers; their monsters are tinted and stop moving. */
.sv-frozen-lane { fill: #bfefff; opacity: 0.28; stroke: #e8fbff; stroke-width: 0.8; stroke-dasharray: 2 2; }
.sv-frozen-lane.is-thawing { animation: sv-pool-out 0.5s ease-in calc(var(--rt, 0s) + 0.9s) both; }
.sv-ice { opacity: 0.5; }
.sv-frozen.sv-bob, .sv-frozen .sv-frame-a, .sv-frozen .sv-frame-b, .sv-frozen .sv-frame { animation-play-state: paused !important; }
.sv-freeze-beam { stroke: #dff6ff; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 2px #5ac8ff); opacity: 0; animation: sv-bolt 0.5s ease-out; }
/* Garlic: a faint breathing aura around the player, and a pulse through it on every dart. */
.sv-garlic { fill: rgba(255, 240, 250, 0.12); stroke: rgba(255, 230, 250, 0.45); stroke-width: 1; stroke-dasharray: 3 3; animation: sv-garlic 2.4s ease-in-out infinite; }
.sv-garlic-pulse { fill: rgba(255, 235, 250, 0.3); stroke: #fff0fa; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-nova 0.55s ease-out; }
.sv-bolt { opacity: 0; animation: sv-bolt 0.45s ease-out; }
.sv-bolt polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.sv-bolt-glow { stroke: #ffe23a; opacity: 0.55; }
.sv-bolt-core { stroke: #fffbe0; }
.sv-bolt-flash { fill: rgba(255, 246, 160, 0.6); }
.sv-fireball { opacity: 0; animation: sv-fireball 0.3s ease-in; }
.sv-fireball-glow { fill: #ff8a1f; stroke: #e0301e; stroke-width: 1.5; }
.sv-fireball-core { fill: #ffe23a; }
.sv-boom { fill: rgba(255, 140, 30, 0.7); stroke: #ffe23a; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-boom 0.4s ease-out 0.25s; }
/* Santa Water: a flickering blue wash; after the monsters' turn it burns once more, then goes out. */
.sv-pool { fill: #3a8cff; opacity: 0.42; animation: sv-pool 0.8s ease-in-out infinite; }
/* Goblin Mine: lobbed in a spinning arc (sideways in .sv-lob, up and down in .sv-lob-arc), it bursts
   or settles on landing; mines on the board blink, and a spent one vanishes as it goes off. */
.sv-lob { opacity: 0; animation: sv-lob 0.5s linear var(--delay); }
.sv-lob-arc { animation: sv-lob-arc 0.5s linear var(--delay); }
.sv-lob-spin { transform-box: fill-box; transform-origin: center; animation: sv-lob-spin 0.5s linear var(--delay); }
/* The Soul Crystal's beam: a red laser that flares and fades along the number. */
.sv-beam { opacity: 0; animation: sv-beam 0.55s ease-out; }
.sv-beam line { stroke-linecap: round; }
.sv-beam-glow { stroke: rgba(255, 40, 60, 0.35); }
.sv-beam-mid { stroke: #ff2a3a; }
.sv-beam-core { stroke: #ffe0e0; }
@keyframes sv-beam { 0% { opacity: 0; } 10%, 55% { opacity: 1; } 100% { opacity: 0; } }
.survivors-ton.is-soul { background: #5a0a1a; }
.survivors-ton.is-soul strong { color: #ffb0b0; }
/* The Spear of Destiny: a spear flies out along the number and fades past the edge, sparks burst on
   what it strikes; Why Won't You Die's second spear glows red. */
.sv-spear { opacity: 0; animation: sv-spear 0.4s ease-in; }
.sv-spear.is-again { filter: drop-shadow(0 0 2px #ff3040) drop-shadow(0 0 1px #ff3040); }
@keyframes sv-spear { 0% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translateX(var(--reach)); } 100% { opacity: 0; transform: translateX(var(--reach)); } }
.sv-spear-spark { fill: rgba(255, 216, 74, 0.6); stroke: #fffbe0; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-boom 0.35s ease-out; }
.sv-spear-spark.is-again { fill: rgba(255, 48, 64, 0.6); stroke: #ffd84a; }
/* The Axe: a big axe swings across its numbers (rotating from --from to --to round the player),
   each spot it cuts flashing; And My Axe!'s return swing glows red. */
.sv-axe { opacity: 0; transform-box: view-box; transform-origin: 0 0; animation: sv-axe 0.35s ease-in-out; }
.sv-axe-trail { fill: none; stroke: #ffffff; stroke-linecap: round; opacity: 0.45; }
.sv-axe.is-again .sv-axe-trail { stroke: #ff4050; opacity: 0.6; }
.sv-axe.is-again image { filter: drop-shadow(0 0 2px #ff3040); }
@keyframes sv-axe { 0% { opacity: 1; transform: rotate(var(--from)); } 85% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--to)); } }
.sv-axe-cut { fill: #fff; opacity: 0; animation: sv-slash-wash 0.35s ease-out; }
.sv-axe-cut.is-again { fill: #ff6070; }
/* Poison Daggers: daggers fly out like the spear, the poisoned spots wash green, and a poisoned
   monster pulses green with a green health bar. */
.sv-venom-wash { fill: #6ad02a; opacity: 0; animation: sv-slash-wash 0.5s ease-out; }
.sv-venom { opacity: 0.35; animation: sv-venom 1.2s ease-in-out infinite; }
@keyframes sv-venom { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.45; } }
.sv-hp-fill.is-venom { fill: #6ad02a; }
/* The SawGus: blades spin; the marks on the spots it'll grind next sit faint and swing round one
   number (18 degrees) after each dart; on a dart a blade whips out from the player and back. */
.sv-spin { transform-box: fill-box; transform-origin: center; animation: sv-spin 0.35s linear infinite; }
.sv-spin.is-slow { animation-duration: 1.4s; }
@keyframes sv-spin { to { transform: rotate(360deg); } }
.sv-saw-marks { opacity: 0.55; }
.sv-saw-marks.is-turning { animation: sv-saw-turn 0.3s ease-in-out 0.5s both; }
@keyframes sv-saw-turn { from { transform: rotate(-18deg); } }
.sv-saw-fling { opacity: 0; animation: sv-saw-fling 0.55s ease-out; }
@keyframes sv-saw-fling { 0% { opacity: 1; transform: none; } 36%, 60% { opacity: 1; transform: translate(var(--to-x), var(--to-y)); } 100% { opacity: 0; transform: none; } }
/* An archer's arrow (spit, fire and magic are drawn as globs) flies on Goblin Mine's lob arc, slower
   than a mine so the volley is easy to follow; it plays on its own before the rest of the round. */
.sv-lob.sv-shot, .sv-lob.sv-shot .sv-lob-arc { animation-duration: 0.9s; }
.sv-shot-hit { opacity: 0; animation: sv-hurt 0.4s ease-out; }
.sv-number.is-shot { fill: #ff8a6a; font-size: 9px; }
.sv-number.is-poison { fill: #8aff5a; font-size: 10px; }
.sv-number.is-mend { fill: #7dff8a; font-size: 8px; }
.sv-mend { stroke: #7dff8a; stroke-width: 1.2; stroke-dasharray: 2 2; opacity: 0; animation: sv-mend 0.6s ease-out calc(var(--rt, 0s) + 0.75s); }
@keyframes sv-mend { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.sv-bind-chain { opacity: 0; animation: sv-bind 1.6s ease-out; }
@keyframes sv-bind { 0% { opacity: 0; transform: scale(1.6); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* What a monster does, in a little badge over its head: shoots, binds, poisons, heals or explodes. */
.sv-badge circle { stroke: #1d1747; stroke-width: 0.6; }
.sv-arrow-shaft { stroke: #6a4628; stroke-width: 1.2; stroke-linecap: round; }
.sv-arrow-head { fill: #d8dce8; stroke: #1d1747; stroke-width: 0.5; }
.sv-arrow-fletch { stroke: #ff6a6a; stroke-width: 0.9; stroke-linecap: round; }
.sv-mine-land { transform-box: fill-box; transform-origin: 50% 100%; animation: sv-mine-land 0.3s ease-out backwards; }
.sv-mine-spent { animation: sv-pool-out 0.05s linear both; }
.sv-mine-glow { fill: #ff4a1a; transform-box: fill-box; transform-origin: center; animation: sv-mine-glow 1s ease-in-out infinite; }
.sv-mine-boom { fill: rgba(255, 120, 30, 0.8); stroke: #ffe23a; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-mine-boom 0.45s ease-out; }
/* Thor's Ton: the hammer falls and spins upright to land at 0.45s (HAMMER_IMPACT in survivors-pixel.js),
   the board flashes and quakes, and a shockwave rolls out to the doubles. A critical hammer is gold. */
.sv-hammer { opacity: 0; animation: sv-hammer 1.1s linear; }
.sv-hammer-flash { fill: #ffffff; opacity: 0; animation: sv-hammer-flash 0.4s ease-out; }
.sv-hammer-flash.is-crit { fill: #ffe23a; }
.sv-shockwave { fill: none; stroke: #ffffff; stroke-width: 4; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-shockwave 0.7s ease-out; }
.sv-shockwave.is-crit { stroke: #ffd23f; stroke-width: 6; }
.sv-hammer-bolt .sv-bolt { animation-delay: inherit; }
.sv-quake { animation: sv-quake 0.6s linear; }
/* Mirror Shot: a shimmering beam across the board to the ghost dart's spot. */
.sv-mirror-beam { stroke: #e8d8ff; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 4 3; opacity: 0; animation: sv-mirror-beam 0.7s ease-out; filter: drop-shadow(0 0 2px #b080ff); }
.sv-mirror-flash { fill: none; stroke: #c8a8ff; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-shockwave 0.5s ease-out 0.15s; }
.sv-pool-out { animation: sv-pool-out 0.4s ease-in calc(var(--rt, 0s) + 1.45s) both; }
.sv-dying { opacity: 0; transform-box: fill-box; transform-origin: center; animation: sv-die 0.5s ease-out; }
.sv-spark { fill: #fff6c8; opacity: 0; animation: sv-spark 0.5s ease-out; }
.sv-number { fill: #fff; font-family: var(--display); font-size: 9px; text-anchor: middle; stroke: var(--ink); stroke-width: 2.5px; paint-order: stroke fill; opacity: 0; animation: sv-float 0.9s ease-out forwards; }
.sv-number.is-kill { fill: var(--yellow); }
/* A critical hit (a limit-broken weapon, a critical hammer): bigger, orange-gold. */
.sv-number.is-crit { fill: #ffb020; font-size: 12px; }
.sv-number.is-hurt { fill: #ff6a6a; font-size: 11px; animation-delay: calc(var(--rt, 0s) + 0.55s); }
.sv-number.is-heal { fill: #7dff8a; font-size: 9px; animation-delay: calc(var(--rt, 0s) + 0.95s); }
.sv-thorn { stroke: #dfe6f5; stroke-width: 1.6; stroke-linecap: round; opacity: 0; animation: sv-fade 0.4s ease-out calc(var(--rt, 0s) + 0.55s); }
/* After the bats' turn: gems fly to the player, biters lunge, the player flinches, the rest creep in. */
.sv-gem-fly { animation: sv-gem-fly 0.55s ease-in both; }
.sv-lunge { animation: sv-lunge 0.35s ease-in-out calc(var(--rt, 0s) + 0.45s); }
.sv-hero.is-hurt { animation: sv-shake 0.15s linear calc(var(--rt, 0s) + 0.6s) 4; }
.sv-hurt-flash { opacity: 0; animation: sv-hurt 0.6s ease-out calc(var(--rt, 0s) + 0.6s); }
.sv-step { animation: sv-step 0.45s ease-in-out calc(var(--rt, 0s) + 0.95s) both; }
/* Damage numbers stay hidden until their own moment (forwards, not both: during a delay the first
   keyframe would show them already). A monster the second Santa Water burn kills walks in, and one
   the Holy Bible kills stands until the sweep reaches it; then it vanishes as it dies there. */
.sv-doomed { animation: sv-vanish 0.01s linear forwards; }
/* The Holy Bible flies once round its ring from the number hit (--start, its angle), a golden
   trail behind it. */
.sv-sweep { opacity: 0; transform-box: view-box; transform-origin: 0 0; animation: sv-sweep 0.9s linear; }
.sv-sweep-trail { fill: none; stroke: #ffe680; stroke-linecap: round; opacity: 0.55; filter: drop-shadow(0 0 3px #ffd21f); }
.sv-sweep image { filter: drop-shadow(0 0 2px #fff6a0); }
.sv-sweep.is-super .sv-sweep-trail { stroke: #fff6c8; opacity: 0.8; }
@keyframes sv-sweep { 0% { opacity: 1; transform: rotate(var(--start)); } 90% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--start) + 360deg)); } }
@keyframes sv-vanish { from { opacity: 1; } to { opacity: 0; } }
.sv-arrive { animation: sv-arrive 0.5s ease-out calc(var(--rt, 0s) + 1.2s) both; }
.sv-split { animation: sv-step 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) 0.15s both; }
@keyframes sv-frame-a { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
/* Monster frames: with N frames, each is shown for 1/N of the cycle (its delay sets which part). */
@keyframes sv-frames-2 { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes sv-frames-3 { 0%, 33.2% { opacity: 1; } 33.3%, 100% { opacity: 0; } }
@keyframes sv-frames-4 { 0%, 24.9% { opacity: 1; } 25%, 100% { opacity: 0; } }
@keyframes sv-frames-6 { 0%, 16.5% { opacity: 1; } 16.6%, 100% { opacity: 0; } }
@keyframes sv-frames-8 { 0%, 12.4% { opacity: 1; } 12.5%, 100% { opacity: 0; } }
@keyframes sv-frame-b { 0%, 49.9% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes sv-bob { 50% { transform: translateY(-1.5px); } }
@keyframes sv-elite { 50% { filter: drop-shadow(0 0 3.5px #fff) drop-shadow(0 0 1px #fff); } }
@keyframes sv-chest { 50% { transform: translateY(-2px); filter: drop-shadow(0 0 3px #ffe23a); } }
@keyframes sv-chest-open { 0% { opacity: 1; transform: scale(1); } 40% { opacity: 1; transform: scale(1.6) translateY(-4px); } 100% { opacity: 0; transform: scale(1.8) translateY(-8px); } }
@keyframes sv-danger { 50% { opacity: 0.12; } }
@keyframes sv-fade { from { opacity: 0.85; } to { opacity: 0; } }
@keyframes sv-slash-wash { from { opacity: 0.35; } to { opacity: 0; } }
@keyframes sv-whip { 0% { opacity: 1; transform: none; } 60% { opacity: 1; } 100% { opacity: 0; transform: translateX(var(--reach)); } }
@keyframes sv-garlic { 50% { fill: rgba(255, 240, 250, 0.2); } }
@keyframes sv-bolt { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sv-fireball { 0% { opacity: 1; transform: none; } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)); } }
@keyframes sv-boom { from { opacity: 1; transform: scale(0.3); } to { opacity: 0; transform: scale(1.2); } }
@keyframes sv-pool { 50% { opacity: 0.25; } }
@keyframes sv-pool-out { to { opacity: 0; } }
@keyframes sv-lob { from { opacity: 1; transform: none; } to { opacity: 1; transform: translate(var(--to-x), var(--to-y)); } }
@keyframes sv-lob-arc { 0% { transform: none; animation-timing-function: cubic-bezier(0.3, 0.6, 0.5, 1); } 50% { transform: translateY(var(--arc)); animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.4); } 100% { transform: none; } }
@keyframes sv-lob-spin { to { transform: rotate(540deg); } }
@keyframes sv-mine-land { 0% { opacity: 0; transform: scale(1.5, 0.6); } 60% { opacity: 1; transform: scale(0.85, 1.15); } 100% { transform: none; } }
@keyframes sv-mine-glow { 50% { transform: scale(1.25); } }
@keyframes sv-mine-boom { 0% { opacity: 1; transform: scale(0.3); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes sv-hammer { 0% { opacity: 1; transform: translate(-40px, -170px) rotate(-60deg); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.6); } 41% { opacity: 1; transform: none; } 46% { transform: translateY(2px) scale(1.05, 0.95); } 52%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes sv-hammer-flash { 0% { opacity: 0.6; } 100% { opacity: 0; } }
@keyframes sv-shockwave { 0% { opacity: 0.95; transform: scale(0.08); } 100% { opacity: 0; transform: scale(1); } }
@keyframes sv-quake { 0%, 70%, 100% { transform: none; } 10% { transform: translate(2.5px, -1.5px); } 20% { transform: translate(-2.5px, 1.5px); } 30% { transform: translate(2px, 1.5px); } 40% { transform: translate(-1.5px, -2px); } 55% { transform: translate(1px, 0.5px); } }
@keyframes sv-mirror-beam { 0% { opacity: 0; stroke-dashoffset: 14; } 20% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes sv-nova { from { opacity: 1; transform: scale(0.3); } to { opacity: 0; transform: scale(1.05); } }
@keyframes sv-die { from { opacity: 1; transform: scale(1.1); } to { opacity: 0; transform: scale(0.2); } }
@keyframes sv-spark { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate(var(--to-x), var(--to-y)); } }
@keyframes sv-float { 0% { opacity: 1; transform: translateY(2px); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes sv-gem-fly { 0%, 85% { opacity: 1; } 0% { transform: none; } 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)); } }
@keyframes sv-hero-falls { 35% { transform: rotate(-10deg); } 100% { opacity: 0; transform: rotate(85deg) translateY(3px); } }
@keyframes sv-bones-in { from { opacity: 0; transform: scale(0.4, 0.1); } }
@keyframes sv-lunge { 50% { transform: translate(var(--to-x), var(--to-y)); } }
@keyframes sv-shake { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes sv-hurt { 0%, 40% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes sv-step { from { transform: translate(var(--from-x), var(--from-y)); } to { transform: none; } }
@keyframes sv-arrive { from { opacity: 0; transform: translate(var(--from-x), var(--from-y)); } }

/* Level up: three big upgrade cards over the game; after the bats' turn it waits for their moves to play out. */
.survivors-levelup { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(16, 10, 50, 0.72); animation: sv-overlay-in 0.25s ease-out both; }
.survivors-levelup.is-delayed { animation-delay: 1.8s; }
.survivors-levelup-panel { width: min(1000px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 18px 26px 28px; border: 6px solid var(--ink); border-radius: 40px; background: #2a1d66; box-shadow: 0 10px 0 var(--ink), 0 30px 90px rgba(10, 6, 40, 0.5); text-align: center; }
.survivors-levelup h2 { margin: 0; color: var(--yellow); font-size: clamp(3rem, 6vw, 4.6rem); text-transform: uppercase; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; animation: sv-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: inherit; }
.survivors-levelup p { margin: 0; color: #fff; font-size: 1.2rem; font-weight: 900; }
.survivors-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 18px; }
.survivors-card { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 18px 14px 20px; border: 5px solid var(--ink); border-radius: 28px; background: var(--cream); box-shadow: var(--pop); color: var(--ink); text-align: center; transition: transform 80ms ease, box-shadow 80ms ease; }
.survivors-card:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.survivors-card-icon { display: grid; width: 84px; height: 84px; place-items: center; border: 4px solid var(--ink); border-radius: 20px; background: #2a1d66; }
.survivors-card-icon .survivors-icon { width: 60px; height: 60px; }
.survivors-card-badge { padding: 2px 12px; border-radius: 10px; background: var(--ink); color: var(--yellow); font-family: var(--display); font-size: 1rem; }
.survivors-card strong { font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.survivors-card-text { font-size: 1.05rem; font-weight: 800; line-height: 1.3; }
@keyframes sv-overlay-in { from { opacity: 0; visibility: hidden; } }
@keyframes sv-stamp { from { opacity: 0; transform: rotate(-8deg) scale(0.2); } }

@media (max-height: 780px) and (min-width: 761px) {
  .survivors-legend { display: none; }
  .survivors-board-panel { gap: 6px; padding: 10px; }
  .survivors-dart strong { font-size: 1.4rem; }
}
@media (max-width: 760px) {
  .survivors-layout { grid-template-columns: 1fr; }
  .survivors-board { width: min(100%, 320px); height: auto; aspect-ratio: 1; }
  .survivors-current > .survivors-arena-frame { flex: none; height: 70vw; }
}

/* Boss fight: the boss's health and how soon it reaches the player, across the top of the arena. */
/* Stage clear: a banner with the boss's prize, over the emptied arena. */
.survivors-stage-clear { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(16, 10, 50, 0.45); animation: sv-overlay-in 0.4s ease-out both; }
.survivors-stage-clear > b { color: var(--yellow); font-family: var(--display); font-size: clamp(2.6rem, 5.4vw, 3.8rem); font-weight: 400; line-height: 1; text-transform: uppercase; -webkit-text-stroke: 11px var(--ink); paint-order: stroke fill; animation: sv-stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.survivors-stage-clear > small { padding: 2px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-family: var(--display); font-size: 1.1rem; }
.survivors-stage-clear .survivors-treasure-card { animation: sv-stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.2s both; }
.survivors-prizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 94%; }
.survivors-prizes .survivors-treasure-card { flex: 1 1 0; min-width: 0; max-width: 260px; padding: 10px 14px 12px; }
.survivors-prizes .survivors-treasure-card > b { font-size: 1.7rem; }
.survivors-prizes .survivors-treasure-card strong { font-size: 1.3rem; }
.survivors-prizes .survivors-treasure-card small { font-size: 0.85rem; }

/* A new zone: the old ground fades away underneath a banner naming the new one. */
@keyframes sv-ground-out { from { opacity: 1; } to { opacity: 0; } }
.survivors-zone-banner { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 4px; pointer-events: none; animation: sv-zone-banner 3.6s ease-in-out 4s both; }
.survivors-zone-banner b { color: #fff; font-family: var(--display); font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 400; line-height: 1; text-transform: uppercase; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; }
.survivors-zone-banner em { color: var(--yellow); font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-style: normal; line-height: 1; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.survivors-zone-banner small { padding: 2px 14px; border-radius: 10px; background: var(--ink); color: var(--yellow); font-family: var(--display); font-size: 1.2rem; }
@keyframes sv-zone-banner { 0% { opacity: 0; transform: scale(0.6); } 15%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }

/* Treasure: a chest's prize pops up over the arena, then fades by itself; darts keep counting. */
.survivors-treasure { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; animation: sv-treasure 2.8s ease-in-out both; }
.survivors-treasure-card { display: grid; justify-items: center; gap: 4px; padding: 12px 22px 16px; border: 5px solid var(--ink); border-radius: 26px; background: var(--cream); box-shadow: var(--pop), 0 0 40px rgba(255, 210, 31, 0.8); text-align: center; }
.survivors-treasure-card > b { color: var(--yellow); font-family: var(--display); font-size: 2.2rem; font-weight: 400; line-height: 1; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.survivors-treasure-card .survivors-icon { width: 54px; height: 54px; }
.survivors-treasure-card strong { font-family: var(--display); font-size: 1.6rem; font-weight: 400; line-height: 1; }
.survivors-treasure-card small { max-width: 240px; font-size: 0.95rem; font-weight: 800; }
@keyframes sv-treasure { 0% { opacity: 0; transform: scale(0.4) rotate(-6deg); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }

/* Light Riders: a neon night grid; the steering board and darts on the left, the arena on the right */
body:has(.is-playing-riders:not([hidden])) {
  background-color: #120c3a;
  background-image: linear-gradient(rgba(0, 229, 255, 0.07) 2px, transparent 2px), linear-gradient(90deg, rgba(0, 229, 255, 0.07) 2px, transparent 2px);
  background-size: 48px 48px;
}
.is-playing-riders .x01-title h2 { color: #00e5ff; font-size: clamp(2rem, 3.6vw, 3rem); white-space: nowrap; }
.riders-layout { display: grid; grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr); gap: 22px; }
.riders-board-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-items: center; gap: 10px; min-width: 0; min-height: 0; padding: 14px; overflow: hidden; border: 5px solid var(--ink); border-radius: 44px; background: #2a1d66; box-shadow: var(--pop); }
.riders-board-title { display: grid; justify-items: center; gap: 4px; color: #fff; text-align: center; }
.riders-board-title .x01-overline { background: #00e5ff; color: var(--ink); }
.riders-board-title small { font-size: 0.95rem; font-weight: 900; opacity: 0.85; }
.riders-board { width: 100%; max-width: 440px; height: 100%; min-height: 0; }
.riders-board svg { display: block; width: 100%; height: 100%; }
.riders-board .dart-segment.is-custom { fill: var(--section-color); stroke: var(--ink); stroke-width: 1.5; }
.riders-board .dart-segment.is-custom.dart-segment-odd { filter: brightness(0.82); }
.riders-board svg[role="group"] .dart-segment { cursor: pointer; }
.riders-board .dartboard-number[data-riders="blocked"] { fill: #ff3b5c; opacity: 0.7; }
.riders-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; color: #fff; font-size: 0.95rem; font-weight: 900; }
.riders-legend span { display: inline-flex; align-items: center; gap: 6px; }
.riders-legend span::before { content: ""; width: 14px; height: 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--chip); }
.riders-darts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.riders-dart { display: grid; justify-items: center; min-width: 0; padding: 6px; border: 4px dashed rgba(255, 255, 255, 0.5); border-radius: 18px; color: #fff; }
.riders-dart span { font-size: 0.75rem; letter-spacing: 0.08em; }
.riders-dart strong { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1.05; }
.riders-dart small { overflow: hidden; max-width: 100%; font-size: 0.8rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.riders-dart.is-thrown { border: 4px solid var(--ink); background: #fff; box-shadow: var(--pop-sm); color: var(--ink); animation: enter 0.25s ease-out; }
.riders-dart.is-turbo { background: var(--yellow); }
.riders-dart.is-jump { background: #b5f5ff; }
.riders-dart.is-skid { background: #e4e0f7; }
.riders-dart.is-crash { background: var(--red); color: #fff; }
.riders-dart.is-crash strong, .riders-dart.is-crash small { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.riders-arrow { display: inline-block; font-size: 0.8em; font-style: normal; transform: rotate(calc(var(--heading) - 90deg)); }
.riders-dart.is-turbo .riders-arrow, .riders-dart.is-jump .riders-arrow, .riders-dart.is-skid .riders-arrow { opacity: 0.6; }

.x01-current.riders-current { gap: 10px; padding: 12px 16px 14px; }
.riders-current > * { flex-shrink: 0; }
.riders-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.riders-header > div { display: grid; flex: 1; justify-items: start; gap: 2px; min-width: 0; }
.riders-header .x01-overline { padding: 3px 10px; font-size: 0.95rem; }
/* Room under the line for the outline, so the name isn't clipped (overflow hides only the sides' spill). */
.riders-header h3 { overflow: hidden; max-width: 100%; margin: 0; padding: 0.06em 0.2em 0.18em; color: #fff; font-size: clamp(1.7rem, 2.8vw, 2.3rem); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; }
.riders-header > .x01-avatar { width: 56px; height: 56px; }
.riders-roster { display: grid; grid-template-columns: repeat(var(--riders, 4), minmax(0, 1fr)); gap: 10px; padding-top: 8px; }
.riders-chip { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 12px 4px 4px; border: 4px solid var(--ink); border-radius: 999px; background: rgba(255, 255, 255, 0.82); }
.riders-chip .x01-avatar { width: 40px; height: 40px; border-width: 3px; background: var(--player-color); font-size: 1.1rem; -webkit-text-stroke: 4px var(--ink); }
.riders-chip-copy { display: grid; flex: 1; min-width: 0; }
.riders-chip b { overflow: hidden; padding-right: 1px; font-family: var(--display); font-size: 1.25rem; font-weight: 400; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.riders-chip small { color: var(--ink-soft); font-size: 0.8rem; font-weight: 900; line-height: 1.1; }
.riders-chip em { position: absolute; top: -17px; right: 10px; padding: 1px 8px; border: 3px solid var(--ink); border-radius: 10px; background: var(--yellow); color: var(--ink); font-family: var(--display); font-size: 0.85rem; font-style: normal; transform: rotate(5deg); }
.riders-chip.is-current { background: #fff; box-shadow: var(--pop-sm); }
.riders-chip.is-current em { animation: throb 0.9s ease-in-out infinite; }
.riders-chip.is-out { opacity: 0.55; }
.riders-chip.is-out small { color: var(--red); }
.riders-chip.is-winner { background: var(--yellow); box-shadow: var(--pop-sm); }
.riders-chip.is-winner em { background: #fff; }
/* No frame of its own: the canvas draws the arena straight onto the card. */
.riders-current > .riders-arena-frame { position: relative; flex: 1 1 0; min-height: 200px; }
.riders-arena-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The stamp lands once the rider gets there; a crash stamp then clears off so the wreck shows. */
.riders-stamp { width: 34%; max-width: 230px; font-size: clamp(1.8rem, 4vw, 3rem); }
.riders-stamp.is-crash { animation: boardwalk-stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both, riders-stamp-out 0.4s ease-in forwards; }
.riders-stamp.is-winner { top: 18%; }
@keyframes riders-stamp-out { to { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.3); } }
.riders-stamp.is-crash { --stamp-color: var(--red); }
.riders-stamp.is-winner { --stamp-color: var(--yellow); color: #fff; }
.riders-status { flex: 1; min-width: 0; color: #fff; font-size: 1.15rem; font-weight: 900; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
/* Narrower iPads: slimmer chips leave the names more room. */
@media (max-width: 1100px) {
  .riders-roster { gap: 6px; }
  .riders-chip { gap: 5px; padding-right: 8px; }
  .riders-chip .x01-avatar { width: 32px; height: 32px; font-size: 0.95rem; }
  .riders-chip em { right: 4px; }
}
@media (max-height: 780px) and (min-width: 761px) {
  .riders-board-title small { display: none; }
  .riders-dart strong { font-size: 1.4rem; }
}
@media (max-width: 760px) {
  .riders-layout { grid-template-columns: 1fr; }
  .riders-board { height: 70vw; max-height: 420px; }
  .riders-current > .riders-arena-frame { flex: none; height: 72vw; }
  .riders-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tank Arena: Light Riders' layout, dressed as a battlefield of olive drab and hazard yellow */
body:has(.is-playing-tanks:not([hidden])) {
  background-color: #2f4a24;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 24px, transparent 24px 48px);
  background-size: auto;
}
.is-playing-tanks .x01-title h2 { color: var(--yellow); }
.is-playing-tanks .riders-board-panel { background: #3d5a2c; }
.is-playing-tanks .riders-board-title .x01-overline { background: var(--yellow); }
.tanks-dart.is-drive { background: #c4ecff; }
.tanks-dart.is-hit { background: var(--red); color: #fff; }
.tanks-dart.is-hit strong, .tanks-dart.is-hit small { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.tanks-dart.is-wide, .tanks-dart.is-dud { background: #e4e0f7; }
.tanks-dart.is-wide .riders-arrow, .tanks-dart.is-dud .riders-arrow { opacity: 0.6; }
.is-playing-tanks .riders-chip small { color: var(--red); letter-spacing: 0.05em; }
.is-playing-tanks .riders-chip small i { color: rgba(29, 23, 71, 0.25); font-style: normal; }
.tanks-dart.is-prize { background: var(--yellow); }
.tanks-power { display: inline-block; margin-left: 4px; padding: 0 5px; border: 2px solid var(--ink); border-radius: 8px; background: var(--power); color: var(--ink); font-size: 0.65rem; letter-spacing: 0; vertical-align: 1px; }
.riders-stamp.tanks-winner { top: 50%; width: min(52%, 330px); max-width: none; align-content: center; gap: 2px; font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.tanks-winner .x01-avatar { width: 38%; height: auto; aspect-ratio: 1; border-width: 5px; font-size: clamp(1.6rem, 3.4vw, 2.6rem); -webkit-text-stroke: 8px var(--ink); box-shadow: var(--pop-sm); transform: rotate(8deg); }
