/* ═══════════════════════════════════════════════════════════════════════
   world.css — Til Shahri 3D dunyo interfeysi
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #121815;
  --surface: rgba(27, 34, 30, .94);
  --surface-solid: #1b221e;
  --border: rgba(232, 230, 215, .12);
  --border-hi: rgba(232, 230, 215, .22);
  --text: #f0eee6;
  --muted: #a7aaa0;
  --accent: #a8b58e;
  --accent2: #d6936f;
  --green: #8fb68c;
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* `hidden` atributi CSS display xususiyatlaridan ustun bo'lsin */
[hidden] { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  touch-action: auto;
}

/* ═══════ 3D SAHNA ═══════ */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#game-canvas canvas { display: block; }

/* CSS2D label konteyneri — bosish/hover tanlab olinmasin */
#game-canvas .label-renderer { pointer-events: none; }
.label-renderer { pointer-events: none; }
.label-renderer > div { pointer-events: none; }

/* ═══════ YUKLASH ═══════ */
#loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #2d382e, #121815 72%);
  transition: opacity .5s;
}
#loading.done { opacity: 0; pointer-events: none; }

.load-card { text-align: center; width: min(420px, 90vw); }
.load-logo { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.load-logo span { color: var(--accent); }
.load-card h1 {
  font-size: 42px; font-weight: 800; letter-spacing: -1.4px;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.load-sub { color: var(--muted); font-size: 14.5px; margin: 6px 0 28px; }

.load-bar {
  height: 8px; border-radius: 100px; overflow: hidden;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--border);
}
#loadFill {
  height: 100%; width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .25s ease;
}
.load-info {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
}
.load-tip {
  margin-top: 26px; font-size: 13px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px;
}

/* ═══════ HUD QATLAMI ═══════ */
#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 10;
}
#hud > * { pointer-events: auto; }

/* ── Yuqori panel ── */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(4, 6, 15, .75), transparent);
}
.hud-btn {
  min-width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 17px; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color .15s, background .15s;
}
.hud-btn:hover { border-color: var(--border-hi); background: rgba(20, 27, 50, .9); }

.hud-title { flex: 1; min-width: 0; }
.hud-title-main { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.zone-badge {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 3px; font-size: 12.5px; color: var(--muted);
}
.zone-badge .loc {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: var(--zone-color, var(--accent));
  box-shadow: 0 0 8px var(--zone-color, var(--accent));
}

.hud-top-right { display: flex; align-items: center; gap: 9px; }
.streak-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; font-size: 13px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; backdrop-filter: blur(10px);
}

/* ── Minimal xarita ── */
.minimap-wrap {
  position: absolute; top: 78px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
#minimap { display: block; border-radius: 8px; }

/* ── XP ── */
.xp-wrap {
  position: absolute; left: 18px; bottom: 92px;
  width: min(300px, 70vw);
}
.xp-line { display: flex; align-items: center; gap: 10px; }
.level-badge {
  min-width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px; font-weight: 800; font-size: 17px; color: #fff;
  box-shadow: 0 6px 18px rgba(79, 110, 247, .35);
}
.xp-bar {
  flex: 1; height: 14px; border-radius: 100px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border);
  overflow: hidden;
}
.xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 100px;
  transition: width .4s ease;
}
.coins-badge { font-size: 14px; font-weight: 700; color: #f5c842; white-space: nowrap; }
.xp-text {
  margin-top: 5px; font-size: 11.5px; color: var(--muted);
  padding-left: 50px;
}

/* ── Joriy vazifa ── */
.quest-mini {
  position: absolute; left: 18px; top: 78px;
  display: flex; align-items: center; gap: 9px;
  max-width: min(360px, 80vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
}
.quest-mini-ic { font-size: 16px; }
#quest-mini-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Kontekst yordam ── */
.context-hint {
  position: absolute; bottom: 88px; left: 50%; transform: translateX(-50%);
  text-align: center;
  font-size: 13px; color: #fff;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px;
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .3s;
  white-space: nowrap;
}
.context-hint.show { opacity: 1; }
.context-hint b { color: var(--accent2); }

/* ── Pastki yordam (desktop) ── */
.hud-bottom {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 18px;
  font-size: 12px; color: rgba(232, 236, 255, .5);
}
.hud-bottom b { color: rgba(232, 236, 255, .85); }

/* ═══════ MOBIL BOSHQARUV ═══════ */
.mobile-controls {
  position: absolute; inset: 0;
  pointer-events: none;
  display: none;
}
#hud > .mobile-controls { pointer-events: none; }
.joy-zone {
  position: absolute; left: 22px; bottom: 26px;
  width: 148px; height: 148px;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  display: grid; place-items: center;
}
.joy-base {
  width: 112px; height: 112px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 1.5px solid rgba(255, 255, 255, .18);
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.joy-knob {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c8cff, #4f6ef7);
  box-shadow: 0 4px 14px rgba(79, 110, 247, .5);
  transform: translate(0, 0);
}
.interact-btn {
  position: absolute; right: 24px; bottom: 40px;
  width: 74px; height: 74px;
  border-radius: 50%;
  font-size: 28px;
  background: radial-gradient(circle, #8a9bff, #4f6ef7);
  border: 2px solid rgba(255, 255, 255, .25);
  color: #fff;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 110, 247, .5);
  display: grid; place-items: center;
  transition: transform .1s;
}
.interact-btn:active { transform: scale(.92); }

@media (pointer: coarse), (max-width: 860px) {
  .mobile-controls { display: block; }
  .hud-bottom { display: none; }
  .xp-wrap { bottom: 130px; }
  .minimap-wrap { display: none; }
}

/* ═══════ SUHBAT DIALOGI ═══════ */
.dialog {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.dialog-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.npc-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, #4f6ef7, #a78bfa);
}
.dialog-npc-info { flex: 1; min-width: 0; }
.dialog-npc-info b { display: block; font-size: 15px; }
.dialog-npc-info span { font-size: 12.5px; color: var(--muted); }
.dialog-head-right { display: flex; gap: 8px; }

.icon-btn {
  min-width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px; cursor: pointer;
  transition: border-color .15s;
}
.icon-btn:hover { border-color: var(--border-hi); }

.dialog-body {
  max-height: 38vh; min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  animation: msgIn .22s ease;
}
.msg.npc {
  align-self: flex-start;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #5f7bff);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg .msg-correction { display: block; margin-top: 6px; font-size: 12.5px; color: var(--green); }
.msg .msg-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.msg .msg-correct { color: var(--green); }
.msg .msg-bad { color: #f87171; }

@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.dialog-typing {
  padding: 2px 18px 10px;
  font-size: 13px; color: var(--muted);
}
.dialog-typing span::after {
  content: ''; animation: dots 1.2s infinite;
}
@keyframes dots {
  0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; }
}

.dialog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 14px 8px;
}
.dchip {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.dchip:hover {
  border-color: var(--accent2);
  background: rgba(167, 139, 250, .12);
  transform: translateY(-1px);
}

.dialog-input-row {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.dialog-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none;
}
.dialog-input-row input:focus { border-color: var(--accent); }
.mic-btn, .send-btn {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  font-size: 18px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.send-btn { background: var(--accent); border-color: transparent; }
.mic-btn.recording {
  background: #f87171;
  color: #fff;
  animation: pulse .9s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .5); }
  70% { box-shadow: 0 0 0 14px rgba(248, 113, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}
.dialog-mic-hint {
  padding: 8px 16px;
  font-size: 12.5px; color: #fca5a5;
  background: rgba(248, 113, 113, .08);
  border-top: 1px solid rgba(248, 113, 113, .2);
}

/* ═══════ SO'Z KARTASI ═══════ */
.vocab-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(420px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  padding: 26px;
  text-align: center;
}
.vocab-close { position: absolute; top: 12px; right: 12px; }
.vocab-word {
  font-size: 38px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.vocab-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.vocab-translation { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.vocab-example {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px; line-height: 1.55;
}
.vocab-example-en { color: var(--text); }
.vocab-example-tr { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.vocab-btns { display: flex; gap: 10px; margin-bottom: 12px; }
.vbtn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vbtn:hover { border-color: var(--border-hi); }
.vbtn.primary { background: var(--accent); border-color: transparent; }
.vbtn.primary:hover { background: #5f7bff; }
.vbtn.mic.recording { background: #f87171; }
.vocab-score {
  font-size: 14px; font-weight: 700;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
}
.vocab-score .score-big { font-size: 26px; display: block; }

/* ═══════ PANELLAR (quest/settings) ═══════ */
.panel {
  position: absolute; top: 70px; right: 16px;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 90px);
  display: flex; flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
  animation: panelIn .22s ease;
}
@keyframes panelIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head b { font-size: 15px; }
.panel-body { padding: 14px 16px; overflow-y: auto; }

.panel-stats {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.stat-chip {
  flex: 1; text-align: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
}
.stat-chip b { display: block; font-size: 16px; }
.stat-chip span { font-size: 11px; color: var(--muted); }

.quest-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.quest-item.done { opacity: .55; }
.quest-item .qic { font-size: 18px; flex-shrink: 0; }
.quest-item .qt { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.quest-item .qd { font-size: 12px; color: var(--muted); line-height: 1.45; }
.quest-item .qr { margin-top: 6px; font-size: 11.5px; color: #f5c842; }
.quest-item .qprog {
  height: 4px; border-radius: 100px; background: rgba(255, 255, 255, .08);
  margin-top: 7px; overflow: hidden;
}
.quest-item .qprog > div { height: 100%; background: var(--accent); border-radius: 100px; }

.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.set-row span { font-size: 13.5px; }
.set-row select {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; max-width: 190px;
}
.set-row input[type=range] { width: 140px; accent-color: var(--accent); }
.toggle {
  min-width: 52px; padding: 7px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 12px; font-weight: 800; cursor: pointer;
  transition: all .2s;
}
.toggle.on { background: var(--green); border-color: var(--green); color: #04281a; }
.set-note { margin-top: 12px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ═══════ LEVEL UP ═══════ */
.levelup-modal {
  position: absolute; inset: 0;
  z-index: 30;
  display: grid; place-items: center;
  background: rgba(4, 6, 15, .7);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.levelup-card {
  text-align: center;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 44px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.levelup-ic { font-size: 46px; margin-bottom: 8px; }
.levelup-card h2 { font-size: 22px; margin-bottom: 6px; }
.levelup-num {
  font-size: 58px; font-weight: 800;
  background: linear-gradient(120deg, #f5c842, #f97316);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

/* ═══════ TOAST ═══════ */
.toast {
  position: absolute; bottom: 96px; left: 50%; transform: translate(-50%, 20px);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: min(420px, 88vw);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(52, 211, 153, .5); }
.toast.bad { border-color: rgba(248, 113, 113, .5); }

/* ═══════ WORLD LABELLARI (CSS2D) ═══════ */
.lv-word-label {
  background: rgba(10, 14, 28, .82);
  border: 1px solid rgba(79, 110, 247, .5);
  border-radius: 8px;
  padding: 3px 9px;
  text-align: center;
  transform: translateY(-50%);
  white-space: nowrap;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
}
.lv-word-label span {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: #aab3d4;
  margin-top: 1px;
}
.lv-npc-label {
  background: rgba(10, 14, 28, .85);
  border: 1px solid rgba(167, 139, 250, .55);
  border-radius: 8px;
  padding: 4px 10px;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font);
  transform: translateY(-50%);
}
.lv-npc-label span {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: #b9a6e8;
}

/* Suhbat pufakchasi — NPC boshining ustida */
.lv-talk-bubble {
  position: relative;
  background: rgba(12, 16, 32, .9);
  border: 1px solid rgba(167, 139, 250, .6);
  border-radius: 12px;
  padding: 7px 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  font-family: var(--font);
  max-width: 230px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  animation: bubbleIn .25s ease;
}
.lv-talk-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(12, 16, 32, .9);
  border-bottom: 0;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(.95); }
  to { opacity: 1; transform: none; }
}

/* Dialog / vocab ochiq paytda mobil boshqaruvlarni yashirish */
body.ui-locked .mobile-controls { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 100px; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════ SHAHAR TANLASH ═══════ */
#city-select {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #2d382e, #121815 72%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#city-select.show { opacity: 1; pointer-events: auto; }

.city-select-inner { width: min(680px, 94vw); margin: auto; text-align: center; }

.setup-progress {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 26px;
}
.setup-dot {
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  opacity: .55;
  transition: opacity .2s, background .2s, border-color .2s, color .2s;
}
.setup-dot.on {
  opacity: 1;
  background: rgba(167, 139, 250, .14);
  border-color: var(--accent2);
  color: var(--accent2);
}

.city-select-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.city-select-title span { font-size: 26px; }
.city-select-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 12px;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.lang-card:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.lang-card.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px var(--accent2), 0 14px 36px rgba(167, 139, 250, .25);
}
.lang-card:focus-visible, .city-card:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.lang-card.selected .city-flag { transform: scale(1.12); }
.lang-card .city-name { font-size: 17px; margin-top: 8px; }
.lang-card .city-name-en { margin: 2px 0 0; }

.city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.city-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 16px;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.city-card:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.city-card.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px var(--accent2), 0 14px 36px rgba(167, 139, 250, .25);
}
.city-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.city-flag { font-size: 46px; line-height: 1; margin-bottom: 12px; }
.city-name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.city-name-en { color: var(--accent2); font-size: 13px; font-weight: 600; margin: 2px 0 8px; }
.city-desc { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.city-select-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12.5px;
  opacity: .85;
}

.setup-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}
.setup-btn {
  min-height: 46px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s, opacity .15s, background .15s;
}
.setup-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.setup-btn.ghost:hover { border-color: var(--border-hi); color: var(--text); }
.setup-btn.primary {
  background: linear-gradient(135deg, var(--accent2), #7c6cf0);
  border: none;
  color: #fff;
}
.setup-btn.primary:hover { transform: translateY(-2px); }
.setup-btn.primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 620px) {
  .city-grid { grid-template-columns: 1fr; gap: 12px; }
  .city-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; }
  .city-flag { font-size: 34px; margin: 0; }
  .city-name-en, .city-desc { display: none; }
  .city-card.selected::after { position: static; margin-left: auto; flex: 0 0 22px; }
  .city-select-title { font-size: 24px; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lang-card { padding: 16px 10px; }
  .lang-card .city-flag { font-size: 30px; margin: 0; }
}
