:root {
  --bg: #0d0b1a;
  --panel: #17142b;
  --line: #2a2547;
  --text: #f2f0ff;
  --muted: #a39fc4;
  --accent: #b4f04b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Manrope", system-ui, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Yuqori panel */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 11, 26, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font: 800 22px "Unbounded", sans-serif; text-decoration: none; letter-spacing: .5px; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 90px 0 70px;
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(127, 91, 255, .35), transparent 70%),
    radial-gradient(500px 260px at 10% 90%, rgba(180, 240, 75, .18), transparent 70%);
}
.tag { color: var(--accent); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; }
h1 { font: 800 clamp(26px, 6vw, 54px)/1.1 "Unbounded", sans-serif; margin: 0 0 18px; }
h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0 0 30px; }

.btn {
  display: inline-block;
  background: var(--accent); color: #111;
  font-weight: 700; text-decoration: none;
  padding: 14px 26px; border-radius: 14px;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(180, 240, 75, .3); }
.btn-sm { padding: 10px 18px; font-size: 14px; border-radius: 12px; }
.btn.off { background: var(--line); color: var(--muted); cursor: default; box-shadow: none; transform: none; }

/* O'yinlar */
h2 { font: 600 28px "Unbounded", sans-serif; margin: 60px 0 24px; display: flex; align-items: center; gap: 12px; }
.count { font: 700 14px "Manrope", sans-serif; background: var(--line); color: var(--muted); padding: 2px 10px; border-radius: 99px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: #4a4380; }
.icon {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--a), var(--b));
  display: grid; place-items: center;
}
.icon span { font: 800 64px "Unbounded", sans-serif; color: rgba(255, 255, 255, .9); text-shadow: 0 4px 20px rgba(0, 0, 0, .25); }
.icon img { width: 96px; height: 96px; object-fit: cover; border-radius: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.body { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.genre { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.body h3 { margin: 4px 0 6px; font-size: 19px; }
.body p { margin: 0 0 12px; color: var(--muted); font-size: 14px; flex: 1; }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.body .btn { align-self: flex-start; }

/* Yo'riqnoma */
.howto ol { padding-left: 22px; max-width: 680px; }
.howto li { margin-bottom: 10px; }
.note {
  max-width: 680px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  padding: 14px 18px; border-radius: 12px; color: var(--muted); font-size: 14px;
}

/* Yuklash tugmasi bosilgandagi holat */
.btn.yuklanmoqda { background: #2f2a52; color: var(--text); box-shadow: none; transform: none; }
.aylana {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--accent); border-radius: 50%;
  animation: aylan .8s linear infinite;
}
@keyframes aylan { to { transform: rotate(360deg); } }

/* Pastdan chiqadigan yuklash oynasi */
.oyna-fon {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 4, 12, .6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .25s;
}
.oyna-fon[hidden] { display: none; }
.oyna-fon.ochiq { opacity: 1; }
.oyna {
  position: relative; width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 26px 22px 30px; text-align: center;
  transform: translateY(100%); transition: transform .25s ease-out;
}
.oyna-fon.ochiq .oyna { transform: none; }
.yopish {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer;
}
.oyna-ikon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; color: #111; background: var(--accent);
  animation: sakra 1.2s ease-in-out infinite;
}
@keyframes sakra { 50% { transform: translateY(5px); } }
.oyna h3 { margin: 0 0 14px; font-size: 19px; }
.chiziq { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 16px; }
.chiziq i {
  display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--accent);
  animation: yugur 1.3s ease-in-out infinite;
}
@keyframes yugur { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.oyna p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.oyna p b { color: var(--text); }
.tushunarli { display: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; margin: 6px 0 4px; }

/* 5 soniyadan keyin: animatsiya to'xtaydi, belgi ✓ bo'ladi */
.oyna-fon.boshlandi .oyna-ikon { animation: none; font-size: 0; }
.oyna-fon.boshlandi .oyna-ikon::after { content: "✓"; font-size: 28px; font-weight: 800; }
.oyna-fon.boshlandi .chiziq { display: none; }
.oyna-fon.boshlandi .tushunarli { display: inline-block; }
.oyna-fon.boshlandi .qayta { display: block; }

.qayta { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 13px; font-weight: 600; }

.foot { border-top: 1px solid var(--line); margin-top: 70px; padding-top: 20px; padding-bottom: 30px; color: var(--muted); font-size: 14px; }
.foot .small { font-size: 12px; opacity: .75; max-width: 680px; }

@media (max-width: 560px) {
  nav { gap: 14px; }
  nav a { font-size: 13px; }
  .hero { padding: 60px 0 50px; }

  /* Telefonda ixcham karta: ikonka chapda, yozuv o'ngda */
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { flex-direction: row; align-items: center; padding: 12px; border-radius: 16px; }
  .icon { flex: 0 0 84px; width: 84px; height: 84px; aspect-ratio: auto; border-radius: 18px; overflow: hidden; }
  .icon span { font-size: 34px; }
  .icon img { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
  .icon.rasmli { background: #221e3d; }
  .body { padding: 0 0 0 14px; min-width: 0; }
  .body h3 { margin: 2px 0 2px; font-size: 17px; }
  .body p {
    margin: 0 0 6px; font-size: 13px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .meta { margin-bottom: 8px; font-size: 12px; }
  .btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
}
