/* ============ Karra jadvali — umumiy uslublar ============ */
@font-face { font-family: 'Fredoka'; src: url('../vendor/fonts/fredoka-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../vendor/fonts/fredoka-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../vendor/fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../vendor/fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #2d2a4a;
  --ink-soft: #6a6790;
  --paper: #ffffff;
  --card: rgba(255, 255, 255, .93);
  --line: rgba(45, 42, 74, .1);
  --sky: #4fc3f7;
  --sun: #ffca28;
  --coral: #ff7043;
  --pink: #f06292;
  --mint: #1fbf9a;
  --grape: #7e57c2;
  --leaf: #5cb85c;
  --ok: #2ebd6b;
  --bad: #ff5a5f;
  --radius: 26px;
  --shadow: 0 14px 40px rgba(35, 30, 80, .18);
  --shadow-sm: 0 6px 18px rgba(35, 30, 80, .14);
  --font: 'Fredoka', 'Segoe UI Rounded', 'Segoe UI', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #8fd3ff;
  color: var(--ink);
  font-family: var(--font);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.pe { pointer-events: auto; }
.hidden { display: none !important; }

.screen {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; flex-direction: column;
  animation: screenIn .35s ease both;
}
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Yuklanish ---------- */
.boot { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: linear-gradient(#6ec6ff, #c9efff); }
.boot-owl { font-size: 96px; animation: bob 1.2s ease-in-out infinite; }
.boot-text { font-size: 28px; font-weight: 600; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.nojs { position: fixed; inset: 0; display: grid; place-content: center; font: 600 24px sans-serif; background: #fff; padding: 20px; text-align: center; }
@keyframes bob { 50% { transform: translateY(-12px); } }

/* ---------- Tugmalar ---------- */
.btn {
  --c: var(--coral);
  font: inherit; font-weight: 600;
  border: none; cursor: pointer;
  border-radius: 22px;
  padding: .62em 1.25em;
  font-size: clamp(17px, 2.1vw, 26px);
  color: #fff;
  background: var(--c);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 70%, #000), 0 10px 22px rgba(0,0,0,.16);
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  pointer-events: auto;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 70%, #000), 0 4px 10px rgba(0,0,0,.14); }
.btn:disabled { filter: grayscale(.7) brightness(1.1); opacity: .6; cursor: default; }
.btn.big { font-size: clamp(22px, 3vw, 38px); padding: .6em 1.4em; border-radius: 28px; }
.btn.small { font-size: clamp(15px, 1.6vw, 19px); padding: .5em .95em; border-radius: 16px; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); }
.btn.ghost { --c: #ffffff; color: var(--ink); text-shadow: none; box-shadow: 0 5px 0 #d6d4e6, 0 8px 18px rgba(0,0,0,.1); }
.btn.round { width: 2.4em; height: 2.4em; padding: 0; border-radius: 50%; font-size: clamp(18px, 2vw, 24px); }
.btn .ico { font-size: 1.15em; line-height: 1; text-shadow: none; }

.c-coral { --c: #ff7043; } .c-sky { --c: #29a9e6; } .c-mint { --c: #1fbf9a; } .c-grape { --c: #8a63d2; }
.c-pink { --c: #ef5b8f; } .c-sun { --c: #f5b400; } .c-leaf { --c: #4caf50; } .c-ink { --c: #4b4870; }

/* ---------- Umumiy panel ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + var(--safe-t)) 16px 8px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar .title {
  font-weight: 700; font-size: clamp(22px, 3vw, 36px);
  color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.15);
  pointer-events: none;
}
.spacer { flex: 1; }
.pill {
  background: rgba(255,255,255,.92); border-radius: 999px; padding: .35em .9em;
  font-weight: 600; font-size: clamp(16px, 1.8vw, 22px); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: .35em;
}

/* ---------- Splash ---------- */
.splash { align-items: center; justify-content: center; text-align: center; }
.splash .logo {
  font-size: clamp(46px, 9vw, 120px); font-weight: 700; line-height: 1; margin: 0;
  color: #fff; letter-spacing: 1px;
  text-shadow: 0 5px 0 #ff8a50, 0 10px 0 rgba(0,0,0,.12), 0 18px 40px rgba(0,0,0,.18);
  animation: logoIn .8s cubic-bezier(.2,1.6,.4,1) both;
}
.splash .logo span { display: inline-block; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes logoIn { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.splash .sub { font-size: clamp(20px, 3vw, 34px); font-weight: 600; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); margin: 10px 0 34px; }
.splash .btn.big { font-size: clamp(28px, 4vw, 48px); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.splash .hint { margin-top: 24px; color: #fff; font-weight: 500; font-size: 17px; text-shadow: 0 2px 0 rgba(0,0,0,.2); opacity: .95; max-width: 560px; padding: 0 16px; }

/* ---------- Bosh sahifa ---------- */
.home { justify-content: center; padding: 20px clamp(16px, 5vw, 80px); }
.home-panel { width: min(520px, 100%); padding: 28px 28px 24px; pointer-events: auto; animation: panelIn .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes panelIn { from { transform: translateX(-40px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.home-panel h1 { margin: 0 0 4px; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.02; color: var(--ink); }
.home-panel h1 .x { color: var(--coral); }
.home-panel .lead { margin: 0 0 20px; color: var(--ink-soft); font-size: clamp(16px, 1.8vw, 21px); font-weight: 500; }
.menu { display: grid; gap: 14px; }
.menu .btn { justify-content: flex-start; width: 100%; font-size: clamp(20px, 2.4vw, 30px); padding: .55em .9em; }
.menu .btn .ico { font-size: 1.35em; width: 1.4em; }
.menu .btn small { font-size: .55em; opacity: .9; font-weight: 500; margin-left: auto; text-align: right; white-space: normal; line-height: 1.1; max-width: 45%; }
.home-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.mastery { display: flex; gap: 6px; flex-wrap: wrap; }
.mastery .m {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: var(--ink);
  background: conic-gradient(var(--col) calc(var(--p) * 1%), #ebe9f5 0);
  position: relative;
}
.mastery .m::after { content: ''; position: absolute; inset: 4px; background: #fff; border-radius: 50%; z-index: 0; }
.mastery .m b { position: relative; z-index: 1; }

/* ---------- Son tanlash ---------- */
.picker-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 16px 20px; gap: 18px; min-height: 0; }
.picker-card { width: min(940px, 100%); padding: 22px clamp(16px, 3vw, 34px) 24px; pointer-events: auto; }
.picker-card h2 { margin: 0 0 4px; font-size: clamp(24px, 3.2vw, 40px); text-align: center; }
.picker-card p.help { margin: 0 0 18px; text-align: center; color: var(--ink-soft); font-size: clamp(15px, 1.7vw, 20px); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.6vw, 18px); }
.tile {
  --c: #ef5350;
  position: relative; aspect-ratio: 1 / .92;
  border: none; border-radius: 24px; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c));
  color: #fff; font-weight: 700; font-size: clamp(34px, 6vw, 72px);
  text-shadow: 0 4px 0 rgba(0,0,0,.16);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 65%, #000), 0 12px 22px rgba(0,0,0,.15);
  transition: transform .12s ease, box-shadow .12s ease;
  display: grid; place-items: center;
  pointer-events: auto;
}
.tile:active { transform: translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 65%, #000); }
.tile .tick {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--ok); font-size: 22px; display: grid; place-items: center;
  text-shadow: none; transform: scale(0); transition: transform .2s cubic-bezier(.2,1.8,.4,1);
  box-shadow: 0 3px 8px rgba(0,0,0,.2);
}
.tile .stars { position: absolute; bottom: 6px; left: 0; right: 0; font-size: clamp(11px, 1.3vw, 15px); letter-spacing: 1px; text-shadow: none; }
.tile.sel { transform: translateY(-4px) scale(1.04); outline: 5px solid #fff; box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 55%, transparent), 0 12px 24px rgba(0,0,0,.2); }
.tile.sel .tick { transform: scale(1); }
.tile .done { position: absolute; top: 8px; left: 10px; font-size: clamp(14px, 1.6vw, 20px); text-shadow: none; }
.picker-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.sel-summary { text-align: center; margin-top: 14px; font-size: clamp(16px, 1.8vw, 21px); font-weight: 600; color: var(--ink-soft); min-height: 1.3em; }

/* ---------- O'yinlar ro'yxati ---------- */
.games-body { flex: 1; overflow-y: auto; padding: 4px 16px 28px; pointer-events: auto; -webkit-overflow-scrolling: touch; }
.games-wrap { width: min(1180px, 100%); margin: 0 auto; }
.chipbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.chipbar .lbl { font-weight: 600; font-size: clamp(16px, 1.8vw, 20px); margin-right: 4px; }
.chip {
  --c: #888;
  border: none; cursor: pointer; font: inherit; font-weight: 700;
  min-width: 46px; height: 46px; padding: 0 12px; border-radius: 16px;
  font-size: 21px; color: var(--ink);
  background: #efedf7; box-shadow: 0 4px 0 #d8d5e8;
  transition: transform .08s, background .15s, color .15s;
}
.chip:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8d5e8; }
.chip.sel { background: var(--c); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 65%, #000); text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.chip.all { font-size: 17px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.game-card {
  --c: #ff7043;
  position: relative; overflow: hidden;
  border: none; cursor: pointer; text-align: left;
  border-radius: 28px; padding: 20px 20px 18px; min-height: 196px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
  color: #fff; box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 62%, #000), 0 14px 28px rgba(0,0,0,.16);
  transition: transform .15s ease, box-shadow .15s;
  display: flex; flex-direction: column; gap: 6px;
  animation: cardIn .45s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes cardIn { from { transform: translateY(26px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.game-card:hover { transform: translateY(-4px) rotate(-.6deg); }
.game-card:active { transform: translateY(6px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 62%, #000); }
.game-card .gicon { font-size: 62px; line-height: 1; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.game-card .gname { font-size: 27px; font-weight: 700; text-shadow: 0 3px 0 rgba(0,0,0,.16); }
.game-card .gdesc { font-size: 16.5px; font-weight: 500; opacity: .97; line-height: 1.25; }
.game-card .gbest { position: absolute; top: 16px; right: 18px; font-size: 18px; letter-spacing: 1px; }
.game-card .gtag { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.28); border-radius: 999px; padding: 2px 10px; font-size: 14px; font-weight: 600; }
.game-card::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.14); }

/* ---------- Dars (o'rganish) ---------- */
.lesson-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 0; }
.lesson-top > * { pointer-events: auto; }
.ltabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ltab { border: none; font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; padding: 6px 12px; border-radius: 14px; background: rgba(255,255,255,.75); color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.ltab.on { background: var(--c, #ff7043); color: #fff; }
.ltab.done::after { content: ' ✓'; }
.lprogress { flex: 1; height: 14px; background: rgba(255,255,255,.55); border-radius: 99px; overflow: hidden; min-width: 80px; pointer-events: none !important; }
.lprogress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffca28, #ff7043); border-radius: 99px; transition: width .5s ease; }
.eqpanel {
  position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: none; text-align: center; max-width: 92vw;
}
.eq-main {
  background: #fff; border-radius: 26px; padding: 6px 28px 8px;
  font-size: clamp(38px, 6vw, 76px); font-weight: 700; color: var(--ink);
  box-shadow: 0 8px 0 rgba(0,0,0,.1), var(--shadow); white-space: nowrap;
}
.eq-main .q { color: var(--coral); }
.eq-main .ans { color: var(--ok); display: inline-block; }
.eq-main.pop { animation: eqpop .55s cubic-bezier(.2,1.8,.4,1); }
.eq-main.txt { font-size: clamp(26px, 4.2vw, 50px); padding: 8px 26px 10px; }
.eq-sum.long { font-size: clamp(15px, 2vw, 26px); }
@keyframes eqpop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.eq-sum {
  margin-top: 8px; background: rgba(255,255,255,.9); border-radius: 18px; padding: 4px 18px;
  font-size: clamp(20px, 2.8vw, 34px); font-weight: 600; color: var(--grape);
  box-shadow: var(--shadow-sm); min-height: 1.4em; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.eq-sum:empty { visibility: hidden; }
.eq-sum .g { display: inline-block; animation: eqpop .4s ease; }

.ltable {
  position: absolute; right: 14px; top: calc(70px + var(--safe-t)); bottom: 100px;
  width: clamp(170px, 17vw, 230px);
  display: flex; flex-direction: column; padding: 10px; gap: 4px;
  pointer-events: auto; overflow-y: auto;
}
.ltable h3 { margin: 2px 4px 6px; font-size: 19px; text-align: center; }
.lrow {
  border: none; font: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  font-size: clamp(17px, 1.65vw, 22px); font-weight: 600; padding: 4px 10px; border-radius: 12px;
  background: transparent; color: var(--ink); transition: background .2s, transform .2s;
}
.lrow .r { color: var(--ink-soft); }
.lrow.seen .r { color: var(--ok); }
.lrow.cur { background: var(--c, #ff7043); color: #fff; transform: scale(1.05); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.lrow.cur .r { color: #fff; }
.lrow:hover:not(.cur) { background: rgba(0,0,0,.05); }

.bubble {
  position: absolute; left: 0; top: 0;
  max-width: min(440px, 46vw);
  background: #fff; border-radius: 22px; padding: 12px 18px;
  font-size: clamp(16px, 1.9vw, 23px); font-weight: 600; line-height: 1.25; color: var(--ink);
  box-shadow: var(--shadow); pointer-events: none;
  transition: opacity .25s, transform .25s;
  transform-origin: 0 100%;
}
.bubble::before { content: ''; position: absolute; left: -12px; bottom: 16px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble.off { opacity: 0; transform: scale(.85); }
.bubble.say { animation: bubbleIn .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes bubbleIn { from { transform: scale(.8); } to { transform: scale(1); } }

.lcontrols {
  position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; pointer-events: auto;
}
.lcontrols .btn { font-size: clamp(15px, 1.7vw, 21px); padding: .55em .9em; }
.lfinish {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, 92vw); padding: 26px; text-align: center; pointer-events: auto;
  max-height: calc(100vh - 24px); overflow-y: auto;
  animation: centerIn .45s cubic-bezier(.2,1.5,.4,1) both;
}
.lfinish h2 { margin: 6px 0 6px; font-size: clamp(26px, 3.4vw, 40px); }
.lfinish p { margin: 0 0 18px; color: var(--ink-soft); font-size: 19px; font-weight: 500; }
.lfinish .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.big-emoji { font-size: 74px; line-height: 1; animation: bob 1.4s ease-in-out infinite; }

/* ---------- O'yin HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top { display: flex; align-items: flex-start; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 0; }
.hud-top > * { pointer-events: auto; }
.hud-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; pointer-events: none !important; }
.hud-stats .pill { font-size: clamp(16px, 1.8vw, 22px); }
.hud-q {
  position: absolute; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%);
  background: #fff; border-radius: 24px; padding: 4px 26px 6px;
  font-size: clamp(34px, 5.4vw, 64px); font-weight: 700; white-space: nowrap;
  box-shadow: 0 7px 0 rgba(0,0,0,.1), var(--shadow); pointer-events: none;
  transition: background .2s, color .2s;
}
.hud-q .qm { color: var(--coral); }
.hud-q.ok { background: #e3fbe9; color: var(--ok); }
.hud-q.bad { background: #ffe6e6; color: var(--bad); }
.hud-q.pop { animation: eqpop .45s cubic-bezier(.2,1.8,.4,1); }
.hud-q.shake { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(calc(-50% - 10px)); } 40%, 80% { transform: translateX(calc(-50% + 10px)); } }
.hud-sub { position: absolute; left: 50%; top: calc(88px + var(--safe-t)); transform: translateX(-50%); font-size: clamp(15px, 1.6vw, 19px); font-weight: 600; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); white-space: nowrap; pointer-events: none; }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: calc(14px + var(--safe-b)); display: flex; justify-content: center; pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.choices { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; padding: 0 12px; }
.choices .btn { min-width: 110px; font-size: clamp(28px, 4vw, 46px); padding: .35em .8em; }
.choices .btn.right { --c: var(--ok); animation: eqpop .4s ease; }
.choices .btn.wrong { --c: var(--bad); animation: shakeX .4s ease; }
@keyframes shakeX { 25%, 75% { transform: translateX(-8px); } 50% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(6, auto); gap: 8px; background: rgba(255,255,255,.85); border-radius: 22px; padding: 10px; box-shadow: var(--shadow); }
.keypad .disp { grid-column: 1 / -1; background: #1d1b3a; color: #7fffd4; font-size: 34px; font-weight: 700; text-align: center; border-radius: 14px; padding: 2px 0; min-height: 50px; letter-spacing: 4px; }
.keypad .btn { font-size: 26px; width: 58px; height: 54px; padding: 0; border-radius: 16px; }
.keypad .btn.wide { width: auto; padding: 0 14px; }
.toast-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.toast {
  position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%);
  font-size: clamp(34px, 6vw, 72px); font-weight: 700; color: #fff; white-space: nowrap;
  text-shadow: 0 5px 0 rgba(0,0,0,.18), 0 0 30px rgba(0,0,0,.18);
  animation: toastIn 1.3s ease forwards;
}
.toast.ok { color: #fff; -webkit-text-stroke: 2px #23a55a; }
.toast.bad { color: #fff; -webkit-text-stroke: 2px #e0434a; }
.toast.info { -webkit-text-stroke: 2px #7e57c2; }
@keyframes toastIn {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { transform: translate(-50%, -90%) scale(1); opacity: 0; }
}
.floater { position: absolute; font-weight: 700; font-size: 30px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); pointer-events: none; animation: floatUp 1s ease-out forwards; white-space: nowrap; transform: translate(-50%, -50%); }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, -50%) scale(.6); } 20% { transform: translate(-50%, -60%) scale(1.15); } to { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.countdown b { font-size: clamp(90px, 18vw, 220px); color: #fff; text-shadow: 0 8px 0 rgba(0,0,0,.18), 0 0 50px rgba(0,0,0,.2); animation: cd .9s ease forwards; }
@keyframes cd { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.6); opacity: 0; } }
.howto {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, 92vw); text-align: center; padding: 24px 24px 22px; pointer-events: auto;
  max-height: calc(100vh - 24px); overflow-y: auto;
  animation: centerIn .45s cubic-bezier(.2,1.5,.4,1) both;
}
.howto .gicon { font-size: 80px; line-height: 1; }
.howto h2 { margin: 6px 0 8px; font-size: clamp(28px, 3.6vw, 42px); }
.howto p { font-size: clamp(17px, 2vw, 22px); color: var(--ink-soft); margin: 0 0 8px; font-weight: 500; line-height: 1.3; }
.howto .ctrl { display: inline-block; background: #f1effa; border-radius: 14px; padding: 6px 14px; margin: 6px 0 16px; font-weight: 600; font-size: 17px; color: var(--ink); }

/* ---------- Modal ---------- */
.modal-back { position: absolute; inset: 0; background: rgba(30, 24, 70, .45); display: grid; place-items: center; pointer-events: auto; animation: fadeIn .25s ease both; z-index: 10; padding: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 26px 22px; text-align: center; animation: modalIn .45s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes modalIn { from { transform: translateY(30px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes centerIn { from { transform: translate(-50%, -50%) translateY(30px) scale(.85); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.modal h2 { margin: 0 0 8px; font-size: clamp(28px, 3.6vw, 42px); }
.modal p { font-size: 19px; color: var(--ink-soft); margin: 4px 0; font-weight: 500; }
.modal .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.result-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.result-stars span { font-size: clamp(56px, 9vw, 86px); filter: grayscale(1) opacity(.28); transform: scale(.4); display: inline-block; }
.result-stars span.on { animation: starIn .55s cubic-bezier(.2,1.8,.4,1) forwards; }
@keyframes starIn { to { filter: none; transform: scale(1) rotate(360deg); } }
.result-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.result-stats .pill { background: #f3f1fb; box-shadow: none; }
.review { margin-top: 12px; background: #fff6e8; border-radius: 18px; padding: 10px 14px; text-align: left; }
.review b { display: block; margin-bottom: 4px; font-size: 17px; color: #b86a00; }
.review .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.review .facts span { background: #fff; border-radius: 12px; padding: 3px 10px; font-weight: 600; font-size: 19px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }

/* ---------- Sozlamalar ---------- */
.settings { text-align: left; }
.settings h2 { text-align: center; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 19px; font-weight: 600; }
.set-row:last-of-type { border-bottom: none; }
.set-row select, .set-row input[type=range] { font: inherit; font-size: 16px; max-width: 60%; }
.set-row select { padding: 6px 8px; border-radius: 10px; border: 2px solid #e3e1ef; background: #fff; }
.switch { position: relative; width: 62px; height: 34px; border-radius: 99px; background: #d9d6e8; border: none; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(28px); }
.notice { background: #fff4d6; border-radius: 16px; padding: 10px 14px; font-size: 16px; font-weight: 500; color: #7a5300; margin: 8px 0; line-height: 1.3; text-align: left; }
.notice.good { background: #e3fbe9; color: #17703d; }

/* ---------- Pifagor jadvali ---------- */
.table-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4px 12px 16px; min-height: 0; }
.ptable-card { padding: 14px; pointer-events: auto; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.ptable { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; width: min(760px, calc(100vw - 52px), calc((100vh - 190px) * 1.1)); }
.pcell {
  aspect-ratio: 1.1; border: none; border-radius: 10px; font: inherit; font-weight: 600;
  font-size: clamp(13px, 2.1vw, 24px); cursor: pointer; background: #f4f2fb; color: var(--ink);
  transition: transform .12s, background .15s; display: grid; place-items: center; padding: 0;
}
.pcell.h { background: var(--c); color: #fff; font-weight: 700; }
.pcell.corner { background: transparent; font-size: clamp(16px, 2.4vw, 28px); color: var(--coral); cursor: default; }
.pcell.hl { background: #fff1c2; }
.pcell.on { background: var(--coral); color: #fff; transform: scale(1.18); box-shadow: 0 6px 14px rgba(0,0,0,.2); z-index: 1; }
.pcell.sq { box-shadow: inset 0 0 0 2px #ffd36b; }
.ptable-info { text-align: center; font-size: clamp(20px, 2.8vw, 32px); font-weight: 700; min-height: 1.3em; }

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .tile { border-radius: 16px; }
  .tile .tick { width: 24px; height: 24px; font-size: 15px; top: 4px; right: 4px; }
  .ltable { display: none; }
  .bubble { max-width: 62vw; }
  .lcontrols .btn .lbl { display: none; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .game-card { min-height: 160px; padding: 14px; }
  .game-card .gicon { font-size: 44px; }
  .game-card .gname { font-size: 21px; }
  .game-card .gdesc { font-size: 14px; }
  .home { justify-content: flex-end; padding-bottom: 18px; }
  .home-panel { padding: 18px; }
  .menu .btn small { display: none; }
}
@media (max-height: 560px) {
  .ltable { bottom: 80px; }
  .eq-main { font-size: 38px; }
  .tile { aspect-ratio: 1.5; }
}
