/* Dashboard layer on top of styles.css tokens */
body.admin { background: var(--canvas); }
.admin .nav { position: sticky; top: 16px; transform: none; left: auto; margin: 16px auto 0; width: min(1320px, calc(100% - 32px)); }
.save-state { color: var(--body); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.save-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.save-state.dirty i { background: var(--accent); }
.nav-actions { display: flex; gap: 8px; }

.shell { width: min(1320px, calc(100% - 32px)); margin: 24px auto 80px; display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.side { position: sticky; top: 96px; display: grid; gap: 8px; }
.side-item { text-align: left; border: 0; cursor: pointer; background: var(--surface); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow-inset); display: grid; gap: 4px; transition: background .2s, box-shadow .2s; }
.side-item:hover { background: var(--surface-2); }
.side-item[aria-current="true"] { box-shadow: var(--shadow-inset), 0 0 0 1.5px var(--ink); }
.side-item b { font-weight: 600; font-size: 16px; }
.side-item span { color: var(--body); font-size: 13px; }
.side-label { color: var(--body); font-size: 13px; padding: 12px 6px 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(235,240,248,.06); color: var(--body); width: max-content; }
.chip.live { color: var(--green); background: rgba(49,206,1,.1); }
.chip.upcoming { color: var(--lilac); background: rgba(185,166,255,.1); }

.main { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border-radius: var(--r-card); padding: 28px; box-shadow: var(--shadow-inset); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-head .h-label { margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--surface); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-inset); display: grid; gap: 8px; }
.kpi .big { font: 600 30px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .muted { font-size: 14px; }

.field { display: grid; gap: 6px; }
.field > span { color: var(--body); font-size: 13px; font-weight: 500; }
.input, .admin textarea {
  width: 100%; border: 0; outline: none; background: var(--charcoal); border-radius: 14px; padding: 11px 14px; font-size: 15px;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s;
}
.input:focus, .admin textarea:focus { box-shadow: 0 0 0 1.5px var(--ink); }
.input.title-input { font: 600 clamp(26px, 3vw, 36px)/1.1 var(--font-display); letter-spacing: -0.03em; background: transparent; box-shadow: none; padding: 4px 0; border-radius: 0; }
.input.title-input:focus { box-shadow: 0 1.5px 0 var(--ink); }
.admin textarea { min-height: 140px; resize: vertical; font-family: var(--font); line-height: 1.5; }
input[type="datetime-local"].input { color-scheme: dark; }

.btn { border: 0; cursor: pointer; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); transition: background .2s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.danger { color: var(--coral); }
.btn.light { background: var(--ink); color: var(--charcoal); box-shadow: none; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--body); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(235,240,248,.06); color: var(--coral); }
.icon-btn svg { width: 16px; height: 16px; }

/* prize editor */
.prize-list { display: grid; gap: 8px; }
.prize-row { display: grid; grid-template-columns: 56px 1fr 120px 32px; gap: 10px; align-items: center; }
.prize-row .rk { color: var(--body); font-size: 14px; font-variant-numeric: tabular-nums; }
.prize-row .rk img { width: 28px; height: 28px; display: inline-block; vertical-align: middle; }
.prize-bar { height: 10px; border-radius: 6px; background: rgba(235,240,248,.06); overflow: hidden; }
.prize-bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .4s; }
.prize-row:nth-child(1) .prize-bar i { background: var(--metal-gold); }
.prize-row:nth-child(2) .prize-bar i { background: var(--metal-silver); }
.prize-row:nth-child(3) .prize-bar i { background: var(--metal-bronze); }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--body); font-size: 14px; pointer-events: none; }
.money-input .input { padding-left: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.splitter { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.splitter .field { flex: 1 1 120px; }

/* players */
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { padding: 8px 10px; border-top: 0; }
.ptable td { padding: 6px 10px; border-top: 1px solid var(--line); }
.ptable th:nth-child(n+3), .ptable td:nth-child(n+3) { text-align: left; }
.ptable td.rank { width: 56px; color: var(--body); font-variant-numeric: tabular-nums; }
.ptable td.prz { width: 90px; color: var(--accent); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ptable .input { padding: 8px 12px; border-radius: 12px; background: transparent; box-shadow: none; }
.ptable .input:hover { background: var(--charcoal); }
.ptable .input:focus { background: var(--charcoal); box-shadow: 0 0 0 1.5px var(--ink); }
.ptable tr.moved td { animation: flash 1s; }
@keyframes flash { from { background: rgb(var(--accent-rgb) / .15); } to { background: transparent; } }
.paste-hint { color: var(--body); font-size: 13px; margin: 8px 0 12px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--body); transition: transform .2s, background .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }
.vid-row { display: grid; grid-template-columns: 96px 1fr 1fr auto 36px 36px; gap: 10px; align-items: center; }
.vid-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); display: block; }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn[disabled] { opacity: .3; cursor: default; }
@media (max-width: 800px) { .vid-row { grid-template-columns: 72px 1fr 36px 36px; } .vid-row .vid-thumb { width: 72px; } .vid-row [data-v=title] { grid-column: 2 / -1; } .vid-row .switch { grid-column: 2 / -1; } }
.note { color: var(--body); font-size: 14px; line-height: 1.5; }
.note code { background: var(--charcoal); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .side-label { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-actions .hide-sm, .save-state { display: none; }
  .panel { padding: 20px; }
  .prize-row { grid-template-columns: 48px 1fr 100px 32px; }
  .ptable td.prz { display: none; }
}

/* player table: room for names, $ sign clear of the number */
.board-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.ptable { table-layout: fixed; }
.ptable th:nth-child(1) { width: 52px; }
.ptable th:nth-child(3) { width: 150px; }
.ptable th:nth-child(4) { width: 84px; }
.ptable th:nth-child(5) { width: 40px; }
.ptable .money-input .input { padding-left: 24px; text-align: left; }
@media (max-width: 1000px) { .board-cols { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ptable th:nth-child(4) { display: none; } .ptable th:nth-child(3) { width: 120px; } }

/* casino picker beside the dates */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* partner casinos */
.partner-list { display: grid; gap: 12px; margin-top: 20px; }
.partner-card { display: grid; grid-template-columns: 200px 1fr; gap: 20px; background: var(--charcoal); border-radius: 24px; padding: 20px; box-shadow: 0 0 0 1px var(--line); }
.logo-slot { border-radius: 16px; background: var(--canvas); display: grid; place-items: center; padding: 16px; min-height: 120px; box-shadow: inset 0 0 0 1px var(--line); font-size: 22px; text-align: center; }
.logo-slot img { max-width: 100%; max-height: 72px; object-fit: contain; }
.logo-slot .plogo-text { white-space: normal; }
.partner-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.partner-top b { font: 600 20px var(--font-display); letter-spacing: -0.01em; }
.partner-card .input { background: var(--surface); }
.partner-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.switch.small { font-size: 14px; gap: 10px; color: var(--body); }
.soc-field > span { display: inline-flex; align-items: center; gap: 8px; }
.soc-field svg { width: 16px; height: 16px; }

@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .partner-card { grid-template-columns: 1fr; } }

/* main partner picker + per-casino look */
.main-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.pick-card { position: relative; text-align: left; border: 0; cursor: pointer; border-radius: 20px; padding: 16px; display: grid; gap: 12px;
  background: var(--pc-bg, var(--charcoal)); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, transform .15s; color: var(--ink); }
.pick-card:hover { transform: translateY(-2px); }
.pick-card[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--pc-accent, var(--accent)), 0 12px 30px -16px var(--pc-accent, var(--accent)); }
.pick-card .pc-logo { height: 40px; display: flex; align-items: center; font: 600 20px var(--font-display); }
.pick-card .pc-logo img { max-height: 40px; max-width: 100%; object-fit: contain; }
.pick-card .pc-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); }
.pick-card .pc-sw { width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(135deg, var(--pc-accent), var(--pc-accent2)); flex: none; }
.pick-card .pc-badge { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--pc-accent); color: var(--pc-on); }

.theme-preview { position: relative; overflow: hidden; margin-top: 16px; border-radius: 24px; background: var(--hero-night); padding: 28px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); isolation: isolate; }
.theme-preview .hero-art { opacity: .5; }
.theme-preview .tp-logo { height: 34px; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--body); font-size: 14px; }
.theme-preview .tp-logo img { height: 30px; max-width: 220px; object-fit: contain; }
.theme-preview h3 { font: 600 clamp(28px, 3.4vw, 40px)/1 var(--font-display); letter-spacing: -0.03em; margin: 18px 0 8px; }
.theme-preview h3 b { color: var(--accent); font-weight: inherit; }
.theme-preview .tp-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.theme-preview .tp-code { font: 600 15px var(--font-display); letter-spacing: .04em; padding: 10px 16px; border-radius: 999px; border: 1.5px dashed rgb(var(--accent-rgb) / .6); color: var(--accent); }

.look { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.look h4 { margin: 0; font: 600 16px var(--font-display); }
.look-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.color-field { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 6px 12px 6px 6px; }
.color-field input[type=color] { width: 36px; height: 36px; border: 0; padding: 0; border-radius: 10px; background: none; cursor: pointer; flex: none; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 10px; }
.color-field code { font-size: 13px; color: var(--body); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.preset { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 13px; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.preset i { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 0 3px var(--c); }
.art-row { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; }
.art-thumb { aspect-ratio: 16/9; border-radius: 12px; background: var(--surface) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; font-size: 12px; color: var(--body); overflow: hidden; }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; }
.main-flag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
@media (max-width: 900px) { .look-grid { grid-template-columns: 1fr 1fr; } .art-row { grid-template-columns: 1fr; } }

.banner-list { display: grid; gap: 8px; }
.banner-item { display: grid; grid-template-columns: 160px 1fr 40px; gap: 12px; align-items: center; }
.banner-item img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 700px) { .banner-item { grid-template-columns: 96px 1fr 40px; } .banner-item img { width: 96px; } }

/* ---------- sign in ---------- */
.login { position: relative; z-index: 1; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.login[hidden], .page[hidden] { display: none; }
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--r-card); padding: 36px 32px 28px; box-shadow: var(--shadow-inset), var(--shadow-float); display: grid; gap: 16px; text-align: center; }
.login-card .field { text-align: left; }
.login-card h1 { margin: 0; font: 600 30px/1.1 var(--font-display); letter-spacing: -0.03em; }
.login-card .note { margin: -8px 0 4px; }
.login-coin { width: 72px; height: 72px; margin: 0 auto; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.code-input { font: 600 22px var(--font-display); letter-spacing: .4em; text-align: center; }
.login-err { color: var(--coral); font-size: 14px; min-height: 1.2em; margin: 0; }
.login-card .pill { justify-content: center; width: 100%; }
.login-card .pill[disabled] { opacity: .5; cursor: default; }
.back-link { margin: 0; text-decoration: none; }
.back-link:hover { color: var(--ink); }

/* ---------- header states ---------- */
.save-state.draft i { background: var(--accent); }
.save-state.dirty i { background: var(--lilac); animation: pulse 1s infinite alternate; }
.save-state.error { color: var(--coral); }
.save-state.error i { background: var(--coral); }
@keyframes pulse { to { opacity: .35; } }
#publishBtn[disabled] { opacity: .55; cursor: default; filter: grayscale(.6); box-shadow: none; }

/* ---------- casino in the sidebar ---------- */
.now-casino { border: 0; cursor: pointer; text-align: left; border-radius: 20px; padding: 16px 18px; display: grid; gap: 8px; color: var(--ink);
  background: var(--pc-bg, var(--surface)); box-shadow: 0 0 0 1.5px var(--pc-accent, var(--accent)), 0 12px 30px -18px var(--pc-accent, var(--accent)); transition: transform .15s; }
.now-casino:hover { transform: translateY(-2px); }
.now-casino .nc-logo { height: 34px; display: flex; align-items: center; font: 600 22px var(--font-display); }
.now-casino .nc-logo img { max-height: 34px; max-width: 100%; object-fit: contain; }
.now-casino .nc-change { font-size: 13px; color: var(--pc-accent, var(--accent)); font-weight: 600; }
@media (max-width: 1000px) { .now-casino { grid-column: 1 / -1; } }

.casino-note { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px 20px; border-radius: 20px; background: rgb(var(--accent-rgb) / .08); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .35); font-size: 14px; line-height: 1.5; }
.casino-note span { flex: 1 1 280px; }
.casino-note[hidden] { display: none; }

/* ---------- publishing & security ---------- */
.btn[disabled] { opacity: .45; cursor: default; }
.ver-list { display: grid; gap: 8px; }
.ver-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); }
.ver-row > div { display: grid; gap: 2px; margin-right: auto; }
.sec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sec-item { display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: 18px; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); }
.sec-item b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--body); }
.sec-item.ok b::before { background: var(--green); }
.sec-item.warn b::before { background: var(--coral); }
.sec-item .btn { justify-self: start; margin-top: 6px; }
.log-wrap { overflow-x: auto; }
.log-table { table-layout: auto; min-width: 520px; font-size: 14px; }
.log-table th { width: auto !important; display: table-cell !important; text-align: left; }
.log-table td { padding: 10px; }
.log-table td.ok { color: var(--green); }
.log-table td.bad { color: var(--coral); }
@media (max-width: 900px) { .sec-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .nav-actions .pill { padding: 8px 14px; font-size: 14px; } }

/* automatic videos preview */
.auto-list { display: grid; gap: 8px; margin: 14px 0 4px 56px; }
.auto-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: var(--charcoal); box-shadow: 0 0 0 1px var(--line); }
.auto-row img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.auto-row > div { display: grid; gap: 2px; min-width: 0; }
.auto-row b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.ended { color: var(--coral); background: rgba(255,171,148,.1); }
.auto-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.small-note { font-size: 13px; }
@media (max-width: 700px) { .auto-list { margin-left: 0; } .auto-row { grid-template-columns: 72px minmax(0, 1fr); } .auto-row img { width: 72px; } .auto-row .chip { grid-column: 2; } }
