/* LEONIDA — Vice Run · pastel-neon coastal vibe */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #14102a;
  color: #f5f0ff;
  overflow: hidden;
}
#app { display: flex; height: 100vh; height: 100dvh; }

/* ---------- Stage ---------- */
#stage { position: relative; flex: 1 1 auto; min-width: 0; background: #0d2b3a; }
#game { display: block; width: 100%; height: 100%; touch-action: none; }

#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,6,32,.75), rgba(10,6,32,0));
}
#game-title {
  font-size: 22px; font-weight: 900; letter-spacing: 2px;
  color: #ffd166; text-shadow: 0 0 12px rgba(255,92,168,.8), 0 2px 0 #ff5ca8;
}
#game-title span { color: #7bf1ff; font-size: 14px; letter-spacing: 1px; text-shadow: 0 0 8px rgba(123,241,255,.7); }
#identity { font-size: 12.5px; opacity: .92; margin-top: 2px; }
.hud-right { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hud-stat {
  background: rgba(20,14,52,.72); border: 1px solid rgba(123,241,255,.35);
  border-radius: 999px; padding: 4px 11px; font-size: 13px;
}

#objective {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(20,14,52,.85); border: 1px solid #ff5ca8;
  border-radius: 12px; padding: 8px 16px; text-align: center;
  min-width: 260px; max-width: 92%; pointer-events: none;
  box-shadow: 0 0 18px rgba(255,92,168,.35);
}
#objective.hidden, #toast.hidden { display: none; }
#objective-text { font-weight: 700; font-size: 15px; }
#objective-meta { font-size: 12.5px; opacity: .9; margin-top: 2px; }
#timerbar-wrap { height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; margin-top: 6px; overflow: hidden; }
#timerbar { height: 100%; width: 100%; background: linear-gradient(90deg, #7bf1ff, #ff5ca8); transition: width .2s linear; }

#toast {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(20,14,52,.92); border: 2px solid #ffd166; color: #ffd166;
  font-size: 21px; font-weight: 800; padding: 14px 26px; border-radius: 14px;
  text-align: center; pointer-events: none; z-index: 5;
  box-shadow: 0 0 30px rgba(255,209,102,.4); max-width: 90%;
}

#minimap {
  position: absolute; right: 12px; bottom: 12px;
  width: 150px; height: 150px; border-radius: 10px;
  border: 2px solid rgba(123,241,255,.5); background: rgba(8,20,40,.8);
}

/* ---------- Joystick virtual (pengganti pad tombol arah) ---------- */
/* Basis melayang: muncul di titik jempol menyentuh canvas (floating origin),
   digerakkan game.js. Vertikal = gas/rem, horizontal = kemudi (analog). */
#joystick {
  position: absolute; width: 124px; height: 124px; border-radius: 50%;
  border: 2px solid rgba(123,241,255,.55); background: rgba(20,14,52,.35);
  box-shadow: inset 0 0 24px rgba(123,241,255,.18);
  display: none; z-index: 8; pointer-events: none;
  transform: translate(-50%, -50%);
}
#joystick.on { display: block; }
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px;
  border-radius: 50%; background: rgba(255,92,168,.8);
  border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 0 16px rgba(255,92,168,.55);
  transform: translate(-50%, -50%);
}
#joy-hint {
  position: absolute; left: 50%; bottom: 168px; transform: translateX(-50%);
  background: rgba(20,14,52,.8); color: #7bf1ff; border: 1px solid rgba(123,241,255,.4);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700;
  display: none; z-index: 8; pointer-events: none; white-space: nowrap;
}
@media (pointer: coarse) { #joy-hint { display: block; } }
#joy-hint.used { display: none !important; }

/* ---------- Menu lipat (tumpukan tombol panel kiri bawah) ---------- */
/* Urutan tumpukan dari bawah: ✕/☰ (12) · Missions (64) · Slots (108) ·
   Mining (152) · Relics (196) · Fishing (240) — tidak saling menutupi. */
#menu-fold {
  position: absolute; left: 12px; bottom: 12px; z-index: 22;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,14,52,.85); color: #ffd166; border: 1px solid #ffd166;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
#stage.menu-folded #slot-fab,
#stage.menu-folded #panel-toggle,
#stage.menu-folded #mining-fab,
#stage.menu-folded #nft-fab,
#stage.menu-folded #fishing-fab,
#stage.menu-folded #char-fab { display: none !important; }

#panel-toggle {
  position: absolute; left: 12px; bottom: 64px; display: none;
  background: rgba(20,14,52,.85); color: #ffd166; border: 1px solid #ffd166;
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 700;
}

/* ---------- Karakter: FAB + tombol naik/turun + panel ---------- */
#char-fab {
  position: absolute; left: 12px; bottom: 284px; z-index: 6;
  background: linear-gradient(90deg, #7209b7, #2ec5ff); color: #fff; border: none;
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 800;
  cursor: pointer; box-shadow: 0 0 16px rgba(114,9,183,.5);
}
#btn-mode {
  position: absolute; right: 12px; bottom: 174px; z-index: 7;
  background: rgba(20,14,52,.88); color: #ffd166; border: 1px solid #ffd166;
  border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 800;
  cursor: pointer; box-shadow: 0 0 14px rgba(255,209,102,.35);
}
#btn-mode:disabled { opacity: .45; cursor: default; box-shadow: none; }
@media (max-width: 760px) { #btn-mode { bottom: 126px; } }
/* Zoom: tumpukan kecil di kanan atas tombol mode — tidak menyentuh area
   joystick (canvas) maupun minimap di bawahnya. */
#zoom-controls {
  position: absolute; right: 12px; bottom: 224px; z-index: 7;
  display: flex; flex-direction: column; gap: 8px;
}
#zoom-controls button {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(20,14,52,.85); color: #7bf1ff;
  border: 1px solid rgba(123,241,255,.6); font-size: 19px; font-weight: 800;
  cursor: pointer; line-height: 1;
}
@media (max-width: 760px) { #zoom-controls { bottom: 176px; } }
#char-overlay {
  position: absolute; inset: 0; z-index: 33;
  background: rgba(8,4,24,.72); display: flex;
  align-items: center; justify-content: center; padding: 12px;
}
#char-overlay.hidden { display: none; }
.char-box {
  width: min(430px, 96vw); max-height: 94%; overflow-y: auto;
  background: linear-gradient(180deg, #2a1650, #160b36);
  border: 2px solid #2ec5ff; border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 0 34px rgba(46,197,255,.35);
}
.char-head { display: flex; justify-content: space-between; align-items: center; }
.char-title { font-size: 21px; font-weight: 900; letter-spacing: 1px; color: #7bf1ff; }
#char-close {
  background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 50%; width: 30px; height: 30px; font-size: 14px; cursor: pointer;
}
.char-sub { font-size: 12.5px; opacity: .85; margin: 4px 0 8px; line-height: 1.45; }
#char-preview {
  display: block; margin: 4px auto 10px; width: 132px; height: 132px;
  background: radial-gradient(circle, #3f9e63 0%, #2b6e45 78%, #1d4d30 100%);
  border: 2px solid rgba(123,241,255,.5); border-radius: 14px;
}
.char-group { margin-bottom: 11px; }
.char-group h3 { font-size: 13.5px; margin-bottom: 6px; color: #7bf1ff; }
.char-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.char-chip {
  background: rgba(255,255,255,.08); color: #f5f0ff;
  border: 1px solid rgba(123,241,255,.4); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.char-chip.sel { background: rgba(255,92,168,.75); border-color: #ffd166; color: #fff; }
.char-swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.35); padding: 0;
}
.char-swatch.sel { border-color: #ffd166; box-shadow: 0 0 0 2px #ffd166, 0 0 10px rgba(255,209,102,.6); }
.char-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.char-tag { font-size: 10px; font-weight: 700; color: #9be7c4; text-align: center; max-width: 92px; }
.char-tag.locked { color: #ffd166; }
.char-chip.locked, .char-swatch.locked { opacity: .72; border-style: dashed; }
#char-buybar {
  background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.55);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px;
}
#char-buybar.hidden { display: none; }
.char-buytxt { margin: 0 0 8px; line-height: 1.5; }
#char-balance { display: inline-block; margin-top: 2px; color: #ffd166; font-weight: 700; }
.costume-card {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed rgba(255,209,102,.5);
}

/* ---------- Kartu hubungkan Telegram ---------- */
#link-code-out.hidden { display: none; }
#link-code-out { letter-spacing: 6px; }
#link-code-in {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  background: rgba(255,255,255,.08); color: #f5f0ff;
  border: 1px solid rgba(123,241,255,.5); border-radius: 10px;
  padding: 8px 12px; font-size: 15px; letter-spacing: 3px; text-align: center;
}

/* ---------- Panel ---------- */
#panel {
  flex: 0 0 320px; overflow-y: auto; padding: 12px;
  background: linear-gradient(180deg, #1d1440, #120b2e);
  border-left: 2px solid rgba(255,92,168,.4);
}
.card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 13px 14px; margin-bottom: 12px;
}
.card h2 { font-size: 16px; margin-bottom: 9px; color: #ffd166; }
.card h3 { font-size: 13px; margin: 11px 0 5px; opacity: .85; }
.card p { font-size: 13px; line-height: 1.45; }
.note { font-size: 12px; opacity: .75; margin-top: 7px; line-height: 1.4; }

button.action {
  background: linear-gradient(90deg, #ff5ca8, #ff9e5c); color: #fff; border: none;
  border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: 14px;
  cursor: pointer; margin-top: 9px; width: 100%;
}
button.action:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
button.ghost {
  background: transparent; color: #7bf1ff; border: 1px solid rgba(123,241,255,.6);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px;
  cursor: pointer; margin-top: 8px; width: 100%;
}
.quest-desc { font-size: 13.5px; line-height: 1.45; }
.quest-reward { color: #ffd166; font-weight: 700; }

.daily { margin-bottom: 11px; }
.daily-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; }
.daily-desc { font-size: 12.5px; opacity: .85; margin: 2px 0 5px; }
.progress { height: 8px; background: rgba(255,255,255,.13); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #39d98a, #7bf1ff); }
.daily button.action { padding: 6px 12px; font-size: 13px; }
.claimed-tag { color: #39d98a; font-size: 12.5px; font-weight: 700; }

.ledger-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3.5px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
.token-row b { color: #ffd166; }
#history { list-style: none; font-size: 12.5px; max-height: 168px; overflow-y: auto; }
#history li { padding: 3.5px 0; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; gap: 8px; }
#history .plus { color: #39d98a; font-weight: 700; white-space: nowrap; }

/* ---------- Vice Slots ---------- */
#slot-fab {
  position: absolute; left: 12px; bottom: 108px; z-index: 6;
  background: linear-gradient(90deg, #ff5ca8, #ff9e5c); color: #fff; border: none;
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 800;
  cursor: pointer; box-shadow: 0 0 16px rgba(255,92,168,.5);
}
#slot-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(8,4,24,.72); display: flex;
  align-items: center; justify-content: center; padding: 12px;
}
#slot-overlay.hidden { display: none; }
.slot-machine {
  width: min(430px, 96vw); max-height: 94%; overflow-y: auto;
  background: linear-gradient(180deg, #2a1650, #160b36);
  border: 2px solid #ffd166; border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 0 34px rgba(255,209,102,.35);
}
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.slot-title {
  font-size: 21px; font-weight: 900; letter-spacing: 2px; color: #ffd166;
  text-shadow: 0 0 12px rgba(255,92,168,.8), 0 2px 0 #ff5ca8;
}
#slot-close {
  background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 50%; width: 30px; height: 30px; font-size: 14px; cursor: pointer;
}
.slot-sub { font-size: 12px; opacity: .8; margin: 2px 0 10px; }
.slot-reels { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.slot-reel {
  width: 86px; height: 86px; border-radius: 14px;
  background: linear-gradient(180deg, #fff8e6, #ffe3a3);
  border: 3px solid #ff5ca8; display: flex; align-items: center; justify-content: center;
  font-size: 46px; box-shadow: inset 0 0 14px rgba(255,92,168,.35);
}
.slot-reel.spinning { animation: reelshake .12s infinite; filter: blur(1.2px); }
.slot-reel.win { border-color: #39d98a; box-shadow: 0 0 18px rgba(57,217,138,.8); }
@keyframes reelshake {
  0% { transform: translateY(-2px); } 50% { transform: translateY(2px); }
  100% { transform: translateY(-2px); }
}
#slot-result {
  text-align: center; font-size: 16px; font-weight: 800; color: #ffd166;
  min-height: 22px; margin: 6px 0 2px;
}
.slot-balances {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  font-size: 13px; margin: 6px 0 4px;
}
.slot-balances span {
  background: rgba(255,255,255,.08); border: 1px solid rgba(123,241,255,.35);
  border-radius: 999px; padding: 4px 11px;
}
.slot-actions { display: flex; }
.slot-h { font-size: 13.5px; margin: 13px 0 6px; color: #7bf1ff; }
.slot-packages { display: flex; gap: 8px; }
.slot-packages button {
  flex: 1; background: rgba(255,209,102,.14); color: #ffd166;
  border: 1px solid #ffd166; border-radius: 12px; padding: 8px 4px;
  font-weight: 800; font-size: 13px; cursor: pointer;
}
.slot-paytable { font-size: 13px; }
.slot-paytable .pt-row {
  display: flex; justify-content: space-between; padding: 3px 0;
  border-bottom: 1px dashed rgba(255,255,255,.12);
}

/* ---------- Mobile / Telegram: panel jadi overlay ---------- */
@media (max-width: 760px) {
  #panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 86vw; max-width: 330px;
    z-index: 20; transform: translateX(105%); transition: transform .25s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,.5);
  }
  #panel.open { transform: translateX(0); }
  #panel-toggle { display: block; z-index: 21; }
  #minimap { width: 104px; height: 104px; }
  #game-title { font-size: 18px; }
}

/* --- Top Up USDT (order bertanda) --- */
.pay-amount { font-size: 1.7em; font-weight: 800; text-align: center; margin: 6px 0; }
.pay-address { font-family: monospace; word-break: break-all; text-align: center;
  background: rgba(255,255,255,.08); border-radius: 8px; padding: 8px; margin: 6px 0; }
#pay-panel .slot-packages button.active { outline: 2px solid #ffd34d; }
#pay-qr { display: block; margin: 8px auto; background: #fff; border-radius: 8px; }
#pay-panel details { margin-top: 10px; }
#pay-txhash { width: 100%; box-sizing: border-box; margin: 6px 0; }

/* ---------- Level badge + bar XP (HUD) ---------- */
.hud-xpbar {
  width: 110px; height: 6px; margin: 3px 0 3px auto;
  background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden;
}
#hud-xpfill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffd166, #ff5ca8); border-radius: 999px;
  transition: width .6s ease;
}

/* ---------- Gerbang Komunitas ---------- */
#community-banner {
  position: absolute; top: 84px; left: 50%; transform: translateX(-50%);
  width: min(430px, 92%); z-index: 30; text-align: center;
  background: rgba(24,26,28,.96); color: #f2ede2; border: 2px solid #caa22f;
  border-radius: 16px; padding: 18px 20px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
#community-banner.hidden { display: none; }
#community-banner .community-title { font-size: 19px; font-weight: 900; color: #e6be5a; margin-bottom: 6px; }
#community-banner p { font-size: 13.5px; line-height: 1.45; margin: 4px 0; }
#community-guest-note.hidden { display: none; }
.community-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
#btn-community-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none;
  color: #f2ede2; font-size: 16px; cursor: pointer;
}
