/* OQIBAT aksiya — jonli tanlov sahifasi (katta ekran, proyektor, efir uchun).
   Ko'rinish plakatdan olingan: to'q ko'k sahna, qizil "AKSIYA" va sariq "SOVRINLI O'YIN" yorliqlari, og'ma qalin yozuv. */

@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/assets/fonts/Barlow-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Barlow-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/assets/fonts/BarlowCondensed-Bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: italic; font-display: swap; src: url("/assets/fonts/BarlowCondensed-ExtraBoldItalic.ttf") format("truetype"); }

:root {
  --navy: #060f27;
  --navy-2: #12265f;
  --text: #f4f6fd;
  --muted: #aab6d6;
  --gold: #f6b91c;
  --gold-2: #ffe07a;
  --gold-ink: #2a1c00;
  --red: #d8262c;
  --line: rgba(255, 255, 255, .16);
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); overflow-x: hidden; font: 500 17px/1.4 var(--body);
  background:
    radial-gradient(1200px 620px at 50% 30%, rgba(40, 84, 200, .55) 0%, transparent 62%),
    radial-gradient(900px 500px at 50% 118%, rgba(246, 185, 28, .16) 0%, transparent 60%),
    linear-gradient(180deg, #0b1a45, var(--navy));
  background-attachment: fixed;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ yuqori qator */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: clamp(14px, 2.4vw, 30px) clamp(16px, 4vw, 56px) 0; }
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; }
.wordmark-name { font: italic 800 clamp(1.9rem, 4.4vw, 3.6rem)/.9 var(--display); letter-spacing: .01em; color: #fff; }
.wordmark-tag {
  font: italic 800 clamp(.85rem, 1.9vw, 1.5rem)/1 var(--display); letter-spacing: .06em; color: #fff; background: var(--red);
  padding: .16em .7em .22em .5em; transform: rotate(-4deg) skewX(-8deg); margin-left: 1.9em;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.conn { font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #8a94ad; }
.conn.on { color: var(--text); }
.conn.on::before { background: var(--red); box-shadow: 0 0 0 4px rgba(216, 38, 44, .3); animation: onair 1.8s ease-in-out infinite; }
@keyframes onair { 50% { box-shadow: 0 0 0 8px rgba(216, 38, 44, 0); } }
.icon-btn { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); color: var(--text); border-radius: 999px; width: 42px; height: 42px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#sound .wave { display: none; }
#sound[aria-pressed="true"] .wave { display: inline; }
#sound[aria-pressed="true"] .mute { display: none; }

/* ------------------------------------------------------------ sahna */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px clamp(16px, 4vw, 56px); text-align: center; gap: clamp(18px, 3vh, 34px); min-height: 0; }
.view { width: 100%; max-width: 1400px; animation: rise .6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* Plakatdagi cho'tka izidek yorliq */
.tag {
  display: block; width: fit-content; margin: 0 auto clamp(12px, 2.4vh, 26px); font: italic 800 clamp(1.1rem, 3vw, 2.5rem)/1 var(--display);
  letter-spacing: .05em; padding: .22em .9em .28em .7em; transform: rotate(-2.5deg) skewX(-8deg);
}
.tag-gold { background: var(--gold); color: var(--gold-ink); }
.tag-red { background: var(--red); color: #fff; }
.title {
  margin: 0; font: italic 800 clamp(3.4rem, 15vw, 13rem)/.92 var(--display); letter-spacing: .005em; text-transform: uppercase; color: #fff;
  text-shadow: 0 .04em 0 rgba(6, 15, 39, .55), 0 0 1.1em rgba(90, 140, 255, .5);
}
.sub { margin: clamp(10px, 2vh, 20px) 0 0; color: var(--muted); font-size: clamp(1.05rem, 2.5vw, 1.9rem); min-height: 1.4em; }
.big-number { font: italic 800 clamp(9rem, 38vw, 26rem)/.9 var(--display); font-variant-numeric: tabular-nums; color: var(--gold-2); text-shadow: 0 0 .5em rgba(246, 185, 28, .5); }
.big-number.tick { animation: tick .9s ease both; }
@keyframes tick { 0% { transform: scale(1.35); opacity: .2; } 40% { transform: scale(1); opacity: 1; } 100% { transform: scale(.96); } }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.name-slot {
  margin: 6px auto 0; padding: .28em .7em .34em; max-width: 100%; display: inline-block; min-width: min(100%, 9em); min-height: 1.6em;
  font: 700 clamp(2.2rem, 9vw, 7.5rem)/1.05 var(--display); overflow-wrap: anywhere; color: #fff;
  border-top: 3px solid var(--line); border-bottom: 3px solid var(--line);
}
.name-slot.fast { filter: blur(1.4px); opacity: .85; }
.name-slot.tense { color: var(--gold-2); animation: heartbeat .5s ease-in-out infinite; border-color: rgba(246, 185, 28, .6); }
@keyframes heartbeat { 50% { transform: scale(1.06); } }

/* G'olib chiqqan payt: oq chaqnash, sahna silkinishi, nurlar */
.flash { position: fixed; inset: 0; z-index: 20; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { opacity: 1; } 15% { opacity: .9; } 100% { opacity: 0; } }
.stage.shake { animation: shake .6s ease-out; }
@keyframes shake { 15% { transform: translate(-14px, 6px); } 30% { transform: translate(12px, -6px); } 45% { transform: translate(-8px, 4px); } 60% { transform: translate(6px, -3px); } 80% { transform: translate(-2px, 1px); } }
#view-winner { position: relative; isolation: isolate; }
.rays {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(246, 185, 28, .16) 0deg 6deg, transparent 6deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 32%); mask-image: radial-gradient(circle, #000 0%, transparent 32%);
  animation: spin 24s linear infinite, rays-in 1.2s ease-out both; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rays-in { from { opacity: 0; } to { opacity: 1; } }
.big-number.hot { color: #ff6b6b; text-shadow: 0 0 .5em rgba(216, 38, 44, .7); }

.win-name {
  margin: 4px auto 0; padding: .2em .65em .26em; max-width: 100%; display: inline-block; overflow-wrap: anywhere;
  font: italic 800 clamp(2.8rem, 12vw, 10rem)/1 var(--display); color: var(--gold-ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); transform: skewX(-4deg);
  box-shadow: 0 0 1.2em rgba(246, 185, 28, .55); animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.4) rotate(-5deg); opacity: 0; } to { transform: skewX(-4deg); opacity: 1; } }

/* ------------------------------------------------------------ g'oliblar ro'yxati */
.winners { width: 100%; max-width: 1400px; }
.winners h2 { margin: 0 0 12px; font: 700 clamp(1.1rem, 2.4vw, 1.7rem)/1.1 var(--display); color: var(--gold-2); letter-spacing: .04em; }
.winners-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 340px)); justify-content: center; }
.winners-list li { background: rgba(255, 255, 255, .07); border-left: 4px solid var(--gold); padding: 10px 16px; text-align: left; display: flex; align-items: center; gap: 12px; animation: rise .5s ease both; min-width: 0; }
.winners-list .num { flex: none; font: italic 800 clamp(1.4rem, 3vw, 2.2rem)/1 var(--display); color: var(--gold-2); min-width: 1.4em; }
.winners-list .who { font: 600 clamp(1rem, 2.2vw, 1.45rem)/1.2 var(--body); overflow-wrap: anywhere; min-width: 0; }

/* ------------------------------------------------------------ pastki qator: hisob va qanday qatnashish */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; padding: 14px clamp(16px, 4vw, 56px) clamp(16px, 2.6vw, 30px); border-top: 1px solid var(--line); }
.stats { display: flex; margin: 0; }
.stat { padding: 0 clamp(14px, 2.6vw, 34px); border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat dd { margin: 0; font: 700 clamp(1.7rem, 4.6vw, 3.4rem)/1 var(--display); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat dt { color: var(--muted); font-size: clamp(.8rem, 1.5vw, 1.05rem); }
.join { margin: 0; color: var(--muted); font-size: clamp(.95rem, 1.7vw, 1.3rem); max-width: 30em; text-align: right; }
.join strong { color: #fff; font-weight: 600; white-space: nowrap; }
.noscript { position: fixed; inset: auto 0 0 0; text-align: center; padding: 12px; background: #7a1f1f; margin: 0; }

@media (max-width: 720px) {
  .foot { justify-content: center; }
  .join { text-align: center; }
  .conn { font-size: 0; gap: 0; }
  .stat { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  #confetti { display: none; }
}

/* ------------------------------------------------------------ admin boshqaruvi (faqat admin ko'radi) */
.admin-bar {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 30; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 10px 14px; max-width: calc(100vw - 24px); padding: 10px 14px;
  background: rgba(6, 15, 39, .92); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  transition: opacity .4s, transform .4s;
}
.admin-bar.sleep { opacity: 0; transform: translate(-50%, -20px); pointer-events: none; }
@media (max-width: 900px) { .admin-bar { top: auto; bottom: 12px; } .admin-bar.sleep { transform: translate(-50%, 20px); } }
.admin-bar button {
  font: 700 1rem/1 var(--body); border-radius: 10px; padding: 12px 18px; cursor: pointer; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08); color: var(--text);
}
.admin-bar .ab-main { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-size: 1.1rem; padding: 14px 22px; }
.admin-bar .ab-main:hover:not(:disabled) { background: var(--gold-2); }
.admin-bar button:disabled { opacity: .45; cursor: wait; }
.admin-bar button:focus-visible, .admin-bar a:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.ab-status { font-weight: 600; color: var(--gold-2); }
.ab-link { color: var(--gold-2); font-weight: 600; }
.ab-hint { color: var(--muted); font-size: .85rem; }
.ab-msg { color: #ff9b9b; font-size: .9rem; }
.ab-msg:empty { display: none; }
.stat.clickable { cursor: pointer; border-radius: 8px; }
.stat.clickable:hover dd { text-decoration: underline; text-underline-offset: 6px; }
a.who { color: inherit; text-decoration: none; }
a.who:hover { text-decoration: underline; }

dialog.report {
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; width: min(560px, calc(100vw - 32px));
  background: #0b1a45; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog.report::backdrop { background: rgba(3, 8, 22, .7); }
dialog.report h2 { margin: 0 40px 16px 0; font: 700 1.5rem/1.2 var(--display); color: var(--gold-2); }
.report-close { position: absolute; top: 16px; right: 16px; }
.report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.report-list li { display: flex; gap: 14px; align-items: center; padding: 10px 14px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--gold); }
.report-list .num { font: italic 800 1.8rem/1 var(--display); color: var(--gold-2); min-width: 1.3em; }
.report-list strong { display: block; font-size: 1.1rem; }
.report-phone { display: block; font: 700 1.2rem/1.3 var(--display); letter-spacing: .03em; }
.report-tg { color: #8cc4ff; }
.report-link { display: inline-block; margin-top: 16px; color: var(--gold-2); }

/* ------------------------------------------------------------ navbatdagi tanlov: "10 ta g'olib / 1 250 ishtirokchi ichidan" */
.plan { display: flex; align-items: stretch; justify-content: center; gap: clamp(10px, 2vw, 26px); margin: clamp(16px, 3vh, 34px) auto 0; flex-wrap: wrap; }
.plan-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: min(42vw, 330px);
  padding: clamp(10px, 2vh, 20px) clamp(16px, 3vw, 34px); background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  border-radius: 14px; animation: rise .6s ease both;
}
.plan-box b { font: italic 800 clamp(2.8rem, 8vw, 6.2rem)/.95 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.plan-box span { color: var(--muted); font-size: clamp(.95rem, 2vw, 1.5rem); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.plan-win { background: linear-gradient(180deg, rgba(246, 185, 28, .28), rgba(246, 185, 28, .1)); border-color: rgba(246, 185, 28, .55); }
.plan-win b { color: var(--gold-2); text-shadow: 0 0 .4em rgba(246, 185, 28, .45); }
/* Tomoshabin uchun: son o'rnida faqat yozuv ("jami ishtirokchilar ichidan") */
.plan-box.plan-text { justify-content: center; }
.plan-box.plan-text span { color: #fff; font: italic 800 clamp(1.3rem, 3.4vw, 2.6rem)/1.05 var(--display); letter-spacing: .02em; }
/* Raqamli statistika (ishtirokchilar soni va h.k.) faqat admin ekranida; Telegram ichida "qanday qatnashish" ham kerak emas */
body:not(.has-admin) .stats { display: none; }
body.in-telegram:not(.has-admin) .foot { display: none; }
.plan-of { align-self: center; font: italic 800 clamp(2rem, 5vw, 4rem)/1 var(--display); color: rgba(255, 255, 255, .25); }
@media (max-width: 720px) { .plan-of { display: none; } .plan-box { min-width: 0; flex: 1 1 140px; } }

/* telefon barabani joyi */
.slot-box { display: flex; justify-content: center; min-height: 1.3em; }
.phone-slot { --ps-size: clamp(1.3rem, 5.6vw, 6.2rem); }
#view-winner .phone-slot { --ps-size: clamp(1.4rem, 6vw, 6.6rem); }
.win-who { margin: clamp(10px, 2vh, 18px) 0 0; font: italic 800 clamp(1.8rem, 5vw, 4.2rem)/1 var(--display); color: #fff; letter-spacing: .02em; }
.win-who:empty { display: none; }
.winners-list .who-box { display: flex; flex-direction: column; min-width: 0; }
.winners-list .who-phone { font: 700 clamp(1.05rem, 2.3vw, 1.6rem)/1.15 var(--display); letter-spacing: .03em; color: #fff; font-variant-numeric: tabular-nums; }
.winners-list .who-sm { font-size: clamp(.85rem, 1.6vw, 1.05rem); color: var(--muted); }
.admin-bar .ab-start { background: var(--red); border-color: var(--red); color: #fff; }
.admin-bar .ab-start:hover:not(:disabled) { background: #f0383e; }
.admin-bar .ab-start.armed { background: #19a35b; border-color: #19a35b; animation: pulse 1s ease-in-out infinite; }

/* telefonda admin boshqaruvi: pastda to'liq kenglikda, statistikani yopmaydi */
@media (max-width: 900px) {
  .admin-bar { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; max-width: none; padding: 10px; gap: 8px; }
  .admin-bar.sleep { transform: translateY(20px); }
  .admin-bar button { flex: 1 1 auto; padding: 14px 12px; }
  .admin-bar .ab-status { flex: 1 0 100%; text-align: center; font-size: .9rem; }
  .admin-bar .ab-hint { display: none; }
  .admin-bar .ab-link { flex: 1 0 100%; text-align: center; font-size: .85rem; }
  body.has-admin .foot { padding-bottom: 170px; }
}
