:root {
  --bg: #14050a;
  --bg-2: #1f0911;
  --panel: #2c0b16;
  --panel-2: #3a0f1d;
  --line: #6a2a3c;
  --text: #ffffff;
  --muted: #d8c3c9;
  --gold: #e8bf5f;
  --gold-soft: #f2d48a;
  --gold-deep: #a9822f;
  --danger: #ff8a8a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #3a0f1d 0%, var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 Montserrat, system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--gold); }
h1, h2, h3 { font-family: Oswald, sans-serif; font-weight: 600; letter-spacing: .02em; margin: 0; }
h1 { font-size: 28px; text-transform: uppercase; }
h2 { font-size: 18px; text-transform: uppercase; color: var(--gold); }
[hidden] { display: none !important; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: rgba(20, 5, 10, .85); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: Oswald, sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.brand-mark { background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep)); color: #2c0b16;
  border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.topnav { display: flex; gap: 8px; flex: 1; }
.topnav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.topnav a.active, .topnav a:hover { color: var(--gold); background: var(--panel); }
.user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }

/* layout */
.view { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.muted { color: var(--muted); }

/* buttons */
.btn {
  font: 600 14px Montserrat, sans-serif; border-radius: 8px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--gold-deep); background: transparent; color: var(--gold); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: rgba(232, 191, 95, .08); }
.btn-primary { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #2c0b16; border-color: var(--gold); }
.btn-primary:hover { background: linear-gradient(180deg, #f8e3a8, var(--gold-soft)); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-danger { background: #8f2230; border-color: #c24a58; color: #fff; }
.btn-danger:hover { background: #a62a3a; }
.ask-in { width: 100%; margin-top: 6px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .choice:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* tournament list */
.search { width: 100%; max-width: 360px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 600 12px Montserrat, sans-serif; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid rgba(106, 42, 60, .5); }
.table tr.row { cursor: pointer; }
.table tr.row:hover td { background: var(--panel-2); }
.table .name { font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); margin-right: 4px; white-space: nowrap; }
.tag-gold { border-color: var(--gold-deep); color: var(--gold); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h2 { margin-bottom: 8px; }

/* new tournament: two choices */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.choice {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 10px;
}
.choice:hover { border-color: var(--gold); background: var(--panel-2); }
.choice:disabled { opacity: .45; cursor: default; border-color: var(--line); background: var(--panel); }
.choice-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--gold-deep); color: var(--gold); font: 600 22px Oswald, sans-serif; }
.choice h2 { color: var(--text); }
.choice p { margin: 0; color: var(--muted); }

/* form */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 12; }
.span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-8 { grid-column: span 8; }
label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.req { color: var(--gold); }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=search], select {
  font: 15px Montserrat, sans-serif; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; color-scheme: dark;
}
input:hover, select:hover { border-color: #8a3a50; }
.field.invalid input, .field.invalid select, .field.invalid .seg { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; min-height: 0; }
.hint { color: var(--muted); font-size: 13px; }
.section-title { grid-column: span 12; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 600 14px Montserrat, sans-serif; background: var(--bg-2); color: var(--muted); border: 0;
  padding: 10px 18px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed=true] { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #2c0b16; }

.checks { display: flex; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.check:hover { border-color: #8a3a50; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.check:has(input:checked) { border-color: var(--gold-deep); color: var(--gold-soft); }

.days-table { max-width: 640px; }
.days-table td { padding: 6px 12px 6px 0; border-bottom: 0; }
.days-table th { padding-left: 0; }
.days-table input { width: auto; min-width: 150px; }
.days-table tr.invalid input { border-color: var(--danger); }
.days-table .day-err { min-width: 120px; }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.banner { background: var(--panel-2); border: 1px solid var(--gold-deep); border-radius: 8px; padding: 10px 14px;
  margin-bottom: 20px; color: var(--gold-soft); font-size: 14px; }
.banner-error { border-color: var(--danger); color: var(--danger); }

/* wizard steps */
.steps { display: flex; gap: 6px; margin: -8px 0 20px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 600;
  font-size: 14px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--bg-2); }
.step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  border: 1px solid currentColor; }
a.step:hover { color: var(--gold); border-color: var(--gold-deep); }
.step.active { color: #2c0b16; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); border-color: var(--gold); }
.step.disabled { opacity: .45; }

/* structure */
.st-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.st-load { flex: 1; min-width: 260px; max-width: 520px; }
.st-head-actions { margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tb-group { display: flex; align-items: center; gap: 8px; }
.tb-group label { white-space: nowrap; }
.tb-group select { width: auto; padding: 6px 10px; font-size: 14px; }
.tb-right { margin-left: auto; }
.btn-icon { width: 34px; justify-content: center; padding: 6px 0; font-size: 15px; }
input.num-sm { width: 76px; }
.toolbar input.num-sm { padding: 6px 8px; font-size: 14px; }

.grid-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 8px; }
.grid { user-select: none; }
.grid thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.grid td { padding: 4px 10px; height: 42px; }
.grid th.r, .grid td.r { text-align: right; }
.grid .c-n { width: 44px; color: var(--muted); font-weight: 600; }
.grid tr[data-k] { cursor: default; }
.grid tr[data-k]:hover td { background: rgba(58, 15, 29, .6); }
.grid tr.selected td { background: rgba(232, 191, 95, .14) !important; }
.grid tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.grid tr.invalid td { background: rgba(255, 138, 138, .12); }
.grid tr.brk td { color: var(--gold-soft); font-weight: 600; }
.grid tr.dayend td { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-top: 2px solid var(--gold-deep); border-bottom: 2px solid var(--gold-deep); }
.grid input.num, .grid input.lbl { padding: 6px 8px; font-size: 14px; background: transparent; border-color: transparent; }
.grid input.num { width: 110px; text-align: right; }
.grid input.num.num-sm { width: 70px; }
.grid input.lbl { width: 100%; }
.grid input:hover { border-color: var(--line); }
.grid input:focus { background: var(--bg-2); border-color: var(--gold-deep); outline: none; }
.grid .u { color: var(--muted); font-size: 13px; }
.grid .c-at { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bi-wrap { max-height: none; margin-bottom: 10px; }
.bi-grid input.lbl { min-width: 160px; }
.bi-grid input.num { width: 120px; }
.bi-grid .c-total { color: var(--gold-soft); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid input.invalid { border-color: var(--danger) !important; background: rgba(255, 138, 138, .1); }
.st-summary { color: var(--muted); font-size: 14px; margin-top: 12px; }

.step-open { margin-left: auto; color: var(--gold); border-color: var(--gold-deep); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.badge i, .dot { width: 9px; height: 9px; border-radius: 50%; background: #8a7a80; display: inline-block; }
.badge-running i, .badge-reg-open i, .dot-open { background: #6fd08c; }
.badge-finished i { background: var(--gold); }
.badge-reg-suspended i, .dot-suspended { background: #f0b24a; }
.badge-reg-closed i, .dot-closed { background: #ff7a7a; }

/* management screen */
.m-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.m-title h1 { font-size: 30px; }
.m-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 6px; align-items: center; }
.m-clock { text-align: right; }
.m-level { font: 600 15px Oswald, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.m-time { font: 700 64px/1 Oswald, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.m-time.paused { opacity: .5; }
.m-blinds { font: 600 18px Oswald, sans-serif; color: var(--text); letter-spacing: .03em; }

.ribbon { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rb-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 4px; display: flex; flex-direction: column; }
.rb-btns { display: flex; gap: 4px; flex: 1; }
.rb-lab { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
.rb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 84px; padding: 8px 10px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--text); font: 600 13px Montserrat, sans-serif;
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2; }
.rb:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); }
.rb:disabled { opacity: .4; cursor: default; }
.rb-i { font-size: 22px; line-height: 1; color: var(--gold); height: 24px; display: grid; place-items: center; }
.rb-play .rb-i { font-size: 24px; }
.rb-play { min-width: 74px; }
.dot-big { font-size: 0; }
.dot-big::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: currentColor; }
.rb-i.dot-open { color: #6fd08c; background: none; } .rb-i.dot-suspended { color: #f0b24a; background: none; } .rb-i.dot-closed { color: #ff7a7a; background: none; }
.rb-menu { position: relative; }
.menu { position: absolute; top: 100%; left: 0; z-index: 20; background: var(--panel-2); border: 1px solid var(--gold-deep); border-radius: 8px;
  padding: 4px; min-width: 240px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: 600 14px Montserrat, sans-serif;
  padding: 9px 12px; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover { background: rgba(232, 191, 95, .1); }

.m-summary { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 10px 4px 14px; font-size: 14px; color: var(--muted); }
.m-summary b { color: var(--gold); font-weight: 600; margin-right: 4px; }
.m-summary > span { color: var(--text); }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent;
  border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -1px; }
.tab:hover { color: var(--gold); }
.tab.active { color: var(--gold); background: var(--panel); border-color: var(--line); }
.tab-panel { border-top-left-radius: 0; }

.kv-sec + .kv-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.kv-sec h2 { margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; }
.kv .wide { grid-column: span 2; }
.kv span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kv b { font-size: 16px; font-weight: 600; }
.gold-t { color: var(--gold); }
.quick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.lv-view tr.current td { background: rgba(232, 191, 95, .16) !important; }
.lv-view tr.current td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.table td.r, .table th.r { text-align: right; }

/* tables */
.tb-ribbon { margin-bottom: 8px; }
.tb-ribbon .rb-group { background: var(--bg-2); }
.tb-inline { align-items: center; gap: 8px; padding: 0 6px; flex-wrap: wrap; }
.tb-inline select { width: auto; padding: 6px 10px; font-size: 14px; }
.t-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; padding: 6px 2px 10px; }
.t-summary b { color: var(--gold); font-weight: 600; margin-right: 4px; }
.t-selbar { display: flex; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 10px; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.po-pub { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); font-size: 14px; }
.po-pub-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.po-pub-btns { display: flex; gap: 8px; }
.pub-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #8a7a80; }
.pub-dot.on { background: #6fd08c; } .pub-dot.warn { background: #f0b24a; }
.po-calc { margin-bottom: 18px; }
.po-calc-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.po-calc-head h3, .po-saved-h { font: 600 15px Oswald, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); margin: 0; }
.po-calc-head h3 .muted { font: 12px Montserrat, sans-serif; text-transform: none; letter-spacing: 0; }
.po-saved-h { margin: 6px 0 10px; }
#po-frame { width: 100%; height: 1400px; border: 1px solid var(--line); border-radius: 10px; background: #0F0D09; display: block; }
.po-top { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.po-top .field { width: auto; }
.po-top .po-round select { width: auto; }
.po-base { color: var(--muted); font-size: 14px; padding-bottom: 10px; }
.po-base b { color: var(--gold); }
.panel-inner { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.panel-inner h3 { font: 600 15px Oswald, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.panel-inner h3 .muted { font: 12px Montserrat, sans-serif; text-transform: none; letter-spacing: 0; }
.span-3 { grid-column: span 3; }
.po-gen-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.po-wrap { max-height: none; }
.po-grid input.lbl { min-width: 140px; }
.po-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.po-sum { font-size: 14px; color: var(--muted); }
.po-sum b { color: var(--text); }
.po-sum .bad, .po-sum b.bad { color: var(--danger); }
@media (max-width: 720px) { .span-3 { grid-column: span 6; } }
.open-count { padding: 10px 0; font-size: 14px; line-height: 1.5; }
.open-count b { color: var(--gold); font-size: 18px; }
.t-grid > .empty { grid-column: 1 / -1; }
.tcard { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.tcard.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tcard.closed { opacity: .55; }
.tcard-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 9px 12px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #6a1d33, #4a1324); color: #fff; font: 600 16px Oswald, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.tcard.sel .tcard-head { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #2c0b16; }
.tcard-head:disabled { cursor: default; }
.tcard-tags { display: flex; gap: 4px; }
.tg { font: 600 10px Montserrat, sans-serif; font-style: normal; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, .3); }
.tcard-seats { display: flex; flex-direction: column; }
.seat { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 0; border-top: 1px solid rgba(106, 42, 60, .55);
  background: transparent; color: var(--text); font: 14px Montserrat, sans-serif; cursor: pointer; text-align: left; min-height: 32px; }
.seat:disabled { cursor: default; }
.seat:hover:not(:disabled) { background: rgba(58, 15, 29, .8); }
.seat.sel { background: rgba(232, 191, 95, .2); box-shadow: inset 3px 0 0 var(--gold); }
.seat-n { width: 20px; font-weight: 700; color: var(--muted); }
.seat-who { flex: 1; font-size: 12px; color: var(--muted); }
.seat-locked .seat-who { color: #ff9a9a; }
.seat-locked { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 122, 122, .06) 6px 12px); }
.seat-reserved .seat-who { color: #f0b24a; }
.seat-p { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); }
.seat-p.p1 { color: #6fd08c; border-color: #3d7a50; }
.seat-p.p3 { color: var(--muted); }
.tcard-foot { font-size: 12px; color: var(--muted); padding: 6px 12px; border-top: 1px solid var(--line); }
.break-list { padding-left: 22px; max-height: 50vh; overflow: auto; margin: 10px 0; }
.break-list li { padding: 4px 0; }
.break-list li > * { display: inline-flex; align-items: center; }
.break-list li { display: list-item; }
.break-list li span:first-child { min-width: 120px; font-weight: 600; }

/* dialogs */
.dlg { margin: auto; width: min(440px, 94vw); background: var(--panel); color: var(--text); border: 1px solid var(--gold-deep);
  border-radius: 12px; padding: 24px; }
.dlg-wide { width: min(640px, 94vw); }
.dlg::backdrop { background: rgba(0, 0, 0, .65); }
.dlg h2 { margin-bottom: 6px; }
.dlg-sub { font: 600 14px Montserrat, sans-serif; color: var(--text); margin: 18px 0 4px; }
.dlg p { margin: 0 0 10px; font-size: 14px; }
.timer-row { display: flex; gap: 10px; align-items: center; margin: 16px 0 6px; }
.timer-row input { font: 700 34px Oswald, sans-serif; text-align: center; flex: 1; min-width: 0; padding: 6px; }
.screens { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.screens .hint { width: 100%; margin: 4px 0 0; }
.screen-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 140px; padding: 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: 13px Montserrat, sans-serif; }
.screen-btn:hover { border-color: var(--gold); }
.screen-btn span { color: var(--muted); }
.screen-ico { font-size: 28px; color: var(--gold) !important; line-height: 1; }
.paired { display: flex; flex-direction: column; gap: 6px; }
.paired-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.paired-row .paired-now { flex: 1; font-size: 13px; }
.pair-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.pair-form .field { width: auto; }
.pair-form #p-code { width: 140px; font: 600 20px Oswald, sans-serif; letter-spacing: .1em; }
.pair-form #p-name { width: 260px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; font-size: 13px; }
.form-actions.spread { justify-content: space-between; flex-wrap: wrap; }

/* login */
.login { max-width: 380px; margin: 10vh auto 0; }
.login .brand { justify-content: center; margin-bottom: 24px; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login input { width: 100%; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--panel-2); border: 1px solid var(--gold); color: var(--gold-soft); padding: 10px 18px;
  border-radius: 8px; transition: .2s; pointer-events: none; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 720px) {
  .span-6, .span-4, .span-8 { grid-column: span 12; }
  .topbar { gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
  .view { padding: 24px 16px 48px; }
  .table .hide-sm { display: none; }
}

/* ---------- players and registration desk ---------- */
textarea { font: 14px Montserrat, sans-serif; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%; resize: vertical; color-scheme: dark; }
.head-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-ok { border-color: #3d7a50; color: #8fe0a8; }
.tag-bad { border-color: #a04848; color: #ff9a9a; }
.tag-xs { font-size: 10px; padding: 0 6px; vertical-align: 1px; }
.warn-t { color: #f0b24a; }
.span-2 { grid-column: span 2; } .span-5 { grid-column: span 5; }
.dlg-xl { width: min(880px, 96vw); }
.dlg-xl .form-grid { gap: 12px 16px; margin-top: 12px; }
.dlg .banner { margin: 8px 0; }

.ci { display: grid; grid-template-columns: minmax(320px, 2fr) 3fr; gap: 24px; align-items: start; }
.ci h2 { margin-bottom: 12px; }
.ci-searchrow { display: flex; gap: 10px; }
.ci-searchrow input { font-size: 17px; padding: 12px 14px; }
.ci-searchrow .btn { white-space: nowrap; }
.ci-results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ci-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ci-row.blocked { border-color: #a04848; }
.ci-who b { font-size: 15px; }
.ci-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.ci-acts { display: flex; gap: 6px; flex-shrink: 0; }
.ci-listhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ci-listhead h2 { margin: 0; margin-right: auto; }
.ci-listhead h2 .muted { font: 13px Montserrat, sans-serif; text-transform: none; }
.ci-listhead .seg button { padding: 6px 12px; font-size: 13px; }
.ci-fq { max-width: 180px; padding: 7px 10px !important; font-size: 13px !important; }
.ci-table td { padding: 8px 10px; vertical-align: top; }
.ci-table th { padding: 8px 10px; }
.ci-table .hint { font-size: 11px; }
.ci-table .big-n { font: 600 18px Oswald, sans-serif; color: var(--gold-soft); }
.ci-table tr.st-busted td, .ci-table tr.st-cancelled td { opacity: .6; }
.ci-table tr.st-cancelled td b { text-decoration: line-through; }
.ci-eacts { white-space: nowrap; }
.ci-eacts .btn { padding: 4px 8px; font-size: 12px; }
@media (max-width: 1100px) { .ci { grid-template-columns: 1fr; } }

.bi-pick { display: grid; gap: 8px; }
.bi-opt { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 0 10px; align-items: center; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.bi-opt input { grid-row: span 2; width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.bi-opt .hint { grid-column: 2 / 4; }
.bi-opt:has(input:checked) { border-color: var(--gold); background: rgba(232, 191, 95, .08); }
.bi-name { font-weight: 600; }
.bi-price { font: 600 18px Oswald, sans-serif; color: var(--gold-soft); }
.rg-pays { display: grid; gap: 8px; }
.rg-pay { display: grid; grid-template-columns: 160px 110px 1fr 36px; gap: 8px; align-items: center; }
.rg-pay input, .rg-pay select { padding: 8px 10px; font-size: 14px; }
.rg-paybar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; flex-wrap: wrap; }
.rg-consent { margin-top: 12px; }
.seat-big { display: flex; justify-content: center; gap: 16px; margin: 16px 0; }
.seat-big div { text-align: center; background: var(--bg-2); border: 1px solid var(--gold-deep); border-radius: 12px; padding: 10px 28px; }
.seat-big span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.seat-big b { font: 600 56px/1 Oswald, sans-serif; color: var(--gold); }
.seat-who.taken { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.im-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.im-map .field { grid-column: auto; }
.im-prev td { font-size: 13px; padding: 6px 10px; white-space: nowrap; }
.im-prev th { white-space: nowrap; }

/* player history (from the old system) */
.ph-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.ph-sum div { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 8px; padding: 8px 10px; }
.ph-sum span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.ph-sum b { font-size: 16px; }
.ph-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ph-wrap { max-height: 340px; overflow: auto; }
.ph-table td, .ph-table th { white-space: nowrap; font-size: 13px; }
.ph-table td.num, .ph-table th.num { text-align: right; }

/* merge duplicates */
.pk-list { max-height: 50vh; overflow: auto; margin-top: 10px; display: grid; gap: 4px; }
.pk-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: inherit; cursor: pointer; font: inherit; }
.pk-row:hover, .pk-row:focus-visible { border-color: var(--gold); }
.mg-table th[scope], .mg-table tbody th { text-align: left; white-space: nowrap; opacity: .8; font-weight: 600; }
.mg-head { vertical-align: top; text-align: left; }
.mg-head.on { color: var(--gold); }
.mg-head .muted { font-weight: 400; font-size: 12px; margin-top: 4px; }
.mg-same { opacity: .85; }
.mg-opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.mg-opt.on { border-color: var(--gold); background: rgba(232, 193, 95, .08); }
.dp-table td { vertical-align: top; }
.dp-acts { display: flex; flex-direction: column; gap: 6px; }

/* players at the tables */
.seat.has-player { cursor: pointer; }
.seat.has-player:hover { border-color: var(--gold); }
.seat.moving { outline: 2px dashed var(--gold); outline-offset: -2px; }
.seat.target { background: rgba(95, 190, 120, .12); }
.seat.target:hover { background: rgba(95, 190, 120, .28); }
.t-moving { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 10px 0;
  border: 1px solid var(--gold); border-radius: 10px; background: rgba(232, 193, 95, .08); }
.t-unseated { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.us-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--panel-2); }
.us-chip.on { outline: 2px dashed var(--gold); }
.sm-acts { display: grid; gap: 8px; margin-top: 12px; }
.sm-acts .btn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.sm-acts .btn small { font-weight: 400; opacity: .75; font-size: 12px; }

/* balancing advice and move plans */
.t-advice { display: grid; gap: 6px; margin: 10px 0; }
.t-advice .adv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid #b88a2a; background: rgba(232, 193, 95, .1); }
.mv-wrap { max-height: 50vh; overflow: auto; }
.mv-table td { white-space: nowrap; }

/* several tournaments at once */
body.in-tournament .topbar { box-shadow: inset 0 -3px 0 hsl(var(--t-hue) 70% 55%); }
body.in-tournament .m-head { border-left: 6px solid hsl(var(--t-hue) 70% 55%); }
.m-title h1 { display: inline-block; margin-right: 10px; }
.m-win { vertical-align: middle; }
.t-switch { position: relative; }
.t-switch-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 320px; max-width: 90vw; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 6px; }
.sw-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; padding: 6px 10px; }
.sw-row { display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.sw-row:hover { background: var(--panel-2); }
.sw-row a { flex: 1; display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; padding: 8px 10px; color: inherit; text-decoration: none; }
.sw-row a small { grid-column: 2; opacity: .7; font-size: 12px; }
.sw-dot { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--t-hue) 70% 55%); margin-top: 4px; }
#t-switch-n:not(:empty) { background: var(--gold); color: #000; border-radius: 999px; padding: 0 6px; margin-left: 4px; }

/* screens: layouts */
.scr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.scr-head { display: flex; align-items: center; gap: 12px; }
.scr-head .name { font-size: 16px; }
.scr-acts { margin-left: auto; display: flex; gap: 6px; }
.scr-body { display: grid; gap: 12px; margin-top: 10px; }
.scr-lay { display: flex; flex-wrap: wrap; gap: 8px; }
.lay-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.lay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lay-opt.on { border-color: var(--gold); background: rgba(232,193,95,.08); }
.lay-ico { display: grid; width: 30px; height: 18px; gap: 2px; }
.lay-ico i { background: var(--line); border-radius: 2px; }
.lay-opt.on .lay-ico i { background: var(--gold); }
.lay-single i:not(:first-child), .lay-rotate i:not(:first-child) { display: none; }
.lay-single, .lay-rotate { grid-template: 1fr / 1fr; }
.lay-rotate i { background: linear-gradient(90deg, var(--line) 50%, transparent 50%) !important; border: 1px solid var(--line); }
.lay-split2 { grid-template: 1fr / 1fr 1fr; } .lay-split2 i:nth-child(n+3) { display: none; }
.lay-split4 { grid-template: 1fr 1fr / 1fr 1fr; }
.scr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.sec-in { display: flex; align-items: center; gap: 8px; } .sec-in input { width: 90px; }
/* looks */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.th-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.th-meta { padding: 10px 12px 0; } .th-acts { display: flex; gap: 6px; padding: 10px 12px 12px; }
.tp { position: relative; aspect-ratio: 16 / 9; overflow: hidden; font-family: Oswald, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tp-logo { position: absolute; left: 4%; top: 5%; height: 13%; max-width: 22%; object-fit: contain; }
.tp-title { position: absolute; top: 6%; font-size: 11px; letter-spacing: .15em; font-weight: 700; }
.tp-ring { width: 34%; aspect-ratio: 1; border: 4px solid; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 4%; }
.tp-center { max-width: 45%; max-height: 20%; object-fit: contain; }
.tp-time { font-size: 22px; font-weight: 700; line-height: 1; }
.tp-blinds { font-size: 15px; font-weight: 700; margin-top: 3%; }
.tp-pool { position: absolute; left: 4%; bottom: 5%; font-size: 13px; font-weight: 700; }
.te { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.te-prev .tp { border-radius: 10px; border: 1px solid var(--line); margin-top: 6px; }
.te-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.te-dim { display: block; margin-top: 10px; }
input[type=color] { width: 100%; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--gold); }
@media (max-width: 760px) { .te { grid-template-columns: 1fr; } }
