@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --neon: #00e5a0;
  --neon2: #ff4b6e;
  --gold: #ffd166;
  --court: #0a1628;
  --ink: #ffffff;
  --muted: rgba(255,255,255,0.42);
  --soft: rgba(255,255,255,0.62);
  --surface: rgba(255,255,255,0.055);
  --surface-strong: rgba(255,255,255,0.085);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 16px 44px rgba(0,0,0,0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px) 0 0/40px 40px,
    var(--court);
  color: var(--ink);
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#eventSummarySection,
#costSplitSection {
  scroll-margin-top: 80px;
}

html {
  -webkit-text-size-adjust: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 1.25rem 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(10,22,40,0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar > div {
  flex: 1;
}

.admin-actions {
  position: fixed;
  top: 20px;
  right: 66px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.admin-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav-item {
  gap: 8px;
  min-width: 48px;
  padding-inline: 13px;
}

.admin-nav-item i {
  font-size: 18px;
}

.admin-nav-item span {
  font-size: 13px;
}

.admin-nav-item.is-referee {
  background: #ffd76b;
}

.admin-nav-item.is-active {
  background: #ffd76b;
  color: #0a1628;
}

.admin-more-menu {
  position: relative;
}

.admin-header-menu {
  z-index: 1;
}

.admin-more-trigger {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
}

.admin-more-menu summary {
  list-style: none;
}

.admin-more-menu summary::-webkit-details-marker {
  display: none;
}

.admin-more-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(7, 17, 32, .98);
  box-shadow: var(--shadow);
}

.admin-menu-action {
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  text-decoration: none;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.admin-menu-action i {
  width: 16px;
  color: var(--gold);
  text-align: center;
}

.admin-menu-action.is-active {
  border: 1px solid rgba(255,209,102,.35);
  background: rgba(255,209,102,.14);
  color: #ffe7a8;
}

.admin-setup-panel,
.admin-summary-panel,
.admin-ratings-panel,
.admin-referee-stats-panel,
.admin-end-score-panel,
.admin-cost-panel {
  scroll-margin-top: 86px;
}

.eyebrow {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  line-height: 1;
}

.brand-main {
  color: var(--neon);
}

.brand-region {
  color: var(--gold);
}

h1 {
  margin: 2px 0 0;
  color: rgba(255,255,255,0.36);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 5px;
}

h2 {
  margin: 0 0 18px;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 2px;
}

h3,
p {
  margin-top: 0;
}

.shell {
  width: min(980px, calc(100% - 16px));
  margin: 18px auto 42px;
}

.mobile-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.mobile-section-title h2 {
  margin-bottom: 0;
}

.mobile-section-title .muted {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: right;
  text-transform: uppercase;
}

.link-button,
.primary {
  border: 0;
  border-radius: 12px;
  background: var(--neon);
  color: #0a1628;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .4px;
  transition: transform .1s, opacity .15s;
}

.link-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 10px;
}

.primary:active,
.link-button:active {
  transform: scale(.97);
}

.icon-nav-link {
  padding-inline: 12px;
  font-size: 20px;
}

.admin-back-button {
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 16px;
}

.admin-back-button:hover {
  background: rgba(255,255,255,.12);
}

.topbar-event-name {
  margin: 1px 0 0;
  font-size: 12px;
  font-style: italic;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-page-label {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin: 0;
}

.topbar-referee-link {
  margin-left: auto;
  background: #ffd76b;
  color: #0a1628;
}
.topbar-referee-link:hover {
  background: #ffe99a;
  color: #0a1628;
}

.organizer-events-panel {
  position: relative;
}

.organizer-events-panel .section-head {
  padding-right: min(220px, 32%);
}

.organizer-events-panel .player-grid {
  gap: 10px;
}

.event-pin-float {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  min-width: 160px;
  max-width: min(220px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(255,215,107,.38);
  border-radius: 12px;
  background: rgba(10,22,40,.94);
  box-shadow: var(--shadow);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  line-height: 1.35;
}

.event-pin-float strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 1.2px;
}

.event-pin-float code {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: var(--neon);
  font-size: 15px;
  font-weight: 700;
}

.commercial-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(0,229,160,.22);
  border-radius: 14px;
  background: rgba(0,229,160,.07);
}

.commercial-status strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.commercial-status span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.5);
  font-size: 11px;
  line-height: 1.35;
}

.commercial-status b {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,209,102,.16);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.superadmin-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.superadmin-status.is-active {
  border-color: rgba(0,229,160,.35);
  background: rgba(0,229,160,.14);
  color: #c9ffef;
}

.superadmin-status.is-inactive {
  border-color: rgba(255,75,110,.42);
  background: rgba(255,75,110,.16);
  color: #ffd6df;
}

.superadmin-status.is-state {
  border-color: rgba(255,209,102,.35);
  background: rgba(255,209,102,.14);
  color: #ffe7a8;
}

.superadmin-select {
  width: 100%;
  min-width: 112px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(8, 24, 44, .88);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.superadmin-select + .muted {
  display: block;
  margin-top: 5px;
  font-size: 10px;
}

.superadmin-toggle-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
}

.primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.panel,
.toolbar,
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
  min-width: 0;
}

.narrow {
  max-width: 420px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid > * {
  min-width: 0;
}

.grid.two {
  grid-template-columns: minmax(310px, .82fr) minmax(420px, 1.18fr);
  align-items: start;
}

.full-span {
  grid-column: 1 / -1;
}

.grid.two-fields {
  grid-template-columns: 1fr 1fr;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.duration-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.duration-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.health-card {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.health-card strong {
  font-size: 15px;
}

.health-card.is-good {
  border-color: rgba(0,229,160,.35);
  background: rgba(0,229,160,.08);
}

.health-card.is-warn {
  border-color: rgba(255,209,102,.35);
  background: rgba(255,209,102,.08);
}

.health-card.is-bad {
  border-color: rgba(255,75,110,.35);
  background: rgba(255,75,110,.08);
}

.health-list {
  display: grid;
  gap: 6px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.health-pill.health-pass {
  border: 1px solid rgba(0,229,160,.35);
  background: rgba(0,229,160,.14);
  color: #c9ffef;
}

.health-pill.health-fail {
  border: 1px solid rgba(255,75,110,.42);
  background: rgba(255,75,110,.16);
  color: #ffd6df;
}

.health-pill.health-warning {
  border: 1px solid rgba(255,209,102,.40);
  background: rgba(255,209,102,.14);
  color: #ffe7a8;
}

.health-pill.health-info {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--soft);
}

.row-action-cell {
  width: 58px;
  text-align: right;
}

.mobile-match-row {
  display: none;
}

.icon-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

.icon-action-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.icon-action-button i {
  font-size: 14px;
}

.mini-dialog {
  width: min(460px, calc(100vw - 24px));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: #13233d;
  color: #fff;
}

.mini-dialog::backdrop {
  background: rgba(4, 10, 24, 0.72);
}

.mini-dialog-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.mini-dialog-body h3 {
  margin: 0;
  font-size: 20px;
}

.cost-racket-cell {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.cost-racket-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.cost-racket-toggle input {
  width: 16px;
  height: 16px;
}

.cost-racket-cell input[type="number"] {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.field.compact {
  width: min(220px, 100%);
  margin-bottom: 0;
}

.generate-progress {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.generate-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.generate-progress-head strong {
  font-size: 12px;
  letter-spacing: .8px;
  color: #fff;
}

.generate-progress-head span {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

.generate-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
}

.generate-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon), var(--gold), var(--neon2));
  transition: width .2s ease;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.picker-actions .link-button {
  min-width: 0;
}

.inline-add-control {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(128px, .8fr) auto;
  gap: 8px;
}

.inline-add-control button {
  min-height: 44px;
  padding-inline: 18px;
}

.picker-actions-col {
  flex-direction: column;
}

.full-width {
  width: 100%;
}

.secondary-button {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid var(--border);
}

.danger-button {
  border-color: rgba(255,75,110,.35);
  background: rgba(255,75,110,.12);
  color: #ffdce4;
}

.secondary-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mini-button.is-start {
  border-color: rgba(0,229,160,.35);
  color: #d6fff2;
}

.mini-button.is-end {
  border-color: rgba(255,209,102,.35);
  color: #ffe7a7;
}

.mini-button.is-reset {
  border-color: rgba(255,75,110,.35);
  color: #ffdce4;
}

.mini-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.picker-button,
.player-chip {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  color: #fff;
}

.picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 12px;
  text-align: left;
}

.picker-action-pill {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,229,160,.14);
  color: var(--neon);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-align: center;
  text-transform: uppercase;
}

.generate-action-bar {
  margin-top: 6px;
}

.picker-button.is-selected {
  border-color: rgba(0,229,160,.65);
  background: rgba(0,229,160,.1);
}

.picker-button.is-selected .picker-action-pill {
  background: rgba(255,209,102,.16);
  color: var(--gold);
}

.picker-button strong,
.player-chip strong {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.selected-list .player-chip strong {
  font-size: 16px;
}

.picker-button span,
.player-chip span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.34);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.selected-list .player-chip span {
  display: none;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 56px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.player-chip {
  display: inline-grid;
  gap: 6px;
  padding: 4px 10px;
}

.player-chip.is-new {
  border-color: rgba(255,75,110,.35);
  background: rgba(255,75,110,.08);
}

.chip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chip-main > div:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-availability {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.player-chip.avail-open .chip-availability {
  display: grid;
}

.chip-availability label {
  display: grid;
  gap: 6px;
  color: rgba(255,255,255,.34);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chip-availability input,
.chip-availability select {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
}

.chip-constraint {
  color: #ffd76b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.chip-remove {
  border: 0;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.09);
  color: #fff;
  font-weight: 700;
}

.chip-edit {
  border: 1px solid rgba(0,229,160,.35);
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  background: rgba(0,229,160,.08);
  color: #d6fff2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chip-avail-toggle {
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.4);
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chip-avail-toggle.is-active {
  border-color: rgba(255,215,107,.5);
  background: rgba(255,215,107,.1);
  color: #ffd76b;
}

.chip-reset-avail {
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.4);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chip-reset-avail:hover {
  background: rgba(255,80,80,.15);
  border-color: rgba(255,80,80,.4);
  color: #ff8080;
}

.hint-list {
  display: grid;
  gap: 8px;
  margin: -4px 0 16px;
}

.hint-card {
  padding: 10px 12px;
  border: 1px solid rgba(255,209,102,.36);
  border-radius: 12px;
  background: rgba(255,209,102,.08);
  color: rgba(255,255,255,.8);
  font-size: 12px;
  line-height: 1.45;
}

.hint-card strong {
  color: var(--gold);
}

.picker-empty {
  padding: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  color: #fff;
  padding: 13px 14px;
  outline: none;
}

select option {
  background: #0a1628;
  color: #fff;
}

textarea {
  resize: vertical;
  min-height: 220px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.28);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0,229,160,0.14);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.dot.waiting {
  background: var(--neon);
}

.dot.ongoing {
  background: var(--gold);
}

.dot.finished {
  background: rgba(255,255,255,.25);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
}

.section-head p,
.muted {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  transition: transform .1s, border-color .12s, background .12s;
}

.match-card:not(.finished):hover {
  transform: translateY(-1px);
  border-color: rgba(0,229,160,.55);
}

.match-card.finished {
  color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.025);
  box-shadow: none;
  cursor: not-allowed;
}

.match-card.finished h3,
.match-card.finished .round,
.match-card.finished .card-meta,
.match-card.finished strong {
  color: rgba(255,255,255,0.20);
}

.match-card.ongoing {
  border-color: rgba(255,209,102,.65);
  background: rgba(255,209,102,.08);
}

.match-card.locked-by-referee {
  opacity: .55;
  cursor: not-allowed;
}

.match-card.locked-by-referee:hover {
  transform: none;
  border-color: rgba(255,209,102,.65);
}

.match-card.self-referee {
  border-color: rgba(255,75,110,.65);
  background: rgba(255,75,110,.10);
  cursor: not-allowed;
}

.match-card.self-referee .card-meta {
  color: rgba(255,140,162,.95);
}

.match-card.self-referee:hover {
  transform: none;
  border-color: rgba(255,75,110,.85);
}

.match-card.shake {
  animation: cardShake .22s ease-in-out;
}

@keyframes cardShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.match-card.waiting {
  border-color: rgba(0,229,160,.22);
}

.round {
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.match-card h3 {
  margin-bottom: 0;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 4.6vw, 28px);
  font-weight: 400;
  letter-spacing: 1.4px;
  line-height: 1.05;
}

.match-card h3 span {
  color: rgba(255,255,255,0.24);
  font-size: .72em;
}

.card-meta {
  margin: 7px 0 0;
  color: rgba(255,255,255,0.34);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.match-card strong {
  color: var(--soft);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.metric strong {
  color: var(--neon);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.compact-table {
  max-height: 360px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: rgba(255,255,255,0.03);
  font-size: 13px;
}

.dense-table {
  min-width: 0;
  table-layout: fixed;
}

.dense-table th,
.dense-table td {
  padding: 8px 10px;
}

.dense-table th:nth-child(1),
.dense-table td:nth-child(1) {
  width: 52px;
}

.dense-table .rating-value,
.dense-table .match-count {
  font-size: 20px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #10243c;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

td {
  color: rgba(255,255,255,0.7);
}

.rating-value {
  color: var(--neon);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
}

.match-count {
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
}

.rank-change {
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.rank-up { color: #22c55e; }
.rank-down { color: #ef4444; }
.rank-same { color: rgba(255,255,255,0.3); }

.mmr-delta {
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.mmr-delta-up { color: #22c55e; }
.mmr-delta-down { color: #ef4444; }
.mmr-delta-same { color: rgba(255,255,255,0.3); }

.mmr-balance {
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.mmr-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.mmr-group-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
}

.mmr-group-card strong {
  display: block;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mmr-group-card span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
}

.mmr-group-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.error {
  color: var(--neon2);
  font-weight: 700;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.page-loading {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(10,22,40,0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.page-loading-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  padding: 16px 18px;
  text-align: center;
  min-width: 220px;
}

.page-loading-card strong {
  display: block;
  color: var(--neon);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
}

.page-loading-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.home-shell {
  display: grid;
  gap: 18px;
}

.access-gateway {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 24px auto 0;
}

.access-gateway-head {
  margin: 0;
}

.access-gateway-head .section-head {
  align-items: center;
}

.access-list {
  display: grid;
  gap: 12px;
}

.access-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.access-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.26);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.access-option > div {
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.access-option small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.access-option strong {
  display: block;
  max-width: 100%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: .95;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.access-option span {
  display: block;
  max-width: 100%;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.access-option b {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}

.access-option-admin {
  min-height: 152px;
  padding: 26px 24px;
  border-color: rgba(0,229,160,.28);
  background: rgba(0,229,160,.08);
}

.access-option-admin > div {
  gap: 10px;
}

.access-option-admin strong {
  font-size: 38px;
}

.access-option-admin b {
  min-width: 112px;
  padding-block: 14px;
  background: rgba(0,229,160,.16);
}

.access-option-referee {
  border-color: rgba(255,209,102,.28);
  background: rgba(255,209,102,.08);
}

.access-option-viewer {
  border-color: rgba(255,255,255,.12);
}

.access-option.is-active,
.link-button.is-active {
  box-shadow: 0 0 0 2px rgba(0,229,160,.35) inset;
  border-color: rgba(0,229,160,.55);
  background: rgba(0,229,160,.12);
}

.admin-actions .admin-nav-item.is-active {
  box-shadow: none;
  border-color: transparent;
  background: #ffd76b;
  color: #0a1628;
}

.referee-pin-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 13, 24, .74);
  backdrop-filter: blur(10px);
}

.referee-pin-card {
  width: min(100%, 420px);
  position: relative;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(15, 26, 44, .96);
  box-shadow: var(--shadow);
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pin-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.live-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 0;
}

.live-hero-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.live-hero h2 {
  margin-bottom: 0;
  color: var(--neon);
  font-size: clamp(42px, 10vw, 76px);
  line-height: .88;
}

.live-hero p:last-child {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.live-badge.is-live {
  border-color: rgba(255,75,110,.45);
  background: rgba(255,75,110,.1);
  color: #ffd7df;
}

.live-ball {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
}

.live-badge.is-live .live-ball {
  background: #ff4b6e;
  box-shadow: 0 0 0 rgba(255,75,110,.7);
  animation: livePulse 1s ease-in-out infinite;
}

@keyframes livePulse {
  0% {
    opacity: .45;
    transform: scale(.82);
    box-shadow: 0 0 0 0 rgba(255,75,110,.55);
  }
  60% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(255,75,110,0);
  }
  100% {
    opacity: .55;
    transform: scale(.88);
    box-shadow: 0 0 0 0 rgba(255,75,110,0);
  }
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.live-card {
  background: var(--surface);
  border: 1px solid rgba(255,209,102,.34);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.live-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.live-card-head strong {
  color: rgba(255,255,255,.45);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.live-score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.live-team {
  display: grid;
  gap: 7px;
}

.live-team h3 {
  min-height: 48px;
  margin: 0;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 400;
  letter-spacing: 1.5px;
  line-height: .95;
}

.live-team span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 18vw, 112px);
  line-height: .82;
}

.live-team.a span {
  color: var(--neon);
}

.live-team.b {
  text-align: right;
}

.live-team.b span {
  color: var(--neon2);
}

.live-vs {
  color: rgba(255,255,255,.22);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
}

.live-progress {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.live-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon), var(--gold), var(--neon2));
  transition: width .2s;
}

.viewer-match-list {
  display: grid;
  gap: 10px;
}

.viewer-match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.viewer-match-card.waiting {
  border-color: rgba(0,229,160,.22);
}

.viewer-match-card.ongoing {
  border-color: rgba(255,209,102,.65);
  background: rgba(255,209,102,.08);
}

.viewer-match-card.finished {
  opacity: .74;
}

.viewer-match-main {
  min-width: 0;
}

.viewer-match-card h3 {
  margin: 0;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 400;
  letter-spacing: 1.4px;
  line-height: 1;
}

.viewer-match-card h3 span {
  color: rgba(255,255,255,.24);
  font-size: .72em;
}

.viewer-match-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex-shrink: 0;
}

.viewer-match-score {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--neon);
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 9vw, 62px);
  line-height: .8;
}

.viewer-match-score i {
  color: rgba(255,255,255,.28);
  font-style: normal;
  font-size: .55em;
}

.viewer-match-status {
  color: rgba(255,255,255,.48);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.player-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

a.player-pill {
  text-decoration: none;
}

.player-pill.is-playing {
  border-color: rgba(0,229,160,.6);
  background: rgba(0,229,160,.08);
}

.player-pill strong,
.player-pill b {
  display: block;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1;
}

.player-pill span,
.player-pill small {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.34);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.player-pill > div:last-child {
  text-align: right;
}

.finished-list {
  display: grid;
  gap: 10px;
}

.match-distribution {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px 12px;
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.07);
}

.match-dist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}

.match-dist-row span {
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-dist-row strong {
  color: var(--neon);
  flex-shrink: 0;
}

.end-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.end-result-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.end-result-card.end-result-mvp {
  border-color: rgba(255,215,107,.35);
  background: rgba(255,215,107,.07);
}

.end-result-label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
}

.end-result-card strong {
  font-size: 18px;
  color: #fff;
}

.end-result-mvp strong {
  color: #ffd76b;
}

.end-result-val {
  font-size: 12px;
  color: rgba(255,255,255,.5);
}

@media (max-width: 480px) {
  .end-results-grid {
    grid-template-columns: 1fr;
  }
}

.finished-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.finished-row h3 {
  margin: 3px 0 0;
  color: rgba(255,255,255,.42);
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 400;
  letter-spacing: 1.4px;
  line-height: .95;
}

.finished-row h3.winner {
  color: #fff;
}

.finished-score {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.28);
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(42px, 10vw, 64px);
  line-height: .8;
}

.finished-score span.winner {
  color: var(--gold);
}

.finished-score i {
  font-style: normal;
  font-size: .55em;
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding-inline: 1rem;
  }

  .topbar > div {
    flex: 1 1 100%;
    order: -1;
  }

  .topbar .link-button {
    flex: 1;
  }

  .topbar .icon-nav-link {
    font-size: 15px;
    padding-inline: 0;
  }

  .admin-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .admin-topbar > div {
    order: 0;
    min-width: 0;
  }

  .admin-topbar .eyebrow {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }

  .admin-topbar .eyebrow span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .admin-actions {
    top: 14px;
    right: 66px;
  }

  .topbar-home {
    flex-wrap: nowrap;
  }

  .topbar-home > div {
    flex: 1 1 auto;
  }

  .topbar-home .link-button {
    flex: 0 0 auto;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .shell,
  .grid.two,
  .grid.two > *,
  .selected-list,
  .picker-grid,
  .duration-grid,
  .table-wrap {
    min-width: 0;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .field.compact {
    width: 100%;
  }

  .status-strip {
    grid-column: 1 / -1;
  }

  .toolbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-add-control {
    grid-template-columns: minmax(0, 1fr) minmax(106px, .6fr);
  }

  .inline-add-control button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-grid,
  .live-grid {
    grid-template-columns: 1fr;
  }

  .access-option {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-option b {
    min-width: 0;
  }

  .selected-list {
    display: grid;
  }

  .player-chip {
    width: 100%;
  }

  .event-pin-float {
    top: 16px;
    right: 16px;
    min-width: 0;
  }

  .organizer-events-panel .section-head {
    padding-right: min(208px, 42%);
  }
}

@media (max-width: 520px) {
  body {
    background-size: 32px 32px, 32px 32px, auto;
  }

  .topbar {
    gap: 8px;
    padding: .75rem .75rem calc(.5rem + env(safe-area-inset-top, 0px));
  }

  .topbar-home,
  .referee-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 70px;
    align-items: center;
  }

  .topbar-home > div,
  .referee-topbar > div {
    min-width: 0;
  }

  .topbar-home .eyebrow,
  .referee-topbar .eyebrow {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }

  .topbar-home .eyebrow span,
  .referee-topbar .eyebrow span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-home .link-button {
    min-width: 0;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
  }

  .topbar-home #homeAccessNav {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-home #homeRefereeNav,
  .topbar-home #homeAdminNav {
    display: none !important;
  }

  .referee-admin-link {
    display: none;
  }

  .referee-topbar .topbar-page-label {
    top: 9px;
    right: 12px;
  }

  .admin-topbar {
    min-height: 70px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-bottom-color: rgba(255,255,255,.1);
  }

  .admin-topbar .topbar-page-label {
    top: 9px;
    right: 12px;
  }

  .admin-actions {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid rgba(255,255,255,.14);
    border-radius: 20px 20px 0 0;
    background: rgba(7, 17, 32, .96);
    box-shadow: 0 -18px 42px rgba(0,0,0,.38);
    backdrop-filter: blur(18px);
    transform: none;
    overflow: visible;
  }

  .admin-primary-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    width: min(100%, 410px);
    margin: 0 auto;
    min-width: 0;
  }

  .admin-nav-item {
    flex: 0 0 52px;
    flex-direction: row;
    gap: 0;
    width: 52px;
    min-width: 0;
    min-height: 52px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,.72);
    overflow: hidden;
    transition: flex-basis .18s ease, background .18s ease, color .18s ease;
  }

  .admin-nav-item i {
    flex: 0 0 auto;
    font-size: 17px;
  }

  .admin-nav-item span {
    display: none;
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .admin-actions .admin-nav-item.is-active {
    flex: 1 1 128px;
    max-width: 150px;
    gap: 8px;
    padding: 0 14px;
    background: var(--neon);
    color: #061525;
  }

  .admin-actions .admin-nav-item.is-active span {
    display: block;
  }

  .admin-header-menu .admin-more-popover {
    width: min(210px, calc(100vw - 16px));
  }

  .admin-topbar + .admin-actions + .shell {
    padding-bottom: 92px;
  }

  body[data-admin-tab="events"] #adminPanel > [data-admin-section]:not([data-admin-section="events"]),
  body[data-admin-tab="setup"] #adminPanel > [data-admin-section]:not([data-admin-section="setup"]),
  body[data-admin-tab="matches"] #adminPanel > [data-admin-section]:not([data-admin-section="matches"]),
  body[data-admin-tab="results"] #adminPanel > [data-admin-section]:not([data-admin-section="results"]),
  body[data-admin-tab="finance"] #adminPanel > [data-admin-section]:not([data-admin-section="finance"]) {
    display: none !important;
  }

  .eyebrow {
    font-size: 18px;
    gap: 6px;
    letter-spacing: 1.6px;
  }

  h1 {
    font-size: 14px;
  }

  h2 {
    font-size: 26px;
    margin-bottom: 14px;
  }

  .shell {
    width: auto;
    margin: 0 auto 88px;
    padding: 10px 8px 0;
  }

  .home-shell {
    gap: 12px;
    max-width: 100%;
    overflow: hidden;
  }

  .access-gateway {
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
  }

  .access-list,
  .access-option,
  .access-option > div {
    min-width: 0;
    max-width: 100%;
  }

  .access-option-admin {
    min-height: 132px;
    padding: 20px;
  }

  .access-option {
    overflow: hidden;
    max-width: 100%;
  }

  .access-option-admin strong {
    font-size: 32px;
    line-height: .92;
  }

  .access-option strong {
    font-size: 26px;
    line-height: .95;
  }

  .access-option span {
    font-size: 12px;
    line-height: 1.45;
  }

  .event-pin-float {
    position: static;
    max-width: none;
    margin: 0 0 14px;
    padding: 10px 12px;
  }

  .event-pin-float strong {
    font-size: 16px;
  }

  .event-pin-float code {
    font-size: 14px;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  .admin-setup-panel,
  .admin-summary-panel,
  .admin-ratings-panel,
  .admin-referee-stats-panel,
  .admin-end-score-panel,
  .admin-cost-panel {
    scroll-margin-top: 76px;
  }

  #adminPanel {
    gap: 12px;
  }

  .organizer-events-panel {
    display: grid;
    gap: 12px;
  }

  .organizer-events-panel .section-head {
    margin: 0;
    padding-right: 0;
  }

  .organizer-events-panel .grid.two-fields,
  .organizer-events-panel .picker-actions,
  .organizer-events-panel .player-grid {
    margin-bottom: 0;
  }

  .organizer-events-panel .player-pill {
    min-height: 72px;
  }

  .organizer-events-panel .player-pill strong {
    font-size: 23px;
  }

  .admin-setup-panel,
  .admin-summary-panel,
  .admin-end-score-panel,
  .admin-cost-panel {
    border-radius: 18px;
  }

  .admin-summary-panel,
  .admin-ratings-panel,
  .admin-referee-stats-panel,
  .admin-end-score-panel,
  .admin-cost-panel {
    display: grid;
    gap: 12px;
  }

  #scheduleForm {
    display: grid;
    gap: 14px;
    scroll-margin-top: 82px;
  }

  #scheduleForm > .field,
  #scheduleForm > .grid,
  #scheduleForm > .picker-actions,
  #scheduleForm > .picker-grid,
  #scheduleForm > .selected-list {
    margin-bottom: 0;
  }

  .narrow {
    width: 100%;
    max-width: 100%;
  }

  .link-button {
    font-size: 12px;
    min-height: 42px;
    padding-inline: 12px;
  }

  .primary {
    width: 100%;
    min-height: 48px;
  }

  .picker-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #scheduleForm > .picker-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #scheduleForm > .picker-actions:has(#resetAvailabilityBtn) {
    grid-template-columns: 1fr;
  }

  #scheduleForm > .picker-actions .link-button {
    width: 100%;
  }

  .grid.two-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mobile-section-title {
    align-items: center;
    position: sticky;
    top: 70px;
    z-index: 1;
    margin: -4px -4px 0;
    padding: 10px 4px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(21, 34, 53, .98), rgba(21, 34, 53, .92));
    backdrop-filter: blur(10px);
  }

  .mobile-section-title .muted {
    max-width: 112px;
  }

  .inline-add-control {
    grid-template-columns: 1fr;
  }

  .inline-add-control button {
    min-height: 48px;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }

  .status-strip {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
  }

  .match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .match-card h3 {
    overflow: hidden;
    font-size: clamp(20px, 6vw, 24px);
    line-height: .98;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-card strong {
    align-self: center;
    min-width: 74px;
    padding: 8px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    text-align: center;
  }

  .match-card .card-meta {
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .section-head {
    gap: 8px;
  }

  .live-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
  }

  .live-hero-side {
    justify-items: end;
  }

  .live-hero h2 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .live-card,
  .finished-row,
  .player-pill {
    padding: 14px;
  }

  .viewer-match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .viewer-match-side {
    display: grid;
    justify-items: end;
    gap: 4px;
  }

  .viewer-match-card h3 {
    overflow: hidden;
    font-size: clamp(20px, 6vw, 25px);
    line-height: .98;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .viewer-match-card .card-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .viewer-match-score {
    font-size: clamp(36px, 11vw, 52px);
  }

  .live-team h3 {
    min-height: 0;
    font-size: clamp(14px, 4vw, 24px);
  }

  .live-team span {
    font-size: clamp(48px, 14vw, 84px);
  }

  .live-vs {
    font-size: 16px;
  }

  .player-pill > div:last-child {
    text-align: left;
  }

  .player-grid {
    gap: 8px;
  }

  .picker-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 300px;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .picker-button {
    min-height: 60px;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .picker-button strong {
    font-size: 22px;
  }

  .picker-action-pill {
    min-width: 64px;
    padding: 10px 12px;
  }

  .player-chip,
  .duration-card,
  .metric,
  .health-card {
    max-width: 100%;
  }

  .selected-list {
    gap: 10px;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .player-chip {
    padding: 9px 10px;
    border-radius: 14px;
  }

  .chip-actions {
    flex-shrink: 0;
  }

  .player-chip.avail-open .chip-availability {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric {
    padding: 10px;
  }

  .metric strong {
    font-size: 32px;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    border-radius: 14px;
  }

  .mobile-card-table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table th,
  .mobile-card-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .mobile-card-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 10px;
  }

  .mobile-card-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
  }

  .mobile-card-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    border-bottom: 0;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    text-align: right;
  }

  .mobile-card-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    color: rgba(255,255,255,.38);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-align: left;
    text-transform: uppercase;
  }

  .mobile-card-table .table-empty-row {
    display: block;
    padding: 14px;
    border-style: dashed;
  }

  .mobile-card-table .table-empty-row td {
    display: block;
    text-align: left;
  }

  .mobile-card-table .table-empty-row td::before {
    display: none;
  }

  .schedule-preview-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-color: rgba(255,209,102,.24);
  }

  .schedule-preview-table td:not(.mobile-match-row):not(.row-action-cell) {
    display: none;
  }

  .schedule-preview-table .mobile-match-row {
    display: grid;
    gap: 5px;
    min-width: 0;
    text-align: left;
  }

  .schedule-preview-table .mobile-match-row::before {
    display: none;
  }

  .mobile-match-main {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-match-main span {
    color: var(--gold);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.1px;
    text-transform: uppercase;
  }

  .mobile-match-main strong {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(19px, 6vw, 24px);
    font-weight: 400;
    letter-spacing: 1px;
    line-height: .98;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-match-main em {
    color: rgba(255,255,255,.35);
    font-style: normal;
    font-size: .76em;
  }

  .mobile-match-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: rgba(255,255,255,.52);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
  }

  .mobile-card-table .row-action-cell {
    width: auto;
    min-width: 44px;
    align-self: center;
    justify-content: flex-end;
  }

  .schedule-preview-table .row-action-cell::before {
    display: none;
  }

  .cost-mobile-table td {
    align-items: center;
  }

  .cost-mobile-table .cost-racket-cell {
    justify-items: end;
    min-width: 0;
  }

  .generate-action-bar {
    position: static;
    z-index: auto;
    margin: 14px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .generate-action-bar .primary {
    width: 100%;
  }

  .cost-footer {
    padding: 10px 12px;
  }

  .dense-table .rating-value,
  .dense-table .match-count {
    font-size: 18px;
  }

  .cost-racket-cell {
    min-width: 130px;
  }

  .cost-racket-cell input[type="number"] {
    padding: 8px;
  }
}
