/* ==========================================================================
   Yoga Live - design system
   Light + dark themes via Bootstrap's data-bs-theme. Page sections at the bottom.
   ========================================================================== */

:root,
[data-bs-theme="light"] {
  --yl-bg: #f5f6fb;
  --yl-surface: #ffffff;
  --yl-surface-2: #f1f3f9;
  --yl-ink: #0f172a;
  --yl-muted: #64748b;
  --yl-border: #e4e7f0;
  --yl-brand: #4f46e5;
  --yl-brand-600: #4338ca;
  --yl-brand-soft: #eef0ff;
  --yl-violet: #7c3aed;
  --yl-amber: #f59e0b;
  --yl-green: #10b981;
  --yl-red: #ef4444;
  --yl-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --yl-shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 18px 48px rgba(79, 70, 229, .14);
  --yl-gold: #f5b301;
  --yl-silver: #94a3b8;
  --yl-bronze: #c2410c;
  /* score-sheet colours (echoing the spreadsheet: marks / time / total / score / final) */
  --cell-marks: #e3f4ec;
  --cell-time: #fff1d6;
  --cell-total: #ffe3cf;
  --cell-score: #d9f3fb;
  --cell-final: #d8f6df;
  --cell-ink: #14532d;

  --bs-body-bg: var(--yl-bg);
  --bs-body-color: var(--yl-ink);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-primary: var(--yl-brand);
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: var(--yl-brand);
  --bs-link-hover-color: var(--yl-brand-600);
  --bs-border-color: var(--yl-border);
  --bs-border-radius: .75rem;
  --bs-border-radius-lg: 1rem;
}

[data-bs-theme="dark"] {
  --yl-bg: #0a0f1f;
  --yl-surface: #121a30;
  --yl-surface-2: #182240;
  --yl-ink: #e8ecf8;
  --yl-muted: #93a0bd;
  --yl-border: #25314f;
  --yl-brand: #818cf8;
  --yl-brand-600: #a5b4fc;
  --yl-brand-soft: #1c2450;
  --yl-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --yl-shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 20px 50px rgba(0, 0, 0, .5);
  --cell-marks: #12362b;
  --cell-time: #3a2d10;
  --cell-total: #3d2616;
  --cell-score: #0f3440;
  --cell-final: #123d22;
  --cell-ink: #bbf7d0;

  --bs-body-bg: var(--yl-bg);
  --bs-body-color: var(--yl-ink);
  --bs-primary: var(--yl-brand);
  --bs-primary-rgb: 129, 140, 248;
  --bs-link-color: var(--yl-brand);
  --bs-link-hover-color: var(--yl-brand-600);
  --bs-border-color: var(--yl-border);
  --bs-secondary-color: var(--yl-muted);
}

html { scroll-behavior: smooth; }
body { background: var(--yl-bg); color: var(--yl-ink); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; font-weight: 700; }
.text-muted, .text-secondary { color: var(--yl-muted) !important; }
.tnum { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--yl-muted); }

/* ---- buttons ---------------------------------------------------------------- */
.btn { border-radius: .7rem; font-weight: 600; padding: .55rem 1.05rem; }
.btn-lg { padding: .8rem 1.5rem; border-radius: .9rem; }
.btn-primary {
  --bs-btn-bg: var(--yl-brand); --bs-btn-border-color: var(--yl-brand);
  --bs-btn-hover-bg: var(--yl-brand-600); --bs-btn-hover-border-color: var(--yl-brand-600);
  --bs-btn-active-bg: var(--yl-brand-600); --bs-btn-active-border-color: var(--yl-brand-600);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
  background-image: linear-gradient(135deg, var(--yl-brand), var(--yl-violet)); border: 0;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .28);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-soft { background: var(--yl-brand-soft); color: var(--yl-brand); border: 0; }
.btn-soft:hover { background: var(--yl-brand); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--yl-border); color: var(--yl-ink); }
.btn-ghost:hover { background: var(--yl-surface-2); }
.btn-icon { width: 2.4rem; height: 2.4rem; padding: 0; display: inline-grid; place-items: center; border-radius: .7rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--yl-brand) 55%, transparent); outline-offset: 2px; }

/* ---- navbar ----------------------------------------------------------------- */
.app-nav {
  background: color-mix(in srgb, var(--yl-surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--yl-border);
}
.app-nav .navbar-brand { font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: .6rem; color: var(--yl-ink); }
.app-nav .navbar-brand span.live { color: var(--yl-brand); }
.brand-tournament { font-weight: 600; font-size: .85rem; color: var(--yl-muted); letter-spacing: 0; padding-left: .75rem; margin-left: .15rem; border-left: 1px solid var(--yl-border); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
  width: 2.1rem; height: 2.1rem; border-radius: .7rem; display: grid; place-items: center; color: #fff; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--yl-brand), var(--yl-violet)); box-shadow: 0 6px 14px rgba(79, 70, 229, .35);
}
.app-nav .nav-link { color: var(--yl-muted); font-weight: 600; border-radius: .6rem; padding: .45rem .8rem !important; }
.app-nav .nav-link:hover { color: var(--yl-ink); background: var(--yl-surface-2); }
.app-nav .nav-link.active { color: var(--yl-brand); background: var(--yl-brand-soft); }
.live-pill {
  display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .78rem; text-decoration: none;
  padding: .32rem .7rem; border-radius: 999px; background: rgba(239, 68, 68, .12); color: var(--yl-red);
}
.live-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--yl-red); position: relative; display: inline-block; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--yl-red); opacity: 0; animation: ping 1.6s infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---- surfaces --------------------------------------------------------------- */
.card-soft {
  background: var(--yl-surface); border: 1px solid var(--yl-border); border-radius: 1.1rem; box-shadow: var(--yl-shadow);
}
.card-soft.hover-lift { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-soft.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--yl-shadow-lg); border-color: color-mix(in srgb, var(--yl-brand) 40%, var(--yl-border)); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-title h2 { margin: 0; font-size: 1.35rem; }
.page-head { padding: 2rem 0 1.25rem; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--yl-surface-2); color: var(--yl-ink); border: 1px solid var(--yl-border); white-space: nowrap;
}
.chip-brand { background: var(--yl-brand-soft); color: var(--yl-brand); border-color: transparent; }
.chip-live { background: rgba(239, 68, 68, .12); color: var(--yl-red); border-color: transparent; }
.chip-done { background: rgba(16, 185, 129, .13); color: #047857; border-color: transparent; }
[data-bs-theme="dark"] .chip-done { color: #6ee7b7; }
.chip-wait { background: rgba(245, 158, 11, .14); color: #b45309; border-color: transparent; }
[data-bs-theme="dark"] .chip-wait { color: #fcd34d; }
.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--yl-brand), var(--yl-violet)); object-fit: cover; overflow: hidden;
}
.form-control, .form-select { border-radius: .7rem; border-color: var(--yl-border); background-color: var(--yl-surface); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--yl-brand); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--yl-brand) 20%, transparent); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.invalid-feedback { font-size: .8rem; }
.table-modern { --bs-table-bg: transparent; margin: 0; }
.table-modern thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--yl-muted); font-weight: 700; border-bottom: 1px solid var(--yl-border); background: var(--yl-surface-2); white-space: nowrap; }
.table-modern td { vertical-align: middle; border-color: var(--yl-border); }
.asana-thumb { width: 54px; height: 40px; object-fit: contain; background: #fff; border-radius: .45rem; border: 1px solid var(--yl-border); padding: 2px; }
.asana-thumb.lg { width: 84px; height: 64px; }

/* ---- hero (home) ------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden; border-radius: 1.6rem; color: #fff; padding: clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(600px 400px at 0% 110%, rgba(245, 158, 11, .35), transparent 60%),
    linear-gradient(135deg, #3730a3 0%, #5b21b6 55%, #7c3aed 100%);
  box-shadow: var(--yl-shadow-lg);
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; line-height: 1.05; margin-bottom: .75rem; }
.hero p.lead { color: rgba(255, 255, 255, .85); max-width: 40rem; }
.hero .btn-light { color: #3730a3; font-weight: 700; }
.hero .btn-outline-light { font-weight: 600; }
.hero-art { position: absolute; right: -30px; bottom: -40px; font-size: 22rem; line-height: 1; opacity: .09; pointer-events: none; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.75rem; margin-top: 2rem; }
.hero-stats b { display: block; font-size: 1.8rem; line-height: 1; font-weight: 800; }
.hero-stats span { font-size: .8rem; opacity: .8; }
.event-card { padding: 1.4rem; height: 100%; position: relative; }
.event-icon {
  width: 3rem; height: 3rem; border-radius: .9rem; display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 1rem;
  background: var(--yl-brand-soft); color: var(--yl-brand);
}
.step-num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--yl-brand-soft); color: var(--yl-brand); flex: none; }

/* ---- wizard (register) ------------------------------------------------------ */
.wizard-steps { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.wizard-step { flex: 1; display: flex; align-items: center; gap: .65rem; padding: .7rem .9rem; border-radius: .9rem; background: var(--yl-surface); border: 1px solid var(--yl-border); color: var(--yl-muted); font-weight: 600; font-size: .9rem; transition: all .2s; }
.wizard-step .num { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; background: var(--yl-surface-2); flex: none; }
.wizard-step.active { color: var(--yl-brand); border-color: var(--yl-brand); background: var(--yl-brand-soft); }
.wizard-step.active .num { background: var(--yl-brand); color: #fff; }
.wizard-step.done { color: var(--yl-green); }
.wizard-step.done .num { background: var(--yl-green); color: #fff; }
.wizard-step .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) { .wizard-step .label { display: none; } .wizard-step { justify-content: center; } }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.event-option { cursor: pointer; display: block; height: 100%; }
.event-option input { position: absolute; opacity: 0; pointer-events: none; }
.event-option .card-soft { padding: 1.2rem; height: 100%; transition: all .18s; border-width: 2px; }
.event-option:hover .card-soft { border-color: color-mix(in srgb, var(--yl-brand) 50%, var(--yl-border)); }
.event-option input:checked + .card-soft { border-color: var(--yl-brand); background: var(--yl-brand-soft); box-shadow: var(--yl-shadow-lg); }
.event-option input:focus-visible + .card-soft { outline: 3px solid color-mix(in srgb, var(--yl-brand) 55%, transparent); outline-offset: 2px; }
/* one colour per event, as in the registration flowchart: amber / blue / green / violet */
.ev-TR { --ev: #d97706; }
.ev-AS { --ev: #2563eb; }
.ev-AP { --ev: #059669; }
.ev-RP { --ev: #7c3aed; }
[data-bs-theme="dark"] .ev-TR { --ev: #fbbf24; }
[data-bs-theme="dark"] .ev-AS { --ev: #60a5fa; }
[data-bs-theme="dark"] .ev-AP { --ev: #34d399; }
[data-bs-theme="dark"] .ev-RP { --ev: #a78bfa; }
.ev-TR .event-icon, .ev-AS .event-icon, .ev-AP .event-icon, .ev-RP .event-icon,
.event-card.ev-TR .event-icon, .event-card.ev-AS .event-icon, .event-card.ev-AP .event-icon, .event-card.ev-RP .event-icon {
  color: var(--ev); background: color-mix(in srgb, var(--ev) 14%, var(--yl-surface));
}
.event-option .card-soft { border-top: 4px solid var(--ev, var(--yl-border)); }
.event-option input:checked + .card-soft { border-color: var(--ev, var(--yl-brand)); background: color-mix(in srgb, var(--ev, var(--yl-brand)) 9%, var(--yl-surface)); }
.ev-chip { background: color-mix(in srgb, var(--ev, var(--yl-brand)) 14%, var(--yl-surface)); color: var(--ev, var(--yl-brand)); border-color: transparent; }
.event-card[class*="ev-"] { border-top: 4px solid var(--ev); }
.check-list { list-style: none; padding: 0; }
.check { display: flex; gap: .65rem; align-items: flex-start; padding: .4rem 0; font-weight: 600; }
.check small { display: block; font-weight: 500; color: var(--yl-muted); font-size: .76rem; }
.check i { font-size: 1.15rem; margin-top: .05rem; color: var(--yl-muted); }
.check.ok i { color: var(--yl-green); }
.check.fail { color: var(--yl-red); }
.check.fail i { color: var(--yl-red); }
.slot-name { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--yl-muted); margin-bottom: .25rem; }
.photo-drop { border: 2px dashed var(--yl-border); border-radius: 1rem; display: grid; place-items: center; text-align: center; min-height: 10.5rem; padding: 1rem; cursor: pointer; background: var(--yl-surface-2); color: var(--yl-muted); position: relative; overflow: hidden; }
.photo-drop:hover { border-color: var(--yl-brand); color: var(--yl-brand); }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.age-badge { display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: .9rem; background: var(--yl-brand-soft); color: var(--yl-brand); font-weight: 600; }
.age-badge.bad { background: rgba(239, 68, 68, .12); color: var(--yl-red); }
.round-card { padding: 1.1rem 1.2rem; }
.round-card .count { font-variant-numeric: tabular-nums; }
.slot-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.slot {
  flex: 1 1 150px; min-width: 150px; max-width: 220px; border: 2px dashed var(--yl-border); border-radius: 1rem; padding: .6rem; text-align: center;
  background: var(--yl-surface-2); position: relative; min-height: 118px; display: grid; place-items: center; cursor: pointer; transition: all .15s; color: var(--yl-muted); font-weight: 600; font-size: .85rem;
}
.slot:hover { border-color: var(--yl-brand); color: var(--yl-brand); }
.slot.filled { border-style: solid; background: var(--yl-surface); color: var(--yl-ink); }
.slot img { width: 100%; height: 64px; object-fit: contain; background: #fff; border-radius: .6rem; }
.slot .code { font-weight: 700; margin-top: .35rem; display: block; font-size: .9rem; }
.slot .bv { font-size: .72rem; color: var(--yl-muted); font-weight: 600; }
.slot .remove { position: absolute; top: 4px; right: 4px; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0; background: var(--yl-surface-2); color: var(--yl-muted); display: grid; place-items: center; font-size: .75rem; }
.slot .remove:hover { background: var(--yl-red); color: #fff; }
.slot-err { color: var(--yl-red); font-size: .83rem; font-weight: 600; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .65rem; }
.pick {
  border: 2px solid var(--yl-border); border-radius: .9rem; padding: .5rem; background: var(--yl-surface); text-align: center; cursor: pointer; position: relative; transition: all .12s; font-size: .8rem;
}
.pick:hover:not(.blocked) { border-color: var(--yl-brand); transform: translateY(-2px); box-shadow: var(--yl-shadow); }
.pick img { width: 100%; height: 74px; object-fit: contain; background: #fff; border-radius: .55rem; }
.pick b { display: block; margin-top: .3rem; font-size: .88rem; }
.pick.selected { border-color: var(--yl-brand); background: var(--yl-brand-soft); }
.pick.selected::after { content: "\F26A"; font-family: "bootstrap-icons"; position: absolute; top: 4px; right: 6px; color: var(--yl-brand); font-size: 1.1rem; }
.pick.blocked { opacity: .38; cursor: not-allowed; filter: grayscale(1); }
.pick .why { display: block; font-size: .66rem; color: var(--yl-muted); line-height: 1.2; min-height: .8rem; }
.group-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.group-chips .chip { cursor: pointer; user-select: none; }
.group-chips .chip.on { background: var(--yl-brand); color: #fff; border-color: var(--yl-brand); }
.review-grid dt { color: var(--yl-muted); font-weight: 600; font-size: .78rem; }
.review-grid dd { margin-bottom: .6rem; font-weight: 600; }

/* ---- live leaderboard ------------------------------------------------------- */
.now-banner {
  border-radius: 1.2rem; padding: 1rem 1.25rem; color: #fff; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: linear-gradient(120deg, #be123c, #e11d48 45%, #f97316);
  box-shadow: 0 10px 30px rgba(225, 29, 72, .28);
}
.now-banner .chest { font-size: 2rem; font-weight: 800; background: rgba(255, 255, 255, .18); padding: .1rem .8rem; border-radius: .8rem; }
.now-banner .asanas { display: flex; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.now-banner .asanas figure { margin: 0; background: #fff; border-radius: .7rem; padding: 3px 6px; text-align: center; color: #0f172a; font-size: .66rem; font-weight: 700; }
.now-banner .asanas img { height: 44px; display: block; margin: 0 auto; }
.board { position: relative; display: flex; flex-direction: column; gap: .55rem; }
.lb-row {
  background: var(--yl-surface); border: 1px solid var(--yl-border); border-radius: 1rem; box-shadow: var(--yl-shadow);
  transition: box-shadow .2s, border-color .3s; overflow: hidden;
}
.lb-row.is-now { border-color: #e11d48; box-shadow: 0 0 0 2px rgba(225, 29, 72, .25), var(--yl-shadow); }
.lb-row.flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--yl-amber) 35%, var(--yl-surface)); } 100% { background: var(--yl-surface); } }
.lb-main { display: grid; grid-template-columns: 3.2rem 4.2rem minmax(0, 1fr) repeat(3, minmax(4.4rem, 5.6rem)) 6.2rem 1.5rem; gap: .75rem; align-items: center; padding: .7rem .9rem; cursor: pointer; }
.lb-rank { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--yl-surface-2); color: var(--yl-muted); }
.lb-rank.r1 { background: linear-gradient(135deg, #fde68a, var(--yl-gold)); color: #7a4b00; }
.lb-rank.r2 { background: linear-gradient(135deg, #e2e8f0, var(--yl-silver)); color: #1e293b; }
.lb-rank.r3 { background: linear-gradient(135deg, #fdba74, #ea8a4b); color: #5a2200; }
.lb-chest { font-weight: 700; font-size: .85rem; padding: .25rem .5rem; background: var(--yl-surface-2); border-radius: .5rem; text-align: center; font-variant-numeric: tabular-nums; }
.lb-name { font-weight: 700; line-height: 1.15; }
.lb-sub { font-size: .78rem; color: var(--yl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-stat { text-align: right; font-variant-numeric: tabular-nums; }
.lb-stat small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--yl-muted); font-weight: 600; }
.lb-stat b { font-size: .98rem; }
.lb-total { text-align: right; font-variant-numeric: tabular-nums; }
.lb-total b { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.lb-total small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--yl-muted); font-weight: 600; }
.lb-caret { color: var(--yl-muted); transition: transform .2s; }
.lb-row.open .lb-caret { transform: rotate(180deg); }
.lb-progress { height: 3px; background: var(--yl-surface-2); }
.lb-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yl-brand), var(--yl-violet)); transition: width .5s ease; }
.lb-detail { display: none; padding: .25rem .9rem .9rem; border-top: 1px dashed var(--yl-border); }
.lb-row.open .lb-detail { display: block; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; margin-top: .7rem; }
.slot-cell { border: 1px solid var(--yl-border); border-radius: .7rem; padding: .45rem .55rem; background: var(--yl-surface-2); font-size: .78rem; }
.slot-cell .k { font-weight: 700; color: var(--yl-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.slot-cell .v { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.slot-cell .s { color: var(--yl-muted); font-size: .7rem; }
.lb-row.dq .lb-name { text-decoration: line-through; opacity: .6; }
.lb-row.absent { opacity: .55; }
.status-tag { font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: .4rem; background: rgba(239, 68, 68, .14); color: var(--yl-red); margin-left: .35rem; vertical-align: middle; }
@media (max-width: 991px) {
  .lb-main { grid-template-columns: 2.6rem minmax(0, 1fr) 5.4rem 1.2rem; }
  .lb-chest, .lb-stat { display: none; }
  .lb-stat.keep { display: block; }
  .lb-main .lb-chest-inline { display: inline-block; }
}
@media (min-width: 992px) { .lb-chest-inline { display: none; } }
.qual-line { display: block; text-align: center; margin: .6rem 0; padding: .5rem .5rem 0; color: var(--yl-red); font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  border-top: 2px dashed color-mix(in srgb, currentColor 60%, transparent); }
.qual-line.done { color: var(--yl-green); }
.award-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; margin-left: .45rem; vertical-align: middle; white-space: nowrap; }
.award-tag.gold { background: #fde68a; color: #7a4b00; }
.award-tag.silver { background: #e2e8f0; color: #1e293b; }
.award-tag.bronze { background: #fdba74; color: #5a2200; }
.award-tag.merit { background: rgba(79, 70, 229, .14); color: var(--yl-brand); }
.award-pill { display: flex; align-items: center; gap: .6rem; padding: .55rem .85rem; border-radius: .9rem; border: 1px solid var(--yl-border); background: var(--yl-surface-2); }
.award-pill i { font-size: 1.5rem; }
.award-pill.gold i { color: var(--yl-gold); } .award-pill.silver i { color: var(--yl-silver); } .award-pill.bronze i { color: #ea8a4b; } .award-pill.merit i { color: var(--yl-brand); }
.merit-list { border-top: 1px dashed var(--yl-border); padding-top: .75rem; font-size: .88rem; }
.screen .qual-line { font-size: .95rem; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; align-items: end; }
.podium .step { border-radius: 1rem 1rem 0 0; padding: .9rem .6rem; text-align: center; color: #fff; }
.podium .p1 { background: linear-gradient(180deg, #f5b301, #d99200); min-height: 9rem; order: 2; }
.podium .p2 { background: linear-gradient(180deg, #94a3b8, #64748b); min-height: 7.2rem; order: 1; }
.podium .p3 { background: linear-gradient(180deg, #ea8a4b, #c2410c); min-height: 6rem; order: 3; }
.podium .n { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.podium .who { font-weight: 700; font-size: .85rem; line-height: 1.15; margin-top: .3rem; }
.podium .sc { font-size: .78rem; opacity: .9; font-variant-numeric: tabular-nums; }
.connection { font-size: .75rem; font-weight: 600; color: var(--yl-muted); display: inline-flex; align-items: center; gap: .4rem; }
.connection i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--yl-green); display: inline-block; }
.connection.off i { background: var(--yl-red); }
.oop-asana { display: inline-flex; align-items: center; gap: .4rem; margin-right: .8rem; }
.oop-asana img { height: 38px; width: 54px; object-fit: contain; background: #fff; border-radius: .4rem; border: 1px solid var(--yl-border); }
.oop-asana small { display: block; line-height: 1.1; color: var(--yl-muted); font-size: .7rem; }

/* ---- score sheets (judge / timekeeper) -------------------------------------- */
.sheet-banner { background: linear-gradient(90deg, #b91c1c, #dc2626); color: #fff; text-align: center; font-weight: 800; letter-spacing: .04em; padding: .65rem 1rem; border-radius: 1rem 1rem 0 0; text-transform: uppercase; font-size: .95rem; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .8rem 1rem; background: #fde047; color: #422006; font-weight: 700; font-size: .9rem; }
[data-bs-theme="dark"] .sheet-meta { background: #713f12; color: #fef3c7; }
.sheet-meta span em { font-style: normal; opacity: .7; font-weight: 600; margin-right: .3rem; }
.sheet-wrap { background: var(--yl-surface); border: 1px solid var(--yl-border); border-radius: 1rem; overflow: hidden; box-shadow: var(--yl-shadow); }
.sheet-scroll { overflow: auto; max-height: calc(100vh - 17rem); min-height: 22rem; }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .88rem; }
table.sheet th, table.sheet td { border-right: 1px solid var(--yl-border); border-bottom: 1px solid var(--yl-border); padding: .4rem .5rem; text-align: center; vertical-align: middle; white-space: nowrap; background: var(--yl-surface); }
table.sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--yl-surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--yl-muted); font-weight: 700; }
table.sheet thead tr.group th { top: 0; font-size: .8rem; color: var(--yl-ink); background: var(--yl-brand-soft); }
table.sheet thead tr.cols th { top: 2.1rem; }
table.sheet .stick { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--yl-border); }
table.sheet thead .stick { z-index: 4; }
table.sheet td.chest { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; min-width: 4.5rem; background: var(--yl-surface-2); }
table.sheet td.c-marks { background: var(--cell-marks); }
table.sheet td.c-time { background: var(--cell-time); }
table.sheet td.c-total { background: var(--cell-total); font-weight: 700; }
table.sheet td.c-score { background: var(--cell-score); font-weight: 700; }
table.sheet td.c-final { background: var(--cell-final); color: var(--cell-ink); font-weight: 800; font-size: 1.05rem; }
table.sheet td.c-asana img { height: 46px; width: 64px; object-fit: contain; background: #fff; border-radius: .4rem; display: block; margin: 0 auto 2px; }
table.sheet td .code { font-weight: 700; font-size: .8rem; }
table.sheet td .bv { color: var(--yl-muted); font-size: .72rem; }
table.sheet tr.row-now td { box-shadow: inset 0 2px 0 #e11d48, inset 0 -2px 0 #e11d48; }
table.sheet tr.row-now td.chest { background: #fecdd3; color: #881337; }
[data-bs-theme="dark"] table.sheet tr.row-now td.chest { background: #4c0519; color: #fecdd3; }
table.sheet tr.row-off td { opacity: .45; }
.mark-input {
  width: 4.6rem; text-align: center; border: 2px solid transparent; border-radius: .6rem; padding: .45rem .2rem; font-weight: 700; font-size: 1rem;
  background: rgba(255, 255, 255, .85); color: #0f172a; font-variant-numeric: tabular-nums;
}
[data-bs-theme="dark"] .mark-input { background: rgba(0, 0, 0, .35); color: #f1f5f9; }
.mark-input:focus { outline: none; border-color: var(--yl-brand); background: #fff; color: #0f172a; box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--yl-brand) 25%, transparent); }
.mark-input.saving { border-color: var(--yl-amber); }
.mark-input.saved { border-color: var(--yl-green); }
.mark-input.error { border-color: var(--yl-red); background: #fee2e2; color: #7f1d1d; }
.mark-input::-webkit-outer-spin-button, .mark-input::-webkit-inner-spin-button { opacity: 1; }
.cell-sub { display: block; font-size: .68rem; color: var(--yl-muted); font-weight: 600; margin-top: 2px; }
.save-state { font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; color: var(--yl-muted); }
.save-state.ok { color: var(--yl-green); }
.save-state.busy { color: var(--yl-amber); }
.save-state.err { color: var(--yl-red); }
.attempt-toggle { display: inline-flex; border: 1px solid var(--yl-border); border-radius: .55rem; overflow: hidden; }
.attempt-toggle button { border: 0; background: var(--yl-surface); padding: .3rem .55rem; font-weight: 700; font-size: .78rem; color: var(--yl-muted); }
.attempt-toggle button.on { background: var(--yl-brand); color: #fff; }
.sec-input { width: 4.2rem; }
.stopwatch {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1030; width: min(34rem, calc(100vw - 1.5rem));
  background: color-mix(in srgb, var(--yl-surface) 92%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--yl-border);
  border-radius: 1.2rem; box-shadow: var(--yl-shadow-lg); padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem;
}
.stopwatch .clock { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: center; letter-spacing: -.03em; }
.stopwatch .target { font-size: .78rem; color: var(--yl-muted); line-height: 1.25; flex: 1; }
.stopwatch .target b { color: var(--yl-ink); }
.mobile-hint { display: none; }
@media (max-width: 767px) { .mobile-hint { display: block; } .sheet-scroll { max-height: calc(100vh - 14rem); } }

/* ---- control room ----------------------------------------------------------- */
.stat-tile { padding: 1.1rem 1.25rem; }
.stat-tile b { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; display: block; }
.stat-tile span { color: var(--yl-muted); font-size: .8rem; font-weight: 600; }
.judge-dots { display: inline-flex; gap: 3px; }
.judge-dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--yl-border); display: inline-block; }
.judge-dots i.on { background: var(--yl-green); }
.order-input { width: 3.6rem; text-align: center; padding: .3rem; }
.sticky-actions { position: sticky; top: 4.2rem; z-index: 20; }

.panel-ok, .panel-missing { background: var(--yl-surface-2); border: 1px solid var(--yl-border); }
.panel-ok { border-color: color-mix(in srgb, var(--yl-green) 55%, var(--yl-border)); }
.panel-duty { color: var(--yl-muted); font-size: .76rem; line-height: 1.3; }

/* ---- chief judge's desk ----------------------------------------------------- */
.chief-table td, .chief-table th { vertical-align: middle; }
.jtotal { display: inline-block; min-width: 3.7rem; padding: .2rem .45rem; border-radius: .55rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--yl-surface-2); text-align: center; }
.jtotal.flag { background: rgba(239, 68, 68, .16); color: var(--yl-red); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .5); }
.jtotal.missing { color: var(--yl-muted); background: transparent; border: 1px dashed var(--yl-border); font-weight: 500; }
.jtotal.partial { background: rgba(245, 158, 11, .15); color: #b45309; }
[data-bs-theme="dark"] .jtotal.partial { color: #fcd34d; }
.mark-matrix { display: grid; gap: 1px; background: var(--yl-border); border: 1px solid var(--yl-border); border-radius: .7rem; overflow: hidden; font-size: .82rem; font-variant-numeric: tabular-nums; }
.mark-matrix > div { background: var(--yl-surface); padding: .3rem .5rem; text-align: center; }
.mark-matrix .h { background: var(--yl-surface-2); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--yl-muted); }
.mark-matrix .out { background: rgba(239, 68, 68, .18); color: var(--yl-red); font-weight: 800; }
.mark-matrix .none { color: var(--yl-muted); }
.chief-flag { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: rgba(245, 158, 11, .2); color: #b45309; white-space: nowrap; }
[data-bs-theme="dark"] .chief-flag { color: #fcd34d; }
.chief-flag.ok { background: rgba(16, 185, 129, .16); color: #047857; }
[data-bs-theme="dark"] .chief-flag.ok { color: #6ee7b7; }
table.sheet td.chest .chief-flag { display: flex; justify-content: center; margin-top: 2px; font-size: .62rem; padding: .05rem .35rem; cursor: help; white-space: normal; }
.lean { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- stage desk ------------------------------------------------------------- */
.stage-now { border-radius: 1.4rem; padding: 1.5rem; color: #fff; background: linear-gradient(135deg, #be123c, #e11d48 55%, #f97316); box-shadow: 0 16px 44px rgba(225, 29, 72, .3); }
.stage-now .chest { font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.stage-now .nm { font-size: clamp(1.4rem, 3.4vw, 2.2rem); font-weight: 800; line-height: 1.1; }
.stage-now .asanas { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.stage-now figure { margin: 0; background: #fff; color: #0f172a; border-radius: .9rem; padding: .4rem .6rem; text-align: center; font-weight: 800; font-size: .8rem; }
.stage-now figure img { height: 72px; display: block; margin: 0 auto .1rem; }
.stage-idle { border-radius: 1.4rem; padding: 2rem; border: 2px dashed var(--yl-border); text-align: center; color: var(--yl-muted); }
.stage-multi { display: flex; flex-direction: column; gap: 0.85rem; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.85rem; }
.stage-card { border-radius: 1.1rem; padding: 1.15rem; color: #fff; background: linear-gradient(135deg, #be123c, #e11d48 60%, #f97316); box-shadow: 0 10px 28px rgba(225, 29, 72, .22); position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.stage-card .chest { font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stage-card .nm { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.stage-card .asanas { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.stage-card figure { margin: 0; background: #fff; color: #0f172a; border-radius: .7rem; padding: .3rem .45rem; text-align: center; font-weight: 800; font-size: .75rem; }
.stage-card figure img { height: 48px; display: block; margin: 0 auto .1rem; }
.queue-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-bottom: 1px solid var(--yl-border); transition: background .15s ease; }
.queue-row:last-child { border-bottom: 0; }
.queue-row.done { opacity: .5; }
.queue-row.is-next { background: color-mix(in srgb, var(--yl-brand) 9%, transparent); }
.queue-row.is-selected { background: color-mix(in srgb, var(--yl-brand) 16%, transparent); font-weight: 500; }
.queue-cb { width: 1.15rem; height: 1.15rem; cursor: pointer; flex-shrink: 0; }
.announce-line { padding: .55rem .2rem; border-bottom: 1px dashed var(--yl-border); display: flex; gap: .8rem; align-items: baseline; }
.announce-line .pos { font-weight: 800; min-width: 2.6rem; }

/* ---- asana library ---------------------------------------------------------- */
.lib-card { padding: .6rem; text-align: center; cursor: pointer; }
.lib-card img { width: 100%; height: 110px; object-fit: contain; background: #fff; border-radius: .7rem; }

/* ---- rules ------------------------------------------------------------------ */
.annex-table { font-size: .82rem; font-variant-numeric: tabular-nums; }
.annex-table td, .annex-table th { padding: .22rem .6rem; }
.formula { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--yl-surface-2); border: 1px solid var(--yl-border); border-radius: .7rem; padding: .7rem .9rem; font-size: .88rem; }

/* ---- login ------------------------------------------------------------------ */
.auth-wrap { min-height: calc(100vh - 12rem); display: grid; place-items: center; }
.auth-card { width: min(26rem, 100%); padding: 2rem; }

/* ---- confirmation ----------------------------------------------------------- */
.ticket { position: relative; overflow: hidden; }
.ticket-head { background: linear-gradient(135deg, #3730a3, #7c3aed); color: #fff; padding: 1.6rem; }
.ticket-id { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.check-burst { width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: rgba(255, 255, 255, .2); animation: pop .5s ease both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- toasts / misc ---------------------------------------------------------- */
.toast { border-radius: .9rem; border: 1px solid var(--yl-border); box-shadow: var(--yl-shadow-lg); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--yl-muted); }
.empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .6; }
footer.app-footer { color: var(--yl-muted); font-size: .8rem; padding: 2rem 0; }
.skeleton { background: linear-gradient(90deg, var(--yl-surface-2), var(--yl-surface), var(--yl-surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: .6rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- big screen ------------------------------------------------------------- */
body.screen { background: radial-gradient(1200px 600px at 80% -10%, #1e1b4b, transparent 60%), #070b18; color: #e8ecf8; min-height: 100vh; overflow-x: hidden; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 2rem; }
.screen-head h1 { font-size: clamp(1.4rem, 2.6vw, 2.4rem); margin: 0; font-weight: 800; }
.screen-head .sub { color: #93a0bd; font-weight: 600; }
.screen-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; padding: 0 2rem 2rem; }
@media (max-width: 1100px) { .screen-grid { grid-template-columns: 1fr; } }
.screen .lb-row { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); box-shadow: none; }
.screen .lb-main { padding: .85rem 1.1rem; cursor: default; grid-template-columns: 3.4rem minmax(0, 1fr) 6.5rem 7.5rem; }
.screen .lb-name { font-size: 1.35rem; }
.screen .lb-sub { font-size: .95rem; color: #93a0bd; }
.screen .lb-rank { width: 3rem; height: 3rem; font-size: 1.25rem; background: rgba(255, 255, 255, .1); color: #cbd5e1; }
.screen .lb-total b { font-size: 2.1rem; }
.screen .lb-stat b { font-size: 1.2rem; }
.screen .lb-total small, .screen .lb-stat small { color: #93a0bd; }
.screen .lb-chest { background: rgba(255, 255, 255, .1); color: #e2e8f0; }
.screen .lb-progress { background: rgba(255, 255, 255, .06); }
.screen .now-card { border-radius: 1.4rem; padding: 1.6rem; background: linear-gradient(135deg, #be123c, #e11d48 55%, #f97316); box-shadow: 0 20px 60px rgba(225, 29, 72, .35); }
.screen .now-card .chest { font-size: clamp(3rem, 7vw, 6rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.screen .now-card .nm { font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 800; line-height: 1.1; }
.screen .now-asanas { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-top: 1.2rem; }
.screen .now-asanas figure { margin: 0; background: #fff; border-radius: 1rem; padding: .5rem; text-align: center; color: #0f172a; font-weight: 800; }
.screen .now-asanas img { height: 120px; max-width: 100%; object-fit: contain; }
.screen .now-asanas figcaption small { display: block; color: #64748b; font-weight: 600; }
.screen .idle-card { border-radius: 1.4rem; padding: 2rem; background: rgba(255, 255, 255, .05); border: 1px dashed rgba(255, 255, 255, .15); text-align: center; color: #93a0bd; }
.screen .podium .step { color: #fff; }

/* ---- print ------------------------------------------------------------------ */
@media print {
  .app-nav, .no-print, footer.app-footer, .toast-container, .stopwatch { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card-soft { box-shadow: none !important; border-color: #ccc !important; }
  .print-only { display: block !important; }
  a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
