:root {
  color-scheme: light;
  --ink: #101815;
  --ink-soft: #506059;
  --paper: #f4f1e9;
  --surface: #fffdf7;
  --surface-muted: #ebe8df;
  --line: #d6d4cb;
  --green: #1e7559;
  --green-dark: #174b3b;
  --green-pale: #dcebe4;
  --lime: #c7d83d;
  --red: #df6049;
  --red-dark: #a93c2b;
  --red-pale: #f8dfda;
  --amber: #e7b64b;
  --shadow: 0 18px 55px rgba(16, 24, 21, 0.08);
  --radius: 22px;
  --header-height: 72px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(199, 216, 61, 0.09), transparent 24rem),
    var(--paper);
}

button, input, select, textarea { font: inherit; }
button, summary, select, input[type="checkbox"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(30, 117, 89, 0.28);
  outline-offset: 2px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.035em; }
h1 { font-size: clamp(2.7rem, 7vw, 6.7rem); line-height: 0.94; }
h2 { font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.05; margin-bottom: 0; }
h3 { font-size: 1.1rem; }

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 58px);
  color: #f7faf7;
  background: rgba(16, 24, 21, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { font-size: 0.98rem; letter-spacing: 0.01em; }
.brand small { margin-top: 5px; color: #9baca4; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
}

.brand-mark::before, .brand-mark::after, .brand-mark i {
  content: "";
  position: absolute;
  top: 7px;
  width: 2px;
  height: 20px;
  background: var(--red);
  transform: rotate(18deg);
}

.brand-mark::before { left: 10px; }
.brand-mark i:nth-child(1) { left: 16px; }
.brand-mark::after { left: 22px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.save-state { color: #93a49d; font-size: 0.74rem; transition: color .2s; }
.save-state::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--lime); }
.save-state.is-saving { color: white; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.app-header .icon-button { border-color: rgba(255,255,255,.18); }

.overflow-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: clamp(18px, 4vw, 58px);
  width: 230px;
  overflow: hidden;
  padding: 7px;
  background: #19221f;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.36);
}

.overflow-menu button {
  width: 100%;
  padding: 11px 12px;
  color: white;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.overflow-menu button:hover { background: rgba(255,255,255,.07); }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--ink); background: var(--lime); }
.button-quiet { color: inherit; background: transparent; border-color: var(--line); }
.button-danger { color: white; background: var(--red-dark); }
.button-small { min-height: 36px; padding: 8px 13px; font-size: .82rem; }
.button-large { min-height: 58px; padding: 16px 26px; }
.button-full { width: 100%; }
.app-header .button-quiet { border-color: rgba(255,255,255,.2); }

.eyebrow {
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.setup-hero {
  position: relative;
  min-height: clamp(450px, 61vh, 660px);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 66px clamp(22px, 7vw, 100px) 88px;
  color: #eff4f0;
  background:
    linear-gradient(102deg, rgba(16,24,21,1) 0%, rgba(16,24,21,.97) 50%, rgba(16,24,21,.2) 100%),
    repeating-linear-gradient(135deg, #101815 0, #101815 8px, #13231d 8px, #13231d 9px);
}

.setup-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 30px;
  background: var(--paper);
  clip-path: polygon(0 90%, 10% 60%, 24% 85%, 41% 30%, 58% 80%, 77% 45%, 100% 75%, 100% 100%, 0 100%);
}

.hero-copy { position: relative; z-index: 2; width: min(850px, 70%); }
.hero-copy .eyebrow { color: var(--lime); }
.hero-copy h1 { margin-bottom: 30px; font-weight: 800; }
.hero-copy h1 em { color: var(--lime); font-family: Georgia, serif; font-weight: 400; }
.hero-text { max-width: 620px; color: #b8c4be; font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.65; }

.dart-visual {
  position: absolute;
  top: 50%;
  right: clamp(-190px, -9vw, -70px);
  width: clamp(380px, 44vw, 680px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 50%;
  background: repeating-conic-gradient(from -9deg, rgba(236,239,231,.08) 0 9deg, rgba(30,117,89,.25) 9deg 18deg);
  box-shadow: inset 0 0 0 22px rgba(0,0,0,.24), 0 0 80px rgba(0,0,0,.25);
}

.dart-ring { position: absolute; inset: 15%; border: 18px solid rgba(223,96,73,.72); border-radius: 50%; }
.dart-ring.ring-two { inset: 35%; border-width: 13px; border-color: rgba(199,216,61,.8); }
.dart-ring.ring-three { inset: 48%; border-width: 0; background: var(--red); }
.dart-arrow { position: absolute; z-index: 2; left: 47%; top: 4%; width: 7px; height: 52%; background: #f3f3e8; border-radius: 4px; transform: rotate(26deg); transform-origin: bottom; box-shadow: 0 6px 15px rgba(0,0,0,.4); }
.dart-arrow::before { content: ""; position: absolute; top: -27px; left: -12px; width: 31px; height: 35px; background: var(--amber); clip-path: polygon(50% 100%, 0 0, 100% 18%); }

.page-grid {
  width: min(1450px, calc(100% - 44px));
  margin: 0 auto;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(470px, 1.28fr);
  gap: 24px;
  padding: 48px 0 120px;
  align-items: start;
}

.panel {
  padding: clamp(24px, 3vw, 38px);
  background: var(--surface);
  border: 1px solid rgba(16,24,21,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.settings-panel { position: sticky; top: calc(var(--header-height) + 22px); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-note { max-width: 310px; color: var(--ink-soft); font-size: .84rem; text-align: right; }
.count-pill { display: inline-grid; min-width: 34px; height: 34px; place-items: center; margin-left: 8px; vertical-align: .15em; color: white; background: var(--green); border-radius: 50%; font-size: .85rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; min-width: 0; color: var(--ink-soft); font-size: .72rem; font-weight: 750; letter-spacing: .03em; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f9f8f3;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: normal;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); background: white; }
.note { margin: 20px 0 0; padding: 12px 14px; color: var(--green-dark); background: var(--green-pale); border-radius: 9px; font-size: .78rem; line-height: 1.5; }

.player-editor-list { display: grid; gap: 8px; max-height: 630px; overflow: auto; padding-right: 5px; }
.player-editor {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr) auto 120px 40px;
  gap: 12px;
  align-items: end;
  padding: 10px 10px 10px 0;
  background: #f7f5ef;
  border: 1px solid transparent;
  border-radius: 12px;
}
.player-editor:focus-within { background: white; border-color: rgba(30,117,89,.35); }
.player-editor .field { gap: 4px; }
.player-editor .field span { font-size: .65rem; }
.player-editor .field input { min-height: 40px; background: white; }
.player-index { align-self: stretch; display: grid; place-items: center; color: #7d8983; border-right: 1px solid var(--line); font-size: .72rem; font-weight: 800; }
.paid-check { align-self: center; display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.paid-check input { width: 18px; height: 18px; accent-color: var(--green); }
.player-editor .icon-button { align-self: center; color: #7c847f; border-color: transparent; font-size: 1.2rem; }
.player-editor .icon-button:hover { color: white; background: var(--red); }

.bulk-entry { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.bulk-entry summary { color: var(--green); font-size: .82rem; font-weight: 750; }
.bulk-entry form { display: grid; gap: 12px; margin-top: 15px; }
.bulk-entry .button { justify-self: start; }

.start-bar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(22px, 7vw, 100px) max(14px, env(safe-area-inset-bottom));
  color: white;
  background: rgba(16,24,21,.97);
  border-top: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 -18px 50px rgba(16,24,21,.16);
  backdrop-filter: blur(14px);
}
.start-bar > div { display: grid; gap: 4px; }
.start-bar span { color: #99a9a2; font-size: .78rem; }
.start-bar .button span { color: inherit; font-size: 1.1rem; }

.tournament-head {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 35px clamp(22px, 6vw, 90px);
  color: white;
  background:
    linear-gradient(110deg, #101815, #182a23 68%, #1d3a2f),
    var(--ink);
}
.tournament-head .eyebrow { color: var(--lime); }
.tournament-head h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 5.5rem); }
.round-seal { flex: 0 0 auto; width: 118px; height: 118px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; }
.round-seal span { color: #9eaea7; font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; }
.round-seal strong { font-family: Georgia, serif; color: var(--lime); font-size: 3.4rem; line-height: 1; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.metric-strip, .view-tabs, .command-bar { scrollbar-width: none !important; }
.metric-strip::-webkit-scrollbar, .view-tabs::-webkit-scrollbar, .command-bar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.metric { min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 16px clamp(15px, 3vw, 38px); border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric span { color: var(--ink-soft); font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { font-size: clamp(1.35rem, 2.6vw, 2rem); }
.metric-in strong { color: var(--green); }
.metric-out strong { color: var(--red-dark); }

.view-tabs {
  position: sticky;
  z-index: 20;
  top: var(--header-height);
  display: flex;
  gap: 4px;
  padding: 0 clamp(22px, 6vw, 90px);
  background: rgba(244,241,233,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.view-tabs button { position: relative; min-height: 58px; padding: 0 20px; color: var(--ink-soft); background: transparent; border: 0; font-size: .83rem; font-weight: 800; }
.view-tabs button::after { content: ""; position: absolute; right: 14px; bottom: -1px; left: 14px; height: 3px; background: transparent; }
.view-tabs button.active { color: var(--ink); }
.view-tabs button.active::after { background: var(--green); }

.command-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 80px;
  padding: 14px clamp(22px, 6vw, 90px);
  background: #e9e6de;
  border-bottom: 1px solid var(--line);
}
.command-note { margin-left: auto; color: var(--ink-soft); font-size: .78rem; }

.live-content { width: min(1500px, calc(100% - 44px)); margin: 0 auto; padding: 42px 0 80px; }
.content-section > .section-heading { margin-bottom: 24px; }
.legend { display: flex; gap: 18px; color: var(--ink-soft); font-size: .72rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.dot.free { background: var(--green); }.dot.occupied { background: var(--red); }.dot.offline { background: #8d948f; }

.board-grid { display: grid; grid-template-columns: repeat(4, minmax(245px, 1fr)); gap: 16px; }
.board-card { min-height: 250px; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(16,24,21,.045); }
.board-card > header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.board-card > header div { display: flex; align-items: center; gap: 9px; }
.board-card > header > span { color: var(--ink-soft); font-size: .62rem; font-weight: 850; letter-spacing: .12em; }
.status-light { width: 8px; height: 8px; border-radius: 50%; background: #8d948f; }
.board-free .status-light { background: var(--green); box-shadow: 0 0 0 4px var(--green-pale); }
.board-occupied .status-light { background: var(--red); box-shadow: 0 0 0 4px var(--red-pale); }
.board-occupied { border-color: rgba(223,96,73,.45); }
.board-offline { background: #e8e6df; color: #747b77; }
.empty-board { flex: 1; display: grid; place-items: center; padding: 25px; color: var(--ink-soft); text-align: center; font-size: .82rem; }
.empty-board::before { content: ""; position: absolute; }
.board-toggle { min-height: 42px; color: var(--ink-soft); background: transparent; border: 0; border-top: 1px solid var(--line); font-size: .7rem; font-weight: 750; }
.board-toggle:hover { color: var(--ink); background: rgba(255,255,255,.5); }

.board-card form { flex: 1; display: flex; flex-direction: column; }
.scratch-prompt { margin: 14px 15px 7px; color: var(--ink-soft); font-size: .7rem; font-weight: 750; }
.scratch-list { display: grid; gap: 3px; padding: 0 9px 10px; }
.scratch-player { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 8px; transition: background .15s; }
.scratch-player:hover { background: #f2f0e9; }
.scratch-player input { position: absolute; opacity: 0; pointer-events: none; }
.scratch-check { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; color: #8b938e; border: 1px solid var(--line); border-radius: 50%; font-size: 1rem; font-weight: 800; }
.scratch-player input:checked + .scratch-check { color: white; background: var(--red); border-color: var(--red); }
.player-copy { min-width: 0; display: grid; line-height: 1.2; }
.player-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.player-copy small { color: var(--ink-soft); font-size: .64rem; }
.danger-chip { margin-left: auto; padding: 4px 6px; color: var(--red-dark); background: var(--red-pale); border-radius: 999px; font-size: .55rem; font-weight: 800; text-transform: uppercase; }
.board-actions { display: flex; gap: 7px; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.board-actions .button:last-child { flex: 1; }

.group-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.group-column { padding: 18px; background: rgba(255,255,255,.4); border: 1px solid var(--line); border-radius: 17px; }
.group-column > h3, .roster-block > h3 { display: flex; justify-content: space-between; margin: 0 0 13px; font-size: .88rem; }
.group-column > h3 span, .roster-block > h3 span { min-width: 25px; height: 25px; display: grid; place-items: center; color: var(--ink-soft); background: var(--surface-muted); border-radius: 50%; font-size: .65rem; }
.group-card { margin-top: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.group-card header { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; background: #eceae3; }
.group-card header strong { font-size: .82rem; }.group-card header span { color: var(--ink-soft); font-size: .65rem; }
.group-card ol { margin: 0; padding: 6px 12px 9px 34px; }
.group-card li { min-height: 30px; padding: 6px 2px; border-bottom: 1px solid #eceae3; font-size: .78rem; }
.group-card li:last-child { border: 0; }
.group-card li::marker { color: #96a09b; font-size: .68rem; }
.group-card li { display: list-item; }.group-card li span { display: inline-block; max-width: calc(100% - 35px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.group-card li small, .group-card li b { float: right; }.group-card li b { color: var(--red); font-size: 1rem; }
.group-playing { border-color: rgba(223,96,73,.42); }.group-playing header { background: var(--red-pale); }
.group-done { opacity: .72; }.received-scratch { color: var(--red-dark); font-weight: 750; }
.empty-message { margin: 25px 0; color: var(--ink-soft); font-size: .78rem; text-align: center; }

.roster-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; align-items: start; }
.roster-block { padding: 20px; background: rgba(255,255,255,.45); border: 1px solid var(--line); border-radius: 17px; }
.roster-list { display: grid; gap: 7px; }
.roster-player { min-height: 62px; display: grid; grid-template-columns: 38px minmax(150px, 1fr) auto 40px; gap: 12px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid transparent; border-radius: 11px; }
.roster-player:hover { border-color: var(--line); }
.player-number { color: #8a948f; font-size: .68rem; font-weight: 850; }
.roster-player > div:nth-child(2) { display: grid; gap: 3px; }
.roster-player strong { font-size: .86rem; }.roster-player small { color: var(--ink-soft); font-size: .67rem; }
.scratch-marks { display: flex; gap: 4px; }
.scratch-marks i { width: 8px; height: 15px; display: block; border: 1px solid #c7cac5; border-radius: 3px; transform: skew(-10deg); }
.scratch-marks i.hit { background: var(--red); border-color: var(--red); }
.roster-remove { width: 32px; height: 32px; color: #87908b; border-color: transparent; }
.roster-remove:hover { color: white; background: var(--red); }
.roster-player.is-out { color: #737b77; background: #eeece5; }
.rank-chip { min-width: 32px; height: 32px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-pale); border-radius: 50%; font-size: .7rem; font-weight: 850; }

.stats-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.summary-card { min-height: 112px; display: grid; align-content: center; gap: 7px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.summary-card span { color: var(--ink-soft); font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.summary-card strong { font-size: clamp(1.25rem, 2.4vw, 2rem); }
.summary-card.accent { color: white; background: var(--green); border-color: var(--green); }
.summary-card.accent span { color: #c4ddd2; }
.stats-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 20px; align-items: start; }
.ranking-panel, .payout-panel { padding: clamp(20px, 3vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.ranking-panel > h3 { margin-bottom: 18px; }
.ranking-list { display: grid; }
.ranking-row { min-height: 58px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.ranking-row:last-child { border: 0; }
.ranking-place { width: 29px; height: 29px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-pale); border-radius: 50%; font-size: .72rem; font-weight: 850; }
.ranking-row > div { display: grid; }.ranking-row strong { font-size: .85rem; }.ranking-row small { color: var(--ink-soft); font-size: .65rem; }
.ranking-row > span:last-child { color: var(--red-dark); font-size: .76rem; font-weight: 800; }
.payout-panel { position: sticky; top: 155px; color: white; background: var(--ink); border-color: var(--ink); }
.payout-panel .eyebrow { color: var(--lime); }.payout-panel h3 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 3.2rem); }.payout-panel > p:not(.eyebrow) { color: #9fafaa; font-size: .78rem; }
.payout-row { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.11); font-size: .78rem; }
.payout-panel > small { display: block; margin-top: 18px; color: #83928c; font-size: .64rem; line-height: 1.5; }

.winner-hero { position: relative; overflow: hidden; min-height: 440px; display: grid; place-items: center; align-content: center; padding: 55px 22px; color: white; text-align: center; background: var(--ink); }
.winner-hero .eyebrow { color: var(--lime); }.winner-hero h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 6vw, 5rem); }.winner-name { max-width: 1100px; color: var(--lime); font-family: Georgia, serif; font-size: clamp(3rem, 9vw, 8rem); line-height: .95; }.winner-hero > p:not(.eyebrow) { margin: 24px 0; color: #9eada7; }
.winner-actions { position: relative; z-index: 2; }.confetti { position: absolute; inset: 0; opacity: .3; background-image: radial-gradient(circle, var(--red) 0 3px, transparent 4px), radial-gradient(circle, var(--lime) 0 2px, transparent 3px); background-position: 0 0, 30px 40px; background-size: 110px 100px, 130px 115px; mask-image: linear-gradient(to bottom, black, transparent 85%); }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); padding: 13px 18px; color: white; background: var(--green-dark); border-radius: 11px; box-shadow: 0 18px 45px rgba(16,24,21,.28); font-size: .82rem; font-weight: 700; }
.toast[data-tone="error"] { background: var(--red-dark); }

.dialog { width: min(520px, calc(100% - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: 20px; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(8,14,12,.66); backdrop-filter: blur(4px); }
.dialog form { position: relative; padding: clamp(25px, 5vw, 38px); }
.dialog h2 { margin-bottom: 14px; }.dialog p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 36px; height: 36px; background: transparent; border: 0; border-radius: 50%; font-size: 1.6rem; }
.help-dialog { width: min(650px, calc(100% - 32px)); }.help-steps { display: grid; gap: 14px; padding-left: 22px; color: var(--ink-soft); line-height: 1.45; }.help-steps strong { color: var(--ink); }

@media (max-width: 1180px) {
  .setup-grid { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
  .board-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
  .metric-strip { grid-template-columns: repeat(5, 1fr); }
  .metric { padding-inline: 18px; }
}

@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .save-state { display: none; }
  .setup-hero { min-height: 520px; align-items: flex-start; padding-top: 72px; }
  .hero-copy { width: 100%; }
  .hero-copy h1 { max-width: 720px; }
  .dart-visual { top: 78%; right: -110px; width: 350px; opacity: .72; }
  .board-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .group-columns { grid-template-columns: 1fr; }
  .roster-layout, .stats-layout { grid-template-columns: 1fr; }
  .payout-panel { position: static; }
  .stats-cards { grid-template-columns: repeat(3, 1fr); }
  .metric-strip { overflow-x: auto; grid-template-columns: repeat(5, minmax(150px, 1fr)); }
  .command-bar { overflow-x: auto; align-items: stretch; }
  .command-bar .button { flex: 0 0 auto; }
  .command-note { display: none; }
}

@media (max-width: 650px) {
  .app-header { padding-inline: 15px; }
  .app-header .button-small { display: none; }
  .brand small { display: none; }
  .setup-hero { min-height: 475px; padding: 55px 20px 70px; }
  .hero-copy h1 { font-size: clamp(2.55rem, 13vw, 4.2rem); }
  .hero-text { font-size: .95rem; line-height: 1.55; }
  .dart-visual { right: -155px; width: 310px; }
  .page-grid, .live-content { width: min(100% - 24px, 1500px); }
  .setup-grid { gap: 13px; padding: 20px 0 130px; }
  .panel { padding: 22px 16px; border-radius: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .section-heading { align-items: center; margin-bottom: 22px; }
  .section-note { display: none; }
  .player-editor-list { max-height: none; overflow: visible; }
  .player-editor { position: relative; grid-template-columns: 34px minmax(0, 1fr) 38px; gap: 8px; padding: 11px 7px 11px 0; }
  .player-editor .player-name { grid-column: 2; }
  .player-editor .paid-check { grid-column: 2; padding: 4px 0; }
  .player-editor .player-limit { grid-column: 2; }
  .player-editor > .icon-button { position: absolute; top: 8px; right: 6px; }
  .player-index { grid-row: 1 / span 3; }
  .start-bar { min-height: 96px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
  .start-bar > div { display: none; }
  .start-bar .button { width: 100%; }
  .tournament-head { min-height: 170px; padding: 28px 20px; }
  .tournament-head > div:first-child { min-width: 0; }
  .tournament-head h1 { font-size: 1.55rem; overflow-wrap: anywhere; }
  .round-seal { width: 88px; height: 88px; }.round-seal strong { font-size: 2.5rem; }
  .metric-strip { grid-template-columns: repeat(5, minmax(125px, 1fr)); }
  .metric { min-height: 78px; padding: 12px 15px; }
  .view-tabs { overflow-x: auto; padding: 0 7px; }
  .view-tabs button { flex: 1 0 auto; min-height: 52px; padding-inline: 15px; }
  .command-bar { min-height: 68px; padding: 10px 12px; }
  .command-bar .button { min-height: 42px; padding: 10px 14px; font-size: .75rem; }
  .live-content { padding: 27px 0 70px; }
  .board-grid { grid-template-columns: 1fr; }
  .board-card { min-height: 230px; }
  .legend { display: none; }
  .group-column, .roster-block { padding: 12px; }
  .roster-player { grid-template-columns: 30px minmax(120px, 1fr) 35px; }
  .scratch-marks { display: none; }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .summary-card { min-height: 95px; padding: 15px; }.summary-card.accent { grid-column: 1 / -1; }
  .winner-hero { min-height: 380px; }
  .dialog-actions { flex-direction: column-reverse; }.dialog-actions .button { width: 100%; }
  .toast { right: 12px; bottom: 12px; max-width: calc(100% - 24px); }
}

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

/* Shadow Okami inspired visual system */
:root {
  color-scheme: dark;
  --ink: #faf7ff;
  --ink-soft: #aaa0b6;
  --paper: #0c0912;
  --surface: #120d1a;
  --surface-muted: #1b1425;
  --line: rgba(224, 207, 255, 0.14);
  --green: #7c3aed;
  --green-dark: #5b21b6;
  --green-pale: rgba(124, 58, 237, 0.16);
  --lime: #a78bfa;
  --red: #ef6b64;
  --red-dark: #c84c48;
  --red-pale: rgba(239, 107, 100, 0.14);
  --amber: #c4a5ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --header-height: 84px;
  font-family: "Trebuchet MS", Aptos, sans-serif;
}

body {
  background:
    radial-gradient(circle at 78% 8%, rgba(103, 55, 181, 0.2), transparent 34rem),
    radial-gradient(circle at 7% 78%, rgba(67, 32, 102, 0.14), transparent 30rem),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  z-index: 200;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    repeating-radial-gradient(circle at 17% 21%, transparent 0 2px, rgba(255,255,255,.07) 2.5px 3px, transparent 3.5px 7px),
    linear-gradient(115deg, transparent, rgba(255,255,255,.025), transparent);
  background-size: 130px 130px, 100% 100%;
  mix-blend-mode: soft-light;
}

h1, h2, h3, .button, .eyebrow, .brand {
  font-family: Bahnschrift, "Trebuchet MS", sans-serif;
}

h1, h2 { text-transform: uppercase; }
.eyebrow { color: var(--lime); }

.app-header {
  top: 12px;
  width: calc(100% - 32px);
  height: 64px;
  margin: 12px auto 8px;
  padding-inline: clamp(18px, 3vw, 34px);
  background: rgba(18, 13, 26, 0.82);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 15px 50px rgba(0,0,0,.25);
}

.brand-mark { border-color: rgba(224,207,255,.25); }
.brand-mark::before, .brand-mark::after, .brand-mark i { background: var(--lime); }
.brand small { color: #887d95; }
.save-state::before { background: #a78bfa; box-shadow: 0 0 12px rgba(167,139,250,.9); }
.save-state.is-live { color: #d8caff; }
.save-state.is-live::before { animation: livePulse 1.6s infinite; }

.button { letter-spacing: .055em; text-transform: uppercase; font-size: .76rem; }
.button-primary { background: linear-gradient(135deg, #6d28d9, #8b5cf6); box-shadow: inset 0 1px rgba(255,255,255,.18), 0 9px 28px rgba(109,40,217,.22); }
.button-primary:hover { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.button-secondary { color: white; background: rgba(124,58,237,.18); border-color: rgba(167,139,250,.38); }
.button-quiet { color: #e0d8eb; border-color: var(--line); }
.button-danger { background: #a53e45; }

.setup-hero {
  min-height: clamp(520px, 68vh, 710px);
  margin-top: -84px;
  padding-top: 145px;
  background:
    radial-gradient(circle at 78% 44%, rgba(118, 72, 185, .24), transparent 28rem),
    linear-gradient(110deg, rgba(12,9,18,.99), rgba(15,10,22,.94) 55%, rgba(24,14,38,.82)),
    repeating-linear-gradient(135deg, #0c0912 0, #0c0912 10px, #130d1b 10px, #130d1b 11px);
  border-bottom: 1px solid var(--line);
}
.setup-hero::after { display: none; }
.hero-copy .eyebrow { color: #9b78dd; }
.hero-copy h1 { font-size: clamp(3rem, 7.4vw, 7rem); letter-spacing: -.065em; }
.hero-copy h1 em { color: #8b5cf6; font: inherit; font-style: normal; }
.hero-text { color: #a79dad; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.dart-visual { border-color: rgba(224,207,255,.1); background: repeating-conic-gradient(from -9deg, rgba(224,207,255,.055) 0 9deg, rgba(104,57,160,.2) 9deg 18deg); }
.dart-ring { border-color: rgba(139,92,246,.62); }.dart-ring.ring-two { border-color: rgba(196,165,255,.72); }.dart-ring.ring-three { background: #8b5cf6; }

.panel, .board-card, .group-card, .roster-player, .summary-card, .ranking-panel {
  background: rgba(18, 13, 26, 0.82);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.panel { border-radius: 32px; }
.field { color: #b4a9c0; }
.field input, .field select, .field textarea { color: var(--ink); background: rgba(7,5,11,.64); border-color: var(--line); }
.field input:focus, .field select:focus, .field textarea:focus { color: white; background: #0f0a16; border-color: #7c3aed; }
.note { color: #d7c8ed; background: rgba(124,58,237,.12); border: 1px solid rgba(167,139,250,.18); }
.player-editor { background: rgba(255,255,255,.025); border-color: transparent; }
.player-editor:focus-within { background: rgba(255,255,255,.045); border-color: rgba(167,139,250,.32); }
.player-editor .field input { background: rgba(4,3,7,.55); }
.player-index { color: #786e83; border-color: var(--line); }
.bulk-entry { border-color: var(--line); }.bulk-entry summary { color: #a78bfa; }

.start-bar {
  right: 16px;
  bottom: 12px;
  left: 16px;
  min-height: 76px;
  padding-inline: clamp(22px, 6vw, 84px);
  background: rgba(18,13,26,.92);
  border: 1px solid var(--line);
  border-radius: 26px;
}
.start-bar span { color: #8e829b; }

.tournament-head {
  margin-top: -84px;
  padding-top: 118px;
  background: radial-gradient(circle at 82% 35%, rgba(124,58,237,.25), transparent 24rem), linear-gradient(110deg,#0c0912,#171022);
  border-bottom: 1px solid var(--line);
}
.tournament-head h1 { letter-spacing: -.055em; }
.round-seal { border-color: rgba(224,207,255,.24); }.round-seal strong { color: var(--lime); font-family: Bahnschrift, sans-serif; }
.metric-strip { background: rgba(18,13,26,.9); border-color: var(--line); }
.metric { border-color: var(--line); }.metric span { color: #978b9f; }.metric-in strong { color: #b89cf4; }
.view-tabs { top: 12px; background: rgba(12,9,18,.93); border-color: var(--line); }
.view-tabs button { color: #968b9e; letter-spacing: .07em; text-transform: uppercase; }.view-tabs button.active { color: white; }.view-tabs button.active::after { background: #8b5cf6; box-shadow: 0 0 16px rgba(139,92,246,.75); }
.command-bar { background: rgba(20,14,29,.88); border-color: var(--line); }
.live-share-button { margin-left: 3px; color: #d4c1fa; border-color: rgba(167,139,250,.28); }

.dot.free, .board-free .status-light { background: #49d995; }.board-free .status-light { box-shadow: 0 0 0 4px rgba(73,217,149,.12); }
.board-card, .group-column, .roster-block { border-color: var(--line); }
.board-card > header, .board-toggle, .board-actions { border-color: var(--line); }
.board-offline { color: #756d7d; background: rgba(255,255,255,.025); }
.empty-board { color: #887e90; }
.scratch-player:hover { background: rgba(255,255,255,.04); }
.scratch-check { border-color: var(--line); color: #776e80; }.scratch-player input:checked + .scratch-check { background: var(--red); }
.group-column, .roster-block { background: rgba(18,13,26,.42); }
.group-card header { background: rgba(255,255,255,.035); }.group-playing header { background: rgba(239,107,100,.09); }
.group-card li, .ranking-row { border-color: var(--line); }
.roster-player.is-out { color: #77707d; background: rgba(255,255,255,.025); }
.rank-chip, .ranking-place { color: #d7c5ff; background: rgba(124,58,237,.16); }
.payout-panel { background: linear-gradient(145deg,#171020,#0c0912); border-color: var(--line); }
.summary-card.accent { background: linear-gradient(135deg,#5b21b6,#7c3aed); border-color: #7c3aed; }
.winner-hero { margin-top: -84px; padding-top: 130px; background: radial-gradient(circle at 50% 40%, rgba(124,58,237,.28), transparent 30rem), #0c0912; }.winner-name { color: #a78bfa; font-family: Bahnschrift, sans-serif; font-weight: 800; text-transform: uppercase; }
.confetti { background-image: radial-gradient(circle, #8b5cf6 0 3px, transparent 4px), radial-gradient(circle, #c4a5ff 0 2px, transparent 3px); }
.dialog { color: var(--ink); background: #120d1a; border: 1px solid var(--line); }.dialog p:not(.eyebrow) { color: #aaa0b6; }
.dialog::backdrop { background: rgba(5,3,8,.82); }

.code-field input { font-family: Bahnschrift, monospace; font-size: 2rem; font-weight: 800; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.join-dialog form { display: grid; gap: 16px; }.join-dialog h2 { margin-bottom: 0; }
.room-code { display: grid; place-items: center; gap: 5px; margin: 24px 0; padding: 23px; background: radial-gradient(circle,rgba(124,58,237,.2),transparent 70%); border: 1px solid rgba(167,139,250,.24); border-radius: 22px; }
.room-code span, .share-link-row span { color: #968b9f; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }.room-code strong { font-family: Bahnschrift, monospace; color: #c4a5ff; font-size: 3.3rem; letter-spacing: .24em; text-indent: .24em; }.room-code small { color: #766e7e; }
.share-link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }.share-link-row > div { min-width: 0; display: grid; gap: 5px; }.share-link-row code { overflow: hidden; color: #d6cce1; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }.share-actions { justify-content: space-between; }

body[data-view] { overflow-x: hidden; background: #0c0912; }
body[data-view] .app-header { display: none; }
body[data-view] #app { min-height: 100vh; }
.viewer-shell { min-height: 100vh; color: #faf7ff; background: radial-gradient(circle at 82% 8%, rgba(96,52,160,.22), transparent 32rem), #0c0912; }
.viewer-topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px,4vw,60px); background: rgba(18,13,26,.76); border-bottom: 1px solid var(--line); }
.viewer-brand { display: flex; align-items: center; gap: 10px; }.viewer-brand > span:last-child { display: grid; }.viewer-brand strong { font-family: Bahnschrift,sans-serif; font-size: .82rem; letter-spacing: .14em; }.viewer-brand small { color: #766e80; font-size: .58rem; letter-spacing: .12em; }
.viewer-live { margin-left: auto; padding: 8px 13px; color: #d8c8f6; border: 1px solid rgba(167,139,250,.2); border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; }.viewer-live i { width: 6px; height: 6px; display: inline-block; margin-right: 6px; background: #9b6fff; border-radius: 50%; box-shadow: 0 0 12px #9b6fff; animation: livePulse 1.6s infinite; }
.viewer-title { min-height: 190px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 35px clamp(22px,5vw,72px); border-bottom: 1px solid var(--line); }.viewer-title h1 { max-width: 1100px; margin: 0; font-size: clamp(2.3rem,5vw,5.4rem); letter-spacing: -.06em; }.viewer-round { width: 116px; height: 116px; flex: 0 0 auto; display: grid; place-items: center; align-content: center; border: 1px solid rgba(224,207,255,.18); border-radius: 50%; }.viewer-round span { color: #857b8d; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; }.viewer-round strong { color: #a78bfa; font: 800 3rem Bahnschrift,sans-serif; }
.viewer-metrics { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); }.viewer-metrics > div { min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 15px clamp(18px,3vw,42px); border-right: 1px solid var(--line); }.viewer-metrics > div:last-child { border: 0; }.viewer-metrics span { color: #857c8e; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.viewer-metrics strong { font: 800 2rem Bahnschrift,sans-serif; }
.viewer-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.45fr); gap: 22px; padding: clamp(22px,3.4vw,52px); }
.viewer-stage, .viewer-standing { min-width: 0; padding: clamp(16px,2vw,28px); background: rgba(18,13,26,.64); border: 1px solid var(--line); border-radius: 28px; }
.viewer-section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }.viewer-section-title > div { display: flex; align-items: center; gap: 10px; }.viewer-section-title span { color: #7957b9; font: 700 .68rem Bahnschrift,sans-serif; }.viewer-section-title p { margin: 0; font: 800 .78rem Bahnschrift,sans-serif; letter-spacing: .13em; text-transform: uppercase; }.viewer-section-title small { color: #68606f; font-size: .57rem; letter-spacing: .08em; }
.viewer-board-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 13px; }
.viewer-group { overflow: hidden; background: rgba(7,5,11,.62); border: 1px solid var(--line); border-radius: 18px; }.viewer-group header { display: flex; justify-content: space-between; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }.viewer-group header > div { display: flex; align-items: center; gap: 8px; }.viewer-group header i { width: 7px; height: 7px; background: #7b6f84; border-radius: 50%; }.viewer-group-playing header i { background: #ef6b64; box-shadow: 0 0 10px rgba(239,107,100,.7); }.viewer-group header strong { font: 800 .72rem Bahnschrift,sans-serif; letter-spacing: .08em; }.viewer-group header span { color: #84798d; font-size: .58rem; letter-spacing: .1em; }.viewer-group ol { margin: 0; padding: 8px 14px; list-style: none; }.viewer-group li { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(224,207,255,.08); font-size: .8rem; }.viewer-group li:last-child { border: 0; }.viewer-group li small { color: #8e8497; }
.viewer-standing-list { display: grid; }.viewer-player { min-height: 52px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid rgba(224,207,255,.09); }.viewer-player > div { display: grid; }.viewer-player strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }.viewer-player small { color: #7d7485; font-size: .58rem; }.viewer-rank { color: #a78bfa; font: 800 .62rem Bahnschrift,sans-serif; }.viewer-scratches { color: #aaa0b6; font-size: .65rem; font-weight: 800; }.viewer-scratches.danger { color: #ef7770; }.viewer-player-out { opacity: .46; }
.viewer-empty { grid-column: 1/-1; min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; color: #776e7f; border: 1px dashed var(--line); border-radius: 18px; }.viewer-empty strong { color: #b5a8c1; }
.viewer-winner, .viewer-loading { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 13px; padding: 50px 22px; text-align: center; background: radial-gradient(circle,rgba(124,58,237,.22),transparent 30rem); }.viewer-winner h1, .viewer-loading h1 { margin: 0; font-size: clamp(3rem,10vw,9rem); letter-spacing: -.07em; }.viewer-winner > strong { color: #a78bfa; font: 800 clamp(2.5rem,7vw,7rem) Bahnschrift,sans-serif; text-transform: uppercase; }.viewer-winner > p:last-child, .viewer-loading > p:last-child { color: #8d8297; }
.live-orbit { width: 74px; height: 74px; border: 1px solid #7c3aed; border-top-color: transparent; border-radius: 50%; animation: orbit 1s linear infinite; }.viewer-error h1 { color: #ef7770; }

@keyframes livePulse { 50% { opacity: .35; transform: scale(.8); } }
@keyframes orbit { to { transform: rotate(360deg); } }

@media (max-width: 950px) {
  .viewer-grid { grid-template-columns: 1fr; }.viewer-board-grid { grid-template-columns: repeat(2,minmax(180px,1fr)); }.viewer-standing { order: 2; }
}

@media (max-width: 650px) {
  :root { --header-height: 76px; }
  .app-header { top: 8px; width: calc(100% - 16px); height: 58px; margin: 8px auto 10px; padding-inline: 13px; border-radius: 20px; }
  .setup-hero { margin-top: -76px; padding-top: 115px; }
  .hero-copy h1 { font-size: clamp(2.65rem,13vw,4rem); }
  .hero-actions .button { flex: 1 1 150px; }
  .panel { border-radius: 22px; }
  .start-bar { right: 8px; bottom: 8px; left: 8px; border-radius: 20px; }
  .tournament-head { margin-top: -76px; padding-top: 105px; }.tournament-head h1 { font-size: 1.55rem; }
  .view-tabs { top: 8px; }
  .room-code strong { font-size: 2.5rem; }
  .share-link-row { align-items: flex-end; }.share-link-row .button { flex: 0 0 auto; }
  .viewer-topbar { min-height: 68px; padding: 10px 13px; }.viewer-topbar .button { display: none; }.viewer-brand small { display: none; }.viewer-live { font-size: .58rem; }
  .viewer-title { min-height: 150px; padding: 25px 16px; }.viewer-title h1 { font-size: clamp(1.65rem,8.2vw,2.6rem); overflow-wrap: anywhere; }.viewer-round { width: 80px; height: 80px; }.viewer-round strong { font-size: 2.2rem; }
  .viewer-metrics { grid-template-columns: repeat(2,1fr); }.viewer-metrics > div { min-height: 74px; padding: 12px 16px; border-bottom: 1px solid var(--line); }.viewer-metrics strong { font-size: 1.5rem; }
  .viewer-grid { padding: 13px; }.viewer-stage, .viewer-standing { padding: 14px; border-radius: 20px; }.viewer-board-grid { grid-template-columns: 1fr; }
}

/* v3 · compact tournament-first interface */
:root {
  --header-height: 66px;
  --violet: #8b5cf6;
  --violet-bright: #a78bfa;
  --live-green: #58f78b;
  --deep: #08060c;
}

.app-header {
  top: 0;
  width: 100%;
  height: var(--header-height);
  margin: 0;
  padding-inline: clamp(16px, 4vw, 54px);
  background: rgba(10, 7, 14, .92);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.brand strong { font-size: .84rem; letter-spacing: .045em; text-transform: uppercase; }
.brand small { margin-top: 3px; font-size: .55rem; }
.header-actions { gap: 8px; }
.save-state { font-size: .65rem; }
.icon-button { width: 38px; height: 38px; }

.launch-shell {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(34px, 5vw, 68px) 22px;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 16% 46%, rgba(124,58,237,.24), transparent 28rem),
    radial-gradient(circle at 86% 74%, rgba(88,247,139,.04), transparent 19rem),
    #09060d;
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}
.launch-glow { position: absolute; width: 460px; height: 460px; right: -155px; top: -230px; border: 1px solid rgba(167,139,250,.2); border-radius: 50%; box-shadow: inset 0 0 90px rgba(124,58,237,.12), 0 0 120px rgba(124,58,237,.08); }
.launch-glow::before, .launch-glow::after { content: ""; position: absolute; border: 1px solid rgba(167,139,250,.1); border-radius: 50%; }
.launch-glow::before { inset: 76px; }.launch-glow::after { inset: 158px; background: #7c3aed; box-shadow: 0 0 70px rgba(124,58,237,.7); }
.launch-orbit { position: absolute; left: -190px; bottom: -290px; width: 560px; height: 560px; border: 1px solid rgba(167,139,250,.08); border-radius: 50%; box-shadow: inset 0 0 80px rgba(124,58,237,.04); }
.launch-inner { position: relative; z-index: 1; width: min(1190px, 100%); margin: auto; display: grid; grid-template-columns: minmax(340px,.88fr) minmax(470px,1.12fr); gap: clamp(46px,7vw,102px); align-items: center; }
.launch-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; padding: 7px 10px; color: #c8bbd3; background: rgba(8,6,12,.56); border: 1px solid rgba(224,207,255,.11); border-radius: 999px; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.launch-kicker i { width: 6px; height: 6px; background: var(--live-green); border-radius: 50%; box-shadow: 0 0 10px rgba(88,247,139,.65); }
.launch-kicker b { padding-left: 9px; color: #817789; border-left: 1px solid var(--line); font: inherit; }
.launch-copy h1 { max-width: 650px; margin: 0 0 24px; font-size: clamp(3.4rem,6.5vw,6.8rem); line-height: .82; letter-spacing: -.072em; }
.launch-copy h1 em { color: var(--violet); font: inherit; font-style: normal; }
.launch-copy > p { max-width: 530px; color: #aaa0b1; font-size: .98rem; line-height: 1.65; }
.launch-flow { max-width: 530px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 26px; padding: 15px 16px; background: rgba(9,6,13,.58); border: 1px solid rgba(224,207,255,.1); border-radius: 14px; backdrop-filter: blur(12px); }
.launch-flow div { min-width: 0; display: flex; align-items: center; gap: 9px; }.launch-flow b { color: var(--violet-bright); font: 800 .64rem Bahnschrift,sans-serif; }.launch-flow span { color: #a89daf; font-size: .58rem; font-weight: 800; line-height: 1.3; letter-spacing: .045em; text-transform: uppercase; }.launch-flow > i { color: #514858; font-style: normal; }
.launch-proof { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; color: #817789; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.launch-proof span { display: flex; align-items: center; gap: 7px; }.launch-proof i { width: 6px; height: 6px; background: var(--live-green); border-radius: 50%; box-shadow: 0 0 10px rgba(88,247,139,.7); }
.launch-actions { display: grid; gap: 12px; }
.launch-card { position: relative; overflow: hidden; padding: clamp(22px,3vw,34px); background: rgba(18,13,26,.9); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 26px 80px rgba(0,0,0,.3); backdrop-filter: blur(18px); }
.launch-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: #6d28d9; }
.launch-create { padding: clamp(26px,3vw,38px); background: linear-gradient(132deg,rgba(35,22,54,.97),rgba(17,12,24,.96)); border-color: rgba(167,139,250,.29); }
.launch-create::before { background: var(--violet); box-shadow: 0 0 18px rgba(139,92,246,.7); }
.launch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }.launch-card-head .eyebrow { margin-bottom: 6px; }.launch-card-head h2 { margin: 0; font-size: clamp(1.7rem,3vw,2.45rem); }
.launch-time { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 9px; color: #9f94a8; background: rgba(5,3,8,.35); border: 1px solid rgba(224,207,255,.1); border-radius: 999px; font-size: .55rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }.launch-time i { width: 6px; height: 6px; background: var(--live-green); border-radius: 50%; }
.launch-card-copy { margin: 13px 0 20px; color: #8f8498; font-size: .78rem; line-height: 1.5; }
.launch-card form { display: grid; gap: 12px; }
.launch-card label, .quick-player-form label { display: grid; gap: 7px; color: #92889a; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.launch-card input, .quick-player-form input { width: 100%; min-height: 54px; padding: 12px 15px; color: white; background: rgba(5,3,8,.72); border: 1px solid rgba(224,207,255,.16); border-radius: 11px; font-size: 1rem; text-transform: none; letter-spacing: normal; transition: border-color .18s ease, box-shadow .18s ease; }
.launch-card input:focus { border-color: rgba(167,139,250,.7); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
.launch-main-button { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding-inline: 19px; box-shadow: 0 12px 34px rgba(124,58,237,.28); }.launch-main-button b { font-size: 1.25rem; transition: transform .18s ease; }.launch-main-button:hover b { transform: translateX(4px); }
.launch-benefits { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 15px; color: #897e92; font-size: .59rem; font-weight: 700; }.launch-benefits span::first-letter { color: var(--live-green); }
.launch-follow { display: grid; grid-template-columns: minmax(150px,.72fr) minmax(280px,1.28fr); align-items: center; gap: 22px; padding-block: 22px; }.launch-follow::before { background: rgba(139,92,246,.55); }
.launch-follow-copy .eyebrow { margin-bottom: 4px; }.launch-follow-copy h3 { margin: 0 0 5px; font-size: 1.08rem; }.launch-follow-copy > span { color: #776e7e; font-size: .61rem; }
.launch-follow input { font: 800 1.45rem Bahnschrift,monospace; letter-spacing: .28em; text-align: center; text-transform: uppercase; }
.launch-follow form { grid-template-columns: minmax(130px,1fr) minmax(180px,1.1fr); align-items: center; gap: 9px; }.launch-follow form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.launch-follow .button { min-height: 54px; padding-inline: 10px; }.launch-follow .button span { margin-right: 4px; color: var(--violet-bright); }
.restore-link { min-height: 42px; color: #8f8497; background: transparent; border: 0; font-size: .65rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; transition: color .18s ease; }.restore-link:hover { color: white; }
.restore-link span { color: var(--violet-bright); margin-right: 7px; font-size: .9rem; }

.setup-shell { min-height: calc(100vh - var(--header-height)); padding-bottom: 70px; }
.setup-command-head { min-height: 132px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px max(22px,calc((100vw - 1180px)/2)); background: linear-gradient(120deg,#0d0912,#171021); border-bottom: 1px solid var(--line); }
.setup-command-head h1 { max-width: 800px; margin: 0; font-size: clamp(1.8rem,4.2vw,3.7rem); overflow-wrap: anywhere; }
.setup-command-head .eyebrow { margin-bottom: 8px; }
.pin-control { min-width: 142px; display: grid; gap: 3px; padding: 12px 16px; color: white; background: rgba(8,6,12,.7); border: 1px solid rgba(167,139,250,.25); border-radius: 12px; text-align: left; }
.pin-control span { color: #82778b; font-size: .55rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pin-control strong { color: var(--live-green); font: 800 1.18rem Bahnschrift,monospace; letter-spacing: .18em; }
.setup-workspace { width: min(1180px,calc(100% - 32px)); margin: 24px auto 0; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(330px,.7fr); gap: 18px; align-items: start; }
.compact-player-panel, .quick-rules-panel { padding: clamp(20px,2.5vw,30px); border-radius: 20px; }
.quick-rules-panel { position: sticky; top: calc(var(--header-height) + 16px); }
.compact-heading { margin-bottom: 18px; }.compact-heading h2 { font-size: 1.55rem; }.count-pill { min-width: 28px; height: 28px; font-size: .67rem; background: rgba(124,58,237,.25); border: 1px solid rgba(167,139,250,.25); }
.quick-player-form { display: grid; grid-template-columns: 1fr 52px; gap: 9px; margin-bottom: 16px; }
.quick-player-form .button { min-width: 52px; min-height: 52px; padding: 0; font-size: 1.4rem; border-radius: 11px; }
.player-editor-list { max-height: 55vh; gap: 6px; }
.player-editor-list.is-empty { min-height: 190px; }
.empty-roster { min-height: 190px; display: grid; place-items: center; align-content: center; gap: 7px; color: #776e7e; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }
.empty-roster strong { color: #b2a8ba; }.empty-roster span { font-size: .75rem; }
.player-editor { grid-template-columns: 36px minmax(130px,1fr) auto 105px 36px; min-height: 54px; padding: 5px; gap: 8px; border-radius: 10px; }
.player-editor .field span { font-size: .53rem; }.player-editor .field input { min-height: 38px; padding: 7px 9px; }.player-index { font-size: .62rem; }.paid-check span { font-size: .63rem; }.player-editor .icon-button { width: 32px; height: 32px; }
.bulk-entry { margin-top: 14px; }.bulk-entry summary, .advanced-settings summary { min-height: 40px; display: flex; align-items: center; color: #ad9cbe; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rule-control { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rule-control > div:first-child { display: grid; gap: 5px; }.rule-control strong { font-size: .87rem; }.rule-control span { color: #887e91; font-size: .7rem; }
.stepper { flex: 0 0 auto; display: grid; grid-template-columns: 40px 48px 40px; align-items: center; }
.stepper button, .segment-control button { min-height: 40px; color: #ddd2e7; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-weight: 800; }
.stepper button:first-child { border-radius: 9px 0 0 9px; }.stepper button:last-child { border-radius: 0 9px 9px 0; }.stepper output { height: 40px; display: grid; place-items: center; color: white; background: #08060c; border-block: 1px solid var(--line); font: 800 1rem Bahnschrift,monospace; }
.group-size-control { align-items: flex-start; flex-direction: column; }.segment-control { width: 100%; display: grid; grid-template-columns: repeat(5,1fr); }.segment-control button { border-right: 0; }.segment-control button:first-child { border-radius: 9px 0 0 9px; }.segment-control button:last-child { border-right: 1px solid var(--line); border-radius: 0 9px 9px 0; }.segment-control button.active { color: #08060c; background: var(--live-green); border-color: var(--live-green); }
.advanced-settings { border-bottom: 1px solid var(--line); }.advanced-settings[open] { padding-bottom: 16px; }.advanced-settings .form-grid { margin-top: 8px; }
.setup-ready-summary { display: grid; gap: 4px; margin: 20px 0 14px; }.setup-ready-summary span { font-size: .85rem; font-weight: 800; }.setup-ready-summary small { color: #817789; font-size: .68rem; line-height: 1.5; }
.start-tournament-button { border-radius: 11px; }

.recovery-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 12px; padding: 16px; background: rgba(88,247,139,.055); border: 1px solid rgba(88,247,139,.22); border-left: 3px solid var(--live-green); border-radius: 12px; }
.recovery-card > div { min-width: 0; display: grid; gap: 5px; }.recovery-card span { color: #8e8497; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }.recovery-card strong { overflow: hidden; color: var(--live-green); font: 800 clamp(1.1rem,4vw,1.45rem) Bahnschrift,monospace; letter-spacing: .15em; text-overflow: ellipsis; }.recovery-card small { color: #716978; font-size: .62rem; }.recovery-field input { font-size: 1.35rem; letter-spacing: .18em; }

.tournament-head { min-height: 128px; margin-top: 0; padding: 24px clamp(22px,6vw,90px); background: linear-gradient(115deg,#0d0912,#181023); }
.tournament-head h1 { margin: 0 0 6px; font-size: clamp(1.7rem,4vw,3.45rem); }.tournament-head .eyebrow { margin-bottom: 8px; color: #f17a74; }.tournament-subline { color: #82788a; font-size: .68rem; }.live-dot { width: 6px; height: 6px; display: inline-block; margin-right: 5px; background: #ef6b64; border-radius: 50%; box-shadow: 0 0 10px rgba(239,107,100,.8); animation: livePulse 1.6s infinite; }
.metric-strip { grid-template-columns: repeat(5,minmax(120px,1fr)); overflow-x: auto; }.metric { min-height: 66px; padding: 10px clamp(14px,2vw,28px); }.metric span { font-size: .56rem; }.metric strong { font-size: clamp(1.1rem,2vw,1.45rem); }
.view-tabs { top: var(--header-height); min-height: 50px; padding-inline: clamp(12px,6vw,90px); }.view-tabs button { min-height: 50px; padding-inline: 14px; font-size: .7rem; }
.command-bar { min-height: 64px; padding: 10px clamp(16px,6vw,90px); }.command-bar .button { min-height: 40px; }.undo-button { color: #eab463; border-color: rgba(234,180,99,.27); }.command-note { margin-left: auto; }
.live-content { padding-top: 28px; }.board-grid { grid-template-columns: repeat(auto-fit,minmax(285px,1fr)); }.board-card { min-height: 230px; }.board-card > header { min-height: 48px; }.scratch-player { min-height: 52px; }.scratch-player:has(input:checked) { background: rgba(239,107,100,.1); }.board-actions .button:last-child { min-height: 48px; }

body[data-view]::before { display: none; }
.watch-shell, .tv-shell { background: #07050a; }
.viewer-preparing { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 12px; padding: 30px; text-align: center; background: radial-gradient(circle,rgba(124,58,237,.2),transparent 28rem),#07050a; }.viewer-preparing h1 { max-width: 1000px; margin: 0; font-size: clamp(2.4rem,7vw,6rem); overflow-wrap: anywhere; }.viewer-preparing > strong { color: var(--live-green); }.viewer-preparing > p:last-child { color: #857b8d; }
.watch-topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; background: #120d1a; border-bottom: 1px solid var(--line); }.watch-topbar > div:first-child { min-width: 0; display: grid; gap: 4px; }.watch-topbar strong { overflow: hidden; font: 800 1rem Bahnschrift,sans-serif; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.watch-kicker { color: var(--live-green); font-size: .56rem; font-weight: 800; letter-spacing: .12em; }.watch-round { flex: 0 0 auto; display: flex; align-items: baseline; gap: 4px; color: #7e7486; }.watch-round b { color: white; font: 800 1.4rem Bahnschrift,sans-serif; }
.favorite-callout { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 18px; background: rgba(124,58,237,.12); border-bottom: 1px solid rgba(167,139,250,.18); }.favorite-callout span { color: #8d8196; font-size: .56rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.favorite-callout strong { grid-column: 1; font-size: .88rem; }.favorite-callout small { grid-column: 2; grid-row: 1/3; align-self: center; color: #cbb9e7; font-size: .68rem; }
.watch-tabs { position: sticky; z-index: 3; top: 0; display: grid; grid-template-columns: 1fr 1fr; background: rgba(12,9,18,.96); border-bottom: 1px solid var(--line); }.watch-tabs button { min-height: 54px; color: #7d7485; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: .72rem; font-weight: 800; text-transform: uppercase; }.watch-tabs button.active { color: white; border-bottom-color: var(--violet); }.watch-tabs b { margin-left: 4px; color: var(--violet-bright); }
.watch-content { padding: 14px; }.watch-board-list, .watch-player-list { display: grid; gap: 10px; }.watch-board-card { overflow: hidden; background: #120d1a; border: 1px solid var(--line); border-left: 3px solid var(--live-green); border-radius: 12px; }.watch-board-card.has-favorite { border-color: rgba(167,139,250,.55); box-shadow: 0 0 0 1px rgba(124,58,237,.22); }.watch-board-card header { display: flex; justify-content: space-between; padding: 12px 13px; border-bottom: 1px solid var(--line); }.watch-board-card header strong { font-size: .78rem; text-transform: uppercase; }.watch-board-card header span { color: var(--live-green); font-size: .6rem; font-weight: 800; text-transform: uppercase; }.watch-board-card > div { display: grid; }.watch-board-card button { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; color: white; background: transparent; border: 0; border-bottom: 1px solid rgba(224,207,255,.08); text-align: left; }.watch-board-card button:last-child { border: 0; }.watch-board-card button.is-favorite { background: rgba(124,58,237,.15); }.watch-board-card button.is-favorite span::before { content: "★"; margin-right: 7px; color: var(--violet-bright); }.watch-board-card button small { color: #796f82; }
.watch-player { min-height: 58px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 10px 12px; color: white; background: #120d1a; border: 1px solid var(--line); border-radius: 10px; text-align: left; }.watch-player > span { color: var(--live-green); font-size: .6rem; font-weight: 800; }.watch-player strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.watch-player small { color: #82798a; font-size: .65rem; }.watch-player.is-favorite { border-color: var(--violet); background: rgba(124,58,237,.13); }.watch-player.is-favorite strong::before { content: "★"; margin-right: 7px; color: var(--violet-bright); }.watch-player.is-out { opacity: .48; }

.tv-shell { min-width: 900px; min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.tv-topbar { min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 12px 24px; background: #120d1a; border-top: 3px solid #ef6b64; border-bottom: 1px solid var(--line); }.tv-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }.tv-brand strong { overflow: hidden; font: 800 clamp(1.1rem,2vw,1.8rem) Bahnschrift,sans-serif; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.tv-topbar time { font: 800 clamp(1.6rem,2.5vw,2.5rem) Bahnschrift,monospace; letter-spacing: .08em; }.tv-meta { justify-self: end; display: flex; gap: 24px; }.tv-meta span { color: #817688; font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }.tv-meta b { margin-left: 5px; color: white; font-size: 1.2rem; }
.tv-layout { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,22vw); gap: 18px; padding: 20px 24px; }.tv-section-label { margin-bottom: 13px; font: 800 .78rem Bahnschrift,sans-serif; letter-spacing: .1em; text-transform: uppercase; }.tv-section-label span { color: var(--live-green); }.tv-board-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(380px,1fr)); gap: 16px; }.tv-board-card { overflow: hidden; background: #120d1a; border: 1px solid var(--line); border-left: 4px solid var(--live-green); border-radius: 18px; }.tv-board-card header { display: flex; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }.tv-board-card header strong { color: #f5effb; font: 800 clamp(1.25rem,2vw,2.2rem) Bahnschrift,sans-serif; }.tv-board-card header span { color: var(--live-green); font-size: .68rem; font-weight: 800; }.tv-board-card p { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding: 10px 20px; border-bottom: 1px solid rgba(224,207,255,.08); }.tv-board-card p:last-child { border: 0; }.tv-board-card p > span { font-size: clamp(1.45rem,2.7vw,3rem); font-weight: 750; }.tv-board-card p small { display: flex; gap: 6px; }.tv-board-card p i { width: clamp(15px,1.5vw,24px); height: clamp(15px,1.5vw,24px); display: block; background: rgba(224,207,255,.09); border-radius: 50%; }.tv-board-card p i.filled { background: #ef6b64; box-shadow: 0 0 12px rgba(239,107,100,.45); }
.tv-standing { min-width: 0; padding: 16px; background: rgba(18,13,26,.68); border: 1px solid var(--line); border-radius: 16px; }.tv-standing .viewer-player { min-height: 58px; }.tv-footer { min-height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 6px 24px; color: #6f6676; background: #0f0a16; border-top: 1px solid var(--line); font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 900px) {
  .launch-inner { grid-template-columns: 1fr; gap: 38px; }.launch-copy { text-align: center; }.launch-copy > p { margin-inline: auto; }.launch-proof { justify-content: center; }.launch-copy h1, .launch-flow { margin-inline: auto; }
  .setup-workspace { grid-template-columns: 1fr; }.quick-rules-panel { position: static; }
  .board-grid { grid-template-columns: repeat(2,minmax(260px,1fr)); }
}

@media (max-width: 650px) {
  :root { --header-height: 58px; }
  .app-header { top: 0; width: 100%; height: var(--header-height); margin: 0; border-radius: 0; }.brand small, .save-state { display: none; }
  .launch-shell { min-height: calc(100vh - var(--header-height)); padding: 26px 12px 36px; }.launch-inner { gap: 28px; }.launch-kicker { margin-bottom: 18px; }.launch-copy h1 { font-size: clamp(3.15rem,16.5vw,4.8rem); }.launch-copy > p { font-size: .86rem; }.launch-flow { padding: 12px 10px; gap: 6px; }.launch-flow div { display: grid; justify-items: center; gap: 4px; }.launch-flow span { font-size: .53rem; }.launch-proof { margin-top: 18px; justify-content: center; }.launch-card { padding: 22px 18px; border-radius: 16px; }.launch-card-head { display: grid; }.launch-time { position: absolute; top: 19px; right: 16px; }.launch-card-copy { margin-top: 10px; }.launch-benefits { display: grid; gap: 6px; }.launch-follow { grid-template-columns: 1fr; gap: 15px; }.launch-follow form { grid-template-columns: 1fr; }.launch-follow-copy { text-align: left; }.restore-link { padding-inline: 4px; line-height: 1.5; }
  .setup-command-head { min-height: 104px; padding: 18px 14px; }.setup-command-head h1 { font-size: 1.35rem; }.setup-command-head .pin-control { min-width: 112px; padding: 9px 11px; }.setup-command-head .pin-control strong { font-size: .95rem; }
  .setup-workspace { width: calc(100% - 16px); margin-top: 8px; gap: 8px; }.compact-player-panel, .quick-rules-panel { padding: 18px 12px; border-radius: 14px; }.player-editor-list { max-height: none; }
  .player-editor { grid-template-columns: 28px minmax(105px,1fr) 78px 32px; }.player-editor .paid-check { display: none; }.player-editor .player-limit { width: auto; }.player-index { font-size: .55rem; }.player-editor .field input { padding-inline: 7px; font-size: .78rem; }
  .form-grid { grid-template-columns: 1fr; }.form-grid .wide { grid-column: auto; }.rule-control { min-height: 76px; }
  .tournament-head { min-height: 104px; margin-top: 0; padding: 18px 14px; }.tournament-head h1 { font-size: 1.28rem; }.tournament-subline { font-size: .58rem; }.tournament-head .pin-control { min-width: 102px; padding: 8px 10px; }.tournament-head .pin-control strong { font-size: .9rem; }
  .metric-strip { grid-template-columns: repeat(5,112px); }.metric { min-height: 58px; }.view-tabs { top: var(--header-height); padding-inline: 4px; overflow-x: auto; }.view-tabs button { flex: 1 0 auto; min-width: 84px; padding-inline: 8px; }.command-bar { overflow-x: auto; padding-inline: 10px; }.command-note { display: none; }.live-content { width: calc(100% - 16px); padding-top: 18px; }.board-grid { grid-template-columns: 1fr; }
  .recovery-card { align-items: flex-start; }.recovery-card strong { letter-spacing: .08em; }.room-code strong { font-size: 2.3rem; }
}

/* v4 · installed phone app experience */
.mobile-tab-icon,
.mobile-command-status,
.mobile-install-link { display: none; }

.install-options { display: grid; gap: 10px; margin: 22px 0; }
.install-options > div { display: grid; gap: 5px; padding: 15px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 13px; }
.install-options span { color: var(--violet-bright); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.install-options strong { color: #ded5e7; font-size: .8rem; line-height: 1.45; }.install-options b { color: var(--live-green); }

button, .button, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media (max-width: 650px) {
  html { background: #09060d; overscroll-behavior-y: none; }
  body { min-height: 100dvh; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
  input, select, textarea { font-size: 16px !important; }

  .app-header { padding-top: env(safe-area-inset-top); }
  .brand strong { font-size: .72rem; }
  .brand-mark { width: 32px; height: 32px; }
  .icon-button { min-width: 42px; min-height: 42px; }
  .overflow-menu { position: fixed; top: calc(var(--header-height) - 1px); right: 8px; width: min(280px,calc(100% - 16px)); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
  .overflow-menu button { min-height: 52px; padding-inline: 17px; font-size: .75rem; }

  .mobile-install-link { min-height: 68px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 15px; color: #ded5e7; background: rgba(124,58,237,.08); border: 1px solid rgba(167,139,250,.18); border-radius: 14px; text-align: left; }
  .mobile-install-link > span { grid-row: 1/3; width: 32px; height: 32px; display: grid; place-items: center; color: var(--live-green); border: 1px solid rgba(88,247,139,.25); border-radius: 10px; font-size: 1.1rem; }
  .mobile-install-link strong { align-self: end; font-size: .72rem; text-transform: uppercase; }.mobile-install-link small { align-self: start; color: #776e7f; font-size: .59rem; }

  body[data-phase="running"] #app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body[data-phase="running"] .view-tabs {
    position: fixed;
    z-index: 70;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(68px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 0;
    padding: 0 5px env(safe-area-inset-bottom);
    overflow: visible;
    background: rgba(13,9,19,.97);
    border-top: 1px solid rgba(224,207,255,.13);
    border-bottom: 0;
    box-shadow: 0 -12px 34px rgba(0,0,0,.32);
    backdrop-filter: blur(20px);
  }
  body[data-phase="running"] .view-tabs button { min-width: 0; min-height: 68px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 5px 2px; color: #746b7c; font-size: .55rem; letter-spacing: .045em; }
  body[data-phase="running"] .view-tabs button::after { top: 0; right: 16px; bottom: auto; left: 16px; height: 2px; border-radius: 0 0 3px 3px; }
  body[data-phase="running"] .view-tabs button.active { color: #f7f2fb; }
  .mobile-tab-icon { display: block; color: currentColor; font: 800 1.2rem/1 Bahnschrift,sans-serif; transition: transform .18s ease; }
  .view-tabs button.active .mobile-tab-icon { color: var(--violet-bright); transform: translateY(-1px); }

  .tournament-head { min-height: 98px; padding: 17px 13px; }
  .tournament-head > div:first-child { min-width: 0; }
  .tournament-head h1 { max-width: 220px; overflow: hidden; font-size: 1.2rem; text-overflow: ellipsis; white-space: nowrap; }
  .tournament-head .eyebrow { margin-bottom: 5px; font-size: .57rem; }
  .tournament-subline { max-width: 215px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tournament-head .pin-control { min-width: 96px; min-height: 54px; padding: 8px 9px; border-radius: 11px; }
  .tournament-head .pin-control span { font-size: .46rem; }.tournament-head .pin-control strong { font-size: .88rem; }

  .metric-strip { display: flex; gap: 8px; padding: 10px 10px 11px; overflow-x: auto; scroll-snap-type: x mandatory; background: #0d0913; }
  .metric { min-width: 116px; min-height: 62px; scroll-snap-align: start; padding: 10px 11px; background: rgba(255,255,255,.025); border: 1px solid var(--line) !important; border-radius: 11px; }
  .metric span { font-size: .48rem; line-height: 1.25; }.metric strong { font-size: 1.15rem; }

  .command-bar { position: sticky; z-index: 25; top: var(--header-height); min-height: 64px; display: flex; gap: 7px; padding: 8px 9px; overflow-x: auto; background: rgba(15,10,22,.96); box-shadow: 0 9px 28px rgba(0,0,0,.18); backdrop-filter: blur(18px); }
  .mobile-command-status { min-width: 66px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 1px 6px; align-items: center; padding: 4px 8px; border-right: 1px solid var(--line); }
  .mobile-command-status span { color: #776e80; font-size: .48rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.mobile-command-status b { color: var(--violet-bright); font-size: 1.1rem; }.mobile-command-status small { grid-column: 1/3; max-width: 90px; overflow: hidden; color: #82788a; font-size: .5rem; text-overflow: ellipsis; white-space: nowrap; }
  .command-bar .button { min-height: 46px; padding: 8px 12px; border-radius: 11px; font-size: .61rem; white-space: nowrap; }
  .command-bar .button-primary { flex: 1 0 auto; min-width: 150px; }.command-bar .undo-button { min-width: 170px; }

  .live-content { width: calc(100% - 16px); padding: 17px 0 22px; }
  .content-section > .section-heading { margin-bottom: 13px; padding-inline: 3px; }.content-section > .section-heading h2 { font-size: 1.35rem; }.content-section > .section-heading .eyebrow { margin-bottom: 6px; font-size: .56rem; }
  .board-grid { gap: 10px; }
  .board-card { min-height: 0; border-radius: 17px; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
  .board-card > header { min-height: 49px; padding: 10px 13px; }
  .scratch-prompt { margin: 13px 13px 7px; font-size: .65rem; }
  .scratch-list { gap: 4px; padding: 0 8px 9px; }
  .scratch-player { min-height: 58px; padding: 7px; border: 1px solid transparent; border-radius: 11px; }
  .scratch-player:has(input:checked) { background: rgba(239,107,100,.11); border-color: rgba(239,107,100,.24); }
  .scratch-check { width: 38px; height: 38px; font-size: 1.25rem; }
  .player-copy strong { font-size: .9rem; }.player-copy small { margin-top: 3px; font-size: .6rem; }
  .board-actions { gap: 8px; padding: 10px; }.board-actions .button { min-height: 52px; border-radius: 11px; }.board-actions .button:first-child { flex: 0 0 82px; }
  .board-toggle { min-height: 48px; }

  .group-column, .roster-block { border-radius: 15px; }.group-columns, .roster-layout { gap: 10px; }
  .group-card { border-radius: 11px; }.group-card li { min-height: 38px; padding-block: 9px; }
  .roster-player { min-height: 64px; padding-block: 8px; border-radius: 12px; }.roster-remove { min-width: 38px; min-height: 38px; }
  .stats-cards { gap: 8px; }.summary-card { border-radius: 13px; }.ranking-panel, .payout-panel { border-radius: 16px; }

  .dialog { width: 100%; max-width: none; max-height: min(90dvh,760px); margin: auto 0 0; overflow-y: auto; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 24px 24px 0 0; }
  .dialog form { padding: 27px 18px max(22px,env(safe-area-inset-bottom)); }
  .dialog h2 { padding-right: 28px; font-size: 1.55rem; }.dialog-close { width: 42px; height: 42px; }
  .dialog .button { min-height: 50px; }
  .toast { right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); max-width: calc(100% - 20px); border-radius: 12px; }
}

@media (display-mode: standalone) and (max-width: 650px) {
  :root { --header-height: calc(58px + env(safe-area-inset-top)); }
  .app-header { height: var(--header-height); margin: 0; padding-top: env(safe-area-inset-top); border-radius: 0; }
  .overflow-menu { top: var(--header-height); }
  .launch-shell { min-height: calc(100dvh - var(--header-height)); }
  body[data-phase="running"] .view-tabs { min-height: calc(68px + env(safe-area-inset-bottom)); }
}
