:root {
  --blue: #0b63f6;
  --blue-600: #0a52cf;
  --blue-50: #eef4ff;
  --sky: #1a78ff;
  --ink: #0b1733;
  --ink-2: #33415c;
  --muted: #5b6886;
  --line: #e3e8f2;
  --bg: #f6f8fc;
  --card: #ffffff;
  --sun: #ffc22e;
  --pink: #ff5d8f;
  --green: #18b26b;
  --red: #e5484d;
  --gold: #f5b301;
  --silver: #a8b3c7;
  --bronze: #d98a4b;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 23, 51, .04), 0 8px 24px rgba(11, 23, 51, .06);
  --shadow-lg: 0 20px 60px rgba(11, 23, 51, .14);
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans); /* butun saytda bitta shrift */
  --nav-h: 64px;
  --tab-h: 68px;
  --z-nav: 30;
  --z-tab: 40;
  --z-modal: 50;
  --z-toast: 60;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
em, i, cite, var, address, dfn { font-style: normal; }
h1, h2, h3, h4, b, strong { font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #0b1733; outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 6px var(--sun); }
/* Matn maydonlari va ro'yxatlar sariq halqa olmaydi — ular o'zining ko'k fokus ramkasini ko'rsatadi */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; box-shadow: none; }
.skip-link { position: fixed; z-index: var(--z-toast); left: 16px; top: 16px; padding: 10px 16px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-lg); }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================= Navbar ================= */
.nav {
  position: fixed; z-index: var(--z-nav);
  top: 30px; left: 30px; right: 30px;
  max-width: 1040px; margin: 0 auto;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 10px 0 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  color: #fff;
  transition: background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.nav.solid {
  background: rgba(255, 255, 255, .92);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; white-space: nowrap; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; color: var(--blue);
}
.nav.solid .brand-mark { background: var(--blue); color: #fff; }
.nav-links { display: flex; gap: 2px; margin: 0 auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 15px; font-weight: 600;
  opacity: .9; transition: background .2s, opacity .2s;
}
.nav-links a:hover { background: rgba(255, 255, 255, .18); opacity: 1; }
.nav.solid .nav-links a:hover { background: var(--blue-50); }
.nav-links a.active { background: rgba(255, 255, 255, .24); opacity: 1; }
.nav.solid .nav-links a.active { background: var(--blue-50); color: var(--blue); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s, opacity .2s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 20px rgba(11, 99, 246, .35); }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #eef3ff; }
.btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .28); }
.btn-soft { background: var(--blue-50); color: var(--blue); }
.btn-soft:hover { background: #dfe9ff; }
.btn-line { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: #c8d2e6; }
.btn-danger { background: #fff0f0; color: var(--red); }
.btn-danger:hover { background: #ffe1e1; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.nav .btn { min-height: 44px; }
.nav-right { display: flex; align-items: center; gap: 6px; }

/* ================= Hero (design.jpg kompozitsiyasi) ================= */
.hero-frame { padding: 0; }
.hero {
  /* --text-end: tugmalar tugaydigan balandlik. Rasm shunga bog'lanadi:
     qo'llar tugmalar sathida, boshlar undan pastda boshlanadi, oyoqlar pastdan kesiladi. */
  --text-end: 450px;
  /* rasm eni: ekran eni, lekin pastki qirrasi doim ekran tagiga yetadigan darajada */
  --img-w: max(100vw, 1100px, (100svh - var(--text-end)) * 2.96);
  position: relative;
  height: 100svh; min-height: 600px;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 150px 24px 0;
  background-color: #007bfd; /* rasm qirralari bilan bir xil osmon rangi */
  background-image: url('../assets/img/main.jpg');
  background-image: image-set(url('../assets/img/main.webp') type('image/webp'), url('../assets/img/main.jpg') type('image/jpeg'));
  background-repeat: no-repeat;
  background-size: var(--img-w) auto;
  background-position: center calc(var(--text-end) - 0.225 * var(--img-w));
  color: #fff; text-align: center;
}
@media (max-height: 760px) and (min-width: 861px) {
  .hero { --text-end: 392px; padding-top: 128px; }
  .hero h1 { font-size: 50px; margin-bottom: 14px; }
  .hero-cta { margin-top: 24px; }
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.12; letter-spacing: -.025em;
  margin: 0 0 18px;
  text-shadow: 0 2px 24px rgba(0, 50, 140, .25);
}
.hero h1 .hl { color: #ffd84d; }
.hero p.lead {
  max-width: 560px; margin: 0 auto;
  font-size: clamp(16px, 1.5vw, 19px); line-height: 1.45; opacity: .95;
  text-shadow: 0 1px 12px rgba(0, 60, 160, .45);
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero-cta .btn { min-height: 52px; padding: 0 28px; font-size: 16px; }
.hero-cta .btn-primary { background: #0a4fe0; box-shadow: 0 8px 24px rgba(0, 40, 140, .35); }
.hero-cta .btn-primary:hover { background: #0841bd; }
.hero-cta .btn-ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .75); }
.hero-fab {
  position: absolute; right: 22px; bottom: 22px;
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; color: var(--ink);
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15); transition: background .2s;
}
.hero-fab:hover { background: #fff; }
.countdown { display: flex; flex-wrap: wrap; row-gap: 0; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.countdown b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.countdown i { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 700; margin-right: 6px; }
.stat.accent { background: var(--blue); color: #fff; }
.stat.accent span, .stat.accent i { color: #fff; }

/* ================= Sections ================= */
.section { padding: 72px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.h2 { font-weight: 700; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.025em; margin: 0; }
.h2 .hl { color: var(--blue); }
.sub { color: var(--muted); margin: 8px 0 0; max-width: 560px; }

.page-hero {
  background: linear-gradient(180deg, #0757d6 0%, #0a6cff 100%);
  color: #fff;
  padding: calc(var(--nav-h) + 56px) 0 64px;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('../assets/img/main.jpg') center 85% / cover no-repeat;
  background-image: image-set(url('../assets/img/main-sm.webp') type('image/webp'), url('../assets/img/main.jpg') type('image/jpeg'));
  opacity: .22; mix-blend-mode: luminosity;
}
.page-hero .container { position: relative; }
.page-hero .eyebrow { color: #fff3c4; }
.page-hero .sub { color: rgba(255, 255, 255, .88); }
.page-body { padding: 28px 0 80px; position: relative; }
.dir-tags { display: flex; flex-wrap: wrap; gap: 6px; }
td .dir-tags[data-sm] { margin-top: 6px; }

/* stats */
.stats { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 14px; margin-top: 28px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }

/* direction cards */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dir-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--line);
  text-align: left; transition: border-color .2s, box-shadow .2s;
}
.dir-card:hover { border-color: #b9cdf5; box-shadow: var(--shadow); }
.dir-card.selected { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 246, .12); }
.dir-ico { display: inline-flex; flex: none; color: var(--blue); }
.dir-ico svg { width: 44px; height: 44px; stroke-width: 1.6; }
.dir-ico .duo { fill: currentColor; fill-opacity: .22; transition: fill-opacity .2s; }
.dir-card:hover .dir-ico .duo, .dir-card.selected .dir-ico .duo { fill-opacity: .35; }
.chosen .dir-ico svg { width: 32px; height: 32px; }
.dir-card h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.dir-card p { margin: 0; color: var(--muted); font-size: 14px; }
.dir-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue); font-size: 12.5px; font-weight: 700; }
.tag.gray { background: #f0f2f7; color: var(--ink-2); }
.tag.green { background: #e6f8ef; color: #0a6b3f; }
.tag.amber { background: #fff5dc; color: #9a6700; }

/* ================= Reels / Gallery ================= */
.reels {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.reel {
  position: relative; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden;
  background: #0b1733; box-shadow: var(--shadow); border: 0; padding: 0; color: #fff;
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; }
.reel-ui {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 60%, rgba(0,0,0,.6) 100%);
  pointer-events: none;
}
.reel-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.reel-top .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; border: 2px solid #fff; }
.reel-bottom { text-align: left; font-size: 14px; font-weight: 600; padding-right: 52px; }
.reel-play {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); backdrop-filter: blur(8px);
  display: grid; place-items: center; transition: opacity .2s;
}
.reel.playing .reel-play { opacity: 0; }
.reel.playing .reel-play:focus-visible { opacity: 1; }
.reel-mute {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center;
}

.wide-video { border-radius: 24px; overflow: hidden; background: #000; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.wide-video video { width: 100%; height: 100%; object-fit: cover; }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photo {
  position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 9;
  border: 0; padding: 0; background: #dde5f3; box-shadow: var(--shadow);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo:hover img { transform: scale(1.03); }
.photo figcaption {
  position: absolute; left: 14px; bottom: 14px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 700; font-size: 14px;
}

/* 3D (Blender) topshiriqlari */
.nav-links a[hidden], .tabbar a[hidden] { display: none; }
.m3d-lock .countdown { justify-content: center; margin-top: 10px; }
.m3d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.m3d { background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.m3d-img { all: unset; display: block; cursor: zoom-in; aspect-ratio: 3 / 2; overflow: hidden; background: #2b2b2b; }
.m3d-img:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.m3d-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.m3d-img:hover img { transform: scale(1.03); }
.m3d-body { padding: 18px 20px 22px; }
.m3d-body h3 { margin: 10px 0 4px; font-size: 20px; letter-spacing: -.01em; }
.m3d-body p { margin: 0; color: var(--muted); }
.m3d-body { display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.m3d-dl { margin-top: auto; }
.m3d-body p { margin-bottom: 16px; }
.lightbox img { max-width: 100%; object-fit: contain; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(5, 12, 30, .9); display: none; align-items: center; justify-content: center; padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; border-radius: 16px; }
.lightbox .close { position: absolute; top: 16px; right: 16px; }

/* ================= Toolbar / filters ================= */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.toolbar > * { min-width: 0; max-width: 100%; }
.chips { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 14px;
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: #b9cdf5; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { font-weight: 700; opacity: .6; }
.field {
  display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; flex: 1 1 220px;
}
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 246, .12); }
.field input, .field select { border: 0; outline: 0; background: transparent; width: 100%; min-height: 42px; }
.field .icon { color: var(--muted); }
select.select {
  min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 600;
  outline: 0; transition: border-color .15s, box-shadow .15s;
}
select.select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 246, .12); }

/* table */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 14px 18px; background: #fafbfe; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
[data-sm] { display: none; }
@media (max-width: 860px) { [data-sm] { display: block; } .dir-tags[data-sm] { display: flex; } }
.num { color: var(--muted); font-variant-numeric: tabular-nums; width: 56px; }
.person { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
}
.user-ico { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; color: #b8c3da; }
.empty h3 { color: var(--ink); margin: 0 0 4px; font-size: 18px; }

/* ================= Results ================= */
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod {
  background: var(--card); border-radius: var(--radius); padding: 22px 18px; text-align: center; box-shadow: var(--shadow);
  border-top: 6px solid var(--c);
}
.pod.p1 { padding-top: 32px; }
.medal {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: var(--c);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.pod h4 { margin: 0; font-size: 17px; line-height: 1.3; }
.pod p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pod .pod-proj { color: var(--ink); font-weight: 600; }
.pod .score { margin-top: 10px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.place-badge { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; font-weight: 800; background: #f0f2f7; }
.place-badge.g { background: #fff4d1; color: #8a6200; }
.place-badge.s { background: #eef1f6; color: #4b5873; }
.place-badge.b { background: #fdeee2; color: #9a5318; }

/* ================= Upload wizard ================= */
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted);
}
.step i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: #f0f2f7; }
.step.on { color: var(--ink); border-color: var(--blue); }
.step.on i { background: var(--blue); color: #fff; }
.step.done i { background: var(--green); color: #fff; }
.panel { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.panel > p { margin: 0 0 18px; color: var(--muted); }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-height: 460px; overflow: auto; padding: 2px; margin-top: 14px; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; text-align: left; transition: border-color .2s, background .2s;
}
.pick:hover { border-color: #b9cdf5; }
.pick.selected { border-color: var(--blue); background: var(--blue-50); }
.pick small { display: block; color: var(--muted); font-weight: 600; }
.chosen { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--blue-50); margin-bottom: 18px; flex-wrap: wrap; }
.chosen .grow { flex: 1; min-width: 160px; }
.form { display: grid; gap: 16px; }
.form label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 6px; }
.input, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #fff; outline: 0;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 246, .12); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: #f0f2f7; gap: 4px; }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.drop, .form label.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border-radius: 18px; border: 2px dashed #c7d3ea; background: #fafcff; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-50); }
.drop svg { width: 36px; height: 36px; color: var(--blue); }
.drop b { font-size: 16px; }
.drop b, .drop span { overflow-wrap: anywhere; max-width: 100%; }
.drop:has(+ #up-file:focus-visible) { outline: 3px solid #0b1733; outline-offset: 2px; box-shadow: 0 0 0 6px var(--sun); }
.drop span { color: var(--muted); font-size: 14px; }
.progress { height: 8px; border-radius: 999px; background: #e8edf6; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.alert { padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.info { background: var(--blue-50); color: #1b4fae; }
.alert.err { background: #fff0f0; color: #b4232a; }
.alert.ok { background: #e6f8ef; color: #0f7a49; }
.success { text-align: center; padding: 36px 20px; }
.success .big { width: 72px; height: 72px; border-radius: 50%; background: #e6f8ef; color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.success .big svg { width: 36px; height: 36px; }

/* ================= Projects ================= */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1.5px solid transparent;
  transition: border-color .2s;
}
.proj:hover { border-color: #cfdcf5; }
.proj h3 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.proj p { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.proj .foot { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.proj-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.proj-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.proj-time .icon { width: 16px; height: 16px; }
.proj-file {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border-radius: 12px; background: #f5f7fc; font-size: 14px; font-weight: 600;
}
.proj-file .icon { width: 18px; height: 18px; color: var(--blue); }
.proj-file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-file .ext { flex: none; padding: 2px 8px; border-radius: 8px; background: #fff; color: var(--blue); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.proj-actions { display: flex; gap: 8px; }
.proj-actions .btn { flex: 1; justify-content: center; }

/* ================= Footer ================= */
.footer { background: var(--ink); color: #c9d3e8; padding: 48px 0 32px; margin-top: 40px; }
.footer .container { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer h4 { color: #fff; margin: 0 0 8px; }
.footer a:hover { color: #fff; }
.footer small { display: block; margin-top: 24px; color: #7f8bab; }

/* Mobile tab bar */
.tabbar {
  position: fixed; z-index: var(--z-tab); left: 0; right: 0; bottom: 0;
  display: none; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--muted); min-height: 44px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--blue); }
.tabbar a.cta svg { width: 26px; height: 26px; padding: 0; }
.tabbar a.cta span.bubble {
  width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; background: var(--blue); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(11, 99, 246, .4); border: 4px solid #fff;
}

/* toast */
.toast {
  position: fixed; z-index: var(--z-toast); left: 50%; bottom: 24px; translate: -50% 20px;
  padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; translate: -50% 0; }
.toast.err { background: var(--red); }

.skeleton { background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 50%, #eef1f7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ================= Responsive ================= */
@media (max-width: 1024px) {
  .reels { grid-template-columns: repeat(4, 220px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
  .reels::-webkit-scrollbar { display: none; }
  .reel { scroll-snap-align: start; }
}
@media (max-width: 960px) {
  .nav-links, .nav .nav-right { display: none; }
  .nav { justify-content: space-between; }
  .tabbar { display: grid; }
  body:not(.admin) { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}
@media (max-width: 860px) {
  .nav { justify-content: space-between; top: 18px; left: 18px; right: 18px; height: 56px; --nav-h: 56px; }
  .tabbar { display: grid; }
  body.admin { padding-bottom: 0; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 16px; }
  .stats .accent { grid-column: 1 / -1; order: -1; }
  .hero { height: 100svh; min-height: 600px; padding-top: calc(56px + 64px); background-size: auto 58%; background-position: center bottom; }
  .hero-fab { display: none; }
  .photos { grid-template-columns: 1fr; }
  .m3d-grid { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .podium .p1 { order: -1; }
  .toast { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 32px); }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .page-body { padding-top: 24px; padding-bottom: 60px; }
  .toolbar select.select { flex: 1 1 100%; }
  .field { flex-basis: 100%; }
  .section { padding: 52px 0; }
  .countdown b { font-size: 26px; }
  .reels { grid-template-columns: repeat(4, 72vw); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding: 12px 10px; }
  .table { font-size: 14.5px; }
  .table .num { width: 28px; padding-right: 0; }
  .table td { overflow-wrap: anywhere; }
  .table .person { gap: 10px; }
  .table .avatar { width: 34px; height: 34px; font-size: 13px; }
  .table .person { align-items: flex-start; }
  .table .user-ico { width: 36px; height: 36px; }
  .table .num { vertical-align: top; padding-top: 20px; }
  .table-wrap { overflow-x: auto; }
  .panel { padding: 18px; }
  .pick-list { grid-template-columns: 1fr; }
  .stat b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

#view:focus { outline: none; }
#reels-section { scroll-margin-top: 110px; }

.origin-notice {
  position: fixed; z-index: var(--z-toast); left: 50%; top: 104px; translate: -50% 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px; background: #fff4d6; color: #6b4b00;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) { .origin-notice { top: 84px; } }

/* ---- Tekshiruvdan keyingi tuzatishlar ---- */
/* 861–1180px: hisoblagich 1.7fr ustunga sig'maydi — u alohida qatorga chiqadi */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats .accent { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 1024px) {
  .reels { scroll-padding-inline: 20px; }
}
@media (max-width: 560px) {
  .reels { scroll-padding-inline: 16px; }
  .stat { padding: 14px 10px; }
  .stat span { font-size: 12.5px; overflow-wrap: anywhere; }
}
@media (max-width: 400px) {
  .countdown b { font-size: 22px; }
}
/* sensorli ekranlarda bosiladigan elementlar kamida 44px */
@media (pointer: coarse) {
  .btn-sm, .chip, .seg button { min-height: 44px; }
}

/* ================= Fayl ko'ruvchi ================= */
body.no-scroll { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: 24px;
  background: rgba(8, 16, 36, .72); backdrop-filter: blur(4px);
}
.viewer-box {
  width: min(960px, 100%); height: min(88vh, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
}
.viewer-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.viewer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.viewer-title b, .viewer-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title span { color: var(--muted); font-size: 13px; font-weight: 600; }
.viewer-head .btn { flex: none; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; background: #eef1f6; display: flex; }
.viewer-body > img, .viewer-body > video { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body > video { width: 100%; background: #000; }
.viewer-pages { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; min-width: 0; }
.viewer-pages canvas { max-width: 100%; height: auto; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }
.viewer-text { flex: 1; margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 ui-monospace, Consolas, monospace; background: #fff; }
.viewer-msg { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 20px; text-align: center; color: var(--muted); }
.viewer-msg .icon { width: 36px; height: 36px; color: #b8c3da; }
.viewer-msg b { color: var(--ink); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #d6deef; border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  .viewer { padding: 0; }
  .viewer-box { width: 100%; height: 100%; border-radius: 0; }
  .viewer-head { padding: 10px 10px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .viewer-pages { padding: 8px; gap: 8px; }
}

/* ================= Loyiha joylash: ixcham ko'rinish ================= */
.step-label { padding-right: 10px; }
.up-dirs { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.chosen { flex-wrap: nowrap; }
.chosen .grow { min-width: 0; }
.chosen .grow b, .chosen .grow .hint { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen .btn { flex: none; }
.proj-actions .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .up-dirs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .up-dirs .dir-card { padding: 14px; gap: 6px; }
  .up-dirs .dir-ico svg { width: 32px; height: 32px; }
  .up-dirs .dir-card h3 { font-size: 15px; }
  .up-dirs .dir-card p { font-size: 12.5px; }
  .chosen { padding: 10px; gap: 10px; margin-bottom: 12px; }
  .chosen .btn-txt, .viewer-head .btn-txt { display: none; }
  .chosen .btn, .viewer-head .btn { width: 44px; padding: 0; justify-content: center; }
  .drop, .form label.drop { padding: 24px 16px; }
}

/* ================= Moslashuvchanlik tuzatishlari ================= */
/* Planshet va telefon: rasmning yuqori ~38% qismi faqat osmon — u matn ortida qoladi,
   odamlar turgan pastki qism uchun esa joy ajratiladi. Shunda baland planshetda bo'sh ko'k joy
   qolmaydi, past telefonda tugmalar odamlar ustiga tushmaydi. 146vw — rasm haddan tashqari kattalashmasin. */
@media (max-width: 860px) {
  .hero {
    --img-h: clamp(380px, min((100svh - 380px) / .62, 146vw), 1300px);
    height: auto; min-height: 100svh;
    padding-bottom: calc(var(--img-h) * .62);
    background-size: auto var(--img-h);
    background-position: center bottom;
  }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 30px; }
  .hero-cta { margin-top: 22px; }
}

/* Loyiha joylash: forma juda cho'zilib ketmasin, telefonda asosiy tugma butun enida */
#up { max-width: 880px; }
@media (max-width: 560px) {
  #up-form .btn-primary { width: 100%; }
  .steps { gap: 6px; margin-bottom: 14px; }
}
.proj-attempt {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: 8px;
  background: #fff4d1; color: #8a6200; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap;
}
