/* Hallmark · shape: app screen · genre: atmospheric · theme: custom · tokens in tokens.css */
/* waive 2a: .scene-fallback is the brand gradient shown only when WebGL is unavailable */
/* Layout: fixed 1920x1080 stage scaled to the screen; promo column on the open scene, leaderboard column on the right as the designer drew it. */
html, body { height: 100%; overflow-y: clip; }
body { display: flex; align-items: center; justify-content: center; background: var(--color-shadow); }
[data-slot] > img, [data-slot] > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img, > video) > :not(img):not(video) { display: none; }

.holder { position: relative; flex: none; }
.stage {
  position: absolute; top: 0; left: 0;
  width: 1920px; height: 1080px; transform-origin: 0 0;
  padding: 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 600px; gap: 48px;
  overflow: hidden;
  background: var(--scene-0);
}
.scene, .scene-fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-fallback { background: radial-gradient(60% 80% at 100% 30%, var(--scene-2), transparent 70%), linear-gradient(90deg, var(--scene-0), var(--scene-1)); }
.stage > section, .stage > aside { position: relative; min-width: 0; }

/* Promo column */
.promo { display: grid; grid-template-rows: 214px auto minmax(0, 1fr); gap: 28px; min-height: 0; }
.head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 24px; }
.logo { display: block; width: 132px; height: 132px; border-radius: 24px; background: var(--color-plate); }
.title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 128px; line-height: 0.92; letter-spacing: -0.02em; overflow-wrap: break-word; min-width: 0; }
.subtitle { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 22px; }
.subtitle h2 { margin: 0; font-weight: 800; font-size: 44px; text-wrap: balance; }
.subtitle p { margin: 0; font-size: 24px; font-weight: 500; color: var(--color-ink-2); }

.trailers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.trailer { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.trailer-label { display: flex; align-items: center; justify-content: space-between; height: 36px; font-size: 26px; font-weight: 800; }
.on-air {
  font-size: 16px; font-weight: 700; font-style: normal; padding: 7px 14px; border-radius: 99px;
  background: var(--color-accent); color: var(--color-accent-ink);
  transition: opacity var(--dur-long), transform var(--dur-long) var(--ease-out);
}
.js .trailer:not(.is-active) .on-air { opacity: 0; transform: translateY(4px); }
.trailer-slot {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 26px; overflow: hidden;
  background: var(--color-slot);
  display: grid; place-items: center; align-content: center; gap: 14px;
  color: var(--color-ink-2); font-size: 20px; font-weight: 600;
  box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--color-line) 30%, transparent);
  transition: box-shadow var(--dur-long) var(--ease-out);
}
.trailer.is-active .trailer-slot { box-shadow: 0 0 0 4px var(--color-line), 0 18px 40px var(--color-shadow); }
.play { width: 88px; height: 88px; border-radius: 50%; background: var(--color-accent); display: grid; place-items: center; }
.play::after { content: ""; margin-left: 7px; border-left: 28px solid var(--color-accent-ink); border-top: 17px solid transparent; border-bottom: 17px solid transparent; }

.bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; min-height: 0; }
.block { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.block h3 { margin: 0; height: 36px; display: flex; align-items: center; font-size: 26px; font-weight: 800; }
.prizes {
  position: relative; flex: 1; margin: 0; border-radius: 26px; overflow: hidden;
  background: var(--color-slot);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-signal) 45%, transparent);
  display: grid; place-items: center; text-align: center; color: var(--color-ink-2); font-size: 20px; font-weight: 600;
}
.prizes .gift { width: 70px; height: 58px; margin: 14px auto 14px; position: relative; border-radius: 8px; background: var(--color-surface-2); }
.prizes .gift::before { content: ""; position: absolute; left: 50%; top: -14px; bottom: 0; width: 12px; margin-left: -6px; background: var(--color-accent); }
.prizes .gift::after { content: ""; position: absolute; left: -6px; right: -6px; top: -14px; height: 18px; border-radius: 6px; background: color-mix(in oklab, var(--color-surface-2) 70%, var(--color-ink)); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: step; max-width: 380px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; font-size: 20px; font-weight: 600; line-height: 1.3; }
.steps li::before { content: counter(step); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 17px; background: var(--color-surface); box-shadow: inset 0 0 0 1.5px var(--color-line); }
.cta {
  position: relative; margin-top: auto; border-radius: 999px; padding: 22px 26px; text-align: center;
  font-weight: 800; font-size: 25px;
  background: var(--color-accent); color: var(--color-accent-ink);
  box-shadow: 0 14px 34px var(--color-shadow);
}

/* Leaderboard column */
.board { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.last {
  position: relative; height: 180px; border-radius: 30px; padding: 20px 26px;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 2px var(--color-line), 0 18px 40px var(--color-shadow);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: 16px;
  overflow: hidden;
}
.last-top { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 17px; font-weight: 600; color: var(--color-ink-2); }
.last-empty { grid-column: 1 / -1; align-self: center; font-size: 24px; font-weight: 600; line-height: 1.3; }
.who { align-self: end; min-width: 0; }
.who .num { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.who .name { margin-top: 6px; font-size: 19px; font-weight: 600; color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pts { align-self: end; text-align: right; }
.pts .score { font-family: var(--font-display); font-weight: 800; font-size: 50px; line-height: 1; font-variant-numeric: tabular-nums; }
.pts .unit { font-size: 16px; font-weight: 600; color: var(--color-ink-2); }
.last-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 16px; font-weight: 600; color: var(--color-ink-2); }
.chip { padding: 5px 12px; border-radius: 99px; font-size: 15px; font-weight: 700; background: color-mix(in oklab, var(--color-ink) 14%, transparent); color: var(--color-ink); }
.chip.place { background: var(--color-accent); color: var(--color-accent-ink); }
.chip.up { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-signal); color: var(--color-signal); }
.last.enter .who, .last.enter .pts, .last.enter .last-foot { animation: rise 0.7s var(--ease-out) both; }
.last.enter .pts { animation-delay: 0.08s; }
.last.enter .last-foot { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tab {
  position: relative; isolation: isolate; overflow: hidden; height: 52px; border: 0; cursor: pointer; border-radius: 18px;
  font-weight: 700; font-size: 19px; line-height: 1; color: var(--color-muted); background: color-mix(in oklab, var(--color-surface) 70%, transparent);
  transition: color var(--dur-short), background-color var(--dur-short);
}
.tab:hover { color: var(--color-ink-2); }
.tab:active { transform: scale(0.98); }
.tab:disabled { color: var(--color-muted); cursor: default; }
.tab.is-active { color: var(--color-ink); background: var(--color-surface-2); }
/* Обводка поверх заливки, текст поверх всего: заливка лежит слоем ниже содержимого кнопки */
.tab.is-active::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--color-line); pointer-events: none; }
.tab-progress { position: absolute; inset: 0; z-index: -1; background: color-mix(in oklab, var(--color-accent) 50%, var(--color-surface-2)); transform-origin: 0 50%; transform: scaleX(0); }

.grid-cols { display: grid; grid-template-columns: 120px minmax(0, 1fr) 200px; gap: 6px; }
.thead > span {
  height: 56px; border-radius: 18px; background: var(--color-surface);
  display: grid; place-items: center; text-align: center; padding: 0 10px;
  font-size: 16px; font-weight: 500; line-height: 1.15; color: var(--color-ink-2);
}
.rows { display: flex; flex-direction: column; gap: 7px; min-height: 0; transition: opacity 0.35s; }
.rows.swap { opacity: 0; }
.podium { display: flex; flex-direction: column; border-radius: 22px; background: var(--color-surface); padding: 3px; }
.row { position: relative; height: 46px; border-radius: 16px; background: var(--color-surface); align-items: center; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.podium .row { height: 50px; border-radius: 18px; background: transparent; }
.podium .row + .row::before { content: ""; position: absolute; left: 22px; right: 22px; top: -0.5px; height: 1px; background: color-mix(in oklab, var(--color-ink) 12%, transparent); }
.podium .row.first { background: var(--color-surface-2); box-shadow: inset 0 0 0 2px var(--color-line); }
.podium .row.first + .row::before { display: none; }
.r-place { text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.row.first .r-place { color: var(--color-signal); }
.r-team { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding-left: 14px; }
.r-team b { flex: none; font-weight: 700; }
.r-team span { min-width: 0; font-size: 17px; font-weight: 500; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-score { text-align: center; font-weight: 700; }
.row.empty .r-team, .row.empty .r-score { color: var(--color-muted); }
.row.empty .r-team { justify-content: center; padding-left: 0; }
.row.flash::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in oklab, var(--color-signal) 22%, transparent); box-shadow: inset 0 0 0 2px var(--color-signal); animation: flash 2.4s var(--ease-out) forwards; pointer-events: none; }
@keyframes flash { 0%, 35% { opacity: 1; } 100% { opacity: 0; } }

.qr { margin-top: auto; display: flex; align-items: stretch; gap: 12px; }
/* 29 модулей по 3 px и белая зона 4 модуля: на 1080p каждый модуль ложится ровно в пиксели */
.qr-code { flex: none; width: 111px; height: 111px; padding: 12px; border-radius: 20px; background: var(--color-ink); }
.qr-text { flex: 1; display: flex; flex-direction: column; justify-content: center; border-radius: 20px; padding: 12px 24px; background: var(--color-surface); font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--color-ink-2); }
.qr-text b { display: block; font-size: 20px; font-weight: 700; color: var(--color-ink); }
.offline .qr-text { box-shadow: inset 0 0 0 2px var(--color-error); }
