:root {
  color-scheme: dark;
  --bg: #0b151b;
  --surface: #17252c;
  --surface-high: #203239;
  --border: rgba(228, 242, 239, 0.11);
  --text: #f6f4eb;
  --muted: #a9bbb8;
  --lime: #daf27d;
  --mint: #78decd;
  --orange: #ffa273;
  --avatar-outline: #e9e6dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(circle at 80% -15%, #233d3c 0, transparent 45%), var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
[hidden] { display: none !important; }

.site-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(100%, 1200px); min-height: 100dvh; margin: auto; }
.site-header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 30px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.12rem; font-weight: 900; letter-spacing: 0.06em; text-decoration: none; white-space: nowrap; }
.brand-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid var(--lime); border-radius: 50%; color: var(--lime); font-size: 1.8rem; line-height: 1; }
.header-right { display: flex; align-items: center; gap: 10px; }
.prototype-label, .eyebrow, .next-step small { color: var(--mint); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.15em; }
.connection-pill { display: inline-flex; min-height: 39px; align-items: center; gap: 8px; padding: 0 6px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: #17272d; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.connection-pill:hover { border-color: color-mix(in srgb, var(--mint), transparent 55%); background: #21353a; }
.connection-pill:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.connection-pill #connectionText { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.connection-action { padding: 6px 10px; border-radius: 999px; background: #2b403f; color: var(--mint); font-size: 0.72rem; font-weight: 850; }
.connection-pill[data-state="connected"] .connection-action { color: var(--muted); background: #24363a; }
.connection-pill i { width: 8px; height: 8px; border-radius: 50%; background: #738481; }
.connection-pill[data-state="connected"] { color: var(--mint); }
.connection-pill[data-state="connected"] i { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.connection-pill[data-state="connecting"] i { background: var(--lime); animation: blink 1s infinite; }
.connection-pill[data-state="error"] i { background: var(--orange); }

main { min-width: 0; padding: 16px 30px 24px; }
.view { animation: enter 220ms ease-out; }
.view-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.view-heading .eyebrow { margin: 0 0 6px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 850; letter-spacing: -0.025em; line-height: 1.05; }
h2 { margin: 3px 0 0; font-size: clamp(1.25rem, 2.2vw, 1.6rem); letter-spacing: -0.035em; line-height: 1.1; }
.view-subtitle { margin: 0; color: var(--muted); font-size: 0.95rem; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.connect-note { margin: -4px 0 16px; padding: 11px 14px; border: 1px solid rgba(255, 162, 115, 0.35); border-radius: 12px; background: rgba(255, 162, 115, 0.09); color: #ffcfb4; font-size: 0.84rem; }
.button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 1px solid transparent; border-radius: 16px; font-size: 1rem; font-weight: 800; white-space: nowrap; }
.button-primary { background: var(--lime); color: #13221b; }
.button-primary:hover { background: #e5faa4; }
.button-quiet { border-color: var(--border); background: var(--surface); color: var(--text); }
.button-quiet:hover { background: var(--surface-high); }
.button:focus-visible, .tab-bar a:focus-visible, .profile-tile:focus-visible, .profile-close:focus-visible, .game-card:focus-visible, .next-step:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr); gap: 14px; }
.surface { min-width: 0; border: 1px solid var(--border); border-radius: 26px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12); }
.board-surface { min-height: 394px; padding: 20px 22px 16px; }
.surface-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.surface-heading .eyebrow { margin: 0; }
.mini-badge, .count-badge, .preview-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--mint); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.board-content { display: grid; place-items: center; }
.board-graphic { width: min(100%, 440px, calc(100dvh - 315px)); }
.board-graphic svg { display: block; width: 100%; aspect-ratio: 1; }
.dartboard-surround { fill: #0b171c; stroke: #72817f; stroke-width: 1.5; }
.dartboard-face { fill: #22383d; stroke: #879493; stroke-width: 1.5; }
.dartboard-number { fill: #e9e7db; font-size: 17px; font-weight: 700; pointer-events: none; }
.dart-segment { stroke: #627576; stroke-width: 0.75; transition: fill 150ms ease; }
.dart-segment-single.dart-segment-even { fill: #d5d0c2; }
.dart-segment-single.dart-segment-odd { fill: #2b4949; }
.dart-segment-band.dart-segment-even, .dart-segment-ib { fill: #c95560; }
.dart-segment-band.dart-segment-odd, .dart-segment-ob { fill: #39a782; }
.dart-segment.is-recent-hit { animation: board-hit 1.4s ease-out; }
.home-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; min-width: 0; }
.recent-surface { min-height: 310px; padding: 20px; }
.count-badge { min-width: 30px; padding: 0 8px; color: var(--text); }
.recent-list { display: grid; gap: 0; margin: 13px 0 0; padding: 0; list-style: none; }
.recent-list li { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); }
.recent-list .empty-copy { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.throw-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.throw-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: rgba(218, 242, 125, 0.13); color: var(--lime); font-weight: 900; }
.throw-main span:last-child { overflow: hidden; font-size: 0.9rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.throw-score { color: var(--mint); font-weight: 800; white-space: nowrap; }
.next-step { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-radius: 22px; background: var(--orange); color: #2b1b14; text-align: left; }
.next-step span:first-child { display: grid; gap: 4px; }
.next-step small { color: #603b2e; }
.next-step strong { font-size: 1.02rem; }
.next-arrow { font-size: 1.7rem; line-height: 1; }

.preview-chip { color: var(--orange); }
.games-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.game-card { display: grid; align-content: space-between; min-height: 290px; padding: 22px; border: 1px solid var(--border); border-radius: 26px; background: var(--surface); color: var(--text); text-align: left; transition: transform 160ms ease, background 160ms ease; }
.game-card:hover { transform: translateY(-3px); background: var(--surface-high); }
.game-card-top { display: flex; align-items: start; justify-content: space-between; }
.game-symbol { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 19px; background: var(--game-color); color: #10211f; font-size: 2.2rem; font-weight: 900; }
.game-symbol.is-number { font-size: 1.6rem; letter-spacing: -0.04em; }
.game-card small { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.game-card h2 { margin: 0 0 8px; font-size: 1.8rem; }
.game-card p { margin: 0; color: var(--muted); font-size: 0.91rem; line-height: 1.45; }
.game-card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.game-card-arrow { color: var(--game-color); font-size: 1.55rem; }
.game-detail { display: grid; gap: 14px; max-width: 880px; padding: 22px; }
.detail-back { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--mint); font-weight: 800; }
.game-detail-heading { display: flex; align-items: center; gap: 15px; }
.detail-symbol { display: grid; width: 60px; height: 60px; flex: 0 0 auto; place-items: center; border-radius: 19px; background: var(--game-color); color: #10211f; font-size: 2rem; }
.game-detail h2 { margin: 0; font-size: 2.4rem; }
.game-detail p { margin: 0; color: var(--muted); line-height: 1.5; }
.lineup-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.lineup-header .eyebrow { color: var(--mint); }
.lineup-header h3 { margin: 1px 0 0; font-size: 1.55rem; letter-spacing: -0.03em; }
.lineup-count { color: var(--muted); font-size: 0.82rem; font-weight: 750; white-space: nowrap; }
.lineup-count-picker { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; font-weight: 800; }
.lineup-count-picker select, .lineup-count-picker strong { min-width: 80px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: #102127; color: var(--text); font-weight: 850; }
.lineup-count-picker strong { display: inline-flex; align-items: center; }
.lineup-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 330px; overflow-y: auto; padding: 2px; }
.lineup-slot { display: flex; min-width: 0; align-items: center; border: 1px dashed #668080; border-radius: 17px; background: #102127; }
.lineup-slot.is-filled { border-style: solid; border-color: var(--border); }
.lineup-slot-pick { display: flex; min-width: 0; min-height: 84px; flex: 1; align-items: center; gap: 12px; padding: 9px 12px; border: 0; background: transparent; color: var(--text); text-align: left; }
.lineup-slot-pick:hover { background: #1c343b; }
.lineup-slot-pick:focus-visible, .lineup-slot-remove:focus-visible, .character-choice:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.lineup-slot-avatar, .ready-player > span:first-child { display: grid; width: 56px; height: 56px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 2px solid var(--avatar-outline); border-radius: 50%; background: var(--player-color); color: #fff; font-size: 1.18rem; font-weight: 900; text-shadow: 0 1px 3px #000c; }
.lineup-slot:not(.is-filled) .lineup-slot-avatar { border-style: dashed; background: #284147; color: var(--mint); font-size: 2rem; font-weight: 500; }
.lineup-slot-avatar img, .ready-player img { width: 100%; height: 100%; object-fit: cover; }
.ready-player > span:first-child { width: 44px; height: 44px; font-size: 0.96rem; }
.lineup-slot-copy { display: grid; gap: 3px; min-width: 0; }
.lineup-slot-copy small { color: var(--mint); font-size: 0.67rem; font-weight: 850; letter-spacing: 0.1em; }
.lineup-slot-copy strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.lineup-slot-edit { margin-left: auto; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.lineup-slot-remove { width: 40px; height: 44px; flex: 0 0 auto; margin-right: 8px; border: 0; border-radius: 11px; background: #294047; color: var(--text); font-size: 1.5rem; }
.lineup-slot-remove:hover { background: #60403c; }
.lineup-empty { grid-column: 1 / -1; padding: 18px; border: 1px dashed var(--border); border-radius: 14px; }
.lineup-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.lineup-secondary { display: flex; flex-wrap: wrap; gap: 10px; }
.game-rules { padding-top: 2px; color: var(--muted); font-size: 0.85rem; }
.game-rules summary { width: fit-content; color: var(--mint); font-weight: 800; cursor: pointer; }
.game-rules p { max-width: 720px; margin-top: 8px; }
.character-dialog { width: min(830px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; border: 1px solid #516567; border-radius: 26px; background: #17252c; color: var(--text); box-shadow: 0 25px 90px #000b; }
.character-dialog::backdrop { background: #061115ca; backdrop-filter: blur(7px); }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.character-choice { display: grid; justify-items: center; align-content: start; gap: 9px; min-width: 0; min-height: 180px; padding: 16px 8px; border: 1px solid var(--border); border-radius: 20px; background: #102127; color: var(--text); font-weight: 850; text-align: center; }
.character-choice:not(:disabled):hover { border-color: var(--avatar-outline); background: #20383d; }
.character-choice:disabled { opacity: 0.42; }
.character-choice-avatar { display: grid; width: min(100%, 108px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 3px solid var(--avatar-outline); border-radius: 50%; background: var(--player-color); font-size: 2.1rem; text-shadow: 0 1px 4px #000b; }
.character-choice-avatar img { width: 100%; height: 100%; object-fit: cover; }
.character-choice small { color: var(--muted); font-size: 0.7rem; }
.character-manage { margin-top: 18px; }
.game-detail .detail-footnote { color: var(--muted); font-size: 0.76rem; }
.game-ready-icon { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: var(--game-color); color: #10211f; font-size: 2.1rem; font-weight: 900; }
.ready-lineup { display: flex; flex-wrap: wrap; gap: 9px; }
.ready-player { display: inline-flex; min-height: 54px; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border: 1px solid color-mix(in srgb, var(--player-color), white 38%); border-radius: 999px; background: #102127; font-weight: 750; }
.detail-placeholder { padding: 15px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); font-size: 0.9rem; }

.has-live-301 > .view-heading { display: none; }
.game-detail.is-playing-301 { max-width: none; gap: 10px; padding: 16px; }
.x01-topbar, .x01-heading, .x01-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.x01-topbar { position: relative; min-height: 44px; }
.x01-title { display: flex; flex: 1; align-items: baseline; justify-content: center; gap: 12px; min-width: 0; }
.x01-title h2 { margin: 0; font-size: clamp(1.6rem, 2.8vw, 2.15rem); }
.x01-title span { color: var(--muted); font-size: 0.66rem; font-weight: 850; letter-spacing: 0.12em; white-space: nowrap; }
.game-settings { position: relative; z-index: 5; }
.game-settings summary { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--border); border-radius: 11px; background: #24363c; color: var(--text); cursor: pointer; font-size: 0.82rem; font-weight: 800; list-style: none; }
.game-settings summary::-webkit-details-marker { display: none; }
.game-settings summary:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.game-settings-panel { position: absolute; top: calc(100% + 7px); right: 0; display: grid; gap: 7px; width: min(240px, calc(100vw - 36px)); padding: 11px; border: 1px solid #4e6667; border-radius: 14px; background: #1c3036; box-shadow: 0 16px 38px #0009; }
.game-settings-panel button { min-height: 39px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: #294047; color: var(--text); font-size: 0.82rem; font-weight: 750; text-align: left; }
.game-settings-panel button:hover { background: #365059; }
.game-settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 4px 3px; color: var(--text); font-size: 0.84rem; font-weight: 750; }
.game-settings-toggle input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--lime); }
.x01-heading .eyebrow { margin: 0 0 2px; color: var(--orange); }
.x01-heading h2 { margin: 0; font-size: 2rem; }
.x01-round { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.81rem; font-weight: 800; white-space: nowrap; }
.x01-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.8fr); gap: 12px; }
.x01-layout.is-solo { grid-template-columns: 1fr; }
.x01-layout.is-solo .x01-score { justify-content: center; }
.x01-layout.is-solo .x01-score strong { font-size: clamp(8rem, 16vw, 11rem); }
.x01-layout.is-solo .x01-avatar.is-large { width: 120px; height: 120px; font-size: 2.45rem; }
.x01-current, .x01-sidebar { min-width: 0; border: 1px solid var(--border); border-radius: 21px; background: #102027; }
.x01-current { display: grid; align-content: space-between; gap: 7px; min-height: 330px; padding: 18px 22px; background: radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--player-color), transparent 82%), transparent 60%), #102027; }
.x01-current-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.x01-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 2px solid var(--avatar-outline); border-radius: 50%; background: var(--player-color); color: #fff; font-weight: 900; text-shadow: 0 1px 3px #000b; }
.x01-avatar.is-large { width: 88px; height: 88px; font-size: 1.9rem; }
.is-playing-301 .x01-avatar.is-large, .is-playing-bar .x01-avatar.is-large { width: 108px; height: 108px; font-size: 2.15rem; }
.x01-avatar img { width: 100%; height: 100%; object-fit: cover; }
.x01-overline { color: var(--muted); font-size: 0.7rem; font-weight: 850; letter-spacing: 0.12em; }
.x01-current-header h3 { overflow: hidden; margin: 2px 0 0; font-size: clamp(1.55rem, 2.8vw, 2.15rem); text-overflow: ellipsis; white-space: nowrap; }
.x01-score { display: flex; align-items: baseline; gap: 12px; }
.x01-score strong { color: var(--player-color); font-size: clamp(6.8rem, 12vw, 9rem); font-weight: 900; letter-spacing: -0.09em; line-height: 0.9; }
.x01-score span { color: var(--muted); font-size: 0.85rem; font-weight: 750; }
.x01-status { min-height: 22px; color: var(--mint); font-size: 0.85rem; font-weight: 800; }
.x01-status.is-bust { color: var(--orange); }
.x01-status.is-finished { color: var(--lime); }
.x01-darts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.x01-dart { display: grid; gap: 1px; min-height: 59px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: #15262c; color: var(--muted); }
.x01-dart.is-thrown { border-color: color-mix(in srgb, var(--player-color), transparent 62%); color: var(--text); }
.x01-dart span { font-size: 0.63rem; font-weight: 800; letter-spacing: 0.11em; }
.x01-dart strong { font-size: 1.1rem; line-height: 1; }
.x01-dart small { color: var(--muted); font-size: 0.7rem; }
.x01-sidebar { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; padding: 16px; }
.x01-sidebar-heading strong { color: var(--muted); font-size: 0.75rem; }
.x01-queue { display: grid; align-content: start; gap: 7px; max-height: 216px; overflow-y: auto; }
.x01-queue-player { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 62px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 13px; background: #1a2b31; }
.x01-queue-player .x01-avatar { width: 52px; height: 52px; }
.x01-queue-order { color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.x01-queue-name { min-width: 0; overflow: hidden; font-size: 0.9rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.x01-queue-player > strong { margin-left: auto; color: var(--player-color); font-size: 1.4rem; }
.x01-solo { margin: 10px 0; color: var(--muted); font-size: 0.85rem; }
.x01-last-turn { padding-top: 10px; border-top: 1px solid var(--border); }
.x01-last-turn p { margin: 3px 0 0; color: var(--text); font-size: 0.81rem; }
.x01-controls { display: grid; gap: 9px; }
.x01-finish-control { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--lime); font-size: 0.88rem; font-weight: 800; }
.x01-action-row, .x01-demo-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.x01-action-row { padding-top: 8px; border-top: 1px solid var(--border); }
.x01-action-row > .button:last-child { margin-left: auto; }
.x01-controls .button { min-height: 42px; padding-inline: 13px; border-radius: 12px; font-size: 0.82rem; }
.x01-demo-tools label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.x01-demo-tools select { max-width: 155px; min-height: 42px; padding: 0 9px; border: 1px solid var(--border); border-radius: 11px; background: #0e1e24; color: var(--text); font: inherit; }
.game-detail.is-playing-bar { max-width: none; gap: 10px; padding: 16px; }
.bar-scores { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.bar-best { display: grid; justify-items: end; gap: 2px; min-width: 100px; padding-bottom: 4px; }
.bar-best span { color: var(--muted); font-size: 0.65rem; font-weight: 850; letter-spacing: 0.1em; }
.bar-best strong { color: var(--mint); font-size: 2.2rem; line-height: 1; }
.bar-best small { color: var(--muted); font-size: 0.72rem; text-align: right; }
.is-playing-bar .x01-score strong { color: #e9ca76; }
.is-playing-bar .x01-queue-player > strong { font-size: 0.72rem; letter-spacing: 0.08em; }
.is-playing-bar .x01-queue-player.is-out { opacity: 0.48; }
.game-detail.is-playing-bomber { max-width: none; gap: 10px; padding: 16px; }
.bomber-layout { display: grid; grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr); gap: 12px; }
.bomber-board-panel, .bomber-info { min-width: 0; border: 1px solid var(--border); border-radius: 21px; background: #102027; }
.bomber-board-panel { display: grid; justify-items: center; gap: 0; padding: 9px 14px 7px; }
.bomber-board-title { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.bomber-board-title strong { color: #ff866c; font-size: 1.1rem; }
.bomber-board { width: min(100%, 330px); }
.bomber-board svg { display: block; width: 100%; aspect-ratio: 1; }
.bomber-board .dart-segment:not(.is-custom) { opacity: 0.42; }
.bomber-board .dart-segment.is-custom { fill: var(--section-color); stroke: none; 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.55; }
.bomber-board .dartboard-number.is-bomb { fill: var(--bomb-color); font-size: 20px; font-weight: 900; }
.bomber-info { display: grid; align-content: space-between; gap: 4px; padding: 8px 16px; background: radial-gradient(circle at 15% 5%, color-mix(in srgb, var(--player-color), transparent 85%), transparent 55%), #102027; }
.bomber-info .x01-current-header h3 { margin-top: 2px; }
.bomber-progress { display: flex; align-items: baseline; gap: 8px; }
.bomber-progress strong { color: #ff866c; font-size: 2.75rem; line-height: 1; }
.bomber-progress span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.bomber-bombs { display: flex; align-content: start; flex-wrap: wrap; gap: 7px; min-height: 42px; max-height: 105px; overflow-y: auto; }
.bomber-chip { display: flex; align-items: center; gap: 7px; min-width: 72px; height: 41px; padding: 3px 8px; border: 1px solid var(--bomb-color); border-radius: 11px; background: color-mix(in srgb, var(--bomb-color), #102027 88%); }
.bomber-chip strong { color: var(--bomb-color); font-size: 1.3rem; }
.bomber-chip small { color: var(--muted); font-size: 0.58rem; font-weight: 900; }
.bomber-clear { color: var(--mint); font-size: 0.83rem; font-weight: 800; }
.bomber-clear-history { display: grid; gap: 3px; }
.bomber-state-counts { display: flex; flex-wrap: wrap; gap: 5px; }
.bomber-state-count { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 0.64rem; font-weight: 750; text-transform: uppercase; }
.bomber-state-count i, .bomber-history-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--state-color); }
.bomber-state-count.is-white, .bomber-history-dot.is-white { --state-color: #ffffff; }
.bomber-state-count.is-yellow, .bomber-history-dot.is-yellow { --state-color: #ffd649; }
.bomber-state-count.is-red, .bomber-history-dot.is-red { --state-color: #ff5364; }
.bomber-state-count strong { color: var(--text); }
.bomber-clear-history details { color: var(--muted); font-size: 0.7rem; }
.bomber-clear-history summary { width: max-content; cursor: pointer; }
.bomber-clear-history ol { display: grid; gap: 3px; max-height: 90px; overflow-y: auto; margin: 4px 0 0; padding: 5px 0 0; border-top: 1px solid var(--border); list-style: none; }
.bomber-clear-history li { display: flex; align-items: center; gap: 5px; }
.is-playing-bomber .x01-dart.is-thrown { border-color: #ff866c80; }
@keyframes bomber-pulse { 50% { opacity: 0.72; } }
@keyframes bomber-defuse { 0% { opacity: 1; fill: #ffffff; } 45% { opacity: 1; fill: #62ffd0; } 100% { opacity: 0; fill: #62ffd0; } }

.profile-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: start; gap: 15px; }
.profile-tile { display: grid; justify-items: center; gap: 12px; min-width: 0; padding: 18px 12px 16px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--text); text-align: center; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.profile-tile:hover { transform: translateY(-3px); border-color: var(--player-color); background: var(--surface-high); }
.profile-tile-avatar { display: grid; width: min(100%, 150px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 4px solid var(--avatar-outline); border-radius: 50%; background: var(--player-color); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900; text-shadow: 0 2px 6px #000b; }
.profile-tile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-tile-name { max-width: 100%; overflow: hidden; font-size: 1rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.profile-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; border: 1px solid #516567; border-radius: 26px; background: #17252c; color: var(--text); box-shadow: 0 25px 90px #000b; }
.profile-dialog::backdrop { background: #061115ca; backdrop-filter: blur(7px); }
.profile-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.profile-dialog-heading .eyebrow { margin: 0 0 5px; }
.profile-dialog-heading h2 { margin: 0; font-size: 1.8rem; }
.profile-close { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 12px; background: #203239; color: var(--text); font-size: 1.6rem; line-height: 1; }
.profile-card { display: grid; grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.1fr); gap: 20px; min-height: 390px; }
.profile-visual { display: grid; align-content: center; justify-items: center; gap: 14px; min-width: 0; border-radius: 22px; background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--player-color), transparent 55%), transparent 65%), #102027; }
.avatar { display: grid; width: clamp(130px, 18vw, 190px); aspect-ratio: 1; overflow: hidden; place-items: center; border: 5px solid var(--avatar-outline); border-radius: 50%; background: var(--player-color); color: var(--text); font-size: 4.4rem; font-weight: 900; text-shadow: 0 2px 6px #000b; }
.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: 7px; }
.profile-art-actions button { min-height: 38px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 11px; background: #203239; color: var(--text); font-size: 0.8rem; font-weight: 800; }
.profile-art-actions button:hover { border-color: var(--lime); }
.upload-label { position: relative; display: inline-grid; min-height: 44px; overflow: hidden; place-items: center; padding: 0 16px; border: 1px solid var(--border); border-radius: 13px; background: rgba(12, 28, 33, 0.72); font-size: 0.86rem; font-weight: 800; cursor: pointer; }
.upload-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-label:focus-within { outline: 3px solid var(--lime); outline-offset: 2px; }
.profile-fields { display: grid; align-content: center; gap: 16px; }
.profile-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 0.82rem; font-weight: 750; }
.profile-fields input[type="text"] { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; outline: none; background: #0d1b21; color: var(--text); font-size: 1rem; }
.profile-fields input[type="text"]:focus { border-color: var(--player-color); }
.profile-fields input[type="color"] { width: 100%; height: 48px; padding: 4px; border: 1px solid var(--border); border-radius: 13px; background: #0d1b21; }
.profile-save-note { margin: 0; color: var(--muted); font-size: 0.76rem; }
.profile-empty { display: grid; grid-column: 1 / -1; min-height: 350px; align-content: center; justify-items: center; gap: 12px; border: 1px dashed var(--border); border-radius: 28px; color: var(--muted); text-align: center; }
.profile-empty strong { color: var(--text); font-size: 1.5rem; }
.profile-empty p { max-width: 290px; margin: 0; }

.pixel-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid #516567; border-radius: 25px; background: #17252c; color: var(--text); box-shadow: 0 25px 90px #000b; }
.pixel-dialog::backdrop { background: #061115ca; backdrop-filter: blur(7px); }
.pixel-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.pixel-dialog-heading .eyebrow { margin: 0 0 5px; }
.pixel-dialog-heading h2 { margin: 0; font-size: 1.8rem; }
.pixel-editor-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 0.88rem; }
.pixel-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 11px; background: #203239; color: var(--text); font-size: 1.6rem; line-height: 1; }
.pixel-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr); align-items: start; gap: 22px; margin: 20px 0; }
.pixel-canvas-wrap { display: grid; min-width: 0; place-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 18px; background: #0c1b20; }
#pixelCanvas { display: block; width: min(100%, 336px); aspect-ratio: 1; border: 1px solid #63777a; border-radius: 4px; background-color: #c8d2cf; background-image: conic-gradient(#e0e9e5 25%, transparent 0 50%, #e0e9e5 0 75%, transparent 0); background-size: 14px 14px; image-rendering: pixelated; touch-action: none; cursor: crosshair; }
.pixel-controls { display: grid; gap: 17px; }
.pixel-controls fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pixel-controls legend, .pixel-color-label { margin-bottom: 7px; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.pixel-button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pixel-button-row button, .pixel-clear { min-height: 40px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 11px; background: #203239; color: var(--text); font-size: 0.83rem; font-weight: 800; }
.pixel-button-row button[aria-pressed="true"] { border-color: var(--lime); background: #364a3c; color: var(--lime); }
.pixel-color-label { display: grid; gap: 4px; margin: 0; }
#pixelColor { width: 100%; height: 45px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #0d1b21; }
.pixel-clear { justify-self: start; }
.pixel-tip { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.pixel-save-error { margin: 0 0 12px; color: #ffbf9f; font-size: 0.83rem; }
.pixel-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }

.tab-bar { position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 30px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(11, 21, 27, 0.97); backdrop-filter: blur(16px); }
.tab-bar a { display: flex; min-height: 57px; align-items: center; justify-content: center; gap: 9px; border-radius: 16px; color: var(--muted); font-size: 0.95rem; font-weight: 800; text-decoration: none; }
.tab-bar a[aria-current="page"] { background: var(--surface-high); color: var(--lime); }
.tab-icon { font-size: 1.65rem; line-height: 0.8; }
.toast { position: fixed; z-index: 5; right: 18px; bottom: 85px; max-width: min(380px, calc(100vw - 36px)); padding: 13px 17px; transform: translateY(12px); border: 1px solid var(--border); border-radius: 14px; opacity: 0; background: #263d43; box-shadow: 0 12px 40px #0008; font-size: 0.85rem; pointer-events: none; transition: 160ms ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0.4; } }
@keyframes board-hit { 0%, 30% { fill: #fff9b2; filter: brightness(1.5); } 100% { filter: none; } }

@media (max-width: 900px) {
  .prototype-label { display: none; }
  .home-layout { grid-template-columns: 1fr 0.9fr; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .site-header { min-height: 64px; padding: 10px 16px; }
  .brand { font-size: 0.92rem; }
  .brand-icon { width: 35px; height: 35px; }
  main { padding: 18px 16px 22px; }
  .view-heading { align-items: start; flex-direction: column; gap: 13px; }
  .heading-actions { justify-content: start; }
  .home-layout { grid-template-columns: 1fr; }
  .board-surface { min-height: auto; }
  .board-graphic { width: min(100%, 440px); }
  .recent-surface { min-height: auto; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 210px; }
  .lineup-slots { grid-template-columns: 1fr; max-height: 310px; }
  .lineup-actions .button { flex: 1; }
  .character-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x01-layout { grid-template-columns: 1fr; }
  .bomber-layout { grid-template-columns: 1fr; }
  .bomber-board { width: min(100%, 290px); }
  .x01-current { min-height: 275px; }
  .x01-sidebar { min-height: 130px; }
  .x01-queue { max-height: 180px; }
  .x01-action-row > .button:last-child { margin-left: 0; }
  .x01-topbar { flex-wrap: wrap; }
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-card { grid-template-columns: 1fr; min-height: auto; }
  .profile-visual { min-height: 225px; padding: 18px; }
  .pixel-editor-layout { grid-template-columns: 1fr; }
  #pixelCanvas { width: min(100%, 288px); }
  .pixel-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-bar { padding-inline: 12px; }
}

@media (max-width: 430px) {
  .connection-pill { padding: 0 8px; font-size: 0.7rem; }
  .connection-pill #connectionText { max-width: 80px; }
  .connection-action { padding-inline: 6px; font-size: 0.65rem; }
  .view-heading h1 { font-size: 2rem; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; padding: 0 8px; font-size: 0.86rem; }
  .board-graphic { width: min(100%, 380px); }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-tile { padding: 12px 8px; }
  .profile-dialog { padding: 18px; }
  .character-dialog { padding: 18px; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .game-detail.is-playing-301 { padding: 14px; }
  .game-detail.is-playing-bar { padding: 14px; }
  .game-detail.is-playing-bomber { padding: 14px; }
  .x01-current { padding: 14px; }
  .x01-action-row > .button:last-child { width: 100%; }
  .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; min-height: 59px; font-size: 0.75rem; }
}

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