:root {
  --bg-dark: #090b10;
  --panel-bg: rgba(16, 20, 30, 0.92);
  --panel-border: rgba(255, 196, 61, 0.25);
  --gold: #ffc43d;
  --gold-bright: #ffe07d;
  --gold-dark: #d99300;
  --emerald: #10b981;
  --cyan: #38bdf8;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-display: 'Chakra Petch', sans-serif;
  --font-sans: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ================= AUTH SCREEN ================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 180, 30, 0.16), transparent 60%),
    linear-gradient(180deg, #0d121d 0%, #07090e 100%);
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 23, 35, 0.95);
  border: 1px solid rgba(255, 196, 61, 0.35);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(255, 180, 30, 0.12);
}

.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 196, 61, 0.15);
  border: 1px solid rgba(255, 196, 61, 0.4);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 6px;
}

.auth-brand p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(8, 11, 18, 0.8);
  padding: 5px;
  border-radius: 11px;
  margin-bottom: 16px;
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: rgba(255, 196, 61, 0.2);
  color: var(--gold-bright);
  border: 1px solid rgba(255, 196, 61, 0.4);
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.field-group input {
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9px;
  padding: 11px 13px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.field-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 196, 61, 0.2);
}

.btn-primary-gold {
  background: linear-gradient(135deg, #ffd15c 0%, #f59e0b 100%);
  color: #111827;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-primary-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.5);
}

.btn-primary-gold:active {
  transform: translateY(1px);
}

.btn-primary-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-footer-features {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ================= GAME WRAPPER & CANVAS ================= */
#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ================= TOP UI STACK (NEVER OVERLAPS) ================= */
.ui-top-stack {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.hud-top {
  width: 100%;
  max-width: 1260px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 196, 61, 0.25);
  border-radius: 13px;
  flex-wrap: wrap;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operator-pill, .stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.op-icon, .stat-icon {
  font-size: 1.25rem;
}

.op-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.op-sub {
  font-size: 0.72rem;
  color: var(--gold);
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.coins-pill .stat-value {
  color: var(--gold-bright);
}

.stat-value small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* METERS */
.meter-box {
  min-width: 88px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.meter-header {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.meter-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 99px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.2s ease, background-color 0.2s;
}

.energy-fill {
  background: linear-gradient(90deg, #38bdf8, #facc15);
}

.hp-fill {
  background: linear-gradient(90deg, #ef4444, #22c55e);
}

.water-fill {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.food-fill {
  background: linear-gradient(90deg, #d97706, #facc15);
}

.fuel-fill {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.backpack-fill {
  background: linear-gradient(90deg, #a855f7, #ec4899);
}

.world-btn {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.phone-btn {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}

.meter-box.clickable-meter {
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.meter-box.clickable-meter:hover, .meter-box.clickable-meter:active {
  border-color: #f97316;
  transform: translateY(-1px);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.35);
}

.fuel-status-pill {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
  background: #22c55e;
  color: #0b0f19;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.2;
}

.meter-box.full-alert {
  border-color: #ef4444;
  animation: pulseAlert 1s infinite alternate;
}

@keyframes pulseAlert {
  from { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  to { box-shadow: 0 0 12px rgba(239, 68, 68, 0.65); }
}

.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 7px 10px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.hud-icon-btn:hover {
  background: rgba(255, 196, 61, 0.2);
  border-color: var(--gold);
}

.hud-icon-btn.active-toggle {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
}

.hud-icon-btn.danger-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.save-dot.saving {
  background: #facc15;
  animation: blink 0.6s infinite alternate;
}

@keyframes blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* ================= HOTBAR ================= */
.hotbar-container {
  position: relative;
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(11, 15, 25, 0.84);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  max-width: 100%;
}

body.touch-mode-active .slot-key {
  display: none;
}

.hotbar-slot {
  position: relative;
  min-width: 58px;
  height: 54px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px 6px;
  transition: all 0.15s;
}

.hotbar-slot:hover, .hotbar-slot:active {
  background: rgba(255, 196, 61, 0.22);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.slot-key {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-display);
}

.slot-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.slot-name {
  font-size: 0.62rem;
  color: #cbd5e1;
  margin-top: 2px;
}

.slot-count {
  position: absolute;
  top: 2px;
  right: 5px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  padding: 0 4px;
  border-radius: 4px;
}

.shop-quick-slot {
  border-color: rgba(255, 196, 61, 0.45);
  background: rgba(255, 196, 61, 0.1);
}

.pickaxe-toggle-slot {
  min-width: 78px;
  border-width: 2px;
}

.pickaxe-toggle-slot.active-pickaxe {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.pickaxe-toggle-slot.active-pickaxe .slot-name {
  color: #6ee7b7;
  font-weight: 700;
}

.pickaxe-toggle-slot.inactive-pickaxe {
  background: rgba(100, 116, 139, 0.18);
  border-color: rgba(148, 163, 184, 0.35);
  opacity: 0.85;
}

.pickaxe-toggle-slot.inactive-pickaxe .slot-name {
  color: #94a3b8;
}

.jetpack-toggle-slot {
  min-width: 76px;
  border-width: 2px;
}

.jetpack-toggle-slot.active-jetpack {
  background: rgba(249, 115, 22, 0.24);
  border-color: #f97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.35);
}

.jetpack-toggle-slot.active-jetpack .slot-name {
  color: #fdba74;
  font-weight: 700;
}

.jetpack-toggle-slot.inactive-jetpack {
  background: rgba(100, 116, 139, 0.18);
  border-color: rgba(148, 163, 184, 0.35);
  opacity: 0.85;
}

.jetpack-toggle-slot.inactive-jetpack .slot-name {
  color: #94a3b8;
}

.touch-action-btn.btn-jump.inactive-jetpack {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
}

.btn-mine-primary.inactive-pickaxe {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
}

.elevator-quick-slot {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
}

/* ================= CONTEXT BANNER (DESATIVADO PARA NÃO POLUIR A TELA) ================= */
.context-banner {
  display: none !important;
}

.btn-banner-action {
  display: none !important;
}

/* ================= CITY TOP-DOWN OVERLAY & INTERACTION ================= */
.city-interact-bubble {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
  max-width: 90vw;
}

.bubble-icon {
  font-size: 1.5rem;
}

.bubble-info {
  display: flex;
  flex-direction: column;
}

.bubble-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}

.bubble-sub {
  font-size: 0.74rem;
  color: #cbd5e1;
}

.bubble-action-btn {
  background: var(--gold);
  color: #0f172a;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.1s;
}

.bubble-action-btn:hover {
  transform: scale(1.05);
}

/* ================= TOUCH CONTROLS (MOBILE JOYSTICK & ACTION PAD) ================= */
.touch-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 210px;
  z-index: 25;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 22px 24px 22px;
}

.joystick-zone {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.joystick-base {
  position: relative;
  width: 134px;
  height: 134px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.68) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 2px solid rgba(255, 196, 61, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(255, 196, 61, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.joy-dir {
  position: absolute;
  font-size: 0.75rem;
  color: rgba(255, 196, 61, 0.45);
  pointer-events: none;
}
.joy-up { top: 7px; left: 50%; transform: translateX(-50%); }
.joy-down { bottom: 7px; left: 50%; transform: translateX(-50%); }
.joy-left { left: 8px; top: 50%; transform: translateY(-50%); }
.joy-right { right: 8px; top: 50%; transform: translateY(-50%); }

.joystick-stick {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe07d, #d99300);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: transform 0.04s linear;
}

.joystick-hint {
  font-size: 0.7rem;
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 8px;
  border-radius: 99px;
}

.action-pad {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.action-pad-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.touch-action-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  touch-action: none;
}

.touch-action-btn:active, .touch-action-btn.pressed {
  transform: scale(0.93);
  border-color: var(--gold);
  background: rgba(255, 196, 61, 0.32);
}

.btn-mine-primary {
  width: 84px;
  height: 84px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.92));
  border-color: #fde68a;
  color: #111827;
}

.btn-jump {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 116, 144, 0.75);
}

.btn-ladder {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(6, 95, 70, 0.75);
}

.btn-pillar {
  border-color: rgba(217, 119, 6, 0.75);
  background: rgba(120, 53, 15, 0.82);
}

.btn-collect {
  border-color: rgba(250, 204, 21, 0.7);
  background: rgba(113, 63, 18, 0.82);
}

.btn-shop {
  border-color: rgba(168, 85, 247, 0.65);
  background: rgba(88, 28, 135, 0.75);
}

.t-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.t-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 3px;
}

/* ================= MODALS (SHOP, ELEVATOR, LEADERBOARD) ================= */
.geomap-btn {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.45);
  color: #7dd3fc;
}

.geomap-sector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.geomap-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.geomap-tab:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.geomap-tab.active {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.geomap-tab.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.geomap-locked-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 8, 17, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.geomap-ore-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #e2e8f0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-window {
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  background: #111726;
  border: 1px solid rgba(255, 196, 61, 0.35);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

.small-window { max-width: 440px; }
.medium-window { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-bright);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-balance-badge {
  background: rgba(255, 196, 61, 0.16);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 6px 13px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.shop-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow-x: auto;
}

.shop-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

.shop-tab.active {
  background: rgba(255, 196, 61, 0.2);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.sell-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(255, 196, 61, 0.08);
  border: 1px solid rgba(255, 196, 61, 0.25);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.sell-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.total-sale-preview strong {
  color: var(--emerald);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.sell-grid, .upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}

.item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.item-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.item-swatch {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
}

.item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
}

.item-level-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.14);
  padding: 2px 8px;
  border-radius: 99px;
  margin-top: 4px;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.price-tag {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-bright);
  font-size: 0.96rem;
}

.btn-buy {
  background: var(--emerald);
  color: #052e16;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-buy:disabled {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
  cursor: not-allowed;
}

.expedition-card {
  display: flex;
  gap: 16px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.exp-icon {
  font-size: 2.6rem;
}

.exp-info h3 {
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.exp-info p {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.exp-keep-list {
  list-style: none;
  font-size: 0.82rem;
  color: #a7f3d0;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.catalog-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.elevator-floors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floor-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.floor-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.22);
}

.floor-btn:disabled {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

/* LEADERBOARD */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table th {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.ore-rank-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ore-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.74rem;
  color: #f8fafc;
}

.ore-rank-name {
  color: #cbd5e1;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.help-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
}

.help-card h4 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.help-card ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  color: #cbd5e1;
}

/* SMARTPHONE CEOX FRAME */
.smartphone-frame {
  width: 100%;
  max-width: 390px;
  height: 640px;
  max-height: 90vh;
  background: #090d16;
  border: 4px solid #334155;
  border-radius: 36px;
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-notch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: #04070d;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  overflow: hidden;
}

.phone-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.phone-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.phone-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.phone-app-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s, border-color 0.15s;
}

.phone-app-icon:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(255, 196, 61, 0.12);
}

.phone-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.9rem;
  user-select: text;
  -webkit-user-select: text;
}

/* RESPONSIVE MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
  .hud-top {
    padding: 5px 8px;
    gap: 5px;
  }
  .operator-pill {
    display: none;
  }
  .meter-box {
    min-width: 88px;
    padding: 4px 6px;
  }
  .meter-header {
    font-size: 0.64rem;
  }
  .hotbar-container {
    padding: 4px 6px;
    gap: 4px;
  }
  .hotbar-slot {
    min-width: 48px;
    height: 44px;
  }
  .slot-key {
    display: none;
  }
  .context-banner {
    width: 96%;
    justify-content: space-between;
    font-size: 0.74rem;
  }
  .touch-controls {
    padding: 10px 14px 16px 14px;
  }
  .joystick-base {
    width: 118px;
    height: 118px;
  }
  .joystick-stick {
    width: 48px;
    height: 48px;
  }
  .touch-action-btn {
    width: 58px;
    height: 58px;
  }
  .btn-mine-primary {
    width: 74px;
    height: 74px;
  }
}
