/* Pentas Malam: night-market and gig-poster UI. Dark glass panels, neon outlines, LED tickers. */

:root {
  --night: #1b1033;
  --night-2: #2a1650;
  --panel: rgba(28, 14, 54, 0.9);
  --panel-2: rgba(45, 22, 82, 0.92);
  --row: rgba(255, 255, 255, 0.05);
  --row-line: rgba(255, 255, 255, 0.1);
  --text: #fff3fb;
  --muted: #b9a7d6;
  --magenta: #ff3ea5;
  --cyan: #2de2e6;
  --gold: #ffb627;
  --lime: #b6ff3b;
  --bad: #ff5d7a;
  --glow-m: 0 0 10px rgba(255, 62, 165, 0.55), 0 0 2px rgba(255, 62, 165, 0.9);
  --glow-c: 0 0 10px rgba(45, 226, 230, 0.5), 0 0 2px rgba(45, 226, 230, 0.9);
  --glow-g: 0 0 10px rgba(255, 182, 39, 0.5);
  --glow-l: 0 0 10px rgba(182, 255, 59, 0.45);
  --display: 'Bungee', 'Fredoka', system-ui, sans-serif;
  --font: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif;
  /* aliases kept for older markup */
  --ink: var(--text);
  --line: var(--magenta);
  --primary: var(--magenta);
  --good: var(--lime);
  --cream-2: var(--row-line);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#world.pixel { image-rendering: pixelated; }

button { font-family: var(--font); color: var(--text); }
.hidden { display: none !important; }
.neg { color: var(--bad) !important; }
.pos { color: var(--lime) !important; }

.coin {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  font: 700 9px var(--display);
  color: #3a2300;
  background: radial-gradient(circle at 35% 30%, #fff1a8, var(--gold) 60%, #d98a00);
  box-shadow: var(--glow-g);
}
.coin.sm { width: 20px; height: 20px; font-size: 7px; }

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

#hud {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* let the rows shrink instead of overflowing on phones */
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  pointer-events: none;
}
.hud-row { display: flex; gap: 8px; }
.chip, .stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  background: var(--panel);
  border: 2px solid rgba(45, 226, 230, 0.55);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  color: var(--text);
}
.chip { height: 40px; padding: 0 12px; font-size: 15px; cursor: pointer; }
.chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.venue { flex: 1; cursor: default; border-color: rgba(255, 62, 165, 0.6); }
.chip.venue b { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0.03em; }
.chip.icon { position: relative; width: 44px; padding: 0; font-size: 18px; }
.chip.cab { border-color: var(--gold); box-shadow: var(--glow-g); }
.chip.visit { border-color: var(--cyan); box-shadow: var(--glow-c); }
.stat { flex: 1; height: 54px; font-size: 20px; }
.stat b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); font-weight: 400; font-size: 17px; }
.stat b small { font-family: var(--font); font-size: 13px; color: var(--muted); }
.stat.icon { flex: 0 0 54px; font-size: 20px; cursor: pointer; }
.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--magenta);
  color: #fff;
  font: 700 12px/20px var(--font);
  font-style: normal;
  box-shadow: var(--glow-m);
}

/* ---------- World-anchored layer: pins, LED stage ticker, floaters ---------- */

#layer { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#layer > * { position: absolute; left: 0; top: 0; }

.pin { pointer-events: auto; width: 0; height: 0; padding: 0; border: none; background: none; cursor: pointer; }
.pin span {
  position: absolute;
  left: -22px;
  top: -58px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 400 26px/1 var(--display);
  color: #2a1650;
  background: radial-gradient(circle at 35% 30%, #fffbd0, var(--lime) 65%, #7fc219);
  border: 3px solid #fff;
  box-shadow: var(--glow-l), 0 4px 0 rgba(0, 0, 0, 0.35);
  animation: bob 1.2s ease-in-out infinite;
}
.pin span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #fff;
}
.pin.dim span { filter: saturate(0.3) brightness(0.8); }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* LED ticker over the stage */
.bubble-in {
  position: absolute;
  transform: translate(-50%, -100%);
  margin-top: -12px;
  padding: 6px 16px 8px;
  background: #0d0718;
  border: 2px solid var(--gold);
  border-radius: 10px;
  box-shadow: var(--glow-g), inset 0 0 12px rgba(255, 182, 39, 0.15);
  text-align: center;
  white-space: nowrap;
}
.bubble-in::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--gold);
}
.bubble-in small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.bubble-in b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 182, 39, 0.8);
}
.live { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 8px #ff3b5c; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.floater span {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 400 17px var(--display);
  color: var(--lime);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(182, 255, 59, 0.7), 0 2px 0 #1b1033, 0 -2px 0 #1b1033, 2px 0 0 #1b1033, -2px 0 0 #1b1033;
  animation: floatUp 1.3s ease-out forwards;
}
.floater.emote span { font-size: 26px; text-shadow: none; }
@keyframes floatUp {
  from { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  to { opacity: 0; transform: translate(-50%, -250%) scale(1); }
}

/* ---------- Dock ---------- */

#dock {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 20px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#sheet { display: flex; flex-direction: column; gap: 10px; }
#sheet:empty { display: none; }

/* Tabs styled as backstage passes */
#nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
#nav:empty { display: none; }
.nav-btn {
  position: relative;
  height: 70px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--panel);
  border: 2px solid rgba(185, 167, 214, 0.35);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  font: 400 11.5px var(--display);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.nav-btn::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 18px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.nav-btn span { font-size: 24px; line-height: 1; }
.nav-btn.on { border-color: var(--magenta); box-shadow: var(--glow-m), 0 4px 14px rgba(0, 0, 0, 0.35); background: var(--panel-2); color: #fff; }
.nav-btn.locked { opacity: 0.45; }
.nav-btn:active { transform: translateY(2px); }

.card, .coach, .buy-card, .sheet, .modal-card {
  position: relative;
  background: var(--panel);
  border: 2px solid rgba(255, 62, 165, 0.65);
  border-radius: 18px;
  box-shadow: 0 0 18px rgba(255, 62, 165, 0.25), 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: var(--text);
}

.coach { padding: 14px 16px; border-style: dashed; border-color: rgba(45, 226, 230, 0.7); box-shadow: 0 0 16px rgba(45, 226, 230, 0.2), 0 10px 28px rgba(0, 0, 0, 0.45); }
.coach b { font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: 0.02em; color: var(--cyan); }
.coach p { margin: 6px 0; font-size: 15px; line-height: 1.4; }
.coach .row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 8px; }
.coach .btn { margin-top: 6px; }
.coach.incident.bad { border-color: var(--bad); }
.coach.incident.bad b { color: var(--bad); }
.coach.incident.good { border-color: var(--lime); }
.coach.incident.good b { color: var(--lime); }
.link { background: none; border: none; padding: 0; font: 600 14px var(--font); color: var(--cyan); text-decoration: underline; cursor: pointer; }
.link:disabled { opacity: 0.5; }

/* Buy cards look like ticket stubs: a perforated divider and notches */
.buy-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; overflow: visible; }
.buy-card::before, .buy-card::after {
  content: '';
  position: absolute;
  left: 58px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--night);
  border: 2px solid rgba(255, 62, 165, 0.65);
}
.buy-card::before { top: -9px; clip-path: inset(50% 0 0 0); }
.buy-card::after { bottom: -9px; clip-path: inset(0 0 50% 0); }
.buy-icon { font-size: 28px; width: 44px; text-align: center; flex: none; }
.buy-info { flex: 1; min-width: 0; display: flex; flex-direction: column; border-left: 2px dashed var(--row-line); padding-left: 12px; }
.buy-info b { font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase; }
.buy-info b small { font-family: var(--font); font-size: 13px; color: var(--muted); text-transform: none; }
.buy-info small { font-size: 13px; color: var(--muted); }
.buy-info .meta { color: var(--cyan); font-weight: 600; }
.mini-x {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--magenta);
  background: var(--night-2);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glow-m);
}
.sheet-head .mini-x { position: static; }

.price-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 14px 7px 8px;
  border-radius: 12px;
  border: 2px solid var(--lime);
  background: rgba(182, 255, 59, 0.12);
  color: var(--lime);
  font: 400 17px var(--display);
  box-shadow: var(--glow-l);
  cursor: pointer;
}
.price-btn.sm { font-size: 13px; padding: 6px 11px 6px 6px; }
.price-btn.sm .coin { width: 20px; height: 20px; font-size: 7px; }
.price-btn:disabled { border-color: rgba(185, 167, 214, 0.35); color: var(--muted); background: transparent; box-shadow: none; cursor: not-allowed; }
.price-btn:active:not(:disabled) { transform: translateY(2px); }

.tag {
  flex: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--row);
  border: 1px solid var(--row-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  max-width: 130px;
  text-align: center;
}
.tag.on { background: rgba(255, 62, 165, 0.18); border-color: var(--magenta); color: #fff; }
.tag.lock { background: rgba(0, 0, 0, 0.25); }

/* Neon-sign buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--cyan);
  background: rgba(45, 226, 230, 0.08);
  color: var(--cyan);
  font: 400 15px var(--display);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(45, 226, 230, 0.6);
  box-shadow: var(--glow-c);
  cursor: pointer;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-big { padding: 16px; font-size: 24px; }
.btn-primary {
  border-color: #ff7cc6;
  background: linear-gradient(135deg, var(--magenta), #ff7a3d);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: var(--glow-m), 0 6px 18px rgba(255, 62, 165, 0.35);
}
.btn-light { border-color: rgba(185, 167, 214, 0.5); background: rgba(255, 255, 255, 0.06); color: var(--text); text-shadow: none; box-shadow: none; }

/* ---------- Sheets ---------- */

.sheet { padding: 14px; max-height: 56vh; display: flex; flex-direction: column; }
.sheet > .sub, .sheet .sub { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h3 { margin: 0; font: 400 19px var(--display); letter-spacing: 0.02em; color: #fff; text-shadow: 0 0 10px rgba(255, 62, 165, 0.6); }
.sheet-body { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.sheet-body .btn { margin-top: 4px; }
.tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 10px; border: 2px solid var(--row-line); border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.tab { flex: 1; padding: 8px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font: 400 12px var(--display); letter-spacing: 0.03em; cursor: pointer; }
.tab.on { background: var(--magenta); color: #fff; box-shadow: var(--glow-m); }
.tabs.scenes .tab { font-size: 10.5px; padding: 8px 4px; line-height: 1.3; }

.goal { padding: 14px; border-radius: 16px; border: 2px solid var(--gold); background: rgba(255, 182, 39, 0.07); box-shadow: inset 0 0 18px rgba(255, 182, 39, 0.08); }
.goal-head { display: flex; gap: 12px; align-items: center; }
.goal-head b { font: 400 15px var(--display); }
.goal-head .sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.goal-num {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0d0718;
  color: var(--gold);
  font: 400 22px var(--display);
  border: 2px solid var(--gold);
  box-shadow: var(--glow-g);
}
.checklist { list-style: none; margin: 10px 0 12px; padding: 0 0 0 60px; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.checklist .lbl { flex: 1; }
.checklist .check { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--muted); font-size: 12px; font-weight: 700; }
.checklist li.ok { color: var(--lime); font-weight: 600; }
.checklist li.ok .check { background: var(--lime); border-color: var(--lime); color: #1b1033; }

.ladder-mini { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 4px 0; }
.ladder-mini span { padding: 3px 8px; border-radius: 8px; background: var(--row); }
.ladder-mini span.done { color: var(--lime); }
.ladder-mini span.now { background: var(--magenta); color: #fff; font-weight: 700; box-shadow: var(--glow-m); }

.item-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--row); border: 1px solid var(--row-line); border-radius: 14px; }
.item-row.locked { opacity: 0.5; }
.item-row.selected { border-color: var(--magenta); background: rgba(255, 62, 165, 0.1); box-shadow: inset 0 0 14px rgba(255, 62, 165, 0.15); }
.item-row .pips, .pips { display: flex; gap: 4px; margin-top: 5px; }
.item-row .pips i, .pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--row-line); }
.item-row .pips i.on, .pips i.on { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }

.meters { display: grid; gap: 6px; margin-bottom: 8px; }
.meter { display: grid; grid-template-columns: 118px 1fr 30px; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.meter b { text-align: right; font-family: var(--display); font-weight: 400; }
.bar { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); overflow: hidden; border: 1px solid var(--row-line); }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--magenta), var(--gold)); box-shadow: 0 0 8px var(--magenta); transition: width 0.3s; }
.buy-info .bar { height: 8px; margin: 6px 0 3px; }
.fest { margin: 0 0 8px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 182, 39, 0.1); border: 2px dashed var(--gold); font-size: 13px; font-weight: 600; color: var(--gold); }

.map-track { display: flex; align-items: center; padding: 6px 4px 10px; }
.map-track .node { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; width: 76px; }
.map-track .node b { width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; border-radius: 50%; border: 2px solid var(--row-line); background: rgba(0, 0, 0, 0.3); }
.map-track .node small { font-size: 12px; font-weight: 700; color: var(--muted); }
.map-track .node.on b { border-color: var(--cyan); }
.map-track .node.here b { border-color: var(--magenta); background: rgba(255, 62, 165, 0.25); box-shadow: var(--glow-m); }
.map-track .node.here small { color: #fff; }
.map-track .node.off b { opacity: 0.5; }
.map-track .track { flex: 1; height: 4px; margin: 0 -14px 18px; border-radius: 3px; background: var(--row-line); }
.map-track .track.on { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

.switch { flex: none; width: 56px; height: 32px; border-radius: 16px; border: 2px solid var(--row-line); background: rgba(0, 0, 0, 0.35); position: relative; cursor: pointer; }
.switch i { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: left 0.15s; }
.switch.on { border-color: var(--lime); box-shadow: var(--glow-l); }
.switch.on i { left: 28px; background: var(--lime); }

.item-row.account .buy-info { gap: 3px; }
.item-row.account .btn { margin-top: 8px; font-size: 13px; }
.item-row.account .link { align-self: flex-start; margin-top: 6px; font-size: 13px; }
.item-row.account b .link { margin: 0 0 0 6px; display: inline; }
.notice { margin: 6px 0 0; padding: 6px 8px; border-radius: 10px; background: rgba(255, 93, 122, 0.15); border: 1px solid var(--bad); font-size: 13px; }

/* ---------- Cabaran & Kawan ---------- */

#cbar {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 112px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #0d0718;
  border: 2px solid var(--gold);
  box-shadow: var(--glow-g);
  font: 400 15px var(--display);
  color: var(--gold);
  white-space: nowrap;
}
#cbar.hidden { display: none; }
#cbar .link { color: var(--cyan); font-size: 12px; }
#cb-time.hurry { color: var(--bad); animation: blink 1s infinite; }

.twists { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 6px; }
.twists li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 12px; background: rgba(255, 182, 39, 0.08); border: 2px solid var(--gold); }
.twists b { font: 400 14px var(--display); color: var(--gold); }
.twists small { color: var(--muted); font-size: 13px; }
.cab-best { margin-bottom: 4px; font-size: 14px; }
.board-title { margin: 12px 0 6px; font: 400 14px var(--display); color: var(--cyan); }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--row); border: 1px solid var(--row-line); }
.board li.me { border-color: var(--magenta); background: rgba(255, 62, 165, 0.12); }
.board .rk { width: 28px; text-align: center; font-family: var(--display); }
.board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board b { font-family: var(--display); font-weight: 400; color: var(--gold); }

.my-code { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; background: rgba(45, 226, 230, 0.08); border: 2px dashed var(--cyan); }
.my-code span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; }
.my-code b { font: 400 24px var(--display); letter-spacing: 0.15em; color: var(--cyan); text-shadow: 0 0 10px rgba(45, 226, 230, 0.6); }
.my-code .btn { margin: 0; padding: 8px 12px; font-size: 12px; }
.visit-card p { margin: 2px 0 8px; }
.visit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.visit-actions .btn { margin: 0; font-size: 12px; padding: 10px 6px; }
.visit-foot { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- Toast & banner ---------- */

#toast {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 156px);
  left: 50%;
  z-index: 12;
  max-width: calc(100% - 24px);
  padding: 8px 16px;
  border-radius: 999px;
  background: #0d0718;
  border: 1px solid var(--cyan);
  box-shadow: var(--glow-c);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
#toast.show { animation: toast 3s ease forwards; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  8%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

#banner {
  position: fixed;
  top: 30%;
  left: 50%;
  z-index: 16;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 26px;
  background: #0d0718;
  border: 3px solid var(--magenta);
  border-radius: 16px;
  box-shadow: var(--glow-m), 0 0 40px rgba(255, 62, 165, 0.35);
  font: 400 26px var(--display);
  color: #fff;
  text-shadow: 0 0 12px var(--magenta);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#banner.show { animation: stamp 2.4s ease-out forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(-6deg); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.95) rotate(-3deg); }
}

/* ---------- Modals ---------- */

#modal { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 16px; }
#modal.open { display: grid; background: rgba(10, 4, 22, 0.6); backdrop-filter: blur(2px); }
#modal.open.clear { background: none; backdrop-filter: none; }
.modal-card { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 20px 20px; }
.modal-card h2 { font: 400 22px var(--display); letter-spacing: 0.02em; text-shadow: 0 0 10px rgba(255, 62, 165, 0.6); }
.row2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.center { text-align: center; }
.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.report { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.report td { padding: 6px 2px; border-bottom: 1px dashed var(--row-line); }
.report td:last-child { text-align: right; font-family: var(--display); }
.report tr.total td { border-bottom: none; font-size: 18px; padding-top: 10px; color: var(--gold); }

.save-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--row-line); border-radius: 14px; background: var(--row); text-align: left; }
.save-card span { font-weight: 700; }
.save-card small { color: var(--muted); font-size: 12.5px; }
.save-card .btn { margin-top: 6px; font-size: 13px; }
@media (max-width: 400px) { .save-cards { grid-template-columns: 1fr; } }

.cab-result h2 { text-align: center; }
.big-score { text-align: center; font: 400 60px/1.1 var(--display); color: var(--gold); text-shadow: 0 0 18px rgba(255, 182, 39, 0.75); }
.rank-line { text-align: center; margin: 10px 0 4px; font-size: 15px; }
.cab-result .row2 { grid-template-columns: 1fr 1fr; margin-top: 10px; }

/* ---------- Onboarding: posters taped on the padang notice board ---------- */

#modal.onb-open { background: radial-gradient(120% 80% at 50% 30%, rgba(255, 182, 39, 0.16), rgba(10, 4, 22, 0.78) 60%); backdrop-filter: blur(3px); }
.onb { position: relative; width: min(400px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; gap: 14px; padding-top: 40px; }
.onb-skip {
  position: absolute; top: 0; right: 4px; z-index: 3; padding: 7px 12px 8px; border: 0; cursor: pointer;
  font: 700 14px var(--font); color: #4a3200; background: #ffe98a; transform: rotate(3deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); clip-path: polygon(0 0, 100% 0, 100% 80%, 88% 100%, 0 100%);
}
.onb-skip::after { content: ' ›'; }
.onb-board { flex: 1; min-height: 0; display: grid; place-items: center; }
.onb-stack { position: relative; width: 100%; max-height: 100%; display: grid; }

.poster {
  --ink: #2a1650;
  position: relative; width: 100%; max-height: 100%; overflow-y: auto;
  padding: 18px 18px 14px; color: var(--ink); text-align: center;
  background:
    radial-gradient(rgba(42, 22, 80, 0.07) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(170deg, rgba(255, 255, 255, 0.35), transparent 40%, rgba(120, 70, 20, 0.12)),
    var(--paper);
  border-radius: 3px; transform: rotate(-1.5deg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  touch-action: pan-y;
}
.poster.p1 { transform: rotate(1.2deg); }
.poster.p3 { transform: rotate(1deg); }
.poster.ghost { position: absolute; inset: 0; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
.poster.ghost.g0 { transform: rotate(4deg) translate(10px, 6px); filter: brightness(0.82); }
.poster.ghost.g1 { transform: rotate(-5deg) translate(-12px, 12px); filter: brightness(0.66); }
.poster.in-next { animation: poster-in-next 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.poster.in-back { animation: poster-in-back 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes poster-in-next { from { opacity: 0; transform: translate(40px, -30px) rotate(9deg) scale(1.06); } }
@keyframes poster-in-back { from { opacity: 0; transform: translate(-60px, 0) rotate(-10deg); } }
.tape { position: absolute; top: -9px; width: 74px; height: 22px; background: rgba(255, 250, 230, 0.62); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.tape.tl { left: 10px; transform: rotate(-24deg); }
.tape.tr { right: 10px; transform: rotate(22deg); }

.poster-art { height: 168px; margin-bottom: 12px; border-radius: 2px; overflow: hidden; }
.poster-kicker { display: inline-block; padding: 3px 10px; font: 700 12px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper); background: var(--ink); transform: rotate(-2deg); }
.poster h2 { margin: 8px 0 6px; font: 400 26px/1.08 var(--display); color: #d81b72; text-shadow: 2px 2px 0 rgba(42, 22, 80, 0.18); }
.poster p { margin: 0 auto 12px; max-width: 32ch; font-size: 16px; font-weight: 600; line-height: 1.42; }
.poster-foot { display: flex; justify-content: space-between; padding-top: 8px; border-top: 2px dashed rgba(42, 22, 80, 0.3); font: 400 11px var(--display); letter-spacing: 0.06em; opacity: 0.7; }

/* 1: empty stage at night */
.pa-night { position: relative; height: 100%; background: linear-gradient(#0f0a2e, #3b1a62 60%, #a0466e); }
.pa-night .moon { position: absolute; top: 14px; right: 22px; font-size: 34px; filter: drop-shadow(0 0 10px #ffe9a6); }
.pa-night .palm { position: absolute; bottom: 14px; left: 14px; font-size: 54px; }
.pa-night .bare-stage { position: absolute; left: 50%; bottom: 18px; width: 150px; height: 92px; transform: translateX(-50%); }
.bare-stage .roof { position: absolute; top: 0; left: -10px; right: -10px; height: 28px; background: repeating-linear-gradient(90deg, #e2483f 0 18px, #f5ead6 18px 36px); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.bare-stage .deck { position: absolute; bottom: 0; left: 0; right: 0; height: 64px; border-left: 5px solid #6b4426; border-right: 5px solid #6b4426; background: linear-gradient(transparent 70%, #8a5a33 70%); }
.pa-night .no-mic { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); font-size: 30px; opacity: 0.85; }
.pa-night .no-mic::after { content: ''; position: absolute; inset: -6px; border: 3px solid #ff5d7a; border-radius: 50%; background: linear-gradient(45deg, transparent 46%, #ff5d7a 46% 54%, transparent 54%); }

/* 2: price tag + loop */
.pa-tag { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.price-tag { position: relative; padding: 10px 26px 10px 40px; background: #fff8e4; color: var(--ink); border: 2px solid var(--ink); clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 50%); transform: rotate(-4deg); }
.price-tag .hole { position: absolute; left: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--ink); }
.price-tag b { display: block; white-space: nowrap; font: 400 40px/1 var(--display); color: #1f8a4c; }
.price-tag small { font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.pa-loop { display: flex; align-items: center; gap: 6px; }
.pa-loop span { display: flex; flex-direction: column; align-items: center; font-size: 26px; }
.pa-loop small { font-size: 11px; font-weight: 700; }
.pa-loop em { font-style: normal; font-weight: 700; opacity: 0.6; }

/* 3: road map */
.pa-map {
  position: relative; height: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 6px;
  background: repeating-linear-gradient(90deg, rgba(42, 22, 80, 0.45) 0 10px, transparent 10px 18px) center 58% / 88% 3px no-repeat;
}
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; }
.stop.s1, .stop.s3 { transform: translateY(26px); }
.stop.s0, .stop.s2, .stop.s4 { transform: translateY(-14px); }
.stop b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; line-height: 1; font: 400 16px var(--display); background: #fff8e4; border: 2px solid var(--ink); }
.stop small { padding: 0 4px; border-radius: 3px; background: var(--paper); font-size: 11.5px; font-weight: 700; }
.stop.here b { background: #d81b72; color: #fff; box-shadow: 0 0 0 5px rgba(216, 27, 114, 0.25); }
.stop.s4 b { background: #ffd36e; font-size: 20px; }
.stop em { position: absolute; bottom: 100%; margin-bottom: 4px; white-space: nowrap; font: 700 10.5px var(--font); font-style: normal; padding: 2px 6px; background: var(--ink); color: #fff; border-radius: 4px; }

/* 4: three scene flyers */
.pa-flyers { height: 100%; display: flex; justify-content: center; align-items: center; gap: 0; }
.flyer { width: 31%; max-width: 112px; padding: 12px 6px; margin: 0 -1px; display: flex; flex-direction: column; gap: 6px; color: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3); }
.flyer b { font: 400 12px/1.15 var(--display); }
.flyer span { font-size: 26px; letter-spacing: 2px; }
.flyer small { font-weight: 700; font-size: 11px; opacity: 0.85; }
.f-underground { background: #22183a; transform: rotate(-7deg) translateY(6px); }
.f-commercial { position: relative; z-index: 1; background: #d81b72; transform: rotate(1deg) translateY(-6px); }
.f-culture { background: #1f8a4c; transform: rotate(7deg) translateY(6px); }

/* Controls: back, festoon progress, tear-off ticket */
.onb-bar { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding-bottom: 4px; }
.onb-back { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255, 243, 251, 0.35); background: rgba(255, 255, 255, 0.06); font: 400 26px/1 var(--display); cursor: pointer; }
.onb-back:disabled { visibility: hidden; }
.festoon { position: relative; display: flex; justify-content: center; gap: 16px; padding-top: 6px; }
.festoon::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 12px; border-bottom: 1.5px solid rgba(255, 243, 251, 0.35); border-radius: 0 0 50% 50%; }
.festoon i { position: relative; width: 12px; height: 16px; border-radius: 50% 50% 45% 45%; background: #4b3a63; }
.festoon i.on { background: #ffd36e; box-shadow: 0 0 12px 3px rgba(255, 211, 110, 0.7); }
.festoon i:nth-child(2).on { background: #ff7eb6; box-shadow: 0 0 12px 3px rgba(255, 126, 182, 0.7); }
.festoon i:nth-child(3).on { background: #7ef0c4; box-shadow: 0 0 12px 3px rgba(126, 240, 196, 0.7); }
.festoon i:nth-child(4).on { background: #9fd0ff; box-shadow: 0 0 12px 3px rgba(159, 208, 255, 0.7); }
.ticket {
  display: flex; align-items: stretch; min-height: 52px; padding: 0; border: 0; cursor: pointer; color: #2a1650;
  font: 400 15px var(--display); letter-spacing: 0.04em; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}
.ticket span, .ticket i { display: grid; place-items: center; background: #ffb627; }
.ticket span { padding: 0 16px 0 20px; white-space: nowrap; border-radius: 8px 0 0 8px; -webkit-mask: radial-gradient(circle at 0 50%, transparent 7px, #000 7.5px); mask: radial-gradient(circle at 0 50%, transparent 7px, #000 7.5px); }
.ticket i { width: 46px; font-style: normal; font-size: 22px; border-left: 2px dashed rgba(42, 22, 80, 0.45); border-radius: 0 8px 8px 0; background: #ffd36e; }
.ticket:active { transform: translateY(2px) rotate(-1deg); }
@media (max-height: 640px) { .poster-art { height: 128px; } .poster h2 { font-size: 22px; } .poster p { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .poster.in-next, .poster.in-back { animation: none; } }

/* ---------- Title: a neon tube sign ---------- */

.title-screen { width: min(420px, 100%); height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 6vh 0 0; }
.title-screen .card { padding: 16px; }
.title-screen .btn + .btn { margin-top: 10px; }
.sign { align-self: center; display: flex; flex-direction: column; align-items: center; }
.liplap {
  width: 110%;
  height: 16px;
  margin-bottom: -4px;
  background:
    radial-gradient(circle, #ff4d6d 4px, transparent 5px) 0 0 / 60px 16px,
    radial-gradient(circle, #ffd25a 4px, transparent 5px) 15px 0 / 60px 16px,
    radial-gradient(circle, #5be37d 4px, transparent 5px) 30px 0 / 60px 16px,
    radial-gradient(circle, #4dc3ff 4px, transparent 5px) 45px 0 / 60px 16px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  animation: twinkle 1.6s steps(2) infinite;
}
@keyframes twinkle { 50% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)) brightness(1.3); } }
.sign-board {
  background: rgba(13, 7, 24, 0.85);
  border: 3px solid var(--magenta);
  border-radius: 20px;
  padding: 14px 34px 10px;
  text-align: center;
  box-shadow: var(--glow-m), 0 0 40px rgba(255, 62, 165, 0.3), inset 0 0 20px rgba(255, 62, 165, 0.15);
}
.sign-board h1 {
  margin: 0;
  font: 400 60px/1 var(--display);
  color: #ffe3f3;
  text-shadow: 0 0 6px #fff, 0 0 14px var(--magenta), 0 0 28px var(--magenta);
  animation: flicker 6s infinite;
}
.sign-board h1 span { color: #e0ffff; text-shadow: 0 0 6px #fff, 0 0 14px var(--cyan), 0 0 28px var(--cyan); }
.sign-board p { margin: 6px 0 0; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; color: var(--gold); text-shadow: 0 0 8px rgba(255, 182, 39, 0.7); }
.sign-posts { width: 60%; height: 34px; border-left: 6px solid #3a2a55; border-right: 6px solid #3a2a55; }
@keyframes flicker {
  0%, 19%, 21%, 62%, 64%, 100% { opacity: 1; }
  20%, 63% { opacity: 0.55; }
}

/* ---------- Small phones ---------- */

@media (max-width: 420px) {
  .hud-row { gap: 6px; }
  .chip { font-size: 13px; padding: 0 8px; }
  .chip.icon { width: 36px; font-size: 16px; }
  .stat { height: 50px; flex: 1 1 0; gap: 3px; padding: 0 3px; }
  .stat b { font-size: 13px; }
  .stat b small { font-size: 11px; }
  .stat .coin { width: 20px; height: 20px; font-size: 7px; }
  .stat > span { font-size: 15px; }
  .stat.icon { flex: 0 0 38px; font-size: 16px; }
  .stat.gems { flex: 0 0 58px; }
  .stat.gems b { font-size: 12px; }
  .nav-btn { height: 64px; font-size: 10px; }
  .nav-btn span { font-size: 22px; }
  .buy-info b { font-size: 14px; }
  .price-btn { font-size: 15px; }
  .sign-board h1 { font-size: 48px; }
  #banner { font-size: 21px; }
}

/* ---------- Shops (stall types) in BINA ---------- */

.shops { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px 46px; }
.shop-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--row-line); border-radius: 999px; background: var(--row); font: 600 12.5px var(--font); cursor: pointer; }
.shop-chip span { font-size: 15px; }
.shop-chip.on { border-color: var(--cyan); background: rgba(45, 226, 230, 0.15); box-shadow: var(--glow-c); }
.shop-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.shop-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--row-line); border-radius: 14px; background: var(--row); text-align: left; cursor: pointer; }
.shop-opt span { grid-row: span 2; font-size: 26px; }
.shop-opt b { font: 400 12.5px var(--display); letter-spacing: 0.02em; }
.shop-opt small { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.shop-opt.on { border-color: var(--magenta); background: rgba(255, 62, 165, 0.16); }
@media (max-width: 360px) { .shop-picker { grid-template-columns: 1fr; } }

/* ---------- Sponsor card (tap a banner / billboard / screen) ---------- */

#sponsor-card { position: fixed; inset: 0; z-index: 25; display: none; place-items: center; padding: 16px; background: rgba(10, 4, 22, 0.5); }
#sponsor-card.open { display: grid; }
.sponsor-card {
  position: relative; width: min(320px, 100%); padding: 22px 18px 18px; text-align: center; border-radius: 6px;
  background: var(--sp-bg); color: var(--sp-fg); transform: rotate(-1.5deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: poster-in-next 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.sponsor-card .mini-x { position: absolute; top: 8px; right: 8px; }
.sp-tag { display: inline-block; padding: 2px 8px; font: 700 11px var(--font); letter-spacing: 0.1em; background: rgba(0, 0, 0, 0.45); color: #fff; }
.sp-icon { font-size: 56px; line-height: 1.2; margin: 8px 0 2px; }
.sponsor-card b { display: block; font: 400 22px/1.1 var(--display); }
.sponsor-card p { margin: 6px 0 14px; font-weight: 600; font-size: 15px; }
.sponsor-card small { font-size: 12.5px; opacity: 0.8; }
.sponsor-card .sp-pitch { display: block; margin-top: 10px; font-size: 11.5px; opacity: 0.7; }

/* Announcement from the Admin portal: a notice pinned to the board */
#notice-card { position: fixed; inset: 0; z-index: 24; display: none; place-items: center; padding: 16px; background: rgba(10, 4, 22, 0.55); }
#notice-card.open { display: grid; }
.notice-card {
  position: relative; width: min(360px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 22px 18px 18px; text-align: center; border-radius: 6px; background: #fff3d6; color: #2a1650; transform: rotate(1deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: poster-in-next 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.notice-card b { display: block; margin: 10px 0 4px; font: 400 22px/1.15 var(--display); }
.notice-card p { margin: 6px 0 16px; font-weight: 600; font-size: 15px; line-height: 1.4; }

.bina-sub { margin: 14px 2px 6px; font: 400 14px var(--display); letter-spacing: 0.03em; color: var(--cyan); }
.bina-sub small { font: 600 12px var(--font); color: var(--muted); letter-spacing: 0; margin-left: 6px; }

/* ---------- Builders (Tukang), build timers and gems ---------- */

.stat.gems { flex: 0.9; flex-direction: column; gap: 0; cursor: pointer; border-color: rgba(182, 255, 59, 0.55); }
.stat.gems b { font-size: 15px; line-height: 1.1; }
.stat.gems small { font-size: 11px; color: var(--muted); line-height: 1.1; }
@media (max-width: 400px) { .stat.gems b { font-size: 13px; } }

.job { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; margin-top: 6px; }
.job span { font: 400 12px var(--display); color: var(--gold); white-space: nowrap; }
.job.big { margin: 10px 0 2px; }
.job.big span { font-size: 15px; }
.job .bar i { background: linear-gradient(90deg, #f6c445, var(--lime)); box-shadow: 0 0 8px rgba(182, 255, 59, 0.6); }
.gem-btn {
  padding: 6px 10px; border: 2px solid #b6ff3b; border-radius: 10px; cursor: pointer; white-space: nowrap;
  font: 400 13px var(--display); color: #10240a; background: linear-gradient(#e8ffb3, #b6ff3b);
}
.gem-btn.big { padding: 9px 12px; font-size: 15px; }
.gem-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tag.busy { cursor: pointer; border: 1px solid rgba(246, 196, 69, 0.6); color: #f6c445; font-family: var(--font); }

.job-pin {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  margin: -46px 0 0 -48px; width: 96px; padding: 5px 0; text-align: center;
  font: 400 13px var(--display); color: #2a1650; background: #f6c445;
  border: 2px solid #fff; border-radius: 12px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(246, 196, 69, 0.6);
}

/* ---------- PETA: illustrated Malaysia map ---------- */

.sheet-head h3 small { font: 600 12px var(--font); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.map-wrap { margin: 0 0 10px; padding: 5px; border-radius: 10px; background: linear-gradient(135deg, #8b5a2b, #6b4426); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 0 2px #c08a52; }
.map { display: block; width: 100%; height: auto; border-radius: 6px; }
.map .sea { fill: #3fa9c9; }
.map .my { fill: #f3dfa8; stroke: #7a5a2e; stroke-width: 1.4; stroke-linejoin: round; }
.map .other { fill: #d9c48f; opacity: 0.55; stroke: #7a5a2e; stroke-width: 0.6; stroke-dasharray: 2 2; }
.map .region { font: 400 9px Bungee, sans-serif; fill: rgba(90, 60, 25, 0.55); letter-spacing: 0.06em; }
.map .sea-name { font: 700 8px Fredoka, sans-serif; font-style: italic; fill: rgba(255, 255, 255, 0.75); }
.map .doodle .dl { font: 700 6.5px Fredoka, sans-serif; fill: #5a3c19; }
.map .compass circle { fill: #f3dfa8; stroke: #7a5a2e; stroke-width: 1.2; }
.map .compass path { fill: #c0392b; }
.map .compass path.ew { fill: #2a1650; opacity: 0.7; }
.map .compass text { font: 400 7px Bungee, sans-serif; fill: #f3dfa8; }
.map .route { fill: none; stroke: rgba(42, 22, 80, 0.45); stroke-width: 1.6; stroke-dasharray: 3 3; }
.map .route.on { stroke: #ff3ea5; stroke-dasharray: none; stroke-width: 2; }
.map .pin-city { cursor: pointer; }
.map .pin-city .drop { fill: #ff3ea5; stroke: #fff; stroke-width: 1.4; }
.map .pin-city .pe { font-size: 10px; }
.map .pin-city .lbl { fill: rgba(42, 22, 80, 0.88); }
.map .pin-city .ln { font: 400 8.5px Bungee, sans-serif; fill: #fff; letter-spacing: 0.02em; }
.map .pin-city.here .drop { fill: #ffb627; }
.map .pin-city.ready .drop { fill: #2de2e6; }
.map .pin-city.off .drop { fill: #8d8a99; }
.map .pin-city.off .lbl { fill: rgba(42, 22, 80, 0.55); }
.map .pin-city.sel .drop { stroke: #2a1650; stroke-width: 2.4; }
.map .pin-city.sel .lbl { fill: #d81b72; }
.map .pulse { fill: none; stroke: #ffb627; stroke-width: 2; transform-origin: 0 -1px; animation: map-pulse 1.6s ease-out infinite; }
@keyframes map-pulse { from { r: 4; opacity: 1; } to { r: 16; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map .pulse { animation: none; } }

/* Mat-slot upgrade options */
.mat-opt b em { font: 600 11px var(--font); font-style: normal; color: var(--cyan); margin-left: 4px; letter-spacing: 0; }
.mat-opt small.price { grid-column: 2; margin-top: 3px; font: 400 12px var(--display); color: var(--gold); }
.mat-opt:disabled { opacity: 0.5; cursor: not-allowed; }
.mat-job { grid-column: 1 / -1; }
.mat-opt small.price .coin { width: 16px; height: 16px; font-size: 6px; vertical-align: -3px; margin-right: 2px; }

/* ---------- Kedai (gem shop) ---------- */

.kedai-cta { margin: 0 0 10px; }
.kedai-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(246, 196, 69, 0.6); background: rgba(246, 196, 69, 0.08); font-size: 13px; line-height: 1.4; }
.kedai-note .btn { margin-top: 8px; font-size: 13px; }
.kedai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kedai-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 12px; text-align: center; border-radius: 16px; border: 1px solid var(--row-line); background: linear-gradient(160deg, rgba(182, 255, 59, 0.08), rgba(255, 255, 255, 0.03)); }
.kedai-card.starter { grid-column: 1 / -1; border-color: var(--gold); background: linear-gradient(160deg, rgba(255, 182, 39, 0.22), rgba(255, 62, 165, 0.12)); box-shadow: var(--glow-g); }
.kedai-card.owned { opacity: 0.6; }
.kedai-icon { font-size: 38px; line-height: 1.1; }
.kedai-card b { font: 400 14px var(--display); letter-spacing: 0.02em; }
.kedai-card small { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.kedai-card .price-btn { margin-top: 6px; width: 100%; justify-content: center; }
.kedai-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 10px; border-radius: 999px; font: 700 11px var(--font); color: #2a1650; background: var(--gold); }
.kedai-confirm { margin: 0 0 12px; padding: 12px; border-radius: 14px; border: 2px solid var(--magenta); background: rgba(255, 62, 165, 0.1); }
.kedai-confirm b { display: block; font: 400 15px var(--display); margin-bottom: 4px; }
.kedai-confirm p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.kedai-card small .coin { width: 16px; height: 16px; font-size: 6px; vertical-align: -3px; }

/* Kedai → Skin */
.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.skin-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px 10px; text-align: center; border-radius: 14px; border: 1px solid var(--row-line); background: var(--row); }
.skin-card.on { border-color: var(--lime); box-shadow: var(--glow-l); }
.skin-card.trying { border-color: var(--cyan); box-shadow: var(--glow-c); }
.skin-icon { font-size: 30px; line-height: 1.15; }
.skin-card b { font: 400 12.5px var(--display); letter-spacing: 0.02em; }
.skin-card small { font-size: 11.5px; line-height: 1.3; color: var(--muted); min-height: 30px; }
.skin-card .tag { cursor: pointer; margin-top: 4px; }
.skin-btns { display: flex; gap: 6px; margin-top: 4px; }
.skin-btns .tag { margin: 0; }

/* ---------- Mod Susun ---------- */
.arrange-btn { margin-left: auto; margin-right: 8px; cursor: pointer; border: 1px solid var(--cyan); color: var(--cyan); }
.arrange-card b { color: var(--cyan); }
.arr { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.arr-item { width: 44px; height: 44px; margin: -22px 0 0 -22px; font-size: 22px; background: rgba(28, 14, 54, 0.92); border: 2px solid var(--cyan); box-shadow: var(--glow-c); }
.arr-item.on { border-color: var(--gold); background: rgba(255, 182, 39, 0.35); box-shadow: 0 0 16px rgba(255, 182, 39, 0.8); }
.arr-spot { width: 38px; height: 38px; margin: -19px 0 0 -19px; font: 400 18px var(--display); color: #fff; background: rgba(45, 226, 230, 0.25); border: 2px dashed var(--cyan); }
.arr-spot.swap { width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 15px; background: rgba(255, 62, 165, 0.35); border-color: var(--magenta); border-style: solid; }
.arr-item.decor { width: 36px; height: 36px; margin: -18px 0 0 -18px; font-size: 18px; border-color: var(--lime); box-shadow: var(--glow-l); }
.arr-item.decor.on { border-color: var(--gold); background: rgba(255, 182, 39, 0.35); }
.decor-row { margin: 4px 0 8px; }
.decor-row .shop-chip:disabled { opacity: 0.45; }
.skin-card .price-btn.sm { margin-top: 6px; }
.skin-card small.meta { min-height: 0; color: var(--cyan); }
.pin.up-badge span { width: 34px; height: 34px; left: -17px; top: -46px; font-size: 18px; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 65%, #c77a00); }
.quick-extra { margin-top: 8px; padding: 10px 12px; max-height: 42vh; overflow-y: auto; }
.quick-extra .shops { margin: 0; }
.pin.mess-pin span { width: 36px; height: 36px; left: -18px; top: -48px; font-size: 20px; background: radial-gradient(circle at 35% 30%, #fff, #d9c3a5 70%, #8a6b45); animation: bob 0.9s ease-in-out infinite; }
.pin.mess-pin.dim span { filter: none; opacity: 0.85; }
.pin.fix-pin span { width: 38px; height: 38px; left: -19px; top: -50px; font-size: 20px; background: radial-gradient(circle at 35% 30%, #fff7d6, #ffb627 65%, #c77a00); animation: bob 0.8s ease-in-out infinite; }
.pin.fix-pin.dim span { filter: saturate(0.4); }
.pin.cow-pin span { background: radial-gradient(circle at 35% 30%, #fff, #c9e7ff 70%, #5a8fb8); }
.title-row { display: flex; gap: 8px; margin-top: 12px; }
.title-chip {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 14px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08); color: #fff;
  font: 700 12px/1.1 var(--display, inherit); letter-spacing: 0.02em;
}
.title-chip b { font-size: 22px; line-height: 1; }
.title-chip:active { transform: translateY(1px); }
.title-chip .dot { position: absolute; top: 6px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 8px #ff3b5c; }
.news-screen { justify-content: flex-end; padding-bottom: 12px; }
.news-card { max-height: 80vh; display: flex; flex-direction: column; gap: 10px; }
.news-card .sheet-head small { margin-left: auto; }
.news-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.invite-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.invite-card p { margin: 0; }
.invite-card .item-row { margin: 0; }
