/* Norm Tycoon — светлая минималистичная тема Norm.
   TT Travels Next для заголовков/цифр, системный шрифт для текста. */

@font-face {
  font-family: "TTN";
  src: url("fonts/ttn-bd.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "TTN";
  src: url("fonts/ttn-black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #fdfcfa;
  --card: #ffffff;
  --ink: #16130f;
  --muted: #8a857e;
  --line: #ece8e2;
  --accent: #ff6b2c;
  --accent-soft: #fff1e8;
  --red: #d64545;
  --green: #3e7c4b;
  --gold: #e8a13c;
  --display: "TTN", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#app { display: flex; flex-direction: column; height: 100dvh; }

/* ---------- header ---------- */
#hdr { position: relative; flex: none; }
.hero { height: 138px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(253,252,250,0) 30%, var(--bg) 96%);
}
.hdr-body { position: relative; margin-top: -44px; padding: 0 16px 10px; text-align: center; }
.district { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.district b { color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 14px; }
.cash {
  font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1.15;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.rate-row { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 13px; color: var(--muted); min-height: 22px; }
.chip { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip-red { background: #fbeaea; color: var(--red); }
.chip-green { background: #e9f3ec; color: var(--green); }
.chip-boost { background: var(--accent-soft); color: var(--accent); animation: pulse 1.2s infinite; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
#view { flex: 1; overflow-y: auto; padding: 6px 14px 90px; }
.tab { display: flex; flex-direction: column; gap: 10px; }

#nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: rgba(255,255,255,0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
#nav button {
  flex: 1; background: none; border: 0; font-family: var(--body); font-size: 10.5px; font-weight: 600;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
  border-radius: 12px; transition: color 0.15s;
}
#nav button span { font-size: 20px; line-height: 1; filter: grayscale(1) opacity(0.6); transition: filter 0.15s; }
#nav button.on { color: var(--accent); }
#nav button.on span { filter: none; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; box-shadow: 0 1px 4px rgba(22,19,15,0.04);
}
.section-title { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 8px 2px 0; }
.section-title-sm { font-family: var(--display); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.section-note { font-size: 13px; color: var(--muted); padding: 2px 4px; line-height: 1.45; }
.muted { color: var(--muted); }

/* услуги */
.svc-row { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.svc-row:active .svc-emoji { transform: scale(0.9); }
.svc-emoji {
  font-size: 34px; width: 58px; height: 58px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border-radius: 16px; transition: transform 0.1s;
}
.svc-info { flex: 1; min-width: 0; }
.svc-name { font-family: var(--display); font-weight: 700; font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.lvl { font-size: 11.5px; color: var(--muted); font-family: var(--body); font-weight: 600; }
.svc-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.bar { height: 6px; background: #f0ebe4; border-radius: 4px; margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 90ms linear; }
.ms { font-size: 11px; color: var(--muted); margin-top: 4px; }
.svc-actions { display: flex; gap: 8px; margin-top: 11px; }
.svc.locked { opacity: 0.92; }
.svc.locked .svc-emoji { background: #f4f1ec; }

/* кнопки */
.btn {
  font-family: var(--display); font-weight: 700; font-size: 13.5px;
  border: 0; border-radius: 13px; padding: 11px 12px; cursor: pointer;
  transition: transform 0.08s, opacity 0.15s, background 0.15s;
  color: #fff; background: var(--accent);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { background: #e8e3dc; color: #b3ada4; cursor: default; }
.btn-buy { flex: 1.4; }
.btn-master { flex: 1; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-master.hired { background: #e9f3ec; color: var(--green); border-color: transparent; opacity: 1; }
.btn-master:disabled:not(.hired) { background: var(--card); color: #c9c4bc; border: 1.5px solid var(--line); }
.buybar { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); padding: 2px 2px 0; }
.buybar button {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 4px 12px; color: var(--muted); font-family: var(--body);
}
.buybar button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* престиж */
.prestige { background: linear-gradient(135deg, #1d1a16, #3a332b); color: #fff; border: 0; }
.prestige-sub { font-size: 12.5px; opacity: 0.85; margin-top: 4px; }
.btn-prestige { width: 100%; margin-top: 10px; background: var(--gold); color: #241c0d; }

/* маркетинг */
.upg { display: flex; gap: 12px; align-items: center; }
.upg-emoji { font-size: 26px; flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border-radius: 13px; }
.upg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upg-body b { font-family: var(--display); font-size: 13.5px; font-weight: 700; }
.upg-body span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.upg .btn { flex: none; min-width: 92px; font-size: 12.5px; }
.upg.owned { opacity: 0.62; }
.upg.owned .btn { background: #e9f3ec; color: var(--green); }
.btn-nk { background: linear-gradient(135deg, #e8a13c, #d97b2a); }

/* коллекция */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.ccard {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 6px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.ccard-emoji { font-size: 30px; }
.ccard-name { font-size: 11px; font-weight: 600; line-height: 1.25; min-height: 27px; }
.ccard-rar { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ccard.unknown { filter: grayscale(1); opacity: 0.55; }
.r-r { border-color: #5b8def; }
.r-e { border-color: #9b5bef; }
.r-l { border-color: var(--gold); box-shadow: 0 0 12px rgba(232,161,60,0.25); }

/* топ */
.toprow {
  display: flex; gap: 10px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px;
}
.toprow.me { border-color: var(--accent); background: var(--accent-soft); }
.pos { width: 30px; font-family: var(--display); font-weight: 700; font-size: 13px; }
.tname { flex: 1; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsum { text-align: right; font-size: 12.5px; font-weight: 700; display: flex; flex-direction: column; }
.tsum i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); }
.btn-invite { width: 100%; background: linear-gradient(135deg, var(--accent), #ff8f5c); font-size: 14px; padding: 14px; }

/* профиль */
.me-head { display: flex; gap: 14px; align-items: center; }
.me-owner { width: 64px; height: 84px; object-fit: cover; object-position: top; border-radius: 12px; background: var(--accent-soft); }
.me-head div { display: flex; flex-direction: column; gap: 3px; }
.me-head b { font-family: var(--display); font-size: 16px; }
.me-head span { font-size: 12.5px; color: var(--muted); }
.streak { display: flex; gap: 8px; }
.streak i {
  flex: 1; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #f4f1ec; color: var(--muted); font-style: normal; font-size: 12px; font-weight: 700;
}
.streak i.on { background: var(--accent); color: #fff; }
.daily { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.daily:first-of-type { border-top: 0; }
.daily div { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.daily b { font-size: 13px; font-weight: 600; }
.daily span { font-size: 11.5px; color: var(--muted); }
.daily.claimed { opacity: 0.55; }
.btn-daily { min-width: 52px; padding: 8px; }
.btn-hh { width: 100%; background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); }
.btn-hh:disabled { background: var(--card); color: var(--muted); border-color: var(--line); }
.ach-title { margin: 6px 2px 0; }
.achv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.achv {
  display: flex; gap: 8px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; opacity: 0.5;
}
.achv.got { opacity: 1; border-color: var(--gold); }
.achv span { font-size: 18px; }
.achv b { font-size: 11.5px; font-weight: 600; line-height: 1.2; }

/* ---------- модалки ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(22,19,15,0.45); z-index: 40;
  display: flex; align-items: flex-end; animation: fade 0.2s;
}
.sheet {
  background: var(--bg); width: 100%; border-radius: 24px 24px 0 0;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; text-align: center;
  animation: up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 86dvh; overflow-y: auto;
}
.sheet h2 { font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: -0.01em; }
.sheet p { font-size: 14px; line-height: 1.5; color: #4c463f; }
.ev-emoji { font-size: 52px; line-height: 1; }
.ev-outcome { font-weight: 600; color: var(--ink) !important; }
.ev-bonus { font-family: var(--display); color: var(--gold); font-weight: 900; font-size: 18px; }
.btn-ev { width: 100%; padding: 14px; font-size: 14.5px; }
.btn-ev2 { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.offline-img { width: 130px; margin: 0 auto; border-radius: 18px; }
.offline-sum { font-family: var(--display); font-weight: 900; font-size: 34px; color: var(--green); }
.card-new { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.ccard-big {
  border: 2px solid var(--line); border-radius: 20px; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px; align-items: center; background: var(--card);
}
.ccard-big-emoji { font-size: 64px; }
.ccard-big b { font-family: var(--display); font-size: 17px; }
.ccard-big p { font-size: 13.5px; }

/* ---------- эффекты ---------- */
#toasts { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(22,19,15,0.92); color: #fff; border-radius: 14px; padding: 11px 15px;
  font-size: 13px; line-height: 1.4; transform: translateY(-12px); opacity: 0; transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(22,19,15,0.25);
}
.toast.in { transform: none; opacity: 1; }
.floater {
  position: fixed; z-index: 55; font-family: var(--display); font-weight: 900; font-size: 17px;
  color: var(--accent); pointer-events: none; animation: floatup 0.9s ease-out forwards;
  text-shadow: 0 1px 0 #fff;
}
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* gate */
.gate { display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; height: 100dvh; padding: 24px; text-align: center; }
.gate img { width: min(420px, 88vw); border-radius: 20px; }
.gate h1 { font-family: var(--display); font-weight: 900; font-size: 30px; }
.gate p { color: var(--muted); font-size: 14px; }
.gate a { text-decoration: none; display: block; max-width: 280px; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
@keyframes floatup { to { transform: translateY(-56px); opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- FTUE ---------- */
#ftue { position: fixed; left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 30; pointer-events: none; }
.ftue-bubble {
  display: flex; gap: 10px; align-items: center; pointer-events: auto;
  background: rgba(22,19,15,0.94); color: #fff; border-radius: 16px; padding: 11px 13px;
  box-shadow: 0 8px 24px rgba(22,19,15,0.3); animation: up 0.3s cubic-bezier(0.2,0.9,0.3,1);
}
.ftue-ava { font-size: 24px; width: 40px; height: 40px; flex: none; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ftue-text { flex: 1; font-size: 13px; line-height: 1.4; }
.ftue-text b { display: block; font-family: var(--display); font-size: 10.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1px; }
.ftue-ok { flex: none; background: var(--accent); color: #fff; border: 0; border-radius: 10px; font-family: var(--display); font-weight: 700; font-size: 13px; padding: 9px 16px; }
.ftue-glow { position: relative; animation: glowpulse 1.2s infinite; border-radius: 14px; }
@keyframes glowpulse { 0%,100% { box-shadow: 0 0 0 2px rgba(255,107,44,0.55); } 50% { box-shadow: 0 0 0 7px rgba(255,107,44,0.12); } }

/* ---------- пролог ---------- */
.overlay.prologue { align-items: center; background: var(--bg); animation: fade 0.3s; }
.overlay.prologue .sheet { border-radius: 24px; margin: 18px; max-width: 420px; box-shadow: 0 10px 40px rgba(22,19,15,0.12); border: 1px solid var(--line); }
.prol-step { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.bar.big { height: 14px; border-radius: 8px; margin: 6px 0 4px; }
.bar.big i { transition: width 0.15s ease-out; }

/* ---------- переезд ---------- */
.welcome-perks { display: flex; flex-direction: column; gap: 8px; background: var(--accent-soft); border-radius: 14px; padding: 13px; font-size: 14px; }

/* ---------- бутик ---------- */
.btn-stars { background: linear-gradient(135deg, #4e9af1, #2f6fdb); min-width: 92px; }
.card.starter { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--gold); background: linear-gradient(135deg, #fff8ec, #fff); position: relative; }
.starter-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.starter-body b { font-family: var(--display); font-size: 13.5px; }
.starter-body span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.starter-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 4px; }
.card.starter .btn-stars { margin-top: 14px; }
.title-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 13px; padding: 12px 14px;
  font-family: var(--body); font-size: 15px; text-align: center; background: var(--card); color: var(--ink);
}
.title-input:focus { outline: none; border-color: var(--accent); }
.tname .ttl { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 500; }
