/* Шаңырақ — ортақ стильдер. Түстер: аспан көк, алтын, киіз ақ, кілем қызыл, ағаш қоңыр. */
:root {
  --sky: #00afca;
  --sky-deep: #0b7d97;
  --gold: #fec50c;
  --gold-deep: #c9930a;
  --felt: #f7eedd;
  --felt-2: #efe2c8;
  --line: #e2cfa8;
  --red: #b5262e;
  --wood: #8b5a2b;
  --ink: #2b1d12;
  --ink-2: #6b5440;
  --green: #2e7d4f;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(43, 29, 18, 0.2);
  --glass: rgba(255, 253, 248, 0.88);
  --hair: rgba(43, 29, 18, 0.1);
  --soft: 0 6px 20px rgba(43, 29, 18, 0.14);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* қошқар мүйіз оюы */
  --oyu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16' viewBox='0 0 48 16'%3E%3Cg fill='none' stroke='%23fec50c' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M0 14.5H48M24 14.5V9C24 3 15 1 13 6c-1.5 3.5 3 5.5 4.5 3M24 9c0-6 9-8 11-3 1.5 3.5-3 5.5-4.5 3'/%3E%3Cpath d='M2 6l2.5 2.5L2 11M46 6l-2.5 2.5L46 11'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--felt);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sky-deep); }
h1, h2, h3, h4 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); font-size: 0.86em; }

.ornament-band {
  height: 16px;
  background: var(--oyu) repeat-x center / auto 14px, var(--red);
}

/* ─── Батырмалар және өрістер ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 14px/1.1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { background: #fff; border-color: rgba(43, 29, 18, 0.14); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field small { font-weight: 500; color: var(--ink-2); font-size: 12px; }
.field legend { padding: 0; margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffaf0;
  font: 500 15px var(--font);
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(0, 175, 202, 0.2); }
.form-error { color: var(--danger); font-weight: 600; font-size: 14px; min-height: 1.2em; margin: 0; }

.card {
  background: var(--felt);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.badge-green { background: #dff1e5; color: var(--green); }
.badge-red { background: #fbe0dc; color: var(--danger); }
.badge-gold { background: #fff1c2; color: #8a6400; margin-left: 8px; }
.badge-soon { background: #e3f5f8; color: var(--sky-deep); margin-top: 4px; }

.dot-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ccf6e;
  margin: 0 4px 1px 6px;
  box-shadow: 0 0 0 2px rgba(60, 207, 110, 0.25);
}

/* ─── Хабарламалар және диалогтар ─────────────────────────────────────── */
.toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 60;
  width: min(460px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  background: rgba(43, 29, 18, 0.92);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--sky);
  animation: toast-in 0.25s ease;
  transition: opacity 0.4s, transform 0.4s;
}
.toast-success { border-left-color: var(--gold); }
.toast-warn { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}
.modal-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fffdf8;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--hair);
}
.modal-card::before { content: ''; display: block; height: 4px; background: linear-gradient(90deg, var(--sky), var(--gold)); }
.modal-card > * { padding: 16px 20px 20px; }
.dialog, .wardrobe { display: grid; gap: 12px; }
.dialog p, .wardrobe p { margin: 0; line-height: 1.45; }
.dialog-icon { font-size: 40px; line-height: 1; }
.warn { background: #fbe9e5; color: #8f2a1f; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ─── Кіру беті ───────────────────────────────────────────────────────── */
.auth-page { min-height: 100%; overflow-x: hidden; background: #2c3e7a; }
.sky {
  position: fixed;
  inset: 0;
  background: linear-gradient(#22346e 0%, #5a4c97 32%, #e9845c 66%, #fdbf7e 82%, #fdd79c 100%);
}
.sun {
  position: absolute;
  left: 50%;
  bottom: 24%;
  width: 180px;
  height: 180px;
  margin-left: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #fec50c 55%, rgba(254, 197, 12, 0) 72%);
}
.steppe { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 38vh; }
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: center;
  gap: 48px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px;
}
.brand { color: #fffaf0; text-shadow: 0 2px 12px rgba(20, 10, 40, 0.35); }
.brand-logo { width: 96px; height: 96px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3)); }
.brand h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: 0.06em; margin: 12px 0 8px; color: var(--gold); }
.brand-lead { font-size: 19px; font-weight: 600; line-height: 1.45; margin: 0 0 22px; max-width: 30ch; }
.brand-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-weight: 600; }
.brand-points li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.brand-points span { font-size: 20px; line-height: 1.2; }
.auth-card { background: var(--felt); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 22px 0; gap: 6px; }
.tab {
  border: 0;
  background: transparent;
  padding: 10px;
  font: 700 16px var(--font);
  color: var(--ink-2);
  border-bottom: 3px solid var(--line);
  cursor: pointer;
}
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.form { display: grid; gap: 14px; padding: 20px 22px 24px; }
.form-foot { margin: 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.tamga-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tamga-opt {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fffaf0;
  color: var(--wood);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
}
.tamga-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tamga-opt:has(input:checked) { border-color: var(--gold-deep); background: #fff1c2; color: var(--ink); }
.tamga-opt:has(input:focus-visible) { outline: 3px solid var(--sky); }
.raising {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(20, 16, 40, 0.75);
  color: #fffaf0;
  font-weight: 700;
  font-size: 18px;
}
.spin { width: 110px; height: 110px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Қала беті (3D) ──────────────────────────────────────────────────── */
.city-page { overflow: hidden; background: #cfe8ef; touch-action: none; user-select: none; -webkit-user-select: none; }
#city { position: fixed; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
#city.dragging { cursor: grabbing; }
/* Сурет шеті сәл күңгірт: көз ортаға түседі. HDR жолында мұны шейдер жасайды, қарапайым жолда — осы қабат. */
body.gfx-flat.city-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at center, transparent 58%, rgba(8, 14, 24, 0.22) 100%); }
/* Экранның әр бұрышында бір ғана нәрсе: профиль, баланс, чат, қалта мен карта. */
.hud-top {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 10;
}
.hud-top > * { pointer-events: auto; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.me-pill, .icon-btn, .balance {
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: var(--soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
}
.me-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 18px 4px 4px;
  border-radius: 999px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  max-width: min(240px, 58vw);
  transition: background 0.15s ease;
}
.me-pill:hover, .icon-btn:hover { background: #fff; }
.me-ring {
  width: 42px;
  height: 42px;
  flex: none;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--gold-deep) var(--growth, 0%), rgba(43, 29, 18, 0.12) 0);
}
.me-avatar { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #2b1d12; }
.me-text { display: grid; min-width: 0; line-height: 1.25; }
.me-text b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--ink-2); }
.me-text small.is-hungry { color: var(--danger); font-weight: 600; }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}
.icon-btn:focus-visible, .me-pill:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.balance {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  font-size: 15px;
}
.balance b { font-weight: 700; font-variant-numeric: tabular-nums; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe88a, var(--gold) 55%, var(--gold-deep)); box-shadow: inset 0 0 0 1px rgba(139, 90, 43, 0.4); }
.balance.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.1); } }
.pip {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px #fffdf8;
  font-size: 0;
}
.bar { position: relative; display: block; height: 8px; border-radius: 99px; background: rgba(43, 29, 18, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width 0.4s ease; }
.bar-food i { background: var(--gold-deep); }
/* Қалта: төменгі ортада ұяшықтар қатары. */
.hotbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: var(--soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 7;
}
.hb-slot { position: relative; width: 50px; height: 50px; padding: 4px; border: 1px solid var(--hair); border-radius: 12px; background: #fff; cursor: pointer; transition: transform 0.12s ease; }
.hb-slot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hb-slot em { position: absolute; left: 4px; top: 2px; font: 700 10px var(--font); font-style: normal; color: var(--ink-2); }
button.hb-slot:hover { transform: translateY(-2px); }
.hb-slot.is-held { box-shadow: 0 0 0 2px var(--gold); border-color: var(--gold-deep); background: #fff8e3; }
.hb-slot.is-empty { background: rgba(255, 255, 255, 0.35); border-style: dashed; cursor: default; }
.hb-more { display: grid; place-items: center; width: 36px; height: 50px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; }
.hb-more:hover { background: rgba(43, 29, 18, 0.06); color: var(--ink); }
.car-btn { position: fixed; right: 158px; bottom: 16px; z-index: 6; }
/* Секіру батырмасы тек телефонда: компьютерде Space пернесі бар. */
.jump-btn { position: fixed; right: 124px; bottom: 14px; z-index: 6; display: none; font-size: 17px; font-weight: 800; color: var(--ink); }
body.touch.has-hero .jump-btn:not(.hidden) { display: grid; place-items: center; }
body.touch.indoors .jump-btn, body.in-mafia .jump-btn { display: none !important; }
/* төбелес пен анимация батырмалары: секіру батырмасының үстінде */
.fight-btn, .emote-btn { position: fixed; right: 124px; z-index: 6; display: grid; place-items: center; font-size: 22px; }
.fight-btn { bottom: 152px; }
.emote-btn { bottom: 206px; }
.fight-btn.hidden, .emote-btn.hidden, body:not(.has-hero) .fight-btn, body:not(.has-hero) .emote-btn,
body.indoors .fight-btn, body.indoors .emote-btn, body.in-mafia .fight-btn, body.in-mafia .emote-btn { display: none !important; }
.fight-btn.is-on { box-shadow: 0 0 0 3px #e0533d inset; }
.emote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.emote-grid .btn { justify-content: flex-start; min-height: 44px; }

.hint {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  background: rgba(43, 29, 18, 0.72);
  color: #fffaf0;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 13px;
  z-index: 5;
  pointer-events: none;
  max-width: min(560px, calc(100% - 24px));
  text-align: center;
  transition: opacity 0.5s ease;
}
.hint.faded { opacity: 0; }
.hint.pulse { animation: pulse 0.9s ease; }
@keyframes pulse { 30% { transform: translateX(-50%) scale(1.08); background: var(--gold-deep); } }

.chat {
  position: fixed;
  left: 14px;
  bottom: 72px;
  width: min(340px, calc(100% - 24px));
  z-index: 6;
  display: grid;
  gap: 6px;
}
.chat-log {
  max-height: 140px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  align-content: end;
  mask-image: linear-gradient(transparent, #000 30%);
  -webkit-mask-image: linear-gradient(transparent, #000 30%);
  scrollbar-width: none;
}
.chat-line {
  justify-self: start;
  background: rgba(43, 29, 18, 0.62);
  color: #fff;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.chat-line b { color: #ffe08a; }
.chat-line.is-me b { color: var(--gold); }
.chat-line.is-admin { background: rgba(31, 111, 178, 0.8); }
.chat form { display: none; }
body.chatting .chat form { display: block; }
.chat input { background: #fffdf8; border: 1px solid var(--hair); border-radius: 14px; padding: 11px 14px; font-size: 15px; box-shadow: var(--soft); }

.chat-btn { position: fixed; left: 14px; bottom: 16px; z-index: 6; }

.joystick {
  display: none;
  position: fixed;
  left: max(22px, env(safe-area-inset-left));
  bottom: max(26px, env(safe-area-inset-bottom));
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 240, 0.25), rgba(43, 29, 18, 0.28));
  border: 3px solid rgba(255, 250, 240, 0.75);
  box-shadow: var(--shadow), inset 0 0 0 10px rgba(254, 197, 12, 0.18);
  z-index: 7;
  touch-action: none;
}
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6d6, #fec50c 60%, #c9930a);
  border: 3px solid #fffaf0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease;
  pointer-events: none;
}
.joystick.on .joy-knob { transition: none; }

#minimap {
  cursor: pointer;
  pointer-events: auto;
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 3px solid #fffdf8;
  box-shadow: var(--soft);
  z-index: 6;
  cursor: pointer;
  background: #8fb85c;
}

/* Телефонда: джойстик сол жақта, чат пен қалта картаның жанында */
body.touch #minimap { width: 100px; height: 100px; }
body.touch.has-hero .joystick { display: block; }
body.touch .chat-btn { left: 14px; top: calc(max(14px, env(safe-area-inset-top)) + 58px); bottom: auto; }
body.touch .hotbar { left: auto; right: 14px; bottom: calc(var(--mini-size, 100px) + 24px); transform: none; flex-direction: column; padding: 5px; gap: 5px; }
body.touch .hb-slot { width: 44px; height: 44px; }
body.touch .hb-more { width: 44px; height: 30px; }
body.touch .car-btn { right: 124px; bottom: 14px; }
body.touch .chat { bottom: auto; top: 128px; width: min(260px, calc(100% - 90px)); }
body.touch.chatting .chat { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); z-index: 30; }
body.touch.chatting .joystick, body.touch.chatting .chat-btn, body.touch.chatting .hotbar { display: none; }
body.touch .hint { bottom: auto; top: 74px; }
body.touch.has-hero .hint { opacity: 0.85; }
body.touch.has-hero .hint.faded { opacity: 0; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  width: min(400px, calc(100% - 24px));
  background: var(--felt);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  z-index: 20;
  animation: sheet-in 0.2s ease;
}
.sheet::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  border-radius: 16px 16px 0 0;
  background: var(--oyu) repeat-x center / auto 9px, var(--red);
}
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.sheet h3 { font-size: 17px; }
.sheet p { margin: 8px 0 0; line-height: 1.45; font-size: 14px; }
.sheet-close {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--felt-2);
  cursor: pointer;
  font-size: 14px;
}
.sheet-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; margin-top: 4px; }
.sheet-tamga, .sheet-icon {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--red);
  font-size: 26px;
}
.sheet-line { color: var(--ink-2); }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Тамақ, тапсырмалар */
.panel { display: grid; gap: 12px; }
.panel p { margin: 0; line-height: 1.45; }
.life-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.life-stat { background: #fffaf0; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 3px; }
.life-stat span { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.life-stat b { font-size: 15px; }
.food-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.food {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffaf0;
  font: 600 13px var(--font);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.food:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold-deep); }
.food:disabled { opacity: 0.45; cursor: not-allowed; }
.food-icon { font-size: 32px; line-height: 1.1; }
.food-price { font-weight: 800; color: #8a6400; }
.food-gain { font-size: 11px; color: var(--green); text-align: center; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.task-list li { display: flex; gap: 10px; align-items: center; background: #fffaf0; border: 2px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.task-list li.done { border-color: #9fd3b0; background: #f1faf3; }
.task-icon { font-size: 24px; flex: none; }
.task-body { display: grid; gap: 4px; flex: 1; min-width: 0; }
.task-body b { font-size: 14px; }
.task-body .muted { font-size: 12px; }

.wardrobe h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); margin: 4px 0 6px; }
.wardrobe-body { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; }
.wardrobe-preview {
  width: 170px;
  height: 210px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #fffaf0, var(--felt-2));
  border: 2px solid var(--line);
}
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  border: 2px solid var(--line);
  background: #fffaf0;
  border-radius: 10px;
  padding: 6px 9px;
  font: 600 13px var(--font);
  color: var(--ink);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.opt.on { border-color: var(--gold-deep); background: #fff1c2; }
.swatch { width: 20px; height: 20px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }

/* Сәбидің туылуы */
.birth {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #3a3f8f 0%, #1c1d4a 70%);
  animation: fade-in 0.6s ease;
}
.birth.out { animation: fade-out 0.5s ease forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.birth-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 70%, #fff, transparent),
    radial-gradient(2px 2px at 55% 15%, #ffe9a8, transparent), radial-gradient(1.5px 1.5px at 75% 40%, #fff, transparent),
    radial-gradient(2px 2px at 88% 80%, #fff, transparent), radial-gradient(1.5px 1.5px at 20% 90%, #ffe9a8, transparent),
    radial-gradient(2px 2px at 65% 85%, #fff, transparent), radial-gradient(1.5px 1.5px at 42% 38%, #fff, transparent);
  animation: twinkle 3s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: 0.5; } }
.birth-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--felt);
  border-radius: 22px;
  overflow: hidden;
  text-align: center;
  padding-bottom: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: rise 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 1;
}
@keyframes rise { from { transform: translateY(40px) scale(0.92); opacity: 0; } }
.birth-cradle {
  width: 112px;
  height: 112px;
  margin: 22px auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: radial-gradient(circle at 50% 40%, #fff6d6, #fec50c);
  box-shadow: 0 0 0 6px rgba(254, 197, 12, 0.35), 0 0 40px rgba(254, 197, 12, 0.6);
}
.birth-cradle span { display: block; animation: rock 1.6s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes rock { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
.birth-title { margin: 6px 22px 12px; font-size: clamp(20px, 5vw, 26px); line-height: 1.3; min-height: 2.6em; color: var(--ink); }
.birth-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 18px 12px; }
.birth-chips span { background: #fffaf0; border: 2px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.birth-card .muted { display: block; margin: 0 24px 16px; line-height: 1.45; }
.confetti {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(60, 40, 20, 0.75), rgba(20, 12, 4, 0.92));
}
.overlay-card {
  width: min(440px, 100%);
  background: var(--felt);
  border-radius: 20px;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow);
  padding-bottom: 24px;
}
.overlay-icon { font-size: 64px; margin-top: 20px; }
.overlay-card h2 { margin: 8px 20px 10px; font-size: 22px; }
.overlay-card p { margin: 0 24px 18px; line-height: 1.5; color: var(--ink-2); }

/* ─── Әкімдік панелі ──────────────────────────────────────────────────── */
.admin-page {
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 175, 202, 0.12), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(254, 197, 12, 0.14), transparent 40%),
    var(--felt-2);
}
.admin-head { background: var(--ink); color: #fffaf0; position: sticky; top: 0; z-index: 10; }
.admin-head-inner { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.admin-brand img { width: 44px; height: 44px; }
.admin-brand b { display: block; font-size: 18px; color: var(--gold); }
.admin-brand span { font-size: 13px; opacity: 0.8; }
.admin-head-actions { display: flex; gap: 8px; }
.admin-main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: #fffaf0;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}
.stat-icon { grid-row: span 2; font-size: 26px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stat b { font-size: 26px; line-height: 1.1; }
.stat span:last-child { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat-sky .stat-icon { background: #e3f5f8; }
.stat-gold .stat-icon { background: #fff1c2; }
.stat-green .stat-icon { background: #dff1e5; }
.stat-red .stat-icon { background: #fbe0dc; }
.admin-card { padding: 18px; }
.admin-card h2 { font-size: 18px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-right input { width: 260px; padding: 9px 12px; font-size: 14px; }
.seg { display: inline-flex; background: var(--felt-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button.active { background: #fffaf0; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.table-wrap { overflow-x: auto; }
.residents { width: 100%; border-collapse: collapse; font-size: 14px; }
.residents th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.residents td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.residents tr.is-blocked td { background: rgba(192, 57, 43, 0.04); }
.td-action { text-align: right; }
.who { display: flex; gap: 10px; align-items: center; }
.who b { display: block; }
.who-tamga { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--red); display: grid; place-items: center; }
.reason { font-size: 12px; color: var(--ink-2); margin-top: 4px; max-width: 240px; }
.empty { text-align: center; color: var(--ink-2); padding: 20px; margin: 0; }
.log { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.log li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.log time { display: block; }
.log-icon { font-size: 18px; }

/* ─── Шағын экрандар ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px 40px; }
  .brand { text-align: center; }
  .brand-lead { margin-inline: auto; }
  .brand-points { display: none; }
  .brand-logo { width: 72px; height: 72px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .residents thead { display: none; }
  .residents, .residents tbody, .residents tr, .residents td { display: block; width: 100%; }
  .residents tr { border-bottom: 2px solid var(--line); padding: 8px 0; }
  .residents td { border: 0; padding: 4px 4px; }
  .residents td[data-label]:not(:first-child)::before { content: attr(data-label) ': '; font-weight: 600; color: var(--ink-2); font-size: 12px; }
  .td-action { text-align: left; }
  .toolbar-right input { width: 100%; }
  .toolbar-right { width: 100%; }
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .tamga-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .sheet { bottom: max(12px, env(safe-area-inset-bottom)); }
  .food-grid { grid-template-columns: repeat(2, 1fr); }
  .life-head { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .life-stat { padding: 6px 8px; }
  .life-stat b { font-size: 13px; }
  .wardrobe-body { grid-template-columns: 1fr; justify-items: center; }
  .admin-head-actions .btn { padding: 8px 12px; font-size: 13px; }
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ─── Ғимараттың ішіндегі әрекеттер тақтасы ───────────────────────────── */
.place-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: calc(100% - 170px);
  background: var(--glass);
  border: 1px solid var(--hair);
  border-radius: 18px;
  box-shadow: var(--soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 8px 8px 8px 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 14px;
}
.place-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.place-actions { display: flex; gap: 4px; flex: none; }
.place-actions .btn { padding: 9px 12px; font-size: 13px; }
.place-actions .btn-ghost { background: transparent; border-color: transparent; }
.place-actions .btn-ghost:hover { background: rgba(43, 29, 18, 0.06); }
body.indoors #minimap, body.indoors .hint { display: none; }
body.indoors .chat { bottom: 72px; }
body.indoors:not(.touch) .hotbar { bottom: 78px; }
body.indoors.touch .hotbar { bottom: 110px; }
.job-chip {
  position: fixed;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  background: var(--glass);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--soft);
  z-index: 11;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: calc(100% - 24px);
}
.job-chip button { border: 0; background: rgba(43, 29, 18, 0.12); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }

/* ─── Дүкен, базар, жұмыс ─────────────────────────────────────────────── */
.balance-line { background: #fff6d6; border: 2px solid #f0d27a; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.shop-item { display: grid; justify-items: center; gap: 4px; text-align: center; background: #fffaf0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 8px; font-size: 13px; }
.shop-item.owned { border-color: #9fd3b0; background: #f1faf3; }
.shop-icon { font-size: 30px; }
.lot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.lot-list li { background: #fffaf0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.lot-head { display: flex; gap: 10px; align-items: center; }
.lot-icon { font-size: 28px; width: 40px; text-align: center; }
.lot-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.lot-time { font-weight: 700; color: var(--danger); }
.bid-row { display: flex; gap: 8px; }
.bid-input { max-width: 120px; padding: 7px 10px; }
.sell-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.sell-form select, .panel select { width: 100%; padding: 9px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fffaf0; font: 500 14px var(--font); }
.sell-form .btn { grid-column: span 2; }
.empty-note { text-align: center; padding: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.check input { width: 20px; height: 20px; }
.quiz-q { font-size: 17px; font-weight: 700; line-height: 1.4; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fffaf0; font: 600 15px var(--font); cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--gold-deep); }
.quiz-opt.right { border-color: var(--green); background: #dff1e5; }
.quiz-opt.wrong { border-color: var(--danger); background: #fbe0dc; }

/* ─── Ойындар ─────────────────────────────────────────────────────────── */
.game-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.game-timer { margin-left: auto; font-weight: 800; color: var(--danger); }
.game-log { max-height: 180px; overflow-y: auto; background: #1f1712; color: #f4ead6; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; display: grid; gap: 2px; }
.game-chat { display: flex; gap: 8px; }
.waiting { text-align: center; font-weight: 700; padding: 18px; }
.togyz-status { font-weight: 800; text-align: center; }
.board { display: grid; gap: 8px; background: linear-gradient(180deg, #b47838, #8b5a2b); border-radius: 16px; padding: 10px; border: 3px solid #6b3a1a; }
.board .row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.kazan { display: flex; justify-content: space-between; align-items: center; background: rgba(43, 29, 18, 0.45); color: #fff6d6; border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.kazan b { font-size: 20px; color: var(--gold); }
.hole { position: relative; display: grid; justify-items: center; gap: 2px; padding: 4px 0 6px; border-radius: 12px; border: 2px solid rgba(43, 29, 18, 0.4); background: #f3dfb8; font: 700 13px var(--font); color: var(--ink); cursor: default; min-height: 74px; }
.hole.can { cursor: pointer; background: #fff1c2; border-color: var(--gold-deep); }
.hole.can:hover { transform: translateY(-2px); }
.hole.last { box-shadow: 0 0 0 3px #00afca; }
.hole.tuzdyk { background: #3a2414; color: var(--gold); }
.hole-n { font-size: 10px; color: var(--ink-2); }
.hole.tuzdyk .hole-n { color: #c9a; }
.balls { display: grid; grid-template-columns: repeat(3, 7px); gap: 2px; min-height: 22px; }
.balls i { width: 7px; height: 7px; border-radius: 50%; background: #fffaf0; box-shadow: inset -1px -1px 0 rgba(0, 0, 0, 0.25); }
@media (max-width: 640px) {
  .place-bar { display: grid; gap: 4px; max-width: none; width: calc(100% - 24px); bottom: max(10px, env(safe-area-inset-bottom)); padding: 8px; }
  .place-title { text-align: center; }
  .place-actions { flex-wrap: wrap; justify-content: center; }
  body.touch.indoors .joystick { bottom: 120px; }
  body.indoors:not(.touch) .chat-btn { bottom: 150px; }
  .sell-form { grid-template-columns: 1fr; }
  .sell-form .btn { grid-column: auto; }
  .hole { min-height: 62px; font-size: 12px; }
  .balls { grid-template-columns: repeat(3, 5px); }
  .balls i { width: 5px; height: 5px; }
}
.jail-chip {
  position: fixed;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  background: #2b2d31;
  color: #fffaf0;
  border: 2px solid #8a9097;
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 800;
  font-size: 14px;
  z-index: 13;
  box-shadow: var(--shadow);
}
.chat-line.kind-me, .chat-line.kind-do, .chat-line.kind-try { background: rgba(106, 61, 154, 0.75); font-style: italic; }
.chat-line.kind-b, .chat-line.kind-ooc { background: rgba(80, 80, 80, 0.7); color: #e6e6e6; }
.chat-line.kind-s { font-weight: 800; }
.chat-line.kind-w { opacity: 0.8; font-style: italic; }
.chat-line.kind-f { background: rgba(31, 63, 143, 0.8); }
.chat-line.kind-news, .chat-line.kind-gov { background: rgba(160, 48, 122, 0.85); font-weight: 700; }
.chat-line.kind-sys { background: rgba(43, 29, 18, 0.85); color: #fec50c; }

/* ─── Құжаттар мен ереже ──────────────────────────────────────────────── */
.passport { border-radius: 14px; overflow: hidden; border: 1px solid var(--hair); background: #fff; }
.pass-head { display: flex; gap: 10px; align-items: center; background: #123f50; color: #fffaf0; padding: 10px 14px; }
.pass-head img { width: 30px; height: 30px; }
.pass-head b { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.pass-head span { font-size: 11px; opacity: 0.8; }
.pass-body { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px; }
.pass-photo { width: 76px; height: 96px; border-radius: 8px; background: #2b1d12; display: grid; place-items: center; }
.pass-rows { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
.pass-row { display: flex; justify-content: space-between; gap: 10px; }
.pass-row span { color: var(--ink-2); flex: none; }
.pass-row b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.rule-list li { display: grid; gap: 2px; background: #fffaf0; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.rule-list b { color: var(--red); }
.panel h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); margin: 4px 0 -4px; }

/* ─── Панельдер: тақырып, тізім, қалта ────────────────────────────────── */
.panel-head { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.panel-head h3 { flex: 1; font-size: 17px; font-weight: 700; }
.icon-plain { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-plain:hover { background: rgba(43, 29, 18, 0.06); color: var(--ink); }
.profile-id { display: flex; align-items: center; gap: 12px; }
.profile-id .me-avatar { width: 52px; height: 52px; flex: none; }
.profile-who { display: grid; min-width: 0; line-height: 1.3; }
.profile-who b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.profile-who small { font-size: 13px; color: var(--ink-2); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.meter { display: grid; gap: 5px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.meter-top b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter .bar { height: 6px; }
.menu-list { border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; background: #fff; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.menu-row + .menu-row { border-top: 1px solid rgba(43, 29, 18, 0.07); }
.menu-row:hover { background: rgba(43, 29, 18, 0.03); }
.menu-row:focus-visible { outline: 2px solid var(--sky); outline-offset: -2px; }
.menu-row:disabled { opacity: 0.55; cursor: not-allowed; }
.menu-row > svg { flex: none; color: rgba(43, 29, 18, 0.35); }
.menu-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #f6efe2; }
.menu-thumb { width: 38px; height: 38px; flex: none; object-fit: contain; }
.menu-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.menu-text b { font-size: 14px; font-weight: 600; }
.menu-text small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-row.is-danger { color: var(--danger); }
.menu-row.is-danger .menu-ic { background: #fbe9e5; }
.menu-state { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.menu-row.is-on .menu-state { color: var(--green); }
.profile-foot { font-size: 12px; color: var(--ink-2); text-align: center; }
.pocket-status { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.pocket-status b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pocket-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slot-cell { display: grid; gap: 4px; min-width: 0; }
.slot-cell span { font-size: 11px; text-align: center; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot { aspect-ratio: 1; width: 100%; padding: 6px; border-radius: 14px; border: 1px solid var(--hair); background: #fff; cursor: pointer; }
.slot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.slot:hover { border-color: rgba(43, 29, 18, 0.28); }
.slot:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.slot.is-held { border-color: var(--gold-deep); box-shadow: 0 0 0 2px var(--gold); }
.slot.is-empty { background: transparent; border-style: dashed; cursor: default; }
.shop-thumb { width: 64px; height: 64px; object-fit: contain; }
.dialog select, .bid-row select, .sheet select { width: 100%; padding: 9px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fffaf0; font: 500 14px var(--font); }
.sheet { max-height: calc(100vh - 90px); overflow-y: auto; }
.who-job { display: block; }
@media (max-width: 640px) {
  .modal-card > .togyz { padding: 14px 8px 14px; }
  .board { padding: 6px; }
  .board .row { gap: 3px; }
}

/* ─── Мафия ауылы ─────────────────────────────────────────────────────── */
body.in-mafia .hud-right, body.in-mafia .hotbar, body.in-mafia .hint, body.in-mafia .job-chip { display: none; }
.menu-row.is-static { cursor: default; }
.menu-row.is-static:hover { background: none; }
.menu-text.wrap small { white-space: normal; }
.mf { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.mf > * { pointer-events: auto; }
.mf-top {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 8px 0 16px;
  border-radius: 999px;
  background: rgba(16, 14, 26, 0.78);
  color: #fffaf0;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 14px;
  white-space: nowrap;
}
.mf-top b { font-weight: 700; }
.mf-time { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 700; font-variant-numeric: tabular-nums; }
.mf-role {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 6px);
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: var(--soft);
  font-size: 13px;
  font-weight: 600;
}
.mf-role.role-mafia, .menu-ic.role-mafia { background: #2b1d12; color: #ffd9d9; }
.mf-role.is-dead { opacity: 0.7; }
.menu-ic.role-doctor { background: #e3f4ea; color: var(--green); }
.menu-ic.role-komissar { background: #e3eef8; color: #1f6fb2; }
.menu-ic.role-guard { background: #fff3d6; color: var(--gold-deep); }
.mf-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(620px, calc(100% - 150px));
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(16, 14, 26, 0.78);
  color: #fffaf0;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: center;
}
.mf-bar p { margin: 0; font-size: 14px; font-weight: 500; }
.mf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.mf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: inherit; font: 600 13px var(--font); cursor: pointer; }
.mf-chip:hover { background: rgba(255, 255, 255, 0.16); }
.mf-chip:disabled { opacity: 0.45; cursor: default; }
.mf-chip.is-on { background: var(--gold); border-color: var(--gold); color: var(--ink); opacity: 1; }
.mf-chip.is-going { border-color: var(--gold); }
.mf-chip em { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-style: normal; font-size: 11px; }
.mf-sleep {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: radial-gradient(circle at 50% 38%, #18224e, #070a1c 70%);
  color: #e8ecff;
  text-align: center;
  z-index: -1;
}
.mf-sleep h2 { font-size: 26px; font-weight: 700; }
.mf-sleep p { margin: 0; opacity: 0.7; font-size: 14px; }
.mf-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 14px 22px;
  border-radius: 16px;
  background: rgba(16, 14, 26, 0.84);
  color: #fffaf0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  animation: mf-in 0.5s ease;
  pointer-events: none;
}
.mf-banner.tone-death { background: rgba(92, 16, 22, 0.92); }
.mf-banner.tone-life { background: rgba(22, 84, 52, 0.92); }
@keyframes mf-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.mf-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 32px));
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 24px;
  border-radius: 22px;
  background: rgba(16, 14, 26, 0.92);
  color: #fffaf0;
  text-align: center;
  box-shadow: var(--shadow);
  animation: mf-card 0.5s ease;
}
@keyframes mf-card { from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); } }
.mf-card small { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.65; }
.mf-card h2 { font-size: 28px; font-weight: 800; }
.mf-card p { margin: 0; font-size: 14px; line-height: 1.45; opacity: 0.85; }
.mf-card .mf-team { color: var(--gold); opacity: 1; font-weight: 600; }
.mf-emblem { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--gold); }
.mf-card.role-mafia .mf-emblem { color: #ff6b6b; }
.mf-card.role-doctor .mf-emblem { color: #6fd39a; }
.mf-card.role-komissar .mf-emblem { color: #7fc1ff; }
.mf-card.win-mafia h2 { color: #ff8a8a; }
.mf-card.win-town h2 { color: var(--gold); }
.mf-list { list-style: none; width: 100%; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.mf-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.mf-list li.is-dead span { opacity: 0.55; text-decoration: line-through; }
.mf-list b { font-weight: 600; color: var(--gold); }
body.in-mafia .chat-btn { z-index: 11; }
body.in-mafia .chat { bottom: 72px; z-index: 10; }
body.in-mafia .toasts { top: 72px; }
@media (max-width: 640px) {
  .mf-top { left: auto; right: 14px; transform: none; }
  .mf-bar { bottom: 10px; width: calc(100% - 24px); }
  .mf-role { top: calc(max(14px, env(safe-area-inset-top)) + 54px); }
  body.in-mafia .me-pill { max-width: 54vw; }
  body.in-mafia .toasts { top: 122px; }
  body.touch.in-mafia .joystick { bottom: 150px; }
  body.in-mafia .chat-btn, body.touch.in-mafia .chat-btn { left: auto; right: 14px; bottom: 150px; }
  body.in-mafia .chat { bottom: 150px; width: calc(100% - 90px); }
  body.touch.in-mafia .chat { top: 122px; bottom: auto; }
}

/* ─── Дурак ───────────────────────────────────────────────────────────── */
.modal-card.is-wide { width: min(760px, 100%); }
.dk-new { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.durak { gap: 10px; }
.dk-head { display: flex; align-items: flex-start; gap: 12px; }
.dk-deck { display: grid; justify-items: center; gap: 2px; flex: none; font-size: 11px; color: var(--ink-2); }
.dk-deck b { font-size: 12px; color: var(--ink); }
.dk-deck b.is-red { color: #c0392b; }
.dk-deck .cd { width: 40px; height: 56px; font-size: 12px; }
.dk-seats { display: flex; gap: 8px; flex: 1; min-width: 0; justify-content: center; flex-wrap: wrap; }
.dk-seat { display: grid; justify-items: center; gap: 2px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--hair); font-size: 12px; background: #fff; min-width: 96px; }
.dk-seat b { font-size: 12px; font-weight: 600; }
.dk-seat span { color: var(--ink-2); font-size: 11px; }
.dk-seat.is-att { box-shadow: 0 0 0 2px var(--gold); }
.dk-seat.is-def { box-shadow: 0 0 0 2px #1f6fb2; }
.dk-seat.is-out { opacity: 0.5; }
.dk-fan { display: flex; height: 26px; margin-top: 2px; }
.dk-fan .cd { width: 18px; height: 26px; margin-left: -9px; border-radius: 3px; }
.dk-fan .cd:first-child { margin-left: 0; }
.dk-table { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px 18px; min-height: 176px; padding: 14px; border-radius: 16px; background: radial-gradient(circle at 50% 40%, #2f7a56, #1d5a3f); }
.dk-empty { margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 13px; }
.dk-pair { position: relative; width: 66px; height: 92px; }
.dk-over { position: absolute; left: 16px; top: 14px; }
.cd { position: relative; display: grid; align-content: center; justify-items: center; width: 62px; height: 88px; padding: 0; border: 1px solid rgba(43, 29, 18, 0.2); border-radius: 8px; background: #fffdf8; color: #22242a; font: 700 15px var(--font); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18); flex: none; }
.cd.is-red { color: #c0392b; }
.cd-rank { line-height: 1; }
.cd-suit { font-size: 22px; line-height: 1.1; }
.cd.is-trump { background: #fff6dc; }
.cd-back { background: repeating-linear-gradient(45deg, #123f50, #123f50 4px, #1b5468 4px, #1b5468 8px); border-color: rgba(0, 0, 0, 0.3); }
button.cd { cursor: pointer; transition: transform 0.12s ease; }
.cd.is-on { box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0, 0, 0, 0.22); }
.cd.is-off { filter: saturate(0.7) brightness(0.93); }
.cd.is-picked { transform: translateY(-12px); box-shadow: 0 0 0 3px #1f6fb2; }
button.cd:hover { transform: translateY(-8px); }
.dk-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; padding: 6px 12px; border-radius: 12px; background: #f6efe2; font-size: 14px; }
.dk-status b { font-weight: 600; }
.dk-status.is-end { background: var(--gold); justify-content: center; }
.dk-status span { font-weight: 700; font-variant-numeric: tabular-nums; }
.dk-actions { display: flex; gap: 8px; }
.dk-actions:empty { display: none; }
.dk-big { flex: 1; padding: 14px; font-size: 16px; }
.dk-hand { display: flex; justify-content: center; padding: 14px 6px 4px; overflow-x: auto; min-height: 112px; }
.dk-hand .cd { margin-left: -14px; }
.dk-hand .cd:first-child { margin-left: 0; }
@media (max-width: 640px) {
  .dk-seat { min-width: 76px; padding: 4px 6px; }
  .dk-table { min-height: 150px; gap: 10px 12px; padding: 10px; }
  .dk-pair { width: 58px; height: 84px; }
  .dk-over { left: 10px; top: 10px; }
  .cd { width: 54px; height: 76px; font-size: 14px; }
  .dk-hand { justify-content: flex-start; }
}

/* ─── Ел, аула, жол салу ──────────────────────────────────────────────── */
.road-map { display: block; width: 100%; max-height: 62vh; border-radius: 12px; background: #f6f2e6; }
.road-hit { cursor: pointer; }
.new-city-form { display: grid; gap: 8px; }
.new-city-form input { padding: 11px 12px; border: 1px solid rgba(43, 29, 18, 0.16); border-radius: 12px; font: 500 14px var(--font); background: #fff; }
.estate-head { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #f6efe2; }
.estate-head b { font-size: 15px; }
.estate-head small { font-size: 12px; color: var(--ink-2); }
.estate-land { display: grid; gap: 8px; }
.travel-veil { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: #101022; color: #fffaf0; font-size: 28px; animation: veil-in 0.4s ease; transition: opacity 0.6s ease; }
.travel-veil.is-out { opacity: 0; }
@keyframes veil-in { from { opacity: 0; } }
.new-city { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(10, 10, 26, 0.86); color: #fffaf0; text-align: center; overflow: hidden; animation: veil-in 0.6s ease; transition: opacity 0.8s ease; pointer-events: none; }
.new-city.is-out { opacity: 0; }
.nc-rays { position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(rgba(254, 197, 12, 0.1) 0 9deg, transparent 9deg 18deg); animation: nc-spin 40s linear infinite; }
@keyframes nc-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.nc-inner { position: relative; display: grid; justify-items: center; gap: 8px; padding: 24px; }
.nc-inner img { width: 110px; height: 110px; animation: nc-pop 0.9s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.nc-inner small { letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; font-size: 13px; animation: nc-rise 0.7s 0.3s ease both; }
.nc-inner h2 { font-size: clamp(24px, 5vw, 38px); font-weight: 800; animation: nc-rise 0.7s 0.5s ease both; }
.nc-inner b { font-size: clamp(36px, 9vw, 72px); font-weight: 900; color: var(--gold); animation: nc-pop 0.9s 0.9s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.nc-inner p { margin: 0; font-size: 18px; animation: nc-rise 0.7s 1.3s ease both; }
@keyframes nc-pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes nc-rise { from { opacity: 0; transform: translateY(16px); } }

/* ─── Қала атауы мен бірінші адам режимі ──────────────────────────────── */
.city-chip { position: fixed; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; line-height: 1.2; color: #fffaf0; text-shadow: 0 1px 6px rgba(20, 12, 4, 0.55); pointer-events: none; z-index: 8; }
.city-chip b { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.city-chip span { font-size: 11px; opacity: 0.92; }
.city-chip em { font-style: normal; font-size: 11px; font-weight: 700; opacity: 0.95; margin-top: 1px; }
.view-btn { position: fixed; display: none; right: 14px; top: calc(max(14px, env(safe-area-inset-top)) + 54px); z-index: 10; }
body.has-hero .view-btn { display: grid; }
.view-btn.is-on { background: var(--gold); }
body.first-person #minimap { opacity: 0.85; }
body.in-mafia .city-chip, body.indoors .city-chip { display: none; }
@media (max-width: 640px) {
  .city-chip { top: calc(max(14px, env(safe-area-inset-top)) + 52px); }
}
.road-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.road-tools button { flex: 1; min-width: 60px; padding: 8px 6px; border: 1px solid var(--hair); border-radius: 10px; background: #fff; font: 600 12px var(--font); color: var(--ink); cursor: pointer; }
.road-tools button.active { background: var(--gold); border-color: var(--gold); }

/* ─── Киім: шкаф пен дүкен ─── */
.fa-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid var(--line, #eadfca); }
.fa-tabs::-webkit-scrollbar { display: none; }
.fa-tabs .tab { flex: none; white-space: nowrap; font-size: 13px; padding: 8px 10px; }
.wardrobe-opts { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.fa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.fa-item {
  display: grid; justify-items: start; gap: 4px; padding: 8px 10px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: #fffdf8; border: 1.5px solid var(--line, #eadfca); border-radius: 12px;
  transition: border-color .12s, transform .12s;
}
.fa-item:hover { transform: translateY(-1px); }
.fa-item.on { border-color: #e9b10a; background: #fff6d8; }
.fa-item .swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.fa-name { font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.fa-item small { font-size: 11.5px; opacity: .72; }
.fa-money { font-size: 13px; opacity: .8; }
@media (max-width: 640px) {
  .wardrobe-preview { max-height: 190px; }
  .wardrobe-opts { max-height: 34vh; width: 100%; }
}

/* ─── Жарнама ─── */
.ad-preview { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 10px; display: block; background: #111; }

/* ─── Жас сатылары ─── */
.perk-card { display: grid; gap: 6px; padding: 12px; margin-bottom: 10px; border-radius: 12px; background: #fff6d8; border: 1.5px solid var(--line); }
.perk-card small { opacity: .8; line-height: 1.35; }
.perk-list { display: grid; gap: 6px; max-height: 44vh; overflow-y: auto; }
.perk { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--felt); opacity: .62; }
.perk.is-open { opacity: 1; background: #e8f4dc; }
.perk small { display: block; opacity: .75; line-height: 1.3; }
.perk-age { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); font-weight: 800; }
.chest-prize { font-size: 20px; font-weight: 800; text-align: center; padding: 10px; border-radius: 10px; background: var(--felt); }
.chest-prize.is-rare { background: #dbeafb; color: #1f3f8f; }
.chest-prize.is-legend { background: #fec50c; }

/* ─── Балық аулау ─── */
.fish-btn { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 20; min-width: 170px; }

/* ─── Ремонт ─── */
.reno-bar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30; width: min(720px, calc(100vw - 20px)); padding: 10px; border-radius: 16px; background: var(--glass); box-shadow: var(--soft); display: grid; gap: 8px; backdrop-filter: blur(10px); }
.reno-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reno-top b { font-size: 14px; margin-right: auto; }
.reno-top small { opacity: .75; }
.reno-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.reno-tabs .tab { flex: none; font-size: 13px; padding: 6px 10px; }
.reno-items { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.reno-item { flex: none; min-width: 104px; display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf8; font: inherit; color: inherit; cursor: pointer; }
.reno-item b { font-size: 12.5px; }
.reno-item small { font-size: 11.5px; opacity: .72; }
.reno-item.on { border-color: var(--gold-deep); background: #fff1c2; }
body.renovating .hotbar, body.renovating .chat, body.renovating .hint, body.renovating .fish-btn { display: none; }

/* ─── Жас: басуға болатын белгі ─── */
.age-pill { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 2px 8px 2px 6px; border-radius: 999px; font-weight: 700; font-size: 11.5px; color: #4a3200; background: linear-gradient(135deg, #ffe58a, #fec50c); box-shadow: 0 1px 4px rgba(201, 147, 10, .45); cursor: pointer; animation: age-glow 2.6s ease-in-out infinite; }
.age-pill::before { content: '★'; font-size: 10px; }
.age-pill::after { content: '›'; font-size: 14px; line-height: 1; }
.age-pill:hover { filter: brightness(1.06); }
@keyframes age-glow { 50% { box-shadow: 0 0 10px rgba(254, 197, 12, .85); } }

/* ─── Бизнес жұмысы ─── */
.work-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.work-steps span { padding: 4px 10px; border-radius: 999px; background: var(--felt); font-size: 12.5px; font-weight: 700; }
.work-steps span.is-done { background: #e8f4dc; color: var(--green); }
.work-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }

/* ─── Тауар ─── */
.stock-row { display: grid; grid-template-columns: 1fr 76px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.stock-row small { display: block; opacity: .75; }
.stock-row input { width: 100%; padding: 6px; border-radius: 8px; border: 1.5px solid var(--line); font: inherit; }
.used-row { grid-template-columns: 1fr auto auto; }

.news-list { display: grid; gap: 8px; margin: 0; padding-left: 18px; max-height: 60vh; overflow-y: auto; line-height: 1.4; }

.top-list { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 22px; }
.top-list li { padding: 5px 4px; border-bottom: 1px solid var(--hair); }
.top-list li > * { display: inline-block; }
.top-list li b { float: right; }
.top-list li.is-me { background: #fff1c2; border-radius: 6px; }

/* Байланыс үзілгенде шығатын белгі */
.net-banner { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: rgba(150, 30, 40, .94); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); pointer-events: none; }

/* ─── Көктем ЖК: пәтер таңдау (телефон бірінші) ─────────────────────────── */
body.apt-open > :not(#city):not(.apt-picker):not(.toasts):not(.modal) { visibility: hidden !important; }
.apt-picker { position: fixed; inset: 0; z-index: 40; pointer-events: none; font-family: var(--font); color: var(--ink); }
.apt-picker > * { pointer-events: auto; }
.apt-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.apt-stage:active { cursor: grabbing; }
.apt-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.apt-chip {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center;
  min-width: 64px; padding: 6px 10px; border-radius: 12px; border: 2px solid #fff; background: #2e7d4f; color: #fff;
  font: 700 13px/1.15 var(--font); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); cursor: pointer;
}
.apt-chip small { font-weight: 600; font-size: 11px; opacity: 0.92; white-space: nowrap; }
.apt-chip.taken { background: #7d848b; }
.apt-chip.mine { background: var(--gold); color: var(--ink); }
.apt-chip.on { background: #1f8fb8; color: #fff; transform-origin: center; outline: 3px solid rgba(31, 143, 184, 0.35); }
.apt-chip.dim { opacity: 0.4; }

.apt-head {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.8));
  border-bottom: 1px solid var(--hair); backdrop-filter: blur(8px);
}
.apt-close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--felt-2); font-size: 18px; cursor: pointer; }
.apt-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.apt-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-title small { font-size: 12px; color: var(--ink-2); }
.apt-balance { position: static; flex: none; }

.apt-rail {
  position: absolute; right: calc(8px + env(safe-area-inset-right)); top: calc(76px + env(safe-area-inset-top)); bottom: 210px;
  width: 58px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: none; padding: 2px;
}
.apt-rail::-webkit-scrollbar { display: none; }
.apt-floor {
  flex: none; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--hair); background: var(--glass);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-family: var(--font);
  box-shadow: 0 2px 6px rgba(43, 29, 18, 0.1); color: var(--ink); padding: 3px 0;
}
.apt-floor b { font-size: 16px; line-height: 1; }
.apt-floor small { font-size: 10px; font-weight: 600; color: var(--green); margin-top: 2px; }
.apt-floor.full small { color: #9aa0a6; }
.apt-floor.mine { border-color: var(--gold-deep); background: #fff4cc; }
.apt-floor.on { background: #1f8fb8; border-color: #1f8fb8; color: #fff; }
.apt-floor.on small { color: #e6f6fb; }
.apt-floor.all b { font-size: 18px; }

.apt-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(520px, 100%);
  background: var(--felt); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 28px rgba(43, 29, 18, 0.18);
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); animation: apt-up 0.22s ease;
}
@keyframes apt-up { from { transform: translate(-50%, 24px); opacity: 0; } }
.apt-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 8px; }
.apt-hint { margin: 0 0 10px; font-size: 14px; font-weight: 600; text-align: center; }
.apt-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
.apt-filters::-webkit-scrollbar { display: none; }
.apt-filter {
  flex: none; height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); background: #fff;
  font: 600 13px var(--font); color: var(--ink); cursor: pointer;
}
.apt-filter.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.apt-legend { display: flex; justify-content: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.apt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.apt-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.apt-legend .free { background: #7cc79a; }
.apt-legend .taken { background: #b9bec4; }
.apt-legend .mine { background: var(--gold); }

.apt-card-top { display: flex; align-items: center; gap: 6px; padding-top: 6px; }
.apt-card-title { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; }
.apt-card-title b { font-size: 17px; }
.apt-card-title small { font-size: 12px; color: var(--ink-2); }
.apt-step, .apt-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--felt-2); font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.apt-x { font-size: 15px; width: 36px; height: 36px; }
.apt-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.apt-facts span { background: #fff; border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--hair); }
.apt-facts b { font-size: 16px; }
.apt-facts small { font-size: 11px; color: var(--ink-2); text-align: center; }
.apt-actions { display: flex; gap: 8px; }
.apt-actions .btn { flex: 1; }
.apt-buy { width: 100%; min-height: 52px; font-size: 15px; font-weight: 800; border-radius: 14px; }
.apt-buy.apt-own { background: var(--ink); color: #fff; }
.apt-buy.sure { background: var(--green); color: #fff; animation: apt-pulse 0.8s ease infinite alternate; }
.apt-buy:disabled { background: #e7e1d6; color: var(--ink-2); }
@keyframes apt-pulse { to { filter: brightness(1.12); } }
.apt-leave { flex: 0 0 auto !important; min-height: 52px; padding: 0 18px; }
.apt-owned { text-align: center; font-weight: 700; padding: 10px; border-radius: 12px; background: #fff4cc; margin-bottom: 8px; font-size: 14px; }
.apt-owned.taken { background: #eceae5; }

@media (max-width: 420px) {
  .apt-actions { flex-direction: column; }
  .apt-leave { flex: 1 !important; }
}
/* Көлденең телефон: панель сол жақта, тізім оң жақта */
@media (max-height: 500px) and (orientation: landscape) {
  .apt-panel { left: calc(8px + env(safe-area-inset-left)); transform: none; bottom: 8px; width: min(360px, 48vw); border-radius: 18px; max-height: calc(100% - 76px); overflow-y: auto; animation: none; }
  .apt-rail { bottom: 8px; top: 68px; }
  .apt-head { padding-top: 6px; padding-bottom: 6px; }
  .apt-facts { margin: 8px 0; }
}

/* Баспана таңдау */
.home-offer { max-width: 440px; }
.home-offer-lead { margin: 4px 0 12px; font-weight: 600; }
.home-choice {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; margin-bottom: 10px;
  border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-family: var(--font); color: var(--ink);
}
.home-choice:hover, .home-choice:focus-visible { border-color: var(--gold-deep); }
.home-choice-icon { font-size: 34px; flex: none; }
.home-choice-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.home-choice-text b { font-size: 16px; }
.home-choice-text small { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.home-choice-go { flex: none; padding: 8px 10px; border-radius: 10px; background: var(--gold); font-weight: 800; font-size: 12px; }
.home-choice.land .home-choice-go { background: #d7ecc9; }
.home-offer-note { display: block; text-align: center; }
@media (max-width: 480px) {
  .home-choice { flex-wrap: wrap; }
  .home-choice-text { flex: 1 1 calc(100% - 50px); }
  .home-choice-go { flex: 1 1 100%; text-align: center; padding: 11px; font-size: 14px; }
}
.apt-swap { flex: none; width: 36px; height: 44px; border-radius: 12px; border: 1.5px solid var(--hair); background: var(--glass); font-size: 22px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0; }
.apt-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .apt-head { gap: 6px; padding-left: 8px; padding-right: 8px; } .apt-swap { width: 30px; } }

/* Кіші картаның баптауы: масштаб, өлшем, бағыт */
.mini-ctl {
  position: fixed; right: calc(var(--mini-size, 132px) + 22px); bottom: 14px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: auto;
}
.mini-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 253, 248, .94); color: var(--ink);
  font: 700 17px/1 var(--font); box-shadow: var(--soft); cursor: pointer; padding: 0;
}
.mini-range { min-width: 40px; text-align: center; font: 700 11px var(--font); color: var(--ink); background: rgba(255, 253, 248, .9); border-radius: 10px; padding: 3px 6px; box-shadow: var(--soft); }
body.touch .mini-btn { width: 28px; height: 28px; font-size: 16px; }
body.indoors .mini-ctl { display: none; }
.mini-set { margin: 12px 0; }
.mini-set b { display: block; margin-bottom: 6px; }
.mini-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-seg .btn { flex: 1 1 auto; min-width: 70px; }

/* ─── Кезекшілік қызметтері (2026-11-18) ─── */
.duty-btn { position: fixed; right: 18px; bottom: 150px; z-index: 7; width: 64px; height: 64px; font-size: 28px; display: grid; place-items: center; border-radius: 50%; touch-action: none; user-select: none; -webkit-user-select: none; }
#btnSpray { background: linear-gradient(180deg, #e3412f, #a8161b); color: #fff; box-shadow: 0 6px 18px rgba(168, 22, 27, 0.45); }
#btnCheck { background: linear-gradient(180deg, #3f7fd8, #1f3f8f); color: #fff; box-shadow: 0 6px 18px rgba(31, 63, 143, 0.45); }
.duty-btn.hidden { display: none; }
.duty-btn:active { transform: scale(0.94); }
.duty-meter { position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%); z-index: 7; width: min(260px, 70vw); height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.duty-meter.hidden { display: none; }
.duty-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3f7fd8, #8fd3ff); transition: width 0.3s; }
.duty-list { display: grid; gap: 8px; margin: 10px 0; }
.duty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(43, 29, 18, 0.05); }
.duty-row .btn { flex: none; }
.duty-pay { font-weight: 800; white-space: nowrap; }
.duty-q { margin: 10px 0; }
.duty-opts { display: grid; gap: 4px; margin-top: 6px; }
.duty-opts label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(43, 29, 18, 0.05); }
