:root {
  --bg: #010a13;
  --bg2: #0a1428;
  --panel: #0f1b2d;
  --panel2: #142338;
  --line: #1e2d44;
  --line2: #2b3e5c;
  --text: #e7e2d6;
  --muted: #8a94a6;
  --gold: #c8aa6e;
  --gold2: #f0e6d2;
  --gold-dim: #785a28;
  --blue: #2fa5e8;
  --blue-bg: rgba(47, 165, 232, .12);
  --red: #e84057;
  --red-bg: rgba(232, 64, 87, .12);
  --ok: #3ccf8e;
  --warn: #f5b041;
  --star: #f3c24f;
  --star-off: #2a3850;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --r-TOP: #d98e3b; --r-JNG: #3ccf8e; --r-MID: #b57bf0; --r-ADC: #f06b6b; --r-SUP: #4fb3f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #12233d 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }
h1, h2, h3 { font-family: Cinzel, Georgia, serif; letter-spacing: .04em; color: var(--gold2); margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 20px; } h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: linear-gradient(#0a1428f2, #010a13f2);
  border-bottom: 1px solid var(--gold-dim);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: Cinzel, serif; font-size: 18px; color: var(--gold2); letter-spacing: .08em; }
.brand b { color: var(--gold); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.topbar nav a:hover { color: var(--gold2); }
.topbar nav a.active { color: var(--gold2); background: #ffffff0d; box-shadow: inset 0 -2px 0 var(--gold); }
.server-status { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.server-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.server-status.on::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.server-status.off::before { background: var(--warn); }

main { max-width: 1440px; margin: 0 auto; padding: 24px; }

/* ---------- panels & controls ---------- */
.panel { background: linear-gradient(var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h2 { display: flex; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 6px; cursor: pointer;
  background: #1a2a42; color: var(--text); border: 1px solid var(--line2);
  font: 600 13px Inter, sans-serif; letter-spacing: .02em; transition: .12s;
}
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(#1e3a5a, #12263e); border-color: var(--gold); color: var(--gold2); }
.btn.gold { background: linear-gradient(#c8aa6e, #8f7140); color: #1a1205; border-color: #f0e6d2; text-transform: uppercase; letter-spacing: .1em; }
.btn.gold:hover:not(:disabled) { color: #000; filter: brightness(1.1); }
.btn.danger { border-color: #6b2232; color: #ff9aa9; }
.btn.danger:hover:not(:disabled) { border-color: var(--red); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.big { padding: 14px 28px; font-size: 15px; }

input, select, textarea {
  background: #07111f; color: var(--text); border: 1px solid var(--line2); border-radius: 6px;
  padding: 8px 10px; font: 14px Inter, sans-serif; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { width: 100%; min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
label.field input, label.field select { text-transform: none; letter-spacing: 0; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 2px; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- stars & roles ---------- */
.stars { display: inline-flex; gap: 1px; color: var(--star-off); font-size: 14px; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.stars i { font-style: normal; }
.stars i.on { color: var(--star); text-shadow: 0 0 6px #f3c24f55; }
.stars i.half { background: linear-gradient(90deg, var(--star) 50%, var(--star-off) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars.edit i { cursor: pointer; font-size: 18px; padding: 0 1px; }
.stars.edit i:hover { transform: scale(1.2); }
.role { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 2px 6px; border-radius: 4px; font: 700 11px Inter, sans-serif; letter-spacing: .06em; color: #0b0f17; }
.role.TOP { background: var(--r-TOP); } .role.JNG { background: var(--r-JNG); } .role.MID { background: var(--r-MID); }
.role.ADC { background: var(--r-ADC); } .role.SUP { background: var(--r-SUP); }
.pips { display: inline-flex; gap: 2px; }
.pips span { width: 7px; height: 10px; border-radius: 2px; background: var(--star-off); }
.pips span.on { background: var(--star); }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; cursor: default; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--gold2); }
.tbl tr:hover td { background: #ffffff05; }
.tbl input.name { width: 100%; min-width: 120px; background: transparent; border-color: transparent; }
.tbl input.name:hover, .tbl input.name:focus { border-color: var(--line2); background: #07111f; }
.table-wrap { overflow-x: auto; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 30px 0 26px; }
.hero h1 { font-size: 42px; background: linear-gradient(var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 18px; font-size: 15px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #07111f; border: 1px solid var(--line); border-radius: 8px; }
.list-item:hover { border-color: var(--line2); }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .1em; color: var(--gold2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: #1a2a42; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gold { background: #c8aa6e22; color: var(--gold); }
.badge.ok { background: #3ccf8e22; color: var(--ok); }

/* ---------- setup ---------- */
.pick-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 560px; overflow: auto; padding-right: 4px; }
.pp { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #07111f; cursor: pointer; user-select: none; }
.pp:hover { border-color: var(--line2); }
.pp.sel { border-color: var(--gold); background: #c8aa6e14; }
.pp .nm { font-weight: 600; }
.pp .mini { display: flex; gap: 4px; font-size: 10px; color: var(--muted); }
.mini b { color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: #07111f; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat .v { font-family: Cinzel, serif; font-size: 22px; color: var(--gold2); }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.order-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.order-strip span { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-weight: 700; font-size: 12px; }
.order-strip .A { background: var(--blue-bg); color: var(--blue); border: 1px solid #2fa5e855; }
.order-strip .B { background: var(--red-bg); color: var(--red); border: 1px solid #e8405755; }
.order-strip .done { opacity: .35; }
.order-strip .now { outline: 2px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 12px var(--gold); }
.alert { padding: 10px 12px; border-radius: 8px; border: 1px solid; font-size: 13px; }
.alert.err { border-color: #6b2232; background: var(--red-bg); color: #ffb3bf; }
.alert.ok { border-color: #1f6b4a; background: #3ccf8e14; color: #9ff0c9; }
.alert.warn { border-color: #7a5a1a; background: #f5b04114; color: #ffd98f; }

/* ---------- draft HUD ---------- */
.hud { display: flex; flex-direction: column; gap: 16px; }
.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.draft-grid { display: grid; grid-template-columns: 1fr minmax(440px, 620px); gap: 16px; align-items: start; }
.board-panel { position: sticky; top: 70px; z-index: 1; }
@media (max-width: 1100px) {
  .hud-top { grid-template-columns: 1fr 1fr; }
  .hud-top .clock { grid-column: 1 / -1; order: -1; }
  .draft-grid { grid-template-columns: 1fr; }
  .board-panel { position: static; order: -1; }
}
@media (max-width: 640px) {
  .hud-top { grid-template-columns: 1fr; } main { padding: 12px 16px; }
  .board-panel { padding: 10px; }
  .board { gap: 6px 4px; }
  .slot { padding: 8px; min-height: 58px; gap: 6px; }
  .slot .pn { font-size: 13px; }
  .slot .stars { display: none; }
  .slot .sv { font-size: 18px; }
  .bh .tn { font-size: 13px; }
  .bh .tot b { font-size: 20px; }
  .brole .role { min-width: 34px; padding: 2px 3px; }
  .topbar { flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; }
  .topbar nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .topbar nav a { padding: 6px 8px; white-space: nowrap; }
  .server-status { font-size: 11px; }
  .clock .time { font-size: 30px; }
  .hero h1 { font-size: 32px; }
  .share { grid-template-columns: 1fr auto; } .share > span { grid-column: 1 / -1; }
}

.team-banner { position: relative; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.team-banner.blue { background: linear-gradient(90deg, #0f3655, #0a1428); border-color: #1d5e8a; }
.team-banner.red { background: linear-gradient(270deg, #4a1620, #0a1428); border-color: #8a2a3a; text-align: right; }
.team-banner.turn { box-shadow: 0 0 0 2px var(--gold), 0 0 24px #c8aa6e66; }
.team-banner .tn { font-family: Cinzel, serif; font-size: 20px; color: #fff; }
.team-banner .sub { font-size: 12px; color: var(--muted); }
.team-banner .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin: 0 4px; vertical-align: middle; }
.team-banner .dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.budget { margin-top: 10px; }
.budget .bar { height: 10px; background: #00000066; border-radius: 99px; overflow: hidden; border: 1px solid #ffffff14; position: relative; }
.budget .fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 99px; transition: width .3s; }
.budget .fill.full { background: linear-gradient(90deg, #a33a2a, var(--red)); }
.budget .lbl { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; color: var(--muted); }
.team-banner.red .budget .lbl { flex-direction: row-reverse; }
.budget .lbl b { color: var(--gold2); font-size: 14px; }

.clock { min-width: 220px; text-align: center; padding: 10px 18px; border-radius: var(--radius); background: linear-gradient(#0f1b2d, #07111f); border: 1px solid var(--gold-dim); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.clock .phase { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 700; }
.clock .time { font-family: Cinzel, serif; font-size: 40px; color: var(--gold2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock .time.low { color: var(--red); animation: pulse 1s infinite; }
.clock .who { font-size: 13px; font-weight: 600; }
.clock .tbar { width: 100%; height: 3px; background: #ffffff14; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.clock .tbar div { height: 100%; background: var(--gold); transition: width .25s linear; }
@keyframes pulse { 50% { opacity: .5; } }

/* 5v5 board: [blue team] [role] [red team] */
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.bh { padding: 2px 4px 8px; border-bottom: 2px solid var(--line2); min-width: 0; }
.bh.blue { border-color: var(--blue); }
.bh.red { border-color: var(--red); text-align: right; }
.bh.mid { align-self: end; text-align: center; border-color: transparent; font-family: Cinzel, serif; color: var(--gold); }
.bh .tn { font-family: Cinzel, serif; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh.turn .tn { color: var(--gold2); text-shadow: 0 0 10px var(--gold); }
.bh .tot { font-size: 13px; color: var(--muted); }
.bh .tot b { font-family: Cinzel, serif; font-size: 26px; color: var(--gold2); transition: color .15s; }
.bh .tot b.preview { color: var(--ok); }
.bh.mid .lim { font-family: Inter, system-ui, sans-serif; font-size: 10px; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.bh.mid .lim b { font-family: Cinzel, serif; font-size: 15px; color: var(--gold2); letter-spacing: 0; }
/* team totals vs the star limit: yellow = up to 3 over, red = more than 3 over */
b.lim-warn, b.lim-warn.preview, .bh .tot b.lim-warn { color: #f5d742 !important; text-shadow: 0 0 10px #f5d74266; }
b.lim-bad, b.lim-bad.preview, .bh .tot b.lim-bad { color: #ff4d4d !important; text-shadow: 0 0 10px #ff4d4d66; }
.brole { display: flex; align-items: center; justify-content: center; }

.slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; min-height: 68px; min-width: 0; border-radius: 8px; background: #07111f; border: 1px solid var(--line); transition: .15s; }
.slot.red { flex-direction: row-reverse; text-align: right; }
.slot .who { min-width: 0; }
.slot.empty { border-style: dashed; color: var(--muted); }
.slot.empty .ph { font-size: 12px; }
.slot.filled { background: linear-gradient(90deg, #13233a, #07111f); }
.slot.red.filled { background: linear-gradient(270deg, #13233a, #07111f); }
.slot.blue.filled { border-left: 3px solid var(--blue); }
.slot.red.filled { border-right: 3px solid var(--red); }
.slot.turn { border-color: var(--gold-dim); background: #c8aa6e0d; }
.slot.new { animation: slotIn .6s ease-out; }
@keyframes slotIn { from { transform: scale(.94); box-shadow: 0 0 0 2px var(--gold), 0 0 30px var(--gold); } }
.slot .pn { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .pn .cap { color: var(--gold); font-size: 12px; margin: 0 4px; }
.slot .sv { font-family: Cinzel, serif; font-size: 22px; color: var(--star); }
.slot.swappable { cursor: pointer; }
.slot.swappable:hover { border-color: var(--gold); }
.slot.swap-sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px #c8aa6e55; }
.board.placing .slot:not(.drop-ok):not(.drop-bad):not(.swap-sel) { opacity: .4; }
.slot.drop-ok { border: 1px solid var(--ok); background: #3ccf8e12; cursor: pointer; }
.slot.drop-bad { border-color: #6b2232; }
.slot.over.drop-ok { box-shadow: 0 0 0 2px var(--ok), 0 0 18px #3ccf8e55; transform: scale(1.03); }
.slot.over.drop-bad { box-shadow: 0 0 0 2px var(--red); }
.slot .hint { font-size: 11px; font-weight: 600; margin-top: 2px; line-height: 1.25; }
.slot .hint.ok { color: var(--ok); }
.slot .hint.bad { color: #ff9aa9; }

[data-drag] { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body > .drag-ghost { position: fixed; left: 0; top: 0; z-index: 200; margin: 0; pointer-events: none; opacity: .92; box-shadow: 0 16px 40px #000a, 0 0 0 1px var(--gold); transition: none; }
body.dragging, body.dragging * { cursor: grabbing !important; }

.hud-center { min-width: 0; }
.center-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { background: #07111f; border: 1px solid var(--line); color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; font: 600 12px Inter, sans-serif; }
.tabs button.on { color: var(--gold2); border-color: var(--gold); }

.tip { color: var(--muted); font-size: 13px; }
.tip b { color: var(--gold2); }

/* draft player list: same cards as the setup page */
.pick-pool.draft-list { max-height: none; overflow: visible; padding-right: 0; }
.release-zone { outline: 2px dashed var(--ok); outline-offset: 6px; border-radius: 8px; transition: background .15s; }
.release-zone.over { background: #3ccf8e14; }
.pp .cap { color: var(--gold); margin-left: 5px; font-size: 12px; }
.pp.idle { cursor: default; }
.pp.idle:hover { border-color: var(--line); }
.pp[data-drag]:hover { border-color: var(--gold-dim); }
.pp.nolegal { opacity: .45; }
.pp.placed { background: #0a1628; }
.pp.placed .nm { color: var(--muted); }
.pp.placed.blue { border-left: 3px solid var(--blue); }
.pp.placed.red { border-left: 3px solid var(--red); }
.pp.sel { border-color: var(--gold); background: #c8aa6e14; box-shadow: 0 0 14px #c8aa6e44; }
.pp .where { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.pp .where .badge { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance { grid-column: 1 / -1; }
.meter { display: flex; height: 14px; border-radius: 99px; overflow: hidden; border: 1px solid #ffffff1a; }
.meter .a { background: linear-gradient(90deg, #0f5d8c, var(--blue)); transition: width .4s; }
.meter .b { background: linear-gradient(90deg, var(--red), #8c1f30); flex: 1; }
.meter-lbl { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; color: var(--muted); }
.meter-lbl b { color: var(--text); }

.log { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.log div { padding: 4px 8px; border-radius: 4px; background: #07111f; }
.log .A { border-left: 3px solid var(--blue); } .log .B { border-left: 3px solid var(--red); }

.lobby-cap { text-align: center; padding: 18px; border-radius: 10px; background: #07111f; border: 1px solid var(--line); }
.lobby-cap.ready { border-color: var(--ok); box-shadow: 0 0 16px #3ccf8e33; }
.lobby-cap .tn { font-family: Cinzel, serif; font-size: 18px; }
.share { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; }
.share input { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.final { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .final { grid-template-columns: 1fr; } }
.final .vs { font-family: Cinzel, serif; text-align: center; font-size: 26px; color: var(--gold); margin: 6px 0; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { padding: 10px 14px; border-radius: 8px; background: #142338; border: 1px solid var(--line2); box-shadow: var(--shadow); max-width: 360px; animation: toastIn .2s ease-out; }
.toast.err { border-color: var(--red); }
.toast.ok { border-color: var(--ok); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

.rules ol, .rules ul { padding-left: 20px; }
.rules li { margin-bottom: 6px; }
.kbd { font-family: ui-monospace, Consolas, monospace; background: #07111f; border: 1px solid var(--line2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* panels inside grids align; grids stacked under panels get spacing */
.grid2 > .panel + .panel, .grid3 > .panel + .panel, .grid2 > div > .panel:first-child { margin-top: 0; }
.grid2 + .panel, .panel + .grid2 { margin-top: 16px; }

/* ---------- mode choice ---------- */
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 16px; justify-content: center; margin-top: 8px; }
.mode-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px; border: 1px solid var(--line2); border-radius: var(--radius); background: linear-gradient(#142338, #0a1428); color: var(--text); text-align: center; transition: border-color .15s, transform .15s, box-shadow .15s; }
.mode-card:hover { color: var(--text); border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 24px #c8aa6e33; }
.mode-card .mi { font-size: 34px; color: var(--star); line-height: 1; }
.mode-card h3 { margin: 0; }
.mode-card p { margin: 0 0 6px; font-size: 13px; color: var(--muted); flex: 1; }
@media (max-width: 700px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.mode-tabs a { padding: 8px 16px; border: 1px solid var(--line2); border-radius: 99px; color: var(--muted); font-weight: 600; }
.mode-tabs a.on { border-color: var(--gold); color: var(--gold2); background: #c8aa6e1a; }

/* ---------- auction ---------- */
/* drawn token coin (the coin emoji is missing from older emoji fonts) */
.coin { display: inline-block; width: .78em; height: .78em; margin-left: .15em; vertical-align: -.06em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--star) 45%, #a4761f); box-shadow: inset 0 0 0 .07em #8a6418, 0 0 .3em #f3c24f55; }
.au-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.au-grid > .panel { margin-top: 0; }
@media (max-width: 1000px) { .au-grid { grid-template-columns: 1fr; } }
.au-team { border-top: 3px solid var(--line2); }
.au-team.blue { border-top-color: var(--blue); }
.au-team.red { border-top-color: var(--red); }
.au-team.turn { box-shadow: 0 0 0 2px var(--gold), 0 0 24px #c8aa6e55; }
.au-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.au-head .tn { font-family: Cinzel, serif; font-size: 18px; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-head .tokens { font-family: Cinzel, serif; font-size: 24px; color: var(--gold2); white-space: nowrap; }
.au-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.au-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #07111f; }
.au-row .nm { font-weight: 600; }
.au-row .cap { color: var(--gold); margin-left: 5px; font-size: 12px; }
.au-row .mini { display: flex; gap: 4px; font-size: 10px; color: var(--muted); }
.au-row .price { min-width: 44px; text-align: right; font-weight: 700; color: var(--gold2); }
.au-row.empty { justify-content: center; color: var(--muted); font-size: 12px; border-style: dashed; background: transparent; }
.bid-box { margin-top: 12px; padding: 12px; border: 1px solid var(--gold-dim); border-radius: 8px; background: #c8aa6e10; }
.bid-box.lead { border-color: var(--ok); background: #3ccf8e12; text-align: center; }
.au-center { text-align: center; }
.wheel { position: relative; width: min(500px, 88vw); aspect-ratio: 1; margin: 22px auto 0; }
.wheel::before { content: ""; position: absolute; inset: 2%; border-radius: 50%; box-shadow: 0 0 50px #c8aa6e40, 0 18px 40px #000a; }
.wheel-rot { position: absolute; inset: 0; border-radius: 50%; will-change: transform; }
.wheel-svg, .wheel-frame { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wheel-frame { pointer-events: none; }
.wheel-svg text { fill: #fff; font: 800 15px Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; paint-order: stroke; stroke: #0008; stroke-width: 2.5px; }
.wheel-svg .dividers line { stroke: #f0d27acc; stroke-width: 1.6; }
.wheel-svg .slice { transition: opacity .4s, filter .4s; }
/* once the wheel stops, the winning slice lights up and the rest dim */
.wheel.landed .slice { opacity: .4; }
.wheel.landed .slice.win { opacity: 1; filter: brightness(1.25) drop-shadow(0 0 8px #f3c24f); }
.wheel.landed .slice.win text { fill: #fff6d6; }
.wheel-frame .hub-star { fill: #5a3d0c; font: 700 20px Inter, system-ui, sans-serif; }
/* rim lights: dim at rest, chasing while the wheel turns, all lit once it lands */
.wheel-frame .bulb { fill: #fff3c4; opacity: .45; }
.wheel.spinning .wheel-frame .bulb { animation: bulb-chase .6s linear infinite; }
.wheel.landed .wheel-frame .bulb { opacity: 1; filter: drop-shadow(0 0 3px #ffe08a); animation: bulb-glow 1.2s ease-in-out infinite alternate; }
@keyframes bulb-chase { 0%, 100% { opacity: .25; } 25% { opacity: 1; } }
@keyframes bulb-glow { from { opacity: .7; } to { opacity: 1; } }
.wheel-pointer { position: absolute; top: -5.5%; left: 50%; width: 9%; margin-left: -4.5%; z-index: 2; transform-origin: 50% 30%; filter: drop-shadow(0 3px 4px #000c); }
.wheel.spinning .wheel-pointer { animation: pointer-tick .14s ease-in-out infinite alternate; }
@keyframes pointer-tick { from { transform: rotate(-9deg); } to { transform: rotate(5deg); } }
.au-status { margin-top: 12px; font-size: 15px; }
.au-lot { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.au-lot .mini { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.au-player { font-family: Cinzel, serif; font-size: 28px; color: var(--gold2); }
.au-bid { font-family: Cinzel, serif; font-size: 30px; padding: 4px 16px; border-radius: 8px; }
.au-bid.blue { color: var(--blue); background: var(--blue-bg); }
.au-bid.red { color: var(--red); background: var(--red-bg); }
.au-bids { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.au-bids span { font-size: 11px; padding: 1px 6px; border-radius: 99px; }
.au-bids span.blue { background: var(--blue-bg); color: var(--blue); }
.au-bids span.red { background: var(--red-bg); color: var(--red); }

/* auction screen: everything about 25% larger than the rest of the app */
.au-page { font-size: 17px; }
.au-page h2 { font-size: 30px; }
.au-page h3 { font-size: 22px; }
.au-page .small { font-size: 15px; }
.au-page .badge { font-size: 13px; padding: 3px 10px; }
.au-page .btn { font-size: 16px; padding: 11px 20px; }
.au-page .btn.small { font-size: 15px; padding: 7px 13px; }
.au-page .btn.big { font-size: 19px; padding: 16px 36px; }
.au-page .role { font-size: 13px; min-width: 46px; padding: 3px 7px; }
.au-page input[type=number] { font-size: 17px; padding: 9px 10px; }
.au-page .log { font-size: 16px; max-height: 280px; }
.au-page .log div { padding: 6px 10px; }
.au-head .tn { font-size: 23px; }
.au-head .tokens { font-size: 32px; }
.au-row { padding: 9px 12px; }
.au-row .cap { font-size: 15px; }
.au-row .mini { font-size: 12.5px; gap: 6px; }
.au-row .price { font-size: 18px; min-width: 52px; }
.au-row.empty { font-size: 15px; min-height: 46px; }
.au-status { font-size: 19px; }
.au-lot .mini { font-size: 15px; gap: 10px; }
.au-player { font-size: 38px; }
.au-bid { font-size: 40px; }
.au-bids span { font-size: 13px; padding: 2px 8px; }
.au-page .final .vs { font-size: 34px; }
.au-page .lobby-cap .tn { font-size: 23px; }
