:root {
  --bg: #12141d;
  --panel: #171a26;
  --card: #232738;
  --card-hi: #2a2f45;
  --line: #303650;
  --text: #e8ebf5;
  --dim: #8b93ad;
  --gold: #f6b93b;
  --gold-dark: #d9962b;
  --gold-text: #7a5410;
  --green: #2ecc71;
  --green-dark: #1e8e53;
  --blue: #4a9ff5;
  --blue-dark: #3b83cc;
  --red: #ff6b5e;
  --accent: #f5b942;
}

/* per-city room palettes — the lit room glows against the dark UI */
body[data-city="0"] { --floor-c: #f0d9a7; --wall-left: #f2a65a; --wall-right: #e8756d; --carpet: #c0392b; }
body[data-city="1"] { --floor-c: #e3e9d0; --wall-left: #6fb7d9; --wall-right: #5a8fc4; --carpet: #2e6da4; }
body[data-city="2"] { --floor-c: #f3d1a0; --wall-left: #e57fb1; --wall-right: #c95d9e; --carpet: #a83279; }
body[data-city="3"] { --floor-c: #f5deb0; --wall-left: #e2574c; --wall-right: #c44133; --carpet: #8e2b22; }
body[data-city="4"] { --floor-c: #efe3c8; --wall-left: #b9a7e8; --wall-right: #9a86d4; --carpet: #6c5ab8; }
body[data-city="5"] { --floor-c: #cdd6e8; --wall-left: #4a5b8c; --wall-right: #37456e; --carpet: #22d3ee; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button {
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- HUD ---------- */

#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.hud-block { min-width: 0; }

.hud-cash {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #f6b93b 65%, #e69c1f);
  border: 2.5px solid var(--gold-dark);
  color: var(--gold-text);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.cash-val {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 25px;
  line-height: 1;
  white-space: nowrap;
  color: var(--text);
}

.income-val {
  color: #4ade80;
  font-weight: 800;
  font-size: 13px;
  margin-top: 2px;
}

.hud-status {
  text-align: center;
  flex: 1;
}

.city-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--accent);
}

.stars {
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 3px;
  margin: 1px 0;
}

.tier-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #7db8f7;
  border: 1.5px solid rgba(74, 159, 245, 0.35);
  border-radius: 20px;
  padding: 1px 12px;
  background: rgba(74, 159, 245, 0.10);
}

.hud-cur {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cur {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  border-radius: 20px;
  padding: 5px 13px;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

#chipsVal { background: var(--blue); border: 2px solid var(--blue-dark); }
#fameVal { background: #9b59b6; border: 2px solid #7e449a; }

.icon-btn {
  background: var(--card);
  border: 2px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 10px;
  font-size: 15px;
  padding: 4px 9px;
}

/* ---------- banners ---------- */

#goalBanner {
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #d9b968;
  background: #262013;
  border-bottom: 2px solid #3d3319;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

#goalBanner b { color: #ffd75e; }
.req-met { color: #4ade80; }
.req-unmet { color: #7d7355; }

#buffBar {
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #6cc4ff;
  background: #13233b;
  border-bottom: 2px solid #1e3a5c;
  text-align: center;
}

/* ---------- layout ---------- */

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 450px);
  min-height: 0;
}

/* ---------- isometric floor ---------- */

#floorWrap {
  display: flex;
  flex-direction: column;
  padding: 12px;
  min-width: 0;
  min-height: 0;
}

#floor {
  position: relative;
  flex: 1;
  border-radius: 18px;
  border: 2px solid var(--line);
  background:
    radial-gradient(circle at 20% 12%, rgba(120, 140, 255, 0.12), transparent 45%),
    radial-gradient(circle at 82% 8%, rgba(255, 200, 90, 0.09), transparent 40%),
    radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1.4px),
    radial-gradient(rgba(255, 255, 255, 0.22) 0.8px, transparent 1.1px),
    linear-gradient(180deg, #10131f 0%, #171c30 55%, #202944 100%);
  background-size: auto, auto, 110px 110px, 50px 50px, auto;
  background-position: 0 0, 0 0, 12px 8px, 35px 30px, 0 0;
  overflow: hidden;
  min-height: 0;
}

#room {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#room svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#props {
  position: absolute;
  inset: 0;
}

.machine {
  position: absolute;
  width: 106px;
  transform: translate(-50%, -100%);
  text-align: center;
  cursor: pointer;
}

.machine::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(10, 15, 30, 0.35), transparent 70%);
}

.m-body {
  display: inline-block;
  min-width: 66px;
  padding: 8px 10px 7px;
  border-radius: 14px;
  border: 2.5px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.1s;
  position: relative;
}

.kind-slot .m-body { background: linear-gradient(180deg, #c18ff2, #9a6ade); }
.kind-table .m-body { background: linear-gradient(180deg, #4cd08a, #2fa968); }
.kind-vip .m-body { background: linear-gradient(180deg, #ffd36e, #f0a92e); }

.signature .m-body { outline: 3px solid rgba(255, 233, 168, 0.75); }

.signature .m-body::after {
  content: '✨';
  position: absolute;
  top: -12px;
  right: -10px;
  font-size: 18px;
}

.m-face {
  font-size: 32px;
  line-height: 1.1;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25));
}

.m-plate {
  display: inline-block;
  margin-top: 6px;
  background: #262b3f;
  border: 1.5px solid #3a4160;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.m-meta {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--dim);
}

.machine:hover .m-body { transform: translateY(-2px); }
.machine.tapped .m-body { transform: scale(0.92); }

.machine.win .m-body {
  animation: winpop 0.55s;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), 0 0 26px rgba(246, 185, 59, 0.9);
}

@keyframes winpop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}

.prop {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 32px;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}

.prop.sign {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: #262b3f;
  color: #ffd75e;
  border: 2px solid var(--gold-dark);
  border-radius: 7px;
  padding: 2px 8px;
  filter: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

/* ---------- little people ---------- */

.customer {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.customer::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 6px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.35);
}

.person {
  position: relative;
  width: 16px;
  height: 32px;
  transform-origin: 50% 100%;
}

.p-head {
  position: absolute;
  top: 4px;
  left: 3.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--skin);
}

.p-body {
  position: absolute;
  top: 12px;
  left: 2px;
  width: 12px;
  height: 13px;
  border-radius: 6px 6px 4px 4px;
  background: var(--outfit);
}

.p-legs {
  position: absolute;
  top: 25px;
  left: 4px;
  width: 8px;
  height: 7px;
  display: flex;
  justify-content: space-between;
}

.p-legs i {
  display: block;
  width: 3px;
  height: 7px;
  border-radius: 0 0 2px 2px;
  background: #232734;
}

.p-hat { display: none; }

/* tier 1 — tourists: bright baseball cap */
.tier-1 .p-hat {
  display: block;
  position: absolute;
  top: 1px;
  left: 3.5px;
  width: 9px;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--outfit);
  filter: brightness(1.35);
}

.tier-1 .p-hat::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 2px;
  border-radius: 1px;
  background: inherit;
}

/* tier 3 — enthusiasts: fedora */
.tier-3 .p-hat {
  display: block;
  position: absolute;
  top: 2px;
  left: 2.5px;
  width: 11px;
  height: 2.5px;
  border-radius: 2px;
  background: #6d4c2f;
}

.tier-3 .p-hat::after {
  content: '';
  position: absolute;
  top: -3.5px;
  left: 2.5px;
  width: 6px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #6d4c2f;
}

/* tier 4 — high rollers: shades + crisp shirt */
.tier-4 .p-head::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 0.5px;
  width: 8px;
  height: 2.5px;
  border-radius: 1px;
  background: #10131c;
}

.tier-4 .p-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4.5px;
  width: 3px;
  height: 5px;
  border-radius: 0 0 2px 2px;
  background: #e8ebf5;
}

/* tier 5 — whales: top hat + gold bowtie */
.tier-5 .p-hat {
  display: block;
  position: absolute;
  top: -4px;
  left: 4px;
  width: 8px;
  height: 7px;
  border-radius: 2px 2px 0 0;
  background: #14161f;
}

.tier-5 .p-hat::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: -2px;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: #14161f;
}

.tier-5 .p-body::before {
  content: '';
  position: absolute;
  top: 0.5px;
  left: 4px;
  width: 4px;
  height: 3px;
  border-radius: 1px;
  background: var(--gold);
}

/* tier 6 — legends: golden halo & glow */
.tier-6 .p-hat {
  display: block;
  position: absolute;
  top: -4px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd75e;
  box-shadow: 0 0 8px 2px rgba(255, 215, 94, 0.8);
}

.person.tier-6 { filter: drop-shadow(0 0 4px rgba(255, 215, 94, 0.55)); }

/* walking & playing animations */
.customer.walking .person { animation: waddle 0.38s infinite alternate ease-in-out; }

@keyframes waddle {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

.customer.walking .p-legs i:first-child { animation: stepA 0.38s infinite alternate ease-in-out; }
.customer.walking .p-legs i:last-child { animation: stepB 0.38s infinite alternate ease-in-out; }

@keyframes stepA {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

@keyframes stepB {
  from { transform: translateY(-3px); }
  to { transform: translateY(0); }
}

.customer.playing .person { animation: bob 0.9s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- rush ---------- */

#rushRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#rushTrack {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: var(--card);
  border: 1.5px solid var(--line);
  overflow: hidden;
}

#rushFill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #ffd36e, var(--gold));
  transition: width 0.2s;
}

#rushBtn {
  min-width: 200px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--card);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--dim);
}

#rushBtn.ready {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: var(--gold-text);
  animation: readypulse 0.8s infinite;
}

#rushBtn.active {
  background: var(--blue);
  border-color: var(--blue-dark);
  color: #fff;
}

@keyframes readypulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---------- panel & tabs ---------- */

#panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 2px solid var(--line);
}

#tabs {
  display: flex;
  border-bottom: 2px solid var(--line);
  background: var(--panel);
}

#tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 2px 6px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--dim);
  font-size: 17px;
}

#tabs button span { font-size: 11px; font-weight: 800; letter-spacing: 0.3px; }

#tabs button.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

#tabContent {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #343b58 transparent;
}

.tab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.tab-hint { font-size: 11.5px; color: var(--dim); font-weight: 800; }

.qty-btn {
  background: var(--blue);
  border: 2px solid var(--blue-dark);
  border-bottom-width: 3px;
  border-radius: 10px;
  padding: 4px 14px;
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}

.note { font-size: 11.5px; color: var(--dim); font-weight: 700; margin-top: 6px; padding: 0 4px; }

/* ---------- rows ---------- */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 9px 10px;
  margin-bottom: 8px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.row.locked { opacity: 0.5; }
.row.done { background: #1c2b26; border-color: #2c4a3d; }

.row-icon { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }

.row-main { flex: 1; min-width: 0; }

.row-title { font-size: 14px; font-weight: 800; }
.row-title .count { color: var(--gold); font-size: 12.5px; margin-left: 4px; }

.gate-tag {
  font-size: 10.5px;
  color: #7db8f7;
  border: 1.5px solid rgba(74, 159, 245, 0.35);
  background: rgba(74, 159, 245, 0.10);
  border-radius: 10px;
  padding: 0 7px;
  vertical-align: middle;
  font-weight: 800;
}

.row-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.row-actions button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 78px;
  padding: 6px 8px;
  background: #1b1f2e;
  border: 2px solid #343b58;
  border-bottom-width: 4px;
  border-radius: 11px;
  transition: transform 0.1s;
}

.row-actions button .b-label { font-size: 12px; font-weight: 900; }
.row-actions button .cost { font-size: 11px; font-weight: 800; color: var(--dim); }

.row-actions button.can {
  background: var(--green);
  border-color: #27ae60;
  border-bottom-color: var(--green-dark);
}

.row-actions button.can .b-label { color: #0e2c1c; }
.row-actions button.can .cost { color: #14532d; }
.row-actions button.can:hover { filter: brightness(1.08); }

.row-actions button:disabled {
  background: #1a1d29;
  border-color: #262c42;
  cursor: default;
}

.row-actions button:disabled .b-label { color: #4d5470; }
.row-actions button:disabled .cost { color: #414861; }

.row-actions button.best {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 2.5px rgba(246, 185, 59, 0.4), 0 0 14px rgba(246, 185, 59, 0.25);
}

.row-actions button.best::before {
  content: '⭐';
  position: absolute;
  top: -10px;
  right: -7px;
  font-size: 13px;
}

.row-actions button.pulse { animation: btnpulse 0.25s; }

@keyframes btnpulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.owned {
  color: #4ade80;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 8px 10px;
}

/* ---------- stats tab ---------- */

.stats-city {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.stats-city-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 19px;
  color: var(--accent);
}

.stats-city-flavor { font-size: 12.5px; font-weight: 700; color: var(--dim); margin-bottom: 8px; }

.progress {
  height: 10px;
  border-radius: 5px;
  background: #1b1f2e;
  border: 1.5px solid var(--line);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4cd08a, #2fa968);
  border-radius: 5px;
}

.stats-line { font-size: 12.5px; font-weight: 700; color: var(--dim); }
.stats-line b { color: var(--text); }

.franchise-box {
  background: #262013;
  border: 2px solid #57451c;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  text-align: center;
}

.fr-title { font-weight: 900; font-size: 15px; margin-bottom: 4px; color: var(--text); }
.fr-sub { font-size: 12.5px; font-weight: 700; color: #a9976a; margin-bottom: 10px; line-height: 1.5; }
.fr-sub b { color: #ffd75e; }

.franchise-box button {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--gold-dark);
  border-bottom-width: 4px;
  background: var(--gold);
  color: var(--gold-text);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.franchise-box button:disabled {
  background: #1a1d29;
  border-color: #262c42;
  color: #4d5470;
  cursor: default;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.stat {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
}

.stat span { color: var(--dim); font-weight: 700; }
.stat b { font-size: 13px; }

.stats-btns { display: flex; gap: 8px; }

.stats-btns button {
  flex: 1;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--card);
  font-weight: 800;
  font-size: 12.5px;
}

.stats-btns .danger { border-color: #5c2a24; color: var(--red); background: #2a1815; }

/* ---------- toasts ---------- */

#toasts {
  position: fixed;
  top: 70px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  width: 320px;
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(30, 34, 51, 0.97);
  border: 2px solid #343b58;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: slidein 0.3s ease-out;
}

.toast.out { opacity: 0; transition: opacity 0.4s; }

.toast-icon { font-size: 20px; }
.toast-title { font-weight: 900; font-size: 13px; color: var(--text); }
.toast-text { font-size: 12px; font-weight: 700; color: var(--dim); line-height: 1.4; }

@keyframes slidein {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- modals ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadein 0.2s;
}

@keyframes fadein { from { opacity: 0; } }

.modal-card {
  background: #1e2233;
  border: 2px solid #3a4160;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  border-radius: 18px;
  padding: 22px;
  width: min(400px, 92vw);
  text-align: center;
  animation: pop 0.25s ease-out;
}

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon { font-size: 44px; }

.modal-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 19px;
  margin: 6px 0;
  color: var(--text);
}

.modal-body { font-size: 14px; font-weight: 700; color: var(--dim); line-height: 1.55; margin-bottom: 16px; }
.modal-body b { color: #ffd75e; }

.offline-gain {
  display: inline-block;
  margin-top: 8px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(246, 185, 59, 0.4);
}

.modal-choices { display: flex; flex-direction: column; gap: 8px; }

.modal-btn {
  padding: 11px;
  border-radius: 12px;
  border: 2px solid #343b58;
  border-bottom-width: 4px;
  background: var(--card);
  font-weight: 900;
  font-size: 13.5px;
}

.modal-btn.primary {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: var(--gold-text);
}

.modal-btn:hover { filter: brightness(1.12); }

/* ---------- celebrate ---------- */

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.92);
  cursor: pointer;
  animation: fadein 0.3s;
}

.celebrate-emoji { font-size: 80px; animation: pop 0.4s ease-out; }

.celebrate-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 46px);
  color: var(--gold);
  letter-spacing: 2px;
  margin: 8px 0 6px;
  text-align: center;
  text-shadow: 0 0 30px rgba(246, 185, 59, 0.5);
}

.celebrate-sub { font-size: 17px; color: var(--text); font-weight: 800; text-align: center; padding: 0 20px; }
.celebrate-hint { margin-top: 26px; font-size: 12px; font-weight: 800; color: var(--dim); letter-spacing: 2px; }

/* ---------- floating text & fx ---------- */

.float-text {
  position: fixed;
  transform: translate(-50%, -100%);
  font-weight: 900;
  font-size: 15px;
  color: #4ade80;
  text-shadow: -1.5px 0 #0c0e16, 1.5px 0 #0c0e16, 0 -1.5px #0c0e16, 0 1.5px #0c0e16, -1px -1px #0c0e16, 1px 1px #0c0e16, -1px 1px #0c0e16, 1px -1px #0c0e16;
  pointer-events: none;
  z-index: 250;
  animation: floatup 1.4s ease-out forwards;
}

.float-text.tap { color: #ffd75e; font-size: 16px; }
.float-text.win { font-size: 13px; }

.float-text.jackpot {
  color: #ffd75e;
  font-size: 19px;
}

@keyframes floatup {
  0% { opacity: 0; margin-top: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; margin-top: -60px; }
}

#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 350;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; grid-template-rows: 42% 1fr; }
  #panel { border-left: none; border-top: 2px solid var(--line); }
  #floorWrap { padding: 8px; }
  #rushBtn { min-width: 0; max-width: 48%; font-size: 11px; white-space: nowrap; }
  .cash-val { font-size: 20px; }
  .coin { width: 32px; height: 32px; font-size: 16px; }
  .city-name { display: none; }
  #toasts { width: 260px; top: 60px; }
}

@media (max-width: 640px) {
  .row { flex-wrap: wrap; }
  .row-actions { flex: 1 1 100%; justify-content: stretch; }
  .row-actions button { flex: 1; min-width: 0; }
}
