/* osu!-web inspired theme */
:root {
  --hue: 333;
  --bg-0: hsl(var(--hue), 10%, 10%);
  --bg-1: hsl(var(--hue), 10%, 15%);
  --bg-2: hsl(var(--hue), 10%, 20%);
  --bg-3: hsl(var(--hue), 10%, 25%);
  --bg-4: hsl(var(--hue), 10%, 30%);
  --bg-5: hsl(var(--hue), 10%, 40%);
  --c1: hsl(var(--hue), 10%, 92%);
  --c2: hsl(var(--hue), 10%, 72%);
  --c3: hsl(var(--hue), 10%, 55%);
  --pink: hsl(var(--hue), 100%, 70%);
  --pink-2: hsl(var(--hue), 80%, 60%);
  --pink-dark: hsl(var(--hue), 50%, 35%);
  --blue: #66ccff;
  --green: #b3d944;
  --lime: #88da20;
  --red: #ff6666;
  --yellow: #ffcc22;
  --purple: #aa88ff;
  --radius: 10px;
  --font: 'Nunito', 'Noto Sans TC', 'Torus', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-0);
  color: var(--c1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--pink); text-decoration: none; }
a:hover { color: hsl(var(--hue), 100%, 80%); }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 700; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
small, .muted { color: var(--c2); }
.dim { color: var(--c3); }
code { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: hsla(var(--hue), 10%, 15%, .92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--bg-2);
}
.nav-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 0 20px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--c1); font-weight: 800; font-size: 18px; }
.logo-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--pink); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; box-shadow: 0 0 0 3px hsla(var(--hue), 100%, 70%, .25);
}
.nav-links { display: flex; gap: 18px; }
.nav-links a { color: var(--c1); font-weight: 600; padding: 18px 0; border-bottom: 3px solid transparent; }
.nav-links a.router-link-exact-active { border-color: var(--pink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--bg-3); flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; border-radius: 6px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 14px; }
.switcher { position: relative; }
.switcher-menu {
  position: absolute; right: 0; top: 44px; background: var(--bg-2); border-radius: var(--radius);
  padding: 6px; min-width: 210px; box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
.switcher-menu button { width: 100%; justify-content: flex-start; background: transparent; }
.switcher-menu button:hover { background: var(--bg-3); }
.switcher-menu .active { color: var(--pink); }

/* ---------- Layout ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.panel { background: var(--bg-1); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel.tight { padding: 14px; }
.panel-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-title h2, .panel-title h3 { margin: 0; }
.panel-title .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Header banner for tournament ---------- */
.t-header {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 0;
  background: linear-gradient(135deg, var(--pink-dark), var(--bg-2));
  min-height: 150px; display: flex; align-items: flex-end;
}
.t-header img.banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.t-header .t-header-body { position: relative; padding: 20px 24px; width: 100%; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.t-header h1 { font-size: 28px; margin: 0; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.t-tabs {
  display: flex; gap: 4px; background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 16px; margin-bottom: 20px; overflow-x: auto;
}
.t-tabs a { color: var(--c2); padding: 12px 14px; font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.t-tabs a:hover { color: var(--c1); }
.t-tabs a.active { color: var(--c1); border-color: var(--pink); }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs button { background: var(--bg-2); color: var(--c2); border-radius: 999px; }
.subtabs button.active { background: var(--pink); color: #fff; }

/* ---------- Controls ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  border: none; border-radius: 999px; padding: 7px 16px; cursor: pointer;
  background: var(--bg-4); color: var(--c1); transition: background .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--bg-5); color: var(--c1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--pink-2); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--pink); }
button.danger { background: hsl(0, 50%, 40%); }
button.danger:hover { background: hsl(0, 60%, 50%); }
button.ghost { background: transparent; color: var(--c2); }
button.ghost:hover { background: var(--bg-3); color: var(--c1); }
button.sm, .btn.sm { padding: 4px 11px; font-size: 12px; }
button.icon { padding: 5px 9px; }

input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--c1);
  background: var(--bg-3); border: 2px solid transparent; border-radius: 8px; padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink-2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--pink); }
input[type=number] { width: 80px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
select { cursor: pointer; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; color: var(--c2); font-size: 12.5px; }
label.field input, label.field select, label.field textarea { color: var(--c1); }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--c2); font-weight: 700; font-size: 12px; padding: 8px 10px; border-bottom: 2px solid var(--bg-3); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--bg-2); vertical-align: middle; }
tr:hover td { background: hsla(var(--hue), 10%, 25%, .35); }
.table-wrap { overflow-x: auto; }
tr.advance td:first-child { box-shadow: inset 3px 0 0 var(--lime); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--bg-4); color: var(--c1); white-space: nowrap; }
.badge.admin { background: var(--pink-2); color: #fff; }
.badge.pooler { background: #4c8bd8; color: #fff; }
.badge.referee { background: #4aa36b; color: #fff; }
.badge.host { background: var(--yellow); color: #332; }
.badge.test { background: var(--purple); color: #fff; }
.status-not_started, .status-scheduled { background: var(--bg-4); }
.status-picking, .status-in_progress { background: #d88d2a; color: #fff; }
.status-testing { background: #4c8bd8; color: #fff; }
.status-done, .status-completed { background: #4aa36b; color: #fff; }
.status-bye { background: var(--bg-3); color: var(--c3); }
.user-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--c1); }
.user-chip .flag { font-size: 11px; color: var(--c3); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--bg-3); border-radius: 999px; padding: 2px 4px 2px 10px; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.chip button { padding: 0 6px; background: transparent; font-size: 12px; }

/* mod colours (osu! style) */
.mod { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 2px 8px; border-radius: 6px; font-weight: 800; font-size: 12px; color: #1b1b1b; }
.mod-NM { background: #a8b5cc; }
.mod-HD { background: #ffd35a; }
.mod-HR { background: #ff7272; }
.mod-DT, .mod-NC { background: #b98cff; }
.mod-FM { background: #6fe0a3; }
.mod-TB { background: #ff8fc8; }
.mod-EZ { background: #8fe388; }
.mod-FL { background: #444; color: #fff; }
.mod-HT { background: #c7c7c7; }
.mod-X { background: #8ad6ff; }

/* ---------- Tournament cards (home) ---------- */
.t-card { background: var(--bg-2); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; color: var(--c1); }
.t-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.35); color: var(--c1); }
.t-card .t-card-banner { height: 90px; background: linear-gradient(135deg, var(--pink-dark), var(--bg-4)); position: relative; }
.t-card .t-card-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.t-card .t-card-banner .acr { position: absolute; left: 14px; bottom: 8px; font-weight: 800; font-size: 20px; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.t-card .t-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.t-card .name { font-weight: 800; font-size: 16px; }
.t-card.add { align-items: center; justify-content: center; min-height: 190px; border: 2px dashed var(--bg-4); background: transparent; cursor: pointer; color: var(--c2); font-weight: 700; font-size: 16px; }

/* ---------- Hero (logged out) ---------- */
.hero { text-align: center; padding: 90px 20px; }
.hero h1 { font-size: 40px; }
.hero .logo-circle { width: 110px; height: 110px; font-size: 32px; margin: 0 auto 26px; }
.hero p { color: var(--c2); font-size: 16px; }

/* ---------- Beatmap cards ---------- */
.bm-card {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
  min-height: 92px; display: flex; color: var(--c1);
}
.bm-card .bm-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; }
.bm-card .bm-body { position: relative; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; width: 100%; background: linear-gradient(90deg, rgba(20,15,18,.85), rgba(20,15,18,.45)); }
.bm-card .bm-title { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.bm-card .bm-artist { font-size: 12.5px; color: var(--c2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-card .bm-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--c1); }
.bm-card .bm-stats b { color: var(--c2); font-weight: 700; margin-right: 3px; }
.sr { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.bm-card.compact { min-height: 70px; }

/* ---------- Mappool board ---------- */
.pool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pool-col {
  position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto;
  background: var(--bg-1); border-radius: var(--radius); padding: 12px;
}
.slot-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.slot-label { display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; font-size: 14px; color: #1b1b1b; }
.slot-drop { position: relative; border-radius: 8px; border: 2px dashed var(--bg-4); min-height: 64px; display: flex; align-items: stretch; transition: border-color .15s, background .15s; }
.slot-drop.filled { border-style: solid; border-color: transparent; }
.slot-drop.over { border-color: var(--pink); background: hsla(var(--hue), 100%, 70%, .08); }
.slot-drop .bm-card { flex: 1; min-width: 0; }
.slot-clear { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.45); }
.slot-note { background: transparent; padding: 2px 6px; font-size: 12px; color: var(--c2); border-radius: 6px; }
.slot-note:hover, .slot-note:focus { background: var(--bg-3); }
.sugg-form { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg { background: var(--bg-2); border-radius: 8px; overflow: hidden; cursor: grab; border: 2px solid transparent; }
.sugg.in-slot { border-color: hsla(var(--hue), 100%, 70%, .4); }
.sugg .sugg-foot { padding: 5px 8px; display: flex; gap: 6px; align-items: center; font-size: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
select.mini { padding: 2px 6px; font-size: 12px; }
select.mod-select { padding: 2px 4px; border: none; font-size: 12px; min-width: 0; }
.mod-select option { background: var(--bg-2); color: var(--c1); }
.pool-card { cursor: pointer; margin: 0; border: 2px solid transparent; transition: border-color .15s; }
.pool-card:hover { border-color: var(--pink-2); }
select.status-select { border-radius: 999px; font-weight: 800; font-size: 12px; padding: 3px 10px; border: none; color: #fff; }
select.status-select option { background: var(--bg-2); color: var(--c1); }
.save-state { font-size: 12px; color: var(--c3); }
.save-state.saved { color: var(--lime); }
.save-state.error { color: var(--red); }
.banner-btn { background: rgba(0,0,0,.45); align-self: flex-end; }
.subtabs button.admin-tab { border: 1px dashed var(--bg-5); }
.pool-table td, .pool-table th { padding: 4px 6px; }
.pool-table th.c, .pool-table td.c { text-align: center; }
.pool-table input { background: transparent; text-align: center; padding: 5px 4px; }
.pool-table input:hover, .pool-table input:focus { background: var(--bg-3); }
.pool-table .cell-name { text-align: left; width: 170px; font-weight: 700; }
.pool-table .cell-sr { width: 70px; }
.pool-table .cell-num { width: 46px; -moz-appearance: textfield; }
.pool-table .cell-num::-webkit-inner-spin-button { -webkit-appearance: none; }
.modtxt-NM { color: #6fa8ff; } .modtxt-HD { color: #ffd35a; } .modtxt-HR { color: #ff6b6b; }
.modtxt-DT { color: #b98cff; } .modtxt-FM { color: #6fd6c0; } .modtxt-TB { color: #ff8fc8; } .modtxt-X { color: var(--c2); }
table.rounds td { padding: 3px 4px; border: none; }

/* ---------- Bracket ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 10px; }
.bracket { display: flex; gap: 28px; min-width: max-content; }
.bracket-col { display: flex; flex-direction: column; min-width: 210px; }
.bracket-col h4 { text-align: center; color: var(--c2); font-size: 12.5px; margin-bottom: 10px; white-space: nowrap; }
.bracket-col .bracket-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 12px; }
.b-match { background: var(--bg-2); border-radius: 8px; overflow: hidden; position: relative; font-size: 13px; }
.b-match .b-code { position: absolute; right: 6px; top: -1px; font-size: 10px; color: var(--c3); }
.b-match .b-player { display: flex; align-items: center; gap: 7px; padding: 5px 8px; }
.b-match .b-player + .b-player { border-top: 1px solid var(--bg-1); }
.b-match .b-player .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.b-match .b-player .score { font-weight: 800; min-width: 18px; text-align: right; }
.b-match .b-player.win .name, .b-match .b-player.win .score { color: var(--pink); }
.b-match .b-player.lose { opacity: .55; }
.b-match .b-time { font-size: 10.5px; color: var(--c3); padding: 2px 8px; background: var(--bg-1); }
.b-match.bye { opacity: .45; }
.bracket-section { margin-bottom: 26px; }
.bracket-section > h3 { color: var(--pink); }

/* ---------- Referee ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; background: var(--bg-2); border-radius: var(--radius); padding: 18px 24px; }
.scoreboard .side { display: flex; align-items: center; gap: 14px; }
.scoreboard .side.right { justify-content: flex-end; text-align: right; }
.scoreboard .pname { font-size: 20px; font-weight: 800; }
.scoreboard .score { font-size: 46px; font-weight: 800; letter-spacing: 4px; text-align: center; line-height: 1; }
.p1color { color: #ff7a9c; }
.p2color { color: #6bb8ff; }
.p1-bg { background: hsla(345, 100%, 70%, .18) !important; }
.p2-bg { background: hsla(210, 100%, 70%, .18) !important; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.map-btn { position: relative; text-align: left; border-radius: 8px; overflow: hidden; background: var(--bg-2); cursor: pointer; border: 2px solid transparent; padding: 0; display: block; color: var(--c1); font-weight: 600; }
.map-btn:hover { border-color: var(--pink-2); background: var(--bg-2); }
.map-btn .mb-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .25; }
.map-btn .mb-body { position: relative; padding: 7px 10px; display: flex; gap: 8px; align-items: center; }
.map-btn .mb-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.map-btn.banned { opacity: .4; cursor: not-allowed; }
.map-btn.banned .mb-title { text-decoration: line-through; }
.map-btn.picked { cursor: default; }
.map-btn .mb-tag { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.4); }
.next-action { font-size: 16px; font-weight: 800; padding: 10px 16px; border-radius: var(--radius); background: var(--bg-2); border-left: 4px solid var(--pink); }
.timeline { display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: grid; grid-template-columns: 34px 70px 1fr auto; gap: 10px; align-items: center; background: var(--bg-2); padding: 7px 10px; border-radius: 8px; }
.tl-row input[type=number] { width: 110px; }
.cmd { display: flex; gap: 8px; align-items: center; background: var(--bg-0); padding: 6px 6px 6px 12px; border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.cmd span { flex: 1; overflow-x: auto; white-space: nowrap; }

/* ---------- Misc ---------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-3); padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); border-left: 4px solid var(--lime); max-width: 420px; white-space: pre-wrap; }
.toast.error { border-color: var(--red); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--bg-1); border-radius: var(--radius); padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.hint { background: var(--bg-2); border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 6px; color: var(--c2); font-size: 12.5px; }
.empty-state { text-align: center; padding: 40px; color: var(--c3); }
.pre { white-space: pre-wrap; }
.group-box { background: var(--bg-2); border-radius: var(--radius); padding: 12px; }
.group-box h4 { color: var(--pink); }
.loading { text-align: center; padding: 60px; color: var(--c3); }
.stage-card { background: var(--bg-2); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }

@media (max-width: 800px) {
  .pool-layout { grid-template-columns: 1fr; }
  .pool-col { position: static; max-height: none; }
  .scoreboard { grid-template-columns: 1fr; text-align: center; }
  .scoreboard .side, .scoreboard .side.right { justify-content: center; }
  .nav-inner { gap: 10px; }
  .logo span { display: none; }
}
.grid.people { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
th.c, td.c { text-align: center; }

/* compact pool rows (sheet style) */
.pool-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.pslot {
  display: grid; grid-template-columns: 40px 56px minmax(140px, 3fr) 52px 32px 38px 54px 28px 30px 30px minmax(70px, 1fr);
  gap: 6px; align-items: center; min-height: 30px; padding: 2px 4px; font-size: 13px;
  border-bottom: 1px solid var(--bg-2); border-radius: 4px; text-align: center;
}
.pslot > .pslot-title { text-align: left; }
.pslot.empty { border: 1px dashed var(--bg-4); margin: 2px 0; }
.pslot.over { background: hsla(var(--hue), 100%, 70%, .12); }
.pslot-head { font-size: 11.5px; color: var(--c3); border-bottom: 2px solid var(--bg-3); }
.pslot-head > span:nth-child(3) { text-align: left; }
.pslot-label { font-weight: 800; text-align: left; }
.pslot-thumb { width: 56px; height: 22px; object-fit: cover; border-radius: 3px; display: block; }
.pslot-notes { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pslot-notes .slot-note { flex: 1; min-width: 0; text-align: center; }
.pslot-notes button { padding: 2px 6px; font-size: 11px; }

/* drag & drop seeding */
.seed-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.seed-layout > .panel { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto; margin: 0; }
.drag-chip { display: flex; align-items: center; gap: 6px; background: var(--bg-2); padding: 4px 8px; border-radius: 6px; cursor: grab; min-width: 0; }
.drag-chip:active { cursor: grabbing; }
.group-box .drag-chip, .seed-slot .drag-chip { background: var(--bg-3); }
.seed-no { width: 18px; text-align: right; color: var(--c3); font-size: 11.5px; flex-shrink: 0; }
.drop-zone { outline: 2px dashed transparent; outline-offset: -2px; transition: outline-color .1s, background .1s; }
.drop-zone.over { outline-color: var(--pink); background: hsla(var(--hue), 100%, 70%, .06); }
.seed-slot { display: flex; align-items: center; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 8px; min-height: 38px; }

/* referee */
.ref-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ref-split .map-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ref-split .tl-row { grid-template-columns: 24px 56px 1fr auto; }
.order-table td { padding: 3px 6px; border: none; }

/* misc */
.custom-table th { font-size: 11.5px; padding: 4px; }
input.invalid { border-color: var(--red); }
td.q-ban { color: var(--c3); text-decoration: line-through; }
.pool-table .add-mod { width: 60px; font-weight: 700; }
@media (max-width: 1000px) {
  .ref-split, .seed-layout, .pool-layout { grid-template-columns: 1fr; }
  .seed-layout > .panel { position: static; max-height: none; }
}

/* compact suggestion rows */
.srow { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: center; background: var(--bg-2); border-radius: 6px; padding: 4px 6px; cursor: grab; border: 1px solid transparent; }
.srow.in-slot { border-color: hsla(var(--hue), 100%, 70%, .45); }
.srow-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.srow-title { font-size: 13px; font-weight: 700; color: var(--c1); }
.srow-stats { font-size: 11.5px; color: var(--c2); flex: 1; min-width: 0; display: flex; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.srow-title { flex: 1; }
.srow-x { padding: 0 6px !important; font-size: 11px; }
.srow select { padding: 1px 4px; font-size: 11.5px; }
.srow-stats > span { white-space: nowrap; }
.srow-actions { display: flex; align-items: center; gap: 4px; }
.srow-actions button { padding: 2px 6px; }
.bracket-col.gf h4 { color: var(--pink); }
.result-stage { margin-bottom: 28px; }
.result-stage > h2 { color: var(--pink); margin-bottom: 10px; }

/* keep the scrollbar's space reserved so pages don't shift sideways when switching views */
html { scrollbar-gutter: stable; overflow-y: scroll; }

/* referee command sheet */
.cmd-table th { width: 120px; text-align: right; color: var(--c2); font-weight: 700; font-size: 12.5px; border: none; padding: 4px 10px 4px 0; vertical-align: top; white-space: nowrap; }
.cmd-table td { border: none; padding: 3px 0; }
.cmd-table tr:hover td { background: transparent; }
.cmd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cmd-chip {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; font-weight: 600;
  background: var(--bg-0); color: var(--c1); border-radius: 6px; padding: 5px 10px; text-align: left;
}
.cmd-chip:hover { background: var(--bg-3); }
.cmd-chip.p1color { color: #ff7a9c; }
.cmd-chip.p2color { color: #6bb8ff; }

/* teams */
.team-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--bg-2); }
.team-name { width: 150px; flex-shrink: 0; font-weight: 800; }
input.team-name { background: transparent; }
input.team-name:hover, input.team-name:focus { background: var(--bg-3); }
.chip .user-chip { font-size: 12.5px; }
.vs-row { display: flex; align-items: center; gap: 10px; }
.user-chip { vertical-align: middle; }
.dt-select { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dt-select input { padding: 5px 8px; font-size: 13px; text-align: center; }
.dt-select .dt-date { width: 70px; }
.dt-select .dt-time { width: 64px; }
.team-box { background: var(--bg-2); border-radius: 8px; padding: 8px 10px; }
.team-box.free-agents { background: transparent; border: 1px dashed var(--bg-4); }
.team-members { min-height: 30px; margin-top: 6px; }
.team-box .drag-chip { background: var(--bg-3); padding: 2px 4px 2px 8px; }
/* people / staff panels line up: same header height, same input height, same action row height */
.grid.people .panel-title { min-height: 38px; }
.import-text { min-height: 0; height: 56px; resize: vertical; }
.import-row { min-height: 32px; }
