
/* ========================================
   1. ASOSIY SOZLAMALAR
======================================== */

:root {
    --bg: #eef4ff;
    --card: rgba(255, 255, 255, .78);
    --tx: #0d1b3d;
    --mu: #5b6b8c;
    --pr: #1f6bff;
    --pr2: #00b4ff;
    --ln: rgba(31, 107, 255, .15);
    --sh: 0 10px 30px rgba(31, 107, 255, .12);
}

[data-t=dark] {
    --bg: #070d1f;
    --card: rgba(20, 32, 70, .72);
    --tx: #e8eeff;
    --mu: #9aaad0;
    --ln: rgba(120, 160, 255, .2);
    --sh: 0 10px 30px rgba(0, 0, 0, .4);
}

/* ========================================
   2. GLOBAL
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--tx);
    transition: background .3s, color .3s;
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(600px 400px at 10% 0, rgba(31,107,255,.18), transparent),
        radial-gradient(500px 400px at 100% 30%, rgba(0,180,255,.15), transparent);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--pr2);
    outline-offset: 2px;
}

/* ========================================
   3. HEADER VA NAVIGATSIYA
======================================== */

header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4vw;
    background: var(--card);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ln);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.25rem;
}

.logo small {
    display: block;
    font-size: .62rem;
    font-weight: 500;
    color: var(--mu);
}

nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}

nav a {
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
}

nav a:hover {
    background: var(--ln);
}

.ctl {
    display: flex;
    gap: 6px;
}

.ctl button,
.ctl select {
    background: var(--card);
    border: 1px solid var(--ln);
    border-radius: 12px;
    padding: 7px 10px;
}

/* ========================================
   4. SECTION
======================================== */

section {
    padding: 56px 4vw;
    max-width: 1200px;
    margin: 20px auto;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin-bottom: 6px;
}

.sub {
    color: var(--mu);
    margin-bottom: 24px;
}

/* ========================================
   5. HERO
======================================== */

.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    align-items: center;
    margin: 18px auto;
    max-width: 1200px;
    padding: 40px 4vw;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(120deg, #062a6b, #1f6bff 60%, #00b4ff);
    position: relative;
    overflow: hidden;
}

.hero:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
    transform: translateX(-100%);
    animation: shine 5s 1s infinite;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero p {
    opacity: .9;
    margin-bottom: 20px;
    max-width: 46ch;
}

.btn {
    display: inline-block;
    background: #fff;
    color: #0b3d91;
    font-weight: 700;
    padding: 12px 22px;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
    transition: transform .2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.p {
    background: linear-gradient(90deg, var(--pr), var(--pr2));
    color: #fff;
}

.photo {
    aspect-ratio: 1;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.15);
    font-size: 3rem;
    animation: fl 5s ease-in-out infinite;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   6. ANIMATSIYALAR
======================================== */

@keyframes shine {
    to {
        transform: translateX(100%);
    }
}

@keyframes fl {
    50% {
        transform: translateY(-8px);
    }
}

/* ========================================
   7. STATISTIKA VA GRID
======================================== */

.stats {
    display: flex;
    gap: 18px;
    margin-top: 18px;
    font-size: .9rem;
}

.stats b {
    display: block;
    font-size: 1.4rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.card {
    background: var(--card);
    border: 1px solid var(--ln);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--sh);
    backdrop-filter: blur(10px);
}

.sj {
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}

.sj:hover {
    transform: translateY(-4px);
}

.sj .ic {
    font-size: 2.2rem;
}

.sj b {
    display: block;
}

.bar {
    height: 6px;
    border-radius: 9px;
    background: var(--ln);
    margin-top: 8px;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--pr), var(--pr2));
}

/* ========================================
   8. DARS VA IKKI USTUN
======================================== */

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.lesson h3 {
    margin: 4px 0 8px;
}

.tag {
    display: inline-block;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--ln);
    color: var(--pr);
}

/* ========================================
   9. AI CHAT
======================================== */

.chat {
    display: flex;
    flex-direction: column;
    height: 420px;
}

.msgs {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

.m {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--ln);
}

.m.u {
    align-self: flex-end;
    background: linear-gradient(90deg, var(--pr), var(--pr2));
    color: #fff;
}

.row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

input,
select.f {
    flex: 1;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--ln);
    background: var(--card);
    min-width: 0;
}

/* ========================================
   10. TESTLAR
======================================== */

.opt {
    display: block;
    width: 100%;
    text-align: left;
    margin: 8px 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--ln);
    background: var(--card);
    transition: .15s;
}

.opt:hover {
    border-color: var(--pr);
}

.opt.on {
    background: var(--pr);
    color: #fff;
    border-color: var(--pr);
}

/* ========================================
   11. REYTING
======================================== */

.rk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--ln);
}

.rk .bar {
    flex: 1;
}

/* ========================================
   12. O'QITUVCHILAR
======================================== */

.av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ln);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
}

.av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tch {
    text-align: center;
}

.tch .av {
    width: 92px;
    height: 92px;
    margin: 0 auto 8px;
    font-size: 2rem;
}

/* ========================================
   13. JADVAL
======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

td, th {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--ln);
}

/* ========================================
   14. QO'SHIMCHA BLOKLAR
======================================== */

.hide {
    display: none;
}

.rv {
    opacity: 0;
    transform: translateY(16px);
    transition: .6s;
}

.rv.in {
    opacity: 1;
    transform: none;
}

.why {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.why .card b {
    display: block;
    margin: 6px 0 4px;
}

.why .ic {
    font-size: 2rem;
}

/* ========================================
   15. BO'LIMLAR ORQA FONI
======================================== */

#subjects {
    background: rgba(225, 240, 255, .72);
    border-radius: 26px;
}

#ai {
    background: rgba(235, 232, 255, .72);
    border-radius: 26px;
}

#test {
    background: rgba(225, 248, 240, .72);
    border-radius: 26px;
}

#battle {
    background: rgba(230, 238, 255, .82);
    border-radius: 26px;
}

#rank {
    background: rgba(255, 244, 225, .72);
    border-radius: 26px;
}

#teachers {
    background: rgba(242, 235, 255, .72);
    border-radius: 26px;
}

#why {
    background: rgba(230, 247, 250, .72);
    border-radius: 26px;
}

[data-t=dark] #subjects,
[data-t=dark] #ai,
[data-t=dark] #test,
[data-t=dark] #battle,
[data-t=dark] #rank,
[data-t=dark] #teachers,
[data-t=dark] #why {
    background: rgba(18, 34, 72, .62);
}

/* ========================================
   16. RO'YXATDAN O'TISH VA BELLASHUV
======================================== */

.register-top {
    flex: none;
    padding: 8px 13px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(90deg, var(--pr), var(--pr2));
    font-weight: 700;
    font-size: .88rem;
}

.battle-top {
    margin-left: 10px;
    background: #ffdf83;
    color: #17366c;
}

.battle-card {
    max-width: 650px;
    text-align: center;
    margin: auto;
    padding: 30px;
}

.battle-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.battle-card h3 {
    margin-bottom: 8px;
}

/* ========================================
   17. CTA VA IJTIMOIY TARMOQLAR
======================================== */

.cta {
    margin-top: 22px;
    padding: 28px;
    border-radius: 24px;
    text-align: center;
    color: #fff;
    background: linear-gradient(120deg, #062a6b, #1f6bff 60%, #00b4ff);
}

.cta h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.soc {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.soc a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.35);
    font-weight: 600;
    transition: transform .2s, background .2s;
}

.soc a:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.3);
}

.perk {
    margin-top: 14px;
    font-weight: 600;
    font-size: 1.05rem;
}

/* ========================================
   18. FOOTER
======================================== */

footer {
    margin-top: 40px;
    margin-bottom: 2cm;
    padding: 34px 4vw;
    text-align: center;
    color: #fff;
    background: linear-gradient(120deg, #062a6b, #1f6bff 60%, #00b4ff);
    border-radius: 28px 28px 0 0;
    position: relative;
    overflow: hidden;
}

footer:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.15) 50%, transparent 60%);
    transform: translateX(-100%);
    animation: shine 6s 2s infinite;
}

footer a {
    color: #fff;
}

/* ========================================
   19. TELEFON VA PLANShet MOSLASHUVI
======================================== */

@media(max-width: 800px) {
    .hero,
    .two {
        grid-template-columns: 1fr;
    }

    .ctl {
        margin-left: auto;
    }

    nav {
        display: none;
    }

    .hero {
        border-radius: 0;
        margin: 0;
    }

    .register-top {
        font-size: .75rem;
        padding: 7px 9px;
    }

    .battle-top {
        margin: 10px 0 0;
    }
}

/* ========================================
   20. ANIMATSIYANI KAMAYTIRISH
======================================== */

@media(prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .rv {
        opacity: 1;
        transform: none;
    }
}

/* ===== BARCHA QURILMALAR UCHUN RESPONSIVE ===== */

/* Kichik telefonlar */
@media (max-width: 360px) {
  body {
    font-size: 13px;
  }

  .container {
    width: 94%;
  }

  h1 {
    font-size: 25px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* Oddiy telefonlar */
@media (min-width: 361px) and (max-width: 600px) {
  .container {
    width: 92%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }
}

/* Katta telefonlar va kichik planshetlar */
@media (min-width: 601px) and (max-width: 768px) {
  .container {
    width: 94%;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Planshetlar */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    width: 92%;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Noutbuklar */
@media (min-width: 1025px) and (max-width: 1440px) {
  .container {
    width: 90%;
    max-width: 1300px;
  }
}

/* Katta monitorlar va televizorlar */
@media (min-width: 1441px) {
  .container {
    width: 90%;
    max-width: 1700px;
  }

  body {
    font-size: 18px;
  }
}

/* Barcha ekranlar uchun umumiy moslashuv */
img,
video {
  max-width: 100%;
  height: auto;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

img,
video,
iframe {
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 100%;
  padding-left: 15px;
  padding-right: 15px;
}

/* ===== TELEFONDA REYTING VA RO'YXAT ===== */

@media (max-width: 600px) {

    #rank {
        width: 100%;
        max-width: 100%;
        padding: 20px 12px;
        overflow: hidden;
    }

    #rank .card {
        width: 100%;
        min-width: 0;
        padding: 12px;
    }

    /* Reyting qatorlari */
    .rk {
        width: 100%;
        min-width: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        font-size: 13px;
    }

    .rk .bar {
        min-width: 35px;
    }

    /* Ro'yxatdan o'tish formasi */
    #reg {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #reg input,
    #reg select {
        width: 100%;
        min-width: 0;
    }

    #reg .row {
        width: 100%;
        flex-wrap: wrap;
    }

    #reg button {
        max-width: 100%;
    }

    /* Reyting jadvali */
    #rank table {
        width: 100%;
        table-layout: fixed;
        font-size: 11px;
    }

    #rank th,
    #rank td {
        padding: 6px 3px;
        overflow-wrap: anywhere;
    }
}

#videoList {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

#videoList button {
    min-width: 150px;
    min-height: 45px;
    padding: 12px 18px;
    white-space: normal;
    line-height: 1.4;
    overflow: visible;
}


/* ========================================
   21. VIDEO DARSLAR SAHIFASI
======================================== */

.container {
    max-width: 1200px;
    margin: 35px auto;
    padding: 20px;
}

.container h1 {
    text-align: center;
    font-size: clamp(28px, 4vw, 42px);
    margin: 25px 0 10px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--mu);
    margin-bottom: 35px;
}

.back {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--pr), var(--pr2));
    color: white;
    font-weight: 700;
    transition: .3s;
}

.back:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(31,107,255,.3);
}

.videos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.video {
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--ln);
    border-radius: 20px;
    box-shadow: var(--sh);
    backdrop-filter: blur(12px);
    transition: transform .3s, box-shadow .3s;
    animation: videoIn .6s ease both;
}

.video:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(31,107,255,.2);
}

.video h3 {
    margin-bottom: 14px;
    color: var(--tx);
}

.player {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}

.player iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* GEOGRAFIYA SAHIFASI FONI */

body:has(.videos) {
    background: linear-gradient(
        135deg,
        #0f172a,
        #172554,
        #312e81
    );
    background-attachment: fixed;
    min-height: 100vh;
}

body:has(.videos) .subtitle {
    color: #cbd5e1;
}

body:has(.videos) .video {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
}

body:has(.videos) .video h3 {
    color: #ffffff;
}

/* Geografiya sarlavhasi */
body:has(.videos) .container h1 {
    background: linear-gradient(90deg, #67e8f9, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(103, 232, 249, 0.25));
}

@keyframes videoIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media(max-width: 650px) {
    .videos {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 15px;
        margin: 15px auto;
    }
}
