/* ============================================================
   Play — Tournament Engine Design System
   Elevated Dark Gray (#121212) + vibrant accents, mobile-first
   ============================================================ */

:root {
    --bg: #121212;
    --bg-elev: #1a1a1f;
    --bg-card: #1e1e24;
    --stroke: rgba(255, 255, 255, 0.08);
    --stroke-strong: rgba(255, 255, 255, 0.16);

    --text: #f2f2f4;
    --text-2: rgba(242, 242, 244, 0.7);
    --text-3: rgba(242, 242, 244, 0.45);

    --accent: #ff2d55;          /* neon red */
    --accent-2: #ff6b9d;        /* neon pink */
    --purple: #c084fc;
    --blue: #38bdf8;
    --green: #3ddc97;
    --yellow: #ffd166;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --tap-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body.play-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

.play-body main a { color: var(--accent-2); text-decoration: none; }
.muted { color: var(--text-3); }

/* ---------- Top bar ---------- */
.play-topbar {
    top: var(--app-nav-h, 56px);
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(18, 18, 18, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--stroke);
    position: sticky;
}
.play-topbar--center { justify-content: center; }
.spectate-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    justify-content: unset;
    align-items: center;
}
.spectate-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 45, 85, 0.45), transparent);
}
.spectate-topbar .topbar-right { display: flex; justify-content: flex-end; }
.spectate-copy { text-align: center; min-width: 0; }
.spectate-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spectate-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-3);
    font-size: 12px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex: 0 0 auto;
}
.status-dot.live { background: var(--green); animation: pulse 1.8s infinite; }
.status-dot.ended { background: var(--accent); }
.status-dot.idle { background: var(--text-3); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}
.judge-btn {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid var(--stroke-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    transition: transform 0.12s var(--tap-ease), color 0.2s, border-color 0.2s, background 0.2s;
}
.judge-btn .judge-ico { font-size: 14px; line-height: 1; }
.judge-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255, 45, 85, 0.08);
}
.judge-btn:active { transform: scale(0.95); }
.topbar-right { display: flex; gap: 8px; }

/* ---------- Console toolbar (creator + judge topbars) ---------- */
.toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    max-width: 100%;
}
.toolbar-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-2);
    white-space: nowrap;
}
.toolbar-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex: none;
}
.toolbar-status.is-running { color: var(--blue); background: rgba(56, 189, 248, 0.12); }
.toolbar-status.is-running .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18); animation: pulse 1.8s infinite; }
.toolbar-status.is-draft .dot { background: var(--text-3); }
.toolbar-status.is-setup { color: var(--purple); background: rgba(192, 132, 252, 0.14); }
.toolbar-status.is-setup .dot { background: var(--purple); }
.toolbar-status.is-completed { color: var(--green); background: rgba(61, 220, 151, 0.12); }
.toolbar-status.is-completed .dot { background: var(--green); }
.toolbar-status.is-locked { color: var(--accent); background: rgba(255, 45, 85, 0.12); }
.toolbar-status.is-locked .dot { background: var(--accent); }
.toolbar-status.is-console { color: var(--accent-2); background: rgba(255, 45, 85, 0.1); }
.toolbar-status.is-console .dot { background: var(--accent); animation: pulse 1.8s infinite; }

.toolbar-sep { width: 1px; height: 20px; margin: 0 3px; background: var(--stroke-strong); flex: none; }
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.toolbar-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.toolbar-btn:active { transform: scale(0.96); }
.toolbar-btn:disabled { opacity: 0.55; cursor: default; }
.toolbar-btn svg { width: 15px; height: 15px; flex: none; }
.toolbar-btn.is-tsyncing svg { animation: tspin 0.8s linear infinite; }
@keyframes tspin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
    .play-topbar { padding: 12px 10px; }
    .toolbar { width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
    .toolbar .t-label { display: none; }
    .toolbar-btn { padding: 9px 11px; }
    .toolbar .toolbar-sep { display: none; }
    .toolbar .t-status-text { font-size: 11.5px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text);
    background: none;
    transition: transform 0.12s var(--tap-ease), opacity 0.2s, background 0.2s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-lg { padding: 16px 26px; font-size: 17px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0d0d1a;
    box-shadow: 0 6px 20px rgba(255, 45, 85, 0.28);
}
.btn-secondary { background: rgba(255, 255, 255, 0.08); border-color: var(--stroke-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-success { background: var(--green); color: #08130d; }
.btn-danger { background: var(--accent); color: #fff; }

.btn-new-tournament {
    background: linear-gradient(135deg, #b8103a, #d4265a);
    color: #fff;
    border-radius: 999px;
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.02em;
    gap: 10px;
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s var(--tap-ease), box-shadow 0.25s;
}
.btn-new-tournament .nt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    transition: transform 0.2s var(--tap-ease), background 0.2s;
}
.btn-new-tournament:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 32px rgba(184, 16, 58, 0.5);
}
.btn-new-tournament:hover .nt-icon {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.28);
}
.btn-new-tournament:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 4px 12px rgba(184, 16, 58, 0.3);
}
.btn-new-tournament:active .nt-icon {
    transform: rotate(180deg);
}

/* ---------- Layout ---------- */
.play-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 22px 18px 60px;
}
.play-wrap--narrow { max-width: 520px; }

.hero { text-align: center; padding: 24px 0 16px; }
.hero h1 { font-size: 2rem; margin-bottom: 6px; letter-spacing: -0.5px; }
.hero p { color: var(--text-2); margin-bottom: 20px; }

/* ---------- Cards / lists ---------- */
.card, .bento, .mcard, .lock-item, .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
}

.card-list { display: grid; gap: 12px; margin-top: 20px; }
.trow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    color: var(--text);
}
.trow:active { transform: scale(0.99); }
.trow-main { display: flex; align-items: center; gap: 10px; }
.trow-meta { display: flex; gap: 8px; }

.empty { text-align: center; color: var(--text-3); padding: 40px 20px; }

.badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
}
.badge-draft { background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
.badge-setup { background: rgba(192, 132, 252, 0.2); color: var(--purple); }
.badge-running { background: rgba(56, 189, 248, 0.18); color: var(--blue); }
.badge-completed { background: rgba(61, 220, 151, 0.18); color: var(--green); }
.badge-locked { background: rgba(255, 45, 85, 0.2); color: var(--accent); }

.pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--stroke);
    color: var(--text-2);
}

/* ---------- Wizard ---------- */
.wizard { margin-top: 10px; }
.wizard-progress { margin-bottom: 24px; }
.w-progress-bar {
    height: 4px;
    background: var(--accent);
    border-radius: 4px;
    width: 25%;
    transition: width 0.35s var(--tap-ease);
    margin-bottom: 12px;
}
.w-steps { display: flex; justify-content: space-between; }
.w-step { font-size: 12px; color: var(--text-3); font-weight: 700; }
.w-step.active { color: var(--accent-2); }
.w-pane h2 { font-size: 1.5rem; margin-bottom: 6px; }
.w-pane { animation: fadeIn 0.25s ease; }
.w-nav { display: flex; gap: 12px; margin-top: 24px; }
.w-nav .btn { flex: 1; }

.field { display: block; margin-top: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.slug-row {
    display: flex;
    align-items: center;
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    overflow: hidden;
}
.slug-prefix {
    padding: 0 0 0 14px;
    color: var(--text-3);
    font-size: 13px;
    white-space: nowrap;
}
.slug-row .input {
    border: 0;
    background: transparent;
    padding: 13px 14px 13px 6px;
}
.field small.muted { display: block; margin-top: 6px; }
.input {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 16px;
}
.input:focus { outline: none; border-color: var(--accent-2); }
.textarea { resize: vertical; min-height: 90px; }

.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.fmt-btn {
    padding: 16px;
    text-align: left;
    background: var(--bg-card);
    border: 2px solid var(--stroke);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.12s var(--tap-ease);
}
.fmt-btn:active { transform: scale(0.97); }
.fmt-btn.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fmt-btn strong { display: block; margin-bottom: 4px; }
.fmt-btn small { color: var(--text-3); }
.fmt-fields { margin-top: 16px; }

.tb-list {
    display: grid;
    gap: 6px;
    margin: 4px 0 2px;
}
.tb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.15s, box-shadow 0.15s;
}
.tb-row:active { cursor: grabbing; }
.tb-label {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}
.tb-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 26px;
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: -2px;
    pointer-events: none;
}
.tb-row.tb-dragging {
    opacity: 0.5;
    border-style: dashed;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.tb-row.tb-drop-hint {
    border-color: var(--accent);
}

.draft-box { margin-top: 8px; }
.draft-line {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--stroke);
}
.draft-line:last-child { border-bottom: 0; }
.draft-success { text-align: center; padding: 30px 16px; }
.draft-success .big { font-size: 3rem; }
.draft-actions { display: grid; gap: 10px; margin-top: 10px; }

.error { color: var(--accent); font-weight: 600; margin-top: 14px; }

/* ---------- Dashboard ---------- */
.dash-head h1 { font-size: 1.6rem; margin-bottom: 8px; }
.dash-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash-meta .meta-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--stroke-strong); }
.dash-meta .meta-actions .btn,
.dash-meta .meta-actions .btn.hold {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-2);
    box-shadow: none;
    line-height: 1.5;
}
.dash-meta .meta-actions .btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }
.dash-meta .meta-actions .btn:active { transform: scale(0.96); }
.dash-meta .meta-actions .btn-accent { background: rgba(255, 45, 85, 0.18); border-color: rgba(255, 45, 85, 0.4); color: #ff6b9d; }
.dash-meta .meta-actions .btn-danger { background: rgba(255, 45, 85, 0.18); border-color: rgba(255, 45, 85, 0.4); color: var(--accent); }
.dash-meta .meta-actions .dropdown summary.btn { display: inline-flex; }

/* Actions… dropdown button — make it stand out with a pulsing glow */
.dash-meta .meta-actions .dropdown > summary.btn {
    border-color: rgba(192, 132, 252, 0.6);
    color: #ecd9ff;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.32), rgba(99, 45, 240, 0.24));
    text-shadow: 0 0 12px rgba(192, 132, 252, 0.7);
    animation: actions-glow 1.8s ease-in-out infinite;
}
.dash-meta .meta-actions .dropdown[open] > summary.btn {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.46), rgba(99, 45, 240, 0.36));
    color: #fff;
    border-color: rgba(192, 132, 252, 0.9);
    animation: none;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.7), inset 0 0 10px rgba(192, 132, 252, 0.28);
}
.dash-meta .meta-actions .dropdown > summary.btn:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.42), rgba(99, 45, 240, 0.32));
}
@keyframes actions-glow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(192, 132, 252, 0.45), 0 0 14px rgba(192, 132, 252, 0.25), inset 0 0 8px rgba(192, 132, 252, 0.18);
    }
    50% {
        box-shadow: 0 0 14px rgba(192, 132, 252, 0.95), 0 0 28px rgba(192, 132, 252, 0.55), inset 0 0 10px rgba(192, 132, 252, 0.32);
    }
}

/* Actions dropdown menu */
.meta-actions .dash-actions { display: grid; gap: 8px; width: 252px; }
.meta-actions .dash-actions .btn,
.meta-actions .dash-actions .btn.hold {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    box-shadow: none;
    line-height: 1.5;
}
.meta-actions .dash-actions .btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.meta-actions .dash-actions .btn:active { transform: scale(0.98); }
.meta-actions .dash-actions .btn-accent { background: rgba(255, 45, 85, 0.18); border-color: rgba(255, 45, 85, 0.45); color: #ff6b9d; }
.meta-actions .dash-actions .btn-accent:hover { background: rgba(255, 45, 85, 0.26); color: #ff6b9d; }
.meta-actions .dash-actions .btn-danger { background: rgba(255, 45, 85, 0.14); border-color: rgba(255, 45, 85, 0.4); color: var(--accent); }
.meta-actions .dash-actions .btn-danger:hover { background: rgba(255, 45, 85, 0.24); color: var(--accent); }
.dash-actions-block {
    display: grid;
    gap: 8px;
    padding: 10px 0 0;
    border-top: 1px solid var(--stroke);
}
.dash-actions-label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.share-box { margin-top: 18px; display: grid; gap: 14px; }
.share-item label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; font-size: 13px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    padding: 14px;
    width: 220px;
    box-shadow: var(--shadow);
}

.locks { margin: 16px 0; }
.locks h3 { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.lock-list { display: grid; gap: 10px; }
.lock-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.lock-item small { display: block; color: var(--text-3); }

.judge-strip { margin-top: 4px; }
.judge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.judge-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}
.judge-item .j-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green, #3ddc97);
    box-shadow: 0 0 8px currentColor;
    color: var(--green, #3ddc97);
    animation: jpulse 2s ease-in-out infinite;
}
@keyframes jpulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.judge-item .j-name { font-weight: 700; font-size: 13px; }
.judge-item .j-time { color: var(--text-3); font-size: 12px; }
.judge-empty { font-size: 13px; color: var(--text-3); margin: 0; }

.tabs { display: flex; gap: 6px; margin: 24px 0 14px; border-bottom: 1px solid var(--stroke); }
.tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: 0;
    color: var(--text-3);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s ease; }

.round-title {
    font-size: 13px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 24px;
    margin-bottom: 10px;
}
.match-col { display: grid; gap: 10px; }
.mcard { overflow: hidden; }
.mcard.is-locked {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(255, 45, 85, 0.35);
}
.mcard.is-locked .mstatus { color: var(--accent); font-weight: 700; }
.mrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--stroke);
}
.mrow:last-of-type { border-bottom: 0; }
.mrow.is-winner { background: rgba(61, 220, 151, 0.08); }
.mrow.is-winner .mname::after { content: " ✓"; color: var(--green); }
.mscore { font-weight: 800; font-variant-numeric: tabular-nums; }
.mstatus { font-size: 11px; color: var(--text-3); padding: 6px 14px; text-transform: uppercase; }
.m-bye {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    color: var(--text-2);
}

/* ---------- Standings table ---------- */
.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 10px 8px;
    border-bottom: 1px solid var(--stroke);
}
.standings td { padding: 11px 8px; border-bottom: 1px solid var(--stroke); font-variant-numeric: tabular-nums; }
.standings .pname { font-weight: 600; }

/* Top-cut qualifier highlight */
.q-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    vertical-align: 1px;
    letter-spacing: 0.02em;
}
.standings .cut-row td { background: rgba(255, 45, 85, 0.07); }
.standings .cut-row td.pname { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- Players ---------- */
.player-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
#btn-delete-players, #sheet-finalize, #btn-end-tournament, #btn-reopen-tournament, #btn-reset-tournament { user-select: none; -webkit-user-select: none; touch-action: none; }
#btn-delete-players, #sheet-finalize { min-width: 230px; }
.hold-arming {
    position: relative;
    overflow: hidden;
    background: #e67e22;
    border-color: #e67e22;
    color: #fff;
    animation: none;
}
.hold-arming::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: rgba(0, 0, 0, 0.25);
    animation: holdFill 3s linear forwards;
    pointer-events: none;
}
.hold-ready { background: #c0392b; border-color: #c0392b; color: #fff; animation: none; }
@keyframes holdFill {
    from { width: 0; }
    to { width: 100%; }
}
.player-list { display: grid; gap: 8px; margin-bottom: 16px; }
.player-row[draggable="true"] { cursor: grab; }
.player-row[draggable="true"]:active { cursor: grabbing; }
.player-row.dragging {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--accent, #7aa2f7);
}
.player-row .drag-grip {
    color: var(--text-3);
    cursor: grab;
    letter-spacing: -2px;
    user-select: none;
}
.dnd-hint {
    color: var(--text-3);
    font-size: 13px;
    align-self: center;
    margin-right: auto;
}
.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}
.player-row.inactive { opacity: 0.45; }
.player-row .seed { font-weight: 800; color: var(--text-3); width: 24px; }
.player-row .pname { flex: 1; }
.delay-btn { transition: color 0.2s, background 0.2s, border-color 0.2s; }.delay-btn.active-delay {
    color: var(--yellow);
    border-color: rgba(255, 209, 102, 0.35);
    background: rgba(255, 209, 102, 0.1);
}
.delay-btn.active-delay:hover {
    color: #fff;
    border-color: var(--yellow);
    background: rgba(255, 209, 102, 0.2);
}
.dl-badge {
    display: inline-block;
    color: var(--yellow);
    font-size: 12px;
    line-height: 1;
    margin: 0 2px;
    vertical-align: middle;
}
.add-player-box { display: grid; gap: 10px; }

/* ---------- Audit ---------- */
.audit-list { list-style: none; display: grid; gap: 8px; }
.audit-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.audit-list em { color: var(--text-2); font-style: normal; font-weight: 600; }
.audit-list small { margin-left: auto; color: var(--text-3); }

/* ============================================================
   Bento (Spectator)
   ============================================================ */
.bento-wrap { padding-top: 18px; }
.bento-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.bento-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2);
    border-bottom: 1px solid var(--stroke);
}
.dash-bracket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--stroke);
}
.dash-bracket-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2);
}
.bento.card { padding: 0; overflow: hidden; }
.bento .bento-body { padding: 14px; }

.next-match { grid-column: 1 / -1; }
.live-now { grid-column: 1 / -1; }
.standings-card { grid-column: 1 / -1; }
.recent { grid-column: 1 / -1; }

.pin-btn {
    background: none;
    border: 0;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: transform 0.2s var(--tap-ease);
}
.pin-btn.pinned { opacity: 1; transform: scale(1.15); }

.next-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    text-align: center;
}
.next-pair .np-name { font-weight: 700; }
.next-pair .np-vs { color: var(--text-3); font-weight: 800; }
.next-pair .np-empty { color: var(--text-3); text-align: center; padding: 18px; }

.live-match {
    padding: 12px 14px;
    border-bottom: 1px solid var(--stroke);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.live-match:last-child { border-bottom: 0; }
.live-pair { font-weight: 600; }
.live-state { font-size: 11px; }
.live-state.locked { color: var(--yellow); }
.live-state.live { color: var(--green); }

.result-row { padding: 10px 14px; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.result-row:last-child { border-bottom: 0; }
.result-row .r-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.standings-skel { padding: 6px; }

/* Judge gate */
.judge-gate {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    padding: 20px;
}
.judge-gate:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
}
.judge-modal {
    width: 100%;
    max-width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius);
    padding: 24px;
    display: grid;
    gap: 12px;
    box-shadow: var(--shadow);
}
.pin-input { text-align: center; font-size: 28px; letter-spacing: 12px; font-weight: 800; }

/* ============================================================
   Judge Console
   ============================================================ */
.judge-wrap { padding-bottom: 140px; }
.judge-banner { margin-bottom: 18px; }
.judge-banner h1 { font-size: 1.6rem; }
.judge-greet {
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.judge-match-list { display: grid; gap: 10px; }
.judge-match {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s var(--tap-ease), border-color 0.2s;
}
.judge-match > .pill {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}
.judge-match.pending.denied > .pill {
    top: 50%;
}
.judge-match.pending { overflow: hidden; }
.judge-match:active { transform: scale(0.98); }
.judge-match.mine { border-color: var(--green); }
.judge-match.denied { border-color: var(--accent); opacity: 0.7; cursor: not-allowed; }
.jm-pair { font-weight: 700; }
.judge-match.pending .jm-pair {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 22px;
}
.judge-match.pending .jm-name {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.judge-match.pending .jm-name-left { right: 50%; margin-right: 12px; max-width: calc(50% - 12px); }
.judge-match.pending .jm-name-right { left: 50%; margin-left: 12px; max-width: calc(50% - 12px); }
.judge-match.pending .jm-slot {
    width: 30px;
    flex-shrink: 0;
}
.jm-vs-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-3);
    pointer-events: none;
}
.judge-match.pending .jm-sub {
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
}
.jm-vs-inline { font-weight: 600; color: var(--text-3); }
.jm-sub { font-size: 12px; color: var(--text-3); }
.judge-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}
.judge-tabs .jt {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-2);
    border: 1px solid var(--stroke);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.judge-tabs .jt.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.judge-view {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
}
.judge-view .jv.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.judge-view[hidden] { display: none; }
.judge-view .jv { cursor: pointer; }
.judge-match-list[hidden],
#judge-standings[hidden],
.judge-tabs[hidden] { display: none; }

.jm-section-label {
    margin: 18px 0 -2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.judge-match.judged {
    cursor: default;
    opacity: 0.85;
}
.judge-match.judged:active { transform: none; }
.pill.success {
    background: rgba(52, 199, 89, 0.15);
    border-color: var(--green);
    color: var(--green);
}

.jm-win {
    color: var(--green);
    font-weight: 700;
    background: rgba(52, 199, 89, 0.15);
    padding: 0 3px;
    border-radius: 4px;
    background-clip: content-box;
    -webkit-background-clip: content-box;
}

.judge-match.judged.scores {
    flex-direction: column;
    gap: 2px;
}
.judge-match.judged.scores .jm-scores {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 4px;
}
.judge-match.judged.scores .jm-vs {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-3);
    pointer-events: none;
    white-space: nowrap;
}
.judge-match.judged.scores .jm-slot {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 30px;
    text-align: center;
}
.judge-match.judged.scores .jm-name {
    flex: 0 1 calc(50% - 20px);
    min-width: 0;
    font-weight: 700;
    font-size: 15px;
    white-space: normal;
    word-break: break-word;
}
.judge-match.judged.scores .jm-name-left { text-align: right; padding-right: 8px; }
.judge-match.judged.scores .jm-name-right { text-align: left; padding-left: 8px; }

/* Floating save-order button (players pane, draft/setup) */
.order-fab {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--accent, #7aa2f7);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.order-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.order-fab:active { transform: translateY(0); }
.order-fab[hidden] { display: none; }
.order-fab.saving { opacity: 0.65; pointer-events: none; }
.order-fab .fab-icon { width: 18px; height: 18px; flex: none; }
@media (max-width: 520px) { .order-fab .fab-label { display: none; } }

/* Bottom sheet */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: var(--bg-elev);
    border-top: 1px solid var(--stroke-strong);
    border-radius: 20px 20px 0 0;
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(100%);
    transition: transform 0.3s var(--tap-ease);
    max-height: 92vh;
    overflow: hidden auto;
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 4px;
    background: var(--stroke-strong);
    margin: 0 auto 12px;
}
.sheet-title { text-align: center; font-weight: 800; margin-bottom: 16px; }
.sheet-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 10px;
}
.side { text-align: center; }
.swap-btn { align-self: center; }
.side-name { display: block; font-weight: 700; margin-bottom: 12px; min-height: 20px; max-width: 135px; margin-left: auto; margin-right: auto; }
.steppers { display: grid; gap: 8px; justify-items: center; }
.stepper {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    border: 0;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.1s var(--tap-ease);
    -webkit-tap-highlight-color: transparent;
}
.stepper.up { background: linear-gradient(135deg, var(--green), #2cbb7f); }
.stepper.down { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.stepper:active { transform: scale(0.9); }   /* juice pulse */
.stepper-val {
    font-size: 52px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
}
.stepper-val.pulse { animation: pop 0.18s var(--tap-ease); }
.swap-btn {
    background: var(--bg-card);
    border: 1px solid var(--stroke-strong);
    color: var(--text-2);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 20px;
    cursor: pointer;
}
.swap-btn:active { transform: rotate(180deg); transition: transform 0.25s var(--tap-ease); background: var(--purple); }

.sheet-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
#sheet-countdown .cd-ico { font-size: 18px; line-height: 1; vertical-align: -2px; display: inline-block; }
#sheet-countdown.talking {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(192, 132, 252, 0.12);
}
#sheet-countdown.talking .cd-ico { animation: cd-talk 0.7s var(--tap-ease) infinite; }
@keyframes cd-talk {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}
.sheet-msg { text-align: center; margin-top: 12px; min-height: 20px; font-weight: 600; }
.sheet-msg.warn { color: var(--yellow); }
.sheet-msg.err { color: var(--accent); }

/* ---------- Skeleton loaders ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 44px;
    margin-bottom: 8px;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); color: var(--yellow); }
    100% { transform: scale(1); }
}

/* ---------- Responsive desktop ---------- */
@media (min-width: 760px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .next-match { grid-column: 1 / -1; }
    .live-now { grid-column: 1 / 2; }
    .standings-card { grid-column: 2 / 3; grid-row: span 2; }
    .recent { grid-column: 1 / 2; }
    .match-col { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .share-box { grid-template-columns: 1fr 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Edit tournament modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    background: #1e1e1e;
    border: 1px solid var(--glass-border, #333);
    border-radius: 12px;
    padding: 24px 28px;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    color: #eaeaea;
    animation: modalFadeIn 0.25s ease;
}
.modal h3 { margin: 0 0 16px; font-size: 1.25rem; }
.field .field-hint { display: block; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal .modal-actions .btn { flex: 1; }
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   Spectator redesign — round tabs + standings + highlight player
   ============================================================ */
.spectate-wrap { padding-top: 12px; }

.spectate-hl {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
}
.spectate-hl > label { color: var(--text-2); }
.hl-row-flex { display: flex; gap: 8px; align-items: center; }
.hl-row-flex .input { flex: 1; }
.hl-clear {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.01em;
    border: 1px solid var(--stroke-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-2);
    transition: transform 0.12s var(--tap-ease), color 0.2s, border-color 0.2s, background 0.2s;
}
.hl-clear span { font-weight: 900; font-size: 11px; line-height: 1; }
.hl-clear:hover {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(255, 209, 102, 0.08);
}
.hl-clear:active { transform: scale(0.94); }
.hl-clear[hidden] { display: none; }

.combobox {
    position: relative;
    flex: 1;
    min-width: 0;
}
.hl-drop-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.hl-drop-toggle .hl-chev {
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
}
.hl-drop-toggle:hover { color: var(--accent-2); background: rgba(255, 255, 255, 0.06); }
.combobox .input { width: 100%; padding-right: 40px; }
.hl-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-height: 260px;
    overflow-y: auto;
}
.hl-menu[hidden] { display: none; }
.hl-option {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hl-option.active, .hl-option:hover { background: rgba(255, 45, 85, 0.12); color: var(--accent-2); }
.hl-empty {
    display: block;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}

.spectate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
}
.spectate-matches, .spectate-standings { min-width: 0; max-width: 100%; }

.spectate-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    width: 100%;
    justify-self: stretch;
}
.spectate-tabs .st-tab {
    flex: 1;
    padding: 9px 14px;
    border: 0;
    border-radius: calc(var(--radius) - 5px);
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.spectate-tabs .st-tab.active {
    background: var(--accent);
    color: #fff;
}

.spectate-matches .bento-head,
.spectate-standings .bento-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--stroke);
}

.round-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 12px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.round-tabs::-webkit-scrollbar { display: none; }
.round-tabs[hidden] { display: none; }
.round-tabs .rt {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--stroke);
    color: var(--text-2);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
.round-tabs .rt.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

.round-match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 0 12px 14px; }
.round-match-list[hidden] { display: none; }

.match-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--bg-card);
    min-width: 0;
}
.match-card .mc-left { text-align: right; min-width: 0; }
.mc-name { display: block; font-weight: 700; color: var(--text); font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-name--hl { color: var(--yellow); }
.mc-name--win { color: var(--green); }
.match-card .mc-right { text-align: left; min-width: 0; }
.mc-vs { color: var(--text-3); font-size: 11px; font-weight: 700; }
.mc-score {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
.mc-colon { color: var(--text-3); }
.match-card .mc-status {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}
.mc-badge {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 116px;
}
.match-card.bye {
    grid-template-columns: 1fr;
    text-align: center;
}
.match-card.bye .mc-left { text-align: center; }
.match-card.bye .mc-status { grid-column: 1; justify-self: center; }
.match-card.hl-match {
    border-color: var(--yellow);
    box-shadow: 0 0 0 1px var(--yellow), 0 4px 18px rgba(255, 209, 102, 0.15);
}

.standings-list { max-height: 460px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.standings-list .standings { font-size: 13px; min-width: 460px; border-collapse: separate; border-spacing: 0; }
.standings-list::-webkit-scrollbar { height: 8px; width: 8px; }
.standings-list::-webkit-scrollbar-track { background: transparent; }
.standings-list::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 999px;
    border: 2px solid var(--bg);
}
.standings-list .standings th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg, #14161d);
    padding: 9px 8px;
    text-align: left;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--stroke);
    white-space: nowrap;
}
.standings-list .standings .s-rank,
.standings-list .standings .s-rank-head {
    position: sticky;
    left: 0;
    z-index: 2;
}
.standings-list .standings .s-rank-head { z-index: 4; }
.standings-list .standings th.s-rank-head,
.standings-list .standings td.s-rank {
    width: 30px;
    min-width: 30px;
    background: var(--bg, #14161d);
}
.standings-list .standings th.s-name {
    left: 30px;
    background: var(--bg, #14161d);
}
.standings-list .standings td,
.standings-list .standings th { padding: 8px; }
.standings-list .standings td { border-bottom: 1px solid var(--stroke); }
.standings-list .standings td.s-name { position: sticky; left: 30px; z-index: 1; background: var(--bg-card, #1e1e24); font-weight: 600; white-space: nowrap; }
.standings-list .standings .s-rank { color: var(--text-3); font-weight: 700; }
.tb-legend {
    margin: 16px 10px 6px;
    padding: 12px 14px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    color: var(--text-2);
}
.tb-legend[hidden] { display: none; }
.tb-legend .tb-legend-head {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 8px;
}
.tb-legend .tb-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.tb-legend .tb-legend-list li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.4;
}
.tb-legend .tb-legend-list li strong { color: var(--text-1); font-weight: 700; }
.tb-legend .tb-legend-list li .tb-abbr {
    color: var(--accent);
    font-weight: 700;
    font-size: 10.5px;
    background: rgba(127, 127, 255, 0.10);
    border-radius: 5px;
    padding: 1px 5px;
    vertical-align: 1px;
    white-space: nowrap;
}
.tb-legend .tb-legend-list li span { color: var(--text-3); font-size: 11.5px; }
.tb-legend .tb-legend-list li.tb-legend-end { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--stroke); }
.standings-list .standings .s-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.standings-list .standings .s-num--pts { color: var(--accent); font-weight: 800; }
.standings-list .standings tr.hl-row td { background: rgba(255, 209, 102, 0.08); }
.standings-list .standings tr.hl-row td.s-name,
.standings-list .standings tr.hl-row th.s-name,
.standings-list .standings tr.hl-row td.s-rank,
.standings-list .standings tr.hl-row th.s-rank-head {
    background: var(--bg-card, #1e1e24);
}
.standings-list .standings tr.hl-row .s-name { color: var(--yellow); }
.standings-list .standings tr.hl-row td.s-name { box-shadow: inset 3px 0 0 var(--yellow); }
.standings-list .standings tr.cut-row td { background: rgba(255, 45, 85, 0.06); }
.standings-list .standings tr.cut-row td.s-rank,
.standings-list .standings tr.cut-row td.s-name {
    background: rgba(255, 45, 85, 0.09);
}
.standings-list .standings tr.cut-row td.s-name { box-shadow: inset 3px 0 0 var(--accent); }
.standings-list .standings tr.cut-row td.s-rank { color: var(--accent); }

/* ── Spectator view switch ────────────────────────────── */
.view-switch {
    display: inline-flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 2px;
}
.view-switch[hidden] { display: none; }
.vs-btn {
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.vs-btn:hover { color: var(--text); }
.vs-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

/* ── Bracket tree ────────────────────────────────────── */
/* ── Bracket tree (mobile-first, horizontally scrollable) ── */
.bracket-tree {
    overflow: auto;
    max-width: 100%;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    padding: 14px 12px 12px;
}
.bracket-tree::-webkit-scrollbar { height: 10px; width: 10px; }
.bracket-tree::-webkit-scrollbar-track { background: transparent; }
.bracket-tree::-webkit-scrollbar-thumb { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; border: 2px solid var(--bg-card); }
.bracket-inner { position: relative; display: flex; align-items: stretch; min-width: max-content; }
.bracket-col { position: relative; scroll-snap-align: start; }
.bracket-col + .bracket-col { margin-left: 76px; }
.bracket-card { position: absolute; left: 0; width: 188px; }
.bracket-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; }

.bm {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    border-left: 3px solid rgba(255, 255, 255, 0.14);
}
.bm-row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 8px;
    font-size: 12px;
    min-width: 0;
}
.bm-row + .bm-row { border-top: 1px solid var(--stroke); }
.bm-row.win { background: rgba(61, 220, 151, 0.10); }
.bm-row.lose { color: var(--text-3); }
.bm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.bm-score { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.bm-tag {
    font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-3); border: 1px solid var(--stroke); border-radius: 999px; padding: 1px 6px;
}
.bm-leaf { border-left-color: var(--accent-2); }
.bm-leaf .bm-row { justify-content: center; }
.bm-leaf .bm-name { color: var(--text-2); font-weight: 700; }

.bracket-panel { margin-bottom: 8px; }
.bracket-panel:last-child { margin-bottom: 0; }
.bracket-panel-hd {
    font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-3); margin-bottom: 8px;
}
.ladder { display: flex; flex-direction: column; gap: 8px; }
.ladder-item { width: 188px; height: 62px; }

@media (min-width: 820px) {
    .spectate-layout { grid-template-columns: minmax(0, 1fr); max-width: 820px; justify-self: center; width: 100%; }
    .bracket-tree { padding: 16px 14px 14px; }
}

/* ---------- Play landing / dashboard (index) ---------- */
.play-wrap--dash { max-width: 920px; }

.play-hero {
    position: relative;
    text-align: center;
    padding: 44px 0 30px;
    border-bottom: 1px solid var(--stroke);
}
.play-hero::before {
    content: "";
    position: absolute;
    top: -70px;
    left: 50%;
    width: min(1200px, 100vw);
    height: 300px;
    transform: translateX(-50%);
    background:
        radial-gradient(460px 200px at 50% 0%, rgba(255, 45, 85, 0.26), transparent 70%),
        radial-gradient(400px 200px at 10% 15%, rgba(56, 189, 248, 0.14), transparent 70%),
        radial-gradient(400px 200px at 90% 15%, rgba(192, 132, 252, 0.16), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.play-hero > * { position: relative; z-index: 1; }

.play-hero-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 40px rgba(255, 45, 85, 0.35);
}
.play-hero-mark svg { width: 32px; height: 32px; color: #fff; }

.play-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.play-hero-sub {
    color: var(--text-2);
    max-width: 480px;
    margin: 0 auto 26px;
    font-size: 15px;
}
.play-hero-actions { display: flex; justify-content: center; margin-bottom: 26px; }

.play-hero-stats {
    display: flex;
    justify-content: center;
    gap: 44px;
    padding: 18px 0 2px;
}
.stat { display: grid; gap: 2px; text-align: center; }
.stat strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.stat span {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
}

.play-section { padding: 28px 0 6px; }
.play-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.play-section-head h2 { font-size: 1.12rem; letter-spacing: -0.01em; }
.play-count {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 2px 9px;
}

.fmt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}
.fmt-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: transform 0.16s var(--tap-ease), border-color 0.2s, box-shadow 0.25s;
}
.fmt-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 45, 85, 0.45);
    box-shadow: var(--shadow);
}
.fmt-card svg { width: 22px; height: 22px; color: var(--accent-2); }
.fmt-card strong { font-size: 15px; color: var(--text); }
.fmt-card small { color: var(--text-3); font-size: 12.5px; line-height: 1.4; }

.my-tlist { display: grid; gap: 10px; }
.tcard {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.14s var(--tap-ease), border-color 0.2s, box-shadow 0.25s;
}
.tcard:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: var(--shadow);
}
.tcard-main { display: grid; gap: 7px; min-width: 0; }
.tcard-main strong {
    font-size: 15.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tcard-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 360px; }
.tcard-chev { color: var(--text-3); font-size: 24px; line-height: 1; }

.play-empty {
    text-align: center;
    padding: 46px 20px;
    border: 1px dashed var(--stroke-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}
.play-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 45, 85, 0.12);
}
.play-empty-icon svg { width: 24px; height: 24px; color: var(--accent); }
.play-empty h3 { font-size: 1.05rem; margin-bottom: 6px; }
.play-empty p { color: var(--text-3); margin-bottom: 18px; }

@media (max-width: 620px) {
    .play-hero { padding: 34px 0 24px; }
    .play-hero-stats { gap: 28px; }
    .tcard { grid-template-columns: 1fr auto; }
    .tcard-meta { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
    .tcard-chev { display: none; }
}


