* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f1a;
  --bg2: #1a1a2e;
  --bg3: #252540;
  --green: #00e676;
  --green-dark: #00c853;
  --red: #ff5252;
  --gold: #ffd740;
  --text: #e0e0e0;
  --text-dim: #888;
  --radius: 12px;
  /* Alias vars used by newer components */
  --accent: #bb86fc;
  --border: #252540;
  --card: #1a1a2e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  padding-bottom: env(safe-area-inset-bottom);
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

#app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
#top-bar {
  display: flex;
  flex-direction: column;
  padding: 0;
  padding-top: env(safe-area-inset-top);
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  position: sticky;
  top: 0;
  z-index: 200;
}
.top-bar-row1 {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  padding-right: max(12px, env(safe-area-inset-right));
  padding-left: max(12px, env(safe-area-inset-left));
}
.top-bar-row2 {
  display: block;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
  border-top: 1px solid rgba(255,255,255,0.06);
  line-height: 1;
}
.top-bar-row2::-webkit-scrollbar { display: none; }
/* Every direct child renders inline so they never stack */
.top-bar-row2 > * {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
  margin-right: 5px;
}
.top-bar-row2 > *:last-child { margin-right: 0; }
/* Hide row2 entirely when empty */
.top-bar-row2:empty { display: none; }

#back-btn {
  background: none;
  border: none;
  color: var(--green);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

#page-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#admin-indicator {
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
#admin-indicator:active { opacity: 0.7; }

#balance-display {
  background: var(--bg3);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  color: var(--green);
  font-size: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

#balance-display.godmode {
  color: var(--gold);
  border: 1px solid var(--gold);
  animation: godPulse 1.5s ease-in-out infinite;
}

@keyframes godPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255,215,64,0.2); }
  50% { box-shadow: 0 0 15px rgba(255,215,64,0.5); }
}

.hidden { display: none !important; }

/* Streak Banner */
#streak-banner {
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  padding: 4px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

#streak-banner.win-streak { color: var(--green); }
#streak-banner.lose-streak { color: var(--red); }

/* Screens */
#screens { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen { display: none; padding: 16px; padding-bottom: max(32px, calc(16px + env(safe-area-inset-bottom))); }
.screen.active { display: block; }

/* Game HUD (house edge, w/l, profit) */
.game-hud {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.hud-item {
  flex: 1;
  background: var(--bg2);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-item span:last-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.hud-item .profit-neg { color: var(--red); }
.hud-item .profit-pos { color: var(--green); }

/* Clicker */
#clicker-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#click-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.stat {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

#click-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--green);
  background: var(--bg2);
  color: var(--green);
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: 0 0 30px rgba(0, 230, 118, 0.15);
  line-height: 1.3;
}

#click-btn:active {
  transform: scale(0.93);
  box-shadow: 0 0 50px rgba(0, 230, 118, 0.35);
}

#click-value { font-size: 22px; }

#upgrades { width: 100%; }

#upgrades h3 {
  color: var(--text-dim);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.upgrade-item {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.upgrade-item:hover { border-color: var(--bg3); }
.upgrade-item.affordable { border-color: var(--green); }
.upgrade-info { flex: 1; }

.upgrade-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.upgrade-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.upgrade-level {
  font-size: 11px;
  color: var(--green);
  margin-top: 2px;
}

.upgrade-cost {
  background: var(--bg3);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
  white-space: nowrap;
}

.nav-casino-btn {
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border: 2px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-casino-btn:active { background: var(--bg3); }

/* Casino Grid */
#casino-grid {
  display: block;
  padding: 0 4px;
}
.casino-grid-section {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 2px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.casino-grid-section::-webkit-scrollbar { display: none; }

.casino-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--bg3);
  transition: border-color 0.2s, transform 0.1s;
  flex: 0 0 auto;
  width: 90px;
  min-width: 0;
}

.casino-card:active { transform: scale(0.95); }
.casino-card:hover { border-color: var(--green); }
.casino-icon { font-size: 38px; margin-bottom: 6px; }
.casino-name { font-weight: 700; font-size: 13px; line-height: 1.2; }

/* Game Containers */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.game-result {
  min-height: 28px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.game-result.win { color: var(--green); }
.game-result.lose { color: var(--red); }
.game-result.push { color: var(--gold); }

.bet-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bet-controls label {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bet-controls input {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--green);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 12px;
  width: 120px;
  text-align: center;
}

.bet-buttons {
  display: flex;
  gap: 8px;
}

.bet-buttons button {
  background: var(--bg3);
  border: none;
  color: var(--text);
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.bet-buttons button:active { background: var(--bg2); }

.game-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.game-btn {
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
  background: var(--green);
  color: #000;
}

.game-btn:active { transform: scale(0.95); }
.game-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.game-btn.heads { background: var(--green); color: #000; }
.game-btn.tails { background: var(--gold); color: #000; }
.game-btn.spin { background: var(--green); color: #000; flex: 1; }

/* Coin Flip */
.coin {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg2);
  border: 4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  color: var(--gold);
  transition: transform 0.1s;
}

.coin.flipping { animation: coinFlip 0.6s ease-in-out; }

@keyframes coinFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(1800deg) scale(1.2); }
  100% { transform: rotateY(3600deg) scale(1); }
}

/* Coin Flip History */
.cf-history {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 20px;
  justify-content: center;
}

.cf-h-win {
  background: rgba(0, 230, 118, 0.15);
  color: var(--green);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.cf-h-lose {
  background: rgba(255, 82, 82, 0.15);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

/* Lucky Coin Upgrade */
.cf-luck-panel {
  position: relative;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cf-luck-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cf-luck-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}

.cf-luck-stat {
  font-size: 11px;
  color: var(--text-dim);
}

.cf-luck-stat strong {
  color: var(--text);
  font-size: 12px;
}

.cf-luck-btn {
  background: var(--bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.cf-luck-btn:active { background: var(--gold); color: #000; }
.cf-luck-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cf-luck-btn.affordable { border-color: var(--green); color: var(--green); }
.cf-luck-btn.cf-luck-maxed { border-color: var(--green); color: var(--green); }

/* Lucky Coin Lock Overlay */
.cf-luck-locked {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 26, 0.85);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  z-index: 2;
  letter-spacing: 0.5px;
}

/* Slots */
#slots-machine {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  border: 2px solid var(--bg3);
  width: 100%;
}

#slots-reels {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.reel {
  width: 80px;
  height: 168px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.reel-strip {
  position: absolute;
  width: 100%;
  transition: top 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.reel-symbol {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}

.reel-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  border: 2px solid var(--green);
  border-radius: 4px;
  pointer-events: none;
  opacity: 0.5;
}

#slots-paylines {
  display: flex;
  gap: 12px;
  align-items: center;
}

#slots-paylines label {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

#slots-paylines select, #plinko-options select {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
}

.slots-total-bet {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  text-align: center;
  width: 100%;
}

/* Crash */
#crash-display {
  width: 100%;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
  text-align: center;
}

#crash-canvas {
  width: 100%;
  max-width: 350px;
  height: 200px;
  display: block;
  margin: 0 auto;
}

#crash-multiplier {
  font-size: 48px;
  font-weight: 800;
  color: var(--green);
  margin-top: 8px;
}

#crash-multiplier.crashed { color: var(--red); }

/* Blackjack */
#bj-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#bj-dealer, #bj-player {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
}

#bj-dealer h3, #bj-player h3 {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

#bj-dealer h3 span, #bj-player h3 span {
  color: var(--green);
  font-size: 16px;
}

.card-hand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 80px;
}

.card {
  width: 55px;
  height: 78px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.card.red { color: #d32f2f; }
.card.black { color: #222; }

.card-facedown {
  background: linear-gradient(135deg, #1a5276, #2980b9);
  color: transparent;
}

.card-suit { font-size: 14px; }

/* Plinko */
#plinko-canvas {
  width: 100%;
  max-width: 350px;
  height: 400px;
  background: var(--bg2);
  border-radius: var(--radius);
  display: block;
}

#plinko-options {
  display: flex;
  gap: 16px;
}

#plinko-options label {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Plinko auto-drop */
.plinko-auto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.plinko-auto-row label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.plinko-auto-row input {
  width: 70px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: center;
}

.plinko-auto-btn {
  padding: 8px 16px !important;
  font-size: 14px !important;
}

.plinko-auto-active {
  background: var(--gold) !important;
  color: #000 !important;
}

.plinko-auto-status {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  min-height: 18px;
  color: var(--text-dim);
}

.plinko-auto-status.auto-profit { color: var(--green); }
.plinko-auto-status.auto-loss { color: var(--red); }

/* VIP Badge */
#vip-level {
  background: linear-gradient(135deg, #ffd740, #ff9100);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Rebirth */
.rebirth-info {
  width: 100%;
  background: linear-gradient(135deg, #1a1a2e, #2a1a3e);
  border: 1px solid #9c27b0;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.rebirth-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.rebirth-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rebirth-stat span:last-child {
  font-size: 16px;
  font-weight: 700;
  color: #ce93d8;
}

.rebirth-btn {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  border: 2px solid #9c27b0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 2px;
  animation: rebirthPulse 2s ease-in-out infinite;
}

.rebirth-btn:active { transform: scale(0.95); }

.rebirth-req {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--bg3);
}
.rebirth-req-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.req-met { color: #00e676; }
.req-met::before { content: '\2714 '; }
.req-unmet { color: #ff5252; }
.req-unmet::before { content: '\2718 '; }

.vip-perks-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 8px;
  font-size: 11px;
}

.vip-perk-row {
  color: #ffd740;
}

.vip-perk-next {
  color: var(--text-dim);
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--bg3);
}

@keyframes rebirthPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(156,39,176,0.3); }
  50% { box-shadow: 0 0 25px rgba(156,39,176,0.6); }
}

.rebirth-upgrade { border-color: #9c27b0 !important; }

.rebirth-tag {
  background: #9c27b0;
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Float text animation */
.float-text {
  position: fixed;
  pointer-events: none;
  font-weight: 800;
  font-size: 20px;
  color: var(--green);
  animation: floatUp 0.8s ease-out forwards;
  z-index: 999;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

.float-lucky {
  color: var(--gold) !important;
  font-size: 24px !important;
}

.float-crit {
  color: #e040fb !important;
  font-size: 28px !important;
  text-shadow: 0 0 10px rgba(224,64,251,0.5);
}

/* Per-Game Rig Cards (in Admin Cheats tab) */
.admin-game-rig-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.admin-player-row {
  border-bottom: 1px solid var(--bg3);
  padding: 8px 0;
}
.admin-player-row:last-child { border-bottom: none; }
.admin-player-edit { margin-top: 6px; }

.admin-game-rig-card {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 10px;
}

.admin-game-rig-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Rooms Tab */
.admin-rooms-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-room-card {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-room-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-room-game {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.admin-room-players {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.admin-room-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-room-btns button {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  min-width: 44px;
}

.admin-room-btns button.danger {
  border-color: var(--red);
  color: var(--red);
}

.rig-btn {
  background: var(--bg3);
  border: 1px solid var(--bg3);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.rig-btn:active { opacity: 0.8; }
.rig-btn.win { border-color: var(--green); color: var(--green); }
.rig-btn.lose { border-color: var(--red); color: var(--red); }

.rig-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* Admin Login Modal */
.admin-login-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(6px);
  animation: al-fade-in 0.15s ease;
}
@keyframes al-fade-in { from { opacity:0; } to { opacity:1; } }

.admin-login-box {
  background: var(--bg1);
  border: 1px solid #333;
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: min(340px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: al-slide-up 0.2s ease;
}
@keyframes al-slide-up { from { transform:translateY(20px); opacity:0; } to { transform:none; opacity:1; } }

.admin-login-logo { font-size: 40px; text-align: center; line-height: 1; }

.admin-login-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.3px;
}

.admin-login-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
}

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

.admin-login-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.admin-login-input {
  background: var(--bg2);
  border: 1.5px solid var(--bg3);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 11px 13px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.admin-login-input:focus { border-color: var(--gold); }

.admin-login-error {
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.35);
  border-radius: 8px;
  color: #ff5252;
  font-size: 12px;
  padding: 8px 12px;
  text-align: center;
}

.admin-login-btn {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  padding: 13px;
  width: 100%;
  cursor: pointer;
  margin-top: 2px;
  transition: opacity 0.1s;
}
.admin-login-btn:active { opacity: 0.8; }

.admin-login-cancel {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  text-align: center;
  width: 100%;
}
.admin-login-cancel:hover { color: var(--text); }

/* Admin Panel */
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-title {
  color: var(--red);
  font-size: 22px;
  text-align: center;
  margin-bottom: 4px;
}

.admin-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}

.admin-section h3 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-row label {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  min-width: 100px;
}

.admin-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--green);
  font-size: 14px;
  padding: 8px 10px;
  font-weight: 600;
}

.admin-row select {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 6px 8px;
}

.admin-row button, .admin-quick-money button {
  background: var(--bg3);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-row button:active, .admin-quick-money button:active {
  background: var(--green);
  color: #000;
}

.admin-quick-money {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-quick-money button {
  flex: 1;
  min-width: 60px;
  text-align: center;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-stock-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.admin-stock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--bg3);
}
.admin-stock-sym {
  font-weight: 800;
  color: var(--green);
  min-width: 50px;
  font-size: 13px;
}
.admin-stock-price {
  font-weight: 700;
  color: var(--text);
  min-width: 60px;
  font-size: 13px;
}
.admin-stock-btns {
  display: flex;
  gap: 4px;
}
.admin-stock-btns .rig-btn {
  padding: 4px 8px;
  font-size: 11px;
}
.admin-stock-set {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.admin-stock-set input {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 6px;
}
.admin-stock-set button {
  background: var(--bg3);
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.admin-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg3);
  color: var(--text);
}

.admin-btn:active { opacity: 0.8; }
.admin-btn.save { background: var(--green); color: #000; }
.admin-btn.danger { background: var(--red); color: #fff; }
.admin-btn.win-btn { background: var(--bg3); border: 1px solid var(--green); color: var(--green); }
.admin-btn.troll-btn { background: var(--bg3); border: 1px solid #bb86fc; color: #bb86fc; }
.troll-section { border: 1px solid #bb86fc; }

.rig-section { border: 1px solid var(--red); }

/* Troll animations */
@keyframes trollShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px) rotate(-1deg); }
  20%, 40%, 60%, 80% { transform: translateX(8px) rotate(1deg); }
}
.troll-shake { animation: trollShake 0.5s ease-in-out 6; }

@keyframes trollRainbow {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
.troll-rainbow { animation: trollRainbow 2s linear infinite; }

.chat-empty {
  color: #666;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.rig-status {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 26px;
  border: 1px solid var(--bg3);
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--green); border-color: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); background: #000; }

.rig-pct {
  font-weight: 700;
  color: var(--gold);
  min-width: 40px;
  text-align: right;
}

.admin-row input[type="range"] {
  flex: 1;
  accent-color: var(--green);
}

#admin-data {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--text);
  font-family: monospace;
  font-size: 11px;
  padding: 8px;
  resize: vertical;
}

/* Game History */
.admin-history {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
}

.history-entry {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--bg3);
}

.history-entry .h-game { color: var(--text-dim); min-width: 70px; }
.history-entry .h-result { font-weight: 700; }
.history-entry .h-result.win { color: var(--green); }
.history-entry .h-result.lose { color: var(--red); }
.history-entry .h-result.push { color: var(--gold); }
.history-entry .h-amount { color: var(--text); min-width: 80px; text-align: right; }

/* Crash History */
.crash-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 24px;
}

.crash-h-red {
  background: rgba(255,82,82,0.15);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.crash-h-green {
  background: rgba(0,230,118,0.15);
  color: var(--green);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.crash-auto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.crash-auto-row label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.crash-auto-row input {
  width: 80px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 10px;
  text-align: center;
}

/* ===== Multiplayer Room Overlay ===== */
.mp-room-overlay {
  background: linear-gradient(135deg, #1a0a2e 0%, #0d1a3a 100%);
  border: 1px solid #bb86fc55;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-room-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mp-room-badge {
  background: #bb86fc22;
  color: #bb86fc;
  border: 1px solid #bb86fc55;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  letter-spacing: 0.5px;
}
.mp-room-live {
  background: #ff525222;
  color: #ff5252;
  border-color: #ff525255;
  animation: mp-pulse 1s ease-in-out infinite;
}
@keyframes mp-pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.mp-room-host { font-size: 12px; color: var(--text-dim); flex: 1; }
.mp-room-timer {
  font-size: 15px;
  font-weight: 800;
  color: #ffd740;
  min-width: 32px;
  text-align: right;
}
.mp-room-players {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
}
.mp-player-chip {
  background: var(--bg3);
  border-radius: 12px;
  font-size: 11px;
  padding: 2px 9px;
  color: var(--text);
}
.mp-bet-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-dollar { color: var(--text-dim); font-size: 13px; }
.mp-bet-btn {
  background: #bb86fc;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.mp-bet-btn:disabled { opacity: 0.5; cursor: default; }
.mp-bet-confirmed {
  font-size: 12px;
  color: #00e676;
  font-weight: 600;
  padding: 4px 0;
}
.mp-horse-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

/* Admin panel MP room controls */
.admin-mp-rooms { display: flex; flex-direction: column; gap: 6px; }
.admin-mp-room-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border-radius: 8px;
  padding: 6px 10px;
  flex-wrap: wrap;
}
.admin-mp-game { font-weight: 700; min-width: 60px; text-transform: capitalize; }
.admin-mp-btns { display: flex; gap: 4px; margin-left: auto; }
.admin-mp-btns button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text);
  border: none;
  cursor: pointer;
}
.mp-status-idle { color: var(--text-dim); font-size: 11px; }
.mp-status-betting { color: #ffd740; font-size: 11px; font-weight: 700; }
.mp-status-live { color: #ff5252; font-size: 11px; font-weight: 700; }
.mp-status-done { color: #00e676; font-size: 11px; }

/* Roulette */

/* Result display */
.rl-result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 4px;
}

.rl-result-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg3);
  border: 3px solid #444;
  transition: background 0.3s, border-color 0.3s;
}

.rl-result-box.rl-rb-red    { background: #c62828; border-color: #e53935; }
.rl-result-box.rl-rb-black  { background: #1a1a1a; border-color: #555; }
.rl-result-box.rl-rb-green  { background: #2e7d32; border-color: #388e3c; }
.rl-result-box.rl-rb-spinning { background: var(--bg3); border-color: var(--gold); }

@keyframes rl-flash {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}
.rl-rb-flash { animation: rl-flash 0.5s ease; }

.rl-result-num {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.rl-rn-red   { color: #ff8a80; }
.rl-rn-black { color: #ccc; }
.rl-rn-green { color: #a5d6a7; }

.rl-result-label {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  min-height: 18px;
}

/* History */
.rl-history {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 18px;
}

.rl-h-red   { background: #d32f2f; color: #fff; padding: 2px 5px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.rl-h-black { background: #222; color: #fff; padding: 2px 5px; border-radius: 4px; font-size: 11px; font-weight: 700; border: 1px solid #444; }
.rl-h-green { background: #2e7d32; color: #fff; padding: 2px 5px; border-radius: 4px; font-size: 11px; font-weight: 700; }

/* Board */
.rl-board { width: 100%; overflow-x: auto; }

.rl-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Main row: 0 | number grid | col bets */
.rl-table-main {
  display: grid;
  grid-template-columns: 28px 1fr 36px;
  gap: 2px;
  align-items: stretch;
}

.rl-zero-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
}

.rl-zero-cell {
  flex: 1;
  min-height: 0;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-num-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.rl-col-bets {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.rl-col-btn { font-size: 9px !important; padding: 0 !important; }

.rl-doz-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.rl-outside-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}

/* Roulette cells */
.rl-cell {
  padding: 8px 1px;
  border-radius: 3px;
  border: 1px solid #333;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  color: #fff;
  position: relative;
  transition: transform 0.1s, box-shadow 0.15s;
  line-height: 1.2;
}

.rl-cell:active { transform: scale(0.91); }

.rl-cell.rl-red    { background: #c62828; }
.rl-cell.rl-black  { background: #1a1a1a; border-color: #444; }
.rl-cell.rl-green  { background: #2e7d32; }
.rl-cell.rl-outside { background: var(--bg2); color: var(--text); font-size: 11px; padding: 8px 2px; }
.rl-cell.rl-outside-btn { background: var(--bg2); color: var(--text); font-size: 10px; padding: 7px 1px; }
.rl-cell.rl-outside-btn.rl-red   { background: #c62828; color: #fff; }
.rl-cell.rl-outside-btn.rl-black { background: #1a1a1a; color: #fff; border-color: #444; }

.rl-cell.rl-has-bet {
  box-shadow: 0 0 7px rgba(255,215,64,0.7), inset 0 0 3px rgba(255,215,64,0.2);
  border-color: var(--gold) !important;
}

.rl-chip {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold);
  color: #000;
  font-size: 7px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 7px;
  line-height: 1.3;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Bet info bar */
.rl-bet-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  background: var(--bg2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  gap: 8px;
}

.rl-odds-badge {
  font-weight: 800;
  color: var(--gold);
  font-size: 14px;
  white-space: nowrap;
}

/* Stats row */
.rl-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.rl-stat-item {
  background: var(--bg2);
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
}

.rl-stat-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rl-stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

/* Bet input row */
.rl-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.rl-ctrl-btn {
  flex-shrink: 0;
  padding: 9px 8px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid #444;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.rl-ctrl-btn:active { transform: scale(0.94); }

.rl-input-dollar {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
}

.rl-bet-input {
  flex: 1;
  min-width: 0;
  padding: 9px 8px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid #444;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* Main spin button */
.rl-spin-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.rl-spin-btn:active  { transform: scale(0.98); }
.rl-spin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Secondary action row */
.rl-action-secondary {
  display: flex;
  gap: 8px;
  width: 100%;
}

/* Horse Racing */
.horses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.horse-pick {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.1s, background 0.2s;
}

.horse-pick:active { transform: scale(0.95); }
.horse-pick:disabled { opacity: 0.5; cursor: not-allowed; }

.horse-pick.selected {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255,255,255,0.1);
}

.horse-emoji { font-size: 20px; }
.horse-name { font-size: 11px; font-weight: 700; color: var(--text); }
.horse-odds { font-size: 12px; font-weight: 800; color: var(--gold); }

/* Lottery / Scratch Cards */
.lottery-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.lottery-controls label {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lottery-controls select {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
}

.lottery-controls strong {
  color: var(--gold);
  font-size: 16px;
}

.lottery-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

.lottery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
  font-size: 14px;
}

.scratch-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg3);
  transition: transform 0.15s;
}

.scratch-cell.covered {
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  cursor: pointer;
}

.scratch-cell.covered:active { transform: scale(0.9); }

.scratch-cover {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dim);
}

.scratch-cell.revealed {
  background: var(--bg2);
}

.scratch-cell.scratch-win {
  background: rgba(0, 230, 118, 0.08);
}

.scratch-symbol { font-size: 28px; }

.scratch-value {
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
}

.scratch-cell.scratch-lose .scratch-symbol { opacity: 0.4; }

/* Debt badge in top bar */
#debt-badge {
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  animation: debtPulse 2s ease-in-out infinite;
}

@keyframes debtPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#balance-display.in-debt {
  border: 1px solid var(--red);
  color: var(--red);
}

#balance .balance-danger {
  color: var(--red) !important;
}

/* Loan Shark Panel */
.loan-panel {
  width: 100%;
  background: var(--bg2);
  border: 1px solid #ff6f00;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}

.loan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  background: rgba(255, 111, 0, 0.08);
}

.loan-title {
  font-size: 16px;
  font-weight: 800;
  color: #ff9100;
}

.loan-toggle {
  font-size: 12px;
  color: #ff9100;
  transition: transform 0.2s;
}

.loan-body {
  padding: 12px 16px;
}

.loan-status {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.loan-stat {
  flex: 1;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.loan-debt-value {
  font-size: 18px !important;
  font-weight: 800;
  color: var(--red) !important;
}

.loan-stat span:last-child {
  font-size: 15px;
  font-weight: 700;
  color: #ff9100;
}

/* Loan warning messages */
.loan-warning {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #ff9100;
  min-height: 16px;
  margin-bottom: 8px;
}

.loan-warning.caution {
  color: var(--red);
}

.loan-warning.danger {
  color: var(--red);
  font-size: 14px;
  animation: debtPulse 1s ease-in-out infinite;
}

/* Loan option buttons */
.loan-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.loan-btn {
  background: var(--bg);
  border: 1px solid #ff6f00;
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.1s, background 0.15s;
}

.loan-btn:active { transform: scale(0.95); background: rgba(255, 111, 0, 0.15); }

.loan-btn.loan-locked {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--bg3);
}

.loan-icon { font-size: 22px; }
.loan-name { font-size: 11px; font-weight: 700; color: var(--text); }
.loan-amount { font-size: 14px; font-weight: 800; color: #ff9100; }
.loan-rate { font-size: 10px; color: var(--red); font-weight: 600; }

/* Pay back section */
.loan-pay-section {
  border-top: 1px solid var(--bg3);
  padding-top: 10px;
}

.loan-pay-row {
  display: flex;
  gap: 8px;
}

.loan-pay-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--green);
  background: var(--bg);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.loan-pay-btn:active {
  background: var(--green);
  color: #000;
}

.loan-pay-all {
  border-color: var(--gold);
  color: var(--gold);
}

.loan-pay-all:active {
  background: var(--gold);
  color: #000;
}

/* Roulette auto-spin */
.rl-auto-timer {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  min-height: 20px;
  width: 100%;
  animation: autoPulse 1s ease-in-out infinite;
}

.rl-auto-timer:empty { animation: none; min-height: 0; }

@keyframes autoPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.rl-auto-active {
  background: var(--gold) !important;
  color: #000 !important;
}

/* Properties / Tycoon */
.prop-header {
  width: 100%;
  text-align: center;
  margin-bottom: 4px;
}

.prop-income-display {
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#prop-total-income {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}

.prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.prop-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}

.prop-card:active { transform: scale(0.96); }
.prop-card.affordable { border-color: var(--green); }
.prop-card.owned { border-color: var(--green); cursor: default; }
.prop-card.owned:active { transform: none; }

.prop-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--bg3);
}

.prop-card.locked:active { transform: none; }

.prop-icon { font-size: 36px; }
.prop-name { font-size: 13px; font-weight: 700; color: var(--text); }

.prop-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

.prop-detail {
  font-size: 11px;
  color: var(--text-dim);
}

.prop-income-val {
  color: var(--green) !important;
  font-weight: 700;
}

.prop-lock {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 4px;
}

.prop-btn {
  width: 100%;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: var(--bg);
  color: var(--gold);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.prop-btn:active { background: var(--gold); color: #000; }
.prop-btn.affordable { border-color: var(--green); color: var(--green); }
.prop-btn.affordable:active { background: var(--green); color: #000; }
.prop-btn.prop-maxed { border-color: var(--green); color: var(--green); opacity: 0.7; cursor: default; }
.prop-btn.prop-buy-btn { border-color: var(--gold); color: var(--gold); }

/* Property Event Banner */
.prop-event {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  animation: eventPulse 2s ease-in-out infinite;
}

.prop-event.golden {
  background: rgba(255, 215, 64, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
}

.prop-event.bad {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
}

@keyframes eventPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Property Manager Button */
.prop-manager-btn {
  width: 100%;
  padding: 5px 4px;
  border-radius: 6px;
  border: 1px solid var(--bg3);
  background: var(--bg);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 9px;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.15s;
}

.prop-manager-btn.affordable {
  border-color: #ab47bc;
  color: #ce93d8;
}

.prop-manager-btn:active {
  background: #ab47bc;
  color: #000;
}

/* Property Manager Badge */
.prop-manager-badge {
  font-size: 9px;
  font-weight: 700;
  color: #ce93d8;
  background: rgba(156, 39, 176, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 2px;
}

.prop-manager-badge.maxed {
  color: var(--gold);
  background: rgba(255, 215, 64, 0.15);
}

/* Rival Defend Alert */
.prop-rival-alert {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 82, 82, 0.85);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  z-index: 5;
  cursor: pointer;
  animation: rivalFlash 0.5s ease-in-out infinite;
  letter-spacing: 1px;
}

@keyframes rivalFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; background: rgba(255, 82, 82, 0.65); }
}

.prop-card.owned { position: relative; }

/* Loan Duel Button */
.loan-duel-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: 2px solid #ff9100;
  background: rgba(255, 145, 0, 0.1);
  color: #ff9100;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 1px;
}

.loan-duel-btn:active {
  background: #ff9100;
  color: #000;
  transform: scale(0.96);
}

.loan-duel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Shark Duel Overlay */
.shark-duel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.duel-title {
  font-size: 28px;
  font-weight: 900;
  color: #ff9100;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 145, 0, 0.4);
}

.duel-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.duel-cards {
  display: flex;
  align-items: center;
  gap: 24px;
}

.duel-card {
  width: 100px;
  height: 140px;
  background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
  border: 3px solid var(--bg3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 900;
  color: var(--text);
  transition: transform 0.3s, border-color 0.3s;
}

.duel-card-flip {
  animation: cardFlip 0.4s ease-out;
}

@keyframes cardFlip {
  0% { transform: rotateY(0deg) scale(0.8); }
  50% { transform: rotateY(180deg) scale(1.1); }
  100% { transform: rotateY(360deg) scale(1); }
}

.duel-card-win {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
  color: var(--green);
}

.duel-card-lose {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.4);
  color: var(--red);
  opacity: 0.7;
}

.duel-vs {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-dim);
}

.duel-result {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  min-height: 24px;
}

.duel-result.duel-win {
  color: var(--green);
  font-size: 18px;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.duel-result.duel-lose {
  color: var(--red);
  font-size: 18px;
  text-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
}

/* Profile Display in Top Bar */
.profile-display {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.profile-avatar {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.profile-name {
  font-weight: 700;
  color: var(--text);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Settings Gear Button */
#settings-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#settings-btn:active { opacity: 1; }

/* Settings Panel */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-title {
  color: var(--green);
  font-size: 22px;
  text-align: center;
  margin-bottom: 4px;
}

.settings-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}

.settings-section h3 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-row label {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  min-width: 100px;
}

.settings-row input[type="text"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--green);
  font-size: 14px;
  padding: 8px 10px;
  font-weight: 600;
}

.settings-row select {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 6px 8px;
}

/* Theme Picker */
.theme-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.theme-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.theme-circle:active { transform: scale(0.9); }

.theme-circle.selected {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
}

.theme-name {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

/* Avatar Grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.avatar-option {
  aspect-ratio: 1;
  font-size: 24px;
  background: var(--bg);
  border: 2px solid var(--bg3);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.2s;
}

.avatar-option:active { transform: scale(0.9); }

.avatar-option.selected {
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.08);
  transform: scale(1.05);
}

/* Fast Animations Mode */
html.fast-animations .coin.flipping { animation-duration: 0.3s; }
html.fast-animations .reel-strip { transition-duration: 0.25s; }
html.fast-animations .float-text { animation-duration: 0.4s; }
html.fast-animations @keyframes rebirthPulse { 0%, 100% { box-shadow: none; } }

/* Responsive - Small Mobile */
@media (max-width: 400px) {
  #click-btn { width: 150px; height: 150px; font-size: 24px; }
  #click-value { font-size: 18px; }
  .casino-icon { font-size: 36px; }
  .game-btn { padding: 12px 24px; font-size: 16px; }
}

/* ====== MOBILE COMPACT TOP BAR (≤ 430px) ====== */
@media (max-width: 430px) {
  .top-bar-row1 {
    padding: 7px 8px;
    gap: 5px;
  }
  .top-bar-row2 {
    padding: 3px 8px 5px;
    gap: 4px;
  }

  #page-title {
    font-size: 14px;
  }

  .profile-name {
    max-width: 60px;
    font-size: 11px;
  }

  #balance-display {
    font-size: 13px;
    padding: 4px 9px;
  }

  /* Hide hunger % text on narrow screens — icon + bar is enough */
  #hunger-pct {
    display: none;
  }

  .chat-toggle-btn-bar {
    width: 26px;
    height: 26px;
    font-size: 13px;
    flex-shrink: 0;
  }

  #settings-btn {
    font-size: 16px;
    padding: 2px;
    flex-shrink: 0;
  }

  .hamburger-btn {
    font-size: 18px;
    padding: 4px 6px;
    flex-shrink: 0;
  }
}

/* ====== DESKTOP / PC LAYOUT ====== */
html[data-platform="desktop"] #app {
  max-width: 900px;
}

html[data-platform="desktop"] #top-bar {
  border-radius: 0 0 12px 12px;
}
html[data-platform="desktop"] .top-bar-row1 {
  padding: 12px 24px;
}
html[data-platform="desktop"] .top-bar-row2 {
  padding: 4px 24px 8px;
}

html[data-platform="desktop"] #page-title {
  font-size: 22px;
}

html[data-platform="desktop"] #balance-display {
  font-size: 18px;
  padding: 8px 20px;
}

/* Casino grid: larger cards on desktop */
html[data-platform="desktop"] .casino-card {
  width: 120px;
  padding: 24px 16px 20px;
}
html[data-platform="desktop"] .casino-icon { font-size: 48px; }
html[data-platform="desktop"] .casino-name { font-size: 15px; }

/* Wider game containers */
html[data-platform="desktop"] .game-container {
  max-width: 700px;
  margin: 0 auto;
}

/* Roulette desktop: wider layout */
html[data-platform="desktop"] #screen-roulette .game-container {
  max-width: 700px;
}

html[data-platform="desktop"] #screen-roulette .rl-num-grid {
  /* Taller cells on desktop for easier clicking */
}

html[data-platform="desktop"] #screen-roulette .rl-cell {
  padding: 10px 2px;
  font-size: 12px;
}

/* Clicker: better layout on desktop */
html[data-platform="desktop"] #click-stats {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

html[data-platform="desktop"] #click-btn {
  width: 220px;
  height: 220px;
  font-size: 32px;
}

/* Blackjack cards bigger */
html[data-platform="desktop"] .card {
  width: 70px;
  height: 100px;
  font-size: 22px;
}

/* Slots reels bigger */
html[data-platform="desktop"] .reel {
  width: 100px;
  height: 200px;
}

html[data-platform="desktop"] .reel-symbol {
  height: 66px;
  font-size: 42px;
}

/* Crash canvas bigger */
html[data-platform="desktop"] #crash-canvas {
  max-width: 500px;
  height: 280px;
}

/* Horses canvas bigger */
html[data-platform="desktop"] #horses-canvas {
  max-width: 500px;
  height: 300px;
}

/* Plinko canvas bigger */
html[data-platform="desktop"] #plinko-canvas {
  max-width: 450px;
  height: 500px;
}

/* Admin overlay wider on desktop */
html[data-platform="desktop"] .admin-overlay {
  width: 480px;
}

/* Upgrade list: 2 columns */
html[data-platform="desktop"] #upgrade-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

html[data-platform="desktop"] .upgrade-item {
  margin-bottom: 0;
}

/* Properties: 3 columns on desktop */
html[data-platform="desktop"] .prop-grid {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* Settings panel wider on desktop */
html[data-platform="desktop"] .settings-panel {
  max-width: 700px;
  margin: 0 auto;
}

html[data-platform="desktop"] .avatar-grid {
  grid-template-columns: repeat(12, 1fr);
}

/* Slots Auto Spin */
.slots-auto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.slots-auto-row label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.slots-auto-row input {
  width: 70px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: center;
}

.slots-auto-btn {
  padding: 8px 16px !important;
  font-size: 14px !important;
}

.slots-auto-active {
  background: var(--gold) !important;
  color: #000 !important;
}

.slots-auto-status {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  min-height: 18px;
  color: var(--text-dim);
}

/* Crime Empire */
.crime-income-display {
  border-color: var(--red) !important;
}

#crime-total-income {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
}

.crime-card {
  border-color: var(--bg3);
}

.crime-card.owned {
  border-color: var(--red);
  position: relative;
}

.crime-raid-alert {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 82, 82, 0.9);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  z-index: 5;
  cursor: pointer;
  animation: raidFlash 0.4s ease-in-out infinite;
  letter-spacing: 1px;
}

@keyframes raidFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; background: rgba(255, 82, 82, 0.7); }
}

.crime-shutdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 26, 0.85);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
  z-index: 4;
  letter-spacing: 1px;
}

.crime-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 26, 0.92);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.crime-lock-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crime-lock-icon {
  font-size: 48px;
}

.crime-lock-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
}

.crime-lock-hint {
  font-size: 13px;
  color: var(--text-dim);
}

/* Crime screen needs relative positioning for lock overlay */
#screen-crime .game-container {
  position: relative;
}

/* ── Crime Empire: Path Selection ────────────────────────── */
.crime-path-header {
  text-align: center;
  padding: 16px 8px 12px;
}
.crime-path-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}
.crime-path-subtitle {
  font-size: 13px;
  color: var(--text-dim);
}
.crime-path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 2px 16px;
}
.crime-path-card {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.12s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.crime-path-card:hover:not(.locked) {
  border-color: var(--path-color, var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--path-color, var(--accent)) 30%, transparent);
}
.crime-path-card:active:not(.locked) { transform: scale(0.96); }
.crime-path-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.crime-path-icon {
  font-size: 36px;
  line-height: 1;
}
.crime-path-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--path-color, var(--text));
}
.crime-path-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.crime-path-lock {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  margin-top: 4px;
}
.crime-path-start {
  font-size: 12px;
  color: var(--path-color, var(--accent));
  font-weight: 700;
  margin-top: 4px;
}

/* ── Crime Empire: Confirmation ──────────────────────────── */
.crime-confirm-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 8px;
}
.crime-confirm-box {
  background: var(--bg2);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.crime-confirm-icon { font-size: 48px; }
.crime-confirm-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
}
.crime-confirm-desc {
  font-size: 13px;
  color: var(--text-dim);
}
.crime-confirm-warning {
  font-size: 13px;
  color: var(--red);
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.3);
  border-radius: 8px;
  padding: 8px 12px;
}
.crime-confirm-btns {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
}
.crime-confirm-yes {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.crime-confirm-no {
  flex: 1;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
}

/* ── Crime Empire: Upgrade Tree ──────────────────────────── */
.crime-empire-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 2px solid var(--path-color, var(--accent));
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: 0 0 14px color-mix(in srgb, var(--path-color, var(--accent)) 20%, transparent);
}
.crime-empire-icon { font-size: 36px; }
.crime-empire-info { flex: 1; }
.crime-empire-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--path-color, var(--text));
}
.crime-empire-income {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 2px;
}
.crime-special-badge {
  background: rgba(33,150,243,0.15);
  border: 1px solid rgba(33,150,243,0.4);
  color: #64b5f6;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Raid & shutdown banners */
.crime-raid-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,82,82,0.18);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
  animation: raidFlash 0.5s ease-in-out infinite;
}
.crime-bribe-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.crime-bribe-btn.unaffordable {
  background: var(--bg3);
  color: var(--text-dim);
}
.crime-shutdown-banner {
  background: rgba(15,15,26,0.85);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
  text-align: center;
}

/* Upgrade list */
.crime-upg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
}
.crime-upg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px 12px;
  transition: border-color 0.15s;
}
.crime-upg-item.owned {
  border-color: var(--green);
  opacity: 0.75;
}
.crime-upg-item.locked { opacity: 0.4; }
.crime-upg-item.affordable { border-color: var(--accent); }
.crime-upg-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crime-upg-item.owned .crime-upg-num {
  background: var(--green);
  color: #fff;
}
.crime-upg-info { flex: 1; min-width: 0; }
.crime-upg-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.crime-upg-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.crime-upg-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.crime-upg-income {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}
.crime-upg-bonus {
  font-size: 11px;
  color: #64b5f6;
  background: rgba(33,150,243,0.12);
  border-radius: 10px;
  padding: 1px 7px;
}
.crime-upg-action { flex-shrink: 0; }
.crime-upg-btn {
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--bg3);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.crime-upg-btn.affordable {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.crime-upg-owned-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crime-upg-locked-icon {
  font-size: 18px;
  color: var(--text-dim);
}

/* ====== PET SYSTEM ====== */

/* Boost Banner */
.pet-boost-banner {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

/* Pet Tabs */
.pet-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
}

.pet-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--bg3);
  border-radius: 8px 8px 0 0;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pet-tab-btn.active {
  background: var(--bg3);
  color: var(--green);
  border-color: var(--green);
}

/* Pet Grid */
.pet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

/* Pet Card */
.pet-card {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.1s;
}

.pet-card.pet-owned {
  box-shadow: 0 0 8px var(--bg3);
}

.pet-card.pet-locked {
  opacity: 0.6;
}

/* Pixel Art Image */
.pet-pixel-img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.pet-img-locked {
  filter: brightness(0.3) grayscale(1);
}

/* Pet Card Text */
.pet-card-name {
  font-size: 13px;
  font-weight: 800;
}

.pet-card-rarity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pet-card-level {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

.pet-card-boost {
  font-size: 10px;
  color: var(--text);
  font-weight: 600;
}

.pet-card-boost-preview {
  color: var(--text-dim);
  font-style: italic;
}

.pet-card-maxed {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

.pet-card-source {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  font-style: italic;
}

/* Pet Buttons */
.pet-buy-btn, .pet-lvl-btn {
  width: 100%;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid var(--gold);
  background: var(--bg);
  color: var(--gold);
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.pet-buy-btn.affordable, .pet-lvl-btn.affordable {
  border-color: var(--green);
  color: var(--green);
}

.pet-buy-btn:active, .pet-lvl-btn:active {
  background: var(--bg3);
}

.pet-buy-btn:disabled, .pet-lvl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Gacha Panel */
.gacha-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gacha-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gacha-stat {
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.gacha-stat span:last-child {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.gacha-dust-val {
  color: var(--gold) !important;
}

.gacha-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.gacha-btn {
  flex: 1;
  padding: 16px 12px !important;
  font-size: 16px !important;
  line-height: 1.3;
}

.gacha-btn-10 {
  background: var(--gold) !important;
}

.gacha-cost {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

/* Gacha Dust Shop */
.gacha-dust-shop {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}

.gacha-dust-shop h3 {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: center;
}

.gacha-dust-actions {
  display: flex;
  gap: 8px;
}

.gacha-dust-actions .pet-buy-btn {
  flex: 1;
  padding: 10px 6px;
  font-size: 12px;
  line-height: 1.4;
}

/* Gacha Rates */
.gacha-rates {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}

.gacha-rates h3 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-align: center;
}

.gacha-rate-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gacha-rate-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.gacha-rate-row span:last-child {
  color: var(--text);
}

.gacha-pity-info {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* Gacha Result Overlay */
.pet-gacha-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gacha-results-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 360px;
}

.gacha-result-card {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 80px;
  text-align: center;
  animation: gachaReveal 0.4s ease-out;
}

@keyframes gachaReveal {
  0% { transform: scale(0) rotateY(180deg); opacity: 0; }
  60% { transform: scale(1.1) rotateY(0deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); }
}

.gacha-result-name {
  font-size: 10px;
  font-weight: 700;
}

.gacha-result-rarity {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.gacha-new-badge {
  background: var(--green);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.gacha-dust-badge {
  background: var(--bg3);
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.gacha-dust-total {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
}

/* Forge Panel */
.forge-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.forge-card {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.forge-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.forge-recipe {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Easter Egg Styles */
.pet-mystery {
  border-style: dashed !important;
}

.pet-mystery-icon {
  font-size: 36px;
  color: var(--text-dim);
  font-weight: 900;
}

.pet-egg-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #d77bba, #ac3232);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 2;
}

.pet-egg-notif {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2000;
  animation: eggNotifSlide 3s ease-out forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

@keyframes eggNotifSlide {
  0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  10% { transform: translateX(-50%) translateY(0); opacity: 1; }
  80% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

.pet-egg-notif span {
  font-size: 14px;
  font-weight: 800;
}

/* Desktop Pet Layout */
html[data-platform="desktop"] .pet-grid {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

html[data-platform="desktop"] .gacha-results-grid {
  max-width: 500px;
}

html[data-platform="desktop"] #screen-pets .game-container {
  max-width: 700px;
}

/* ====== STOCK MARKET ====== */

/* Stock Tabs */
.stock-tabs, .crypto-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
}

.stock-tab-btn, .crypto-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--bg3);
  border-radius: 8px 8px 0 0;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.stock-tab-btn.active, .crypto-tab-btn.active {
  background: var(--bg3);
  color: var(--green);
  border-color: var(--green);
}

/* Stock Grid */
.stock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.stock-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.stock-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-symbol {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
}

.stock-sector {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stock-name {
  font-size: 11px;
  color: var(--text-dim);
}

.stock-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.stock-change {
  font-size: 13px;
  font-weight: 700;
}

.stock-up { color: var(--green); }
.stock-down { color: var(--red); }

.stock-sparkline {
  width: 80px;
  height: 30px;
  display: block;
  margin: 2px auto;
}

.stock-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.stock-buy-btn, .stock-sell-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid var(--green);
  background: var(--bg);
  color: var(--green);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}

.stock-buy-btn:active { background: var(--green); color: #000; }
.stock-sell-btn { border-color: var(--red); color: var(--red); }
.stock-sell-btn:active { background: var(--red); color: #fff; }
.stock-sell-btn:disabled, .stock-buy-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.stock-empty, .lb-empty, .lb-offline {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 16px;
  font-size: 14px;
}

/* Portfolio */
.portfolio-summary {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.portfolio-stat {
  flex: 1;
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.portfolio-stat span:last-child {
  font-size: 16px;
  font-weight: 700;
}

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.portfolio-item {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portfolio-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portfolio-symbol {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
}

.portfolio-value {
  font-size: 16px;
  font-weight: 700;
}

.portfolio-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

/* News Feed */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.news-item {
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.news-icon { font-size: 16px; flex-shrink: 0; }
.news-text { flex: 1; font-size: 13px; font-weight: 600; }
.news-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.news-good .news-text { color: var(--green); }
.news-bad .news-text { color: var(--red); }

/* Stock Trade Modal */
.stock-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 20, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.stock-trade-modal {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  max-width: 300px;
  width: 100%;
}

.stock-trade-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 16px;
}

.stock-trade-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stock-trade-btn {
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid var(--green);
  background: var(--bg);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}

.stock-trade-btn:active { background: var(--green); color: #000; }
.stock-trade-btn.stock-sell-btn { border-color: var(--red); color: var(--red); }

.stock-trade-cancel {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--bg3);
  background: var(--bg3);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.stock-trade-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-align: center;
}

.coin-custom-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.coin-custom-row input {
  flex: 1;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--bg3);
  background: var(--bg3);
  color: var(--text);
  font-size: 14px;
}

.coin-custom-btn {
  flex-shrink: 0;
  padding: 9px 14px;
  font-size: 14px;
}

.sh-preview {
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 2px;
}

.trade-btn-label {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.trade-btn-value {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

.trade-btn-sub {
  display: block;
  font-size: 11px;
  opacity: 0.65;
}

/* ====== CRYPTO MINING ====== */

.mine-stats {
  display: flex;
  gap: 8px;
  width: 100%;
}

.mine-stat {
  flex: 1;
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.mine-stat span:last-child {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.heat-danger { color: var(--red) !important; }

.heat-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
}

.heat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s, background 0.3s;
}

.mine-hash-display {
  width: 100%;
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  overflow: hidden;
}

.hash-text {
  font-family: monospace;
  font-size: 12px;
  color: var(--green);
  opacity: 0.6;
  letter-spacing: 1px;
  word-break: break-all;
}

.mine-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid #f7931a;
  background: var(--bg2);
  color: #f7931a;
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: 0 0 30px rgba(247, 147, 26, 0.15);
  line-height: 1.3;
}

.mine-btn:active, .mine-btn.mining-active {
  transform: scale(0.93);
  box-shadow: 0 0 50px rgba(247, 147, 26, 0.35);
}

.mine-btn-sub {
  font-size: 14px;
  opacity: 0.8;
}

.mine-wallet-mini {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}

.mine-upgrades {
  width: 100%;
}

.mine-upgrades h3 {
  color: var(--text-dim);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.mine-upgrade-item {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
}

.mine-upgrade-item.affordable { border-color: var(--green); }

/* Rig Grid */
.rig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.rig-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}

.rig-card:active { transform: scale(0.96); }
.rig-card.affordable { border-color: var(--green); }
.rig-card.owned { border-color: var(--green); cursor: default; }

.rig-icon { font-size: 36px; }
.rig-name { font-size: 13px; font-weight: 700; }
.rig-level { font-size: 11px; font-weight: 600; color: var(--green); }
.rig-detail { font-size: 11px; font-weight: 700; }

.rig-efficiency {
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

/* Exchange */
.exchange-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.exchange-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exchange-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exchange-symbol {
  font-size: 18px;
  font-weight: 800;
}

.exchange-price {
  font-size: 13px;
  color: var(--text-dim);
}

.exchange-balance {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.exchange-value {
  color: var(--green);
}

.crypto-chart {
  width: 100%;
  height: 40px;
  display: block;
}

.exchange-actions {
  display: flex;
  gap: 6px;
}

.mine-total-stats {
  width: 100%;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}

.mine-total-stats h3 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.mine-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
}

/* ====== LEADERBOARD ====== */

.lb-header {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.lb-online-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
}

.lb-badge-online {
  background: var(--green);
  color: #000;
}

.lb-tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab-btn {
  background: var(--bg3);
  border: none;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.lb-tab-btn.active { background: var(--gold); color: #000; }

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.lb-row {
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.lb-row:active { background: var(--bg3); }
.lb-row.lb-me { border: 1px solid var(--green); }

.lb-rank {
  font-size: 14px;
  font-weight: 800;
  min-width: 30px;
  text-align: center;
  color: var(--gold);
}

.lb-avatar { font-size: 18px; }

.lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-earned {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.lb-rebirths {
  font-size: 11px;
  font-weight: 700;
  color: #ce93d8;
  background: rgba(156,39,176,0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Profile Modal */
.profile-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 6, 16, 0.88);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.profile-modal-overlay.hidden { display: none; }

/* ── Profile Card ── */
.pcard {
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: pcardSlideUp .22s cubic-bezier(.25,.8,.25,1);
}
@keyframes pcardSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.pcard-banner {
  height: 72px;
  position: relative;
}
.pcard-close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(0,0,0,.4);
  border: none; color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pcard-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: -32px;
  position: relative;
  z-index: 1;
}
.pcard-avatar {
  font-size: 56px;
  line-height: 1;
  background: var(--bg2);
  border: 3px solid var(--bg2);
  border-radius: 50%;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.pcard-body {
  padding: 6px 16px 20px;
  text-align: center;
}
.pcard-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
.pcard-id {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}
.pcard-title {
  display: inline-block;
  background: var(--green);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 10px;
  margin-top: 4px;
  letter-spacing: .04em;
}
.pcard-bio {
  font-size: 13px;
  color: var(--text-dim);
  margin: 6px auto 0;
  max-width: 280px;
  line-height: 1.4;
}
.pcard-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 12px 0 10px;
}
.pcard-stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pcard-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}
.pcard-stat-lbl {
  font-size: 10px;
  color: var(--text-dim);
}
.pcard-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pcard-btn {
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pcard-btn-add  { background: var(--green); color: #000; }
.pcard-btn-msg  { background: var(--bg3); color: var(--text); }
.pcard-btn-gift { background: #e67e22; color: #fff; }
.pcard-btn-dim  { background: var(--bg3); color: var(--text-dim); }

/* ====== CHAT PANEL ====== */

.chat-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border-top: 2px solid var(--green);
  border-radius: 16px 16px 0 0;
  z-index: 500;
  transition: transform 0.3s;
  transform: translateX(-50%) translateY(100%);
  padding-bottom: env(safe-area-inset-bottom);
}

.chat-panel.chat-open {
  transform: translateX(-50%) translateY(0);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: var(--green);
}

.chat-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  margin-right: 8px;
}
.chat-status-online {
  color: #00e676;
  background: rgba(0, 230, 118, 0.1);
}
.chat-status-offline {
  color: #ff9100;
  background: rgba(255, 145, 0, 0.1);
}

.chat-toggle {
  font-size: 10px;
  transition: transform 0.2s;
}

.chat-open .chat-toggle { transform: rotate(180deg); }

.chat-body {
  padding: 0 12px 12px;
}

.chat-messages {
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 4px;
}

.chat-msg {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg);
}

.chat-msg.chat-me { background: rgba(0, 230, 118, 0.08); }

.chat-avatar { font-size: 14px; flex-shrink: 0; }

.chat-name {
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.chat-text {
  color: var(--text);
  word-break: break-word;
}

.chat-input-row {
  display: flex;
  gap: 6px;
}

.chat-input-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
}

.chat-input-row button {
  background: var(--green);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}

.chat-input-row button:active { opacity: 0.8; }

.chat-toggle-btn {
  position: fixed;
  bottom: 56px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 499;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.chat-toggle-btn:active { transform: scale(0.9); }

/* ====== DM / FRIENDS PANEL ====== */

.dm-toggle-btn {
  position: fixed;
  bottom: 56px;
  right: 68px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--green);
  font-size: 18px;
  cursor: pointer;
  z-index: 499;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.dm-toggle-btn:active { transform: scale(0.9); }

.dm-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 420px;
  height: 70vh;
  background: var(--bg2);
  border-top: 2px solid var(--green);
  border-radius: 16px 16px 0 0;
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(-50%) translateY(100%);
  transition: transform 0.3s;
}
.dm-panel.dm-open {
  transform: translateX(-50%) translateY(0);
}

.dm-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--green);
  border-bottom: 1px solid var(--bg3);
  flex-shrink: 0;
}

.dm-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.dm-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dm-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 8px 14px 4px;
  border-bottom: 1px solid var(--bg3);
}

.dm-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 8px;
}
.dm-row:last-child { border-bottom: none; }

.dm-avatar {
  font-size: 22px;
  flex-shrink: 0;
}

.dm-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-unread-badge {
  display: inline-block;
  background: var(--green);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

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

.dm-btn {
  background: var(--bg3);
  border: 1px solid var(--bg3);
  color: var(--text);
  font-size: 14px;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.dm-btn:active { opacity: 0.7; }
.dm-accept { border-color: var(--green); color: var(--green); }
.dm-decline { border-color: var(--red); color: var(--red); }

.dm-back-btn {
  background: none;
  border: none;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px 4px;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.dm-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 24px;
  line-height: 1.6;
}

/* ====== PET MARKET ====== */

.market-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.market-item {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.market-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-seller {
  font-size: 11px;
  color: var(--text-dim);
}

.market-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}

.pet-list-btn {
  width: 100%;
  padding: 4px 4px;
  border-radius: 6px;
  border: 1px solid #627eea;
  background: var(--bg);
  color: #627eea;
  font-weight: 700;
  font-size: 9px;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.15s;
}

.pet-list-btn:active { background: #627eea; color: #fff; }

/* ====== DESKTOP OVERRIDES ====== */

html[data-platform="desktop"] .stock-grid {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
}

html[data-platform="desktop"] .rig-grid {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

html[data-platform="desktop"] .lb-list {
  max-width: 600px;
  margin: 0 auto;
}

html[data-platform="desktop"] .chat-panel {
  max-width: 500px;
}

/* ====== ADMIN OVERLAY ====== */

.admin-overlay-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 20, 0.7);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.admin-overlay-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--bg);
  z-index: 1501;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

.admin-overlay.open {
  transform: translateX(0);
}

.admin-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}

.admin-overlay-header .admin-title {
  margin: 0;
  font-size: 18px;
}

.admin-overlay-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#admin-badge-toggle {
  font-size: 11px;
  padding: 4px 10px;
}

.admin-overlay-close {
  background: none;
  border: 1px solid var(--bg3);
  color: var(--text);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.admin-overlay-close:active {
  background: var(--bg3);
}

.admin-overlay-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Mobile: full width */
@media (max-width: 480px) {
  .admin-overlay {
    width: 100%;
  }
}

/* ====== CHAT UNREAD DOT ====== */

.chat-toggle-btn {
  position: relative;
}

.chat-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg);
  pointer-events: none;
}

.chat-header .chat-unread-dot {
  position: static;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border: none;
}

html[data-platform="desktop"] #screen-stocks .game-container,
html[data-platform="desktop"] #screen-crypto .game-container,
html[data-platform="desktop"] #screen-leaderboard .game-container {
  max-width: 800px;
}

/* ====== COIN FLIP TABS ====== */
.cf-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
}

.cf-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--bg3);
  border-radius: 8px 8px 0 0;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cf-tab-btn.active {
  background: var(--bg3);
  color: var(--green);
  border-color: var(--green);
}

/* ====== PVP COIN FLIP ====== */
.pvp-create-section {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.pvp-create-section h3 {
  font-size: 14px;
  color: var(--green);
  margin-bottom: 10px;
}

.pvp-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.pvp-create-row input[type="number"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--green);
  font-size: 16px;
  padding: 8px 12px;
  font-weight: 700;
}

.pvp-choice-btn {
  padding: 8px 18px;
  border: 2px solid var(--bg3);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pvp-choice-btn.pvp-choice-selected {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 230, 118, 0.1);
}

.pvp-create-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.pvp-create-btn:active {
  opacity: 0.8;
}

.pvp-section-title {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

.pvp-flip-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pvp-flip-avatar {
  font-size: 24px;
}

.pvp-flip-info {
  flex: 1;
}

.pvp-flip-name {
  font-weight: 700;
  font-size: 14px;
}

.pvp-flip-details {
  font-size: 12px;
  color: var(--text-dim);
}

.pvp-flip-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.pvp-flip-actions {
  display: flex;
  gap: 6px;
}

.pvp-accept-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.pvp-cancel-btn {
  padding: 6px 14px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: none;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.pvp-result-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.pvp-result-card .pvp-winner {
  color: var(--green);
  font-weight: 700;
}

.pvp-result-card .pvp-loser {
  color: var(--red);
}

.pvp-result-coin {
  font-size: 18px;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}

.pvp-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
}

/* ====== OUT OF SYNC BANNER ====== */
.out-of-sync-banner {
  background: #e65100;
  color: #fff;
  text-align: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  margin-bottom: 8px;
}

/* ====== NEW FEATURE STYLES ====== */

/* Loan Quick Cash (smaller button) */
.loan-quick-cash {
  grid-column: span 2;
  border-style: dashed;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: transparent;
}

/* Custom Loan Row */
.loan-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.loan-custom-input {
  flex-grow: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font-size: 14px;
}
.loan-custom-btn, .loan-bargain-btn {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
}
.loan-custom-btn:active, .loan-bargain-btn:active { background: var(--blue); color: #fff; }
.loan-bargain-btn { border-color: var(--gold); color: var(--gold); }
.loan-bargain-btn:active { background: var(--gold); color: #000; }

/* Shark Dialogue */
.shark-dialogue {
  background: var(--bg3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-style: italic;
  color: var(--gold);
  text-align: center;
}

/* Bargain Overlay */
.bargain-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 20, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
}
.bargain-overlay h3 { font-size: 22px; font-weight: 800; color: var(--gold); }
.bargain-info { text-align: center; font-size: 14px; color: var(--text-dim); max-width: 280px; }
#bargain-round, #bargain-status { text-align: center; font-size: 15px; }
#bargain-discount { font-size: 18px; font-weight: 800; text-align: center; }
.bargain-buttons { display: flex; gap: 12px; }
.bargain-btn {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}
.bargain-btn-high { background: var(--green); color: #000; }
.bargain-btn-low { background: var(--red); color: #fff; }
.bargain-btn:disabled { opacity: 0.4; cursor: default; }
.bargain-close-btn {
  padding: 10px 24px;
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  font-weight: 700;
}

/* Leaderboard Redesign */
.lb-category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.lb-cat-btn {
  padding: 6px 14px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text-dim);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.lb-cat-btn.active { border-color: var(--green); color: var(--green); background: rgba(0,230,118,0.1); }

.lb-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}
.lb-podium-card {
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
}
.lb-podium-card.rank-1 { border: 2px solid var(--gold); min-height: 120px; justify-content: flex-end; }
.lb-podium-card.rank-2 { border: 2px solid #aaa; min-height: 100px; justify-content: flex-end; }
.lb-podium-card.rank-3 { border: 2px solid #cd7f32; min-height: 85px; justify-content: flex-end; }
.lb-podium-rank { font-size: 20px; }
.lb-podium-avatar { font-size: 20px; }
.lb-podium-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 86px; }
.lb-podium-value { font-size: 11px; color: var(--green); font-weight: 700; }

.lb-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.lb-online-dot.online { background: var(--green); box-shadow: 0 0 4px var(--green); }

.lb-you-card {
  background: rgba(0,230,118,0.08);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Chat: clickable name + rebirth tag */
.chat-name-link {
  cursor: pointer;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}
.chat-name-link:active { opacity: 0.7; }
.chat-rebirth-tag {
  font-size: 10px;
  color: #ce93d8;
  background: rgba(156,39,176,0.15);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
}

/* Profile Actions */
.profile-online-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--bg3);
  display: inline-block;
  margin-bottom: 8px;
}
.profile-online-status.online { background: rgba(0,230,118,0.15); color: var(--green); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.friend-request-btn, .dm-open-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
}
.friend-request-btn.sent { border-color: var(--text-dim); color: var(--text-dim); }
.friend-request-btn.friends { border-color: var(--green); color: var(--green); }

/* Friend Notification */
.friend-notif {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 10px 16px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.friend-notif button { padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.friend-notif .accept-btn { background: var(--green); color: #000; border: none; }
.friend-notif .deny-btn { background: transparent; border: 1px solid var(--text-dim); color: var(--text-dim); }

/* DM Modal */
.dm-modal {
  position: fixed;
  bottom: 70px;
  right: 12px;
  width: 280px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  overflow: hidden;
}
.dm-header {
  background: var(--bg3);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}
.dm-header button { background: transparent; border: none; color: var(--text); font-size: 16px; }
.dm-messages {
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dm-msg {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 90%;
}
.dm-msg.mine { background: rgba(0,230,118,0.15); align-self: flex-end; }
.dm-msg.theirs { background: var(--bg3); align-self: flex-start; }
.dm-msg-sender { font-weight: 700; font-size: 11px; color: var(--text-dim); }
.dm-input-row {
  display: flex;
  padding: 8px;
  gap: 6px;
  border-top: 1px solid var(--bg3);
}
.dm-input-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
}
.dm-input-row button {
  padding: 6px 12px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
}

/* Insider Tip Toast */
.insider-tip-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 12px 20px;
  z-index: 9000;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
}
.insider-tip-toast.toast-in {
  animation: toastSlideIn 0.35s ease forwards;
}
.insider-tip-toast.toast-out {
  animation: toastSlideOut 0.38s ease forwards;
}
@keyframes toastSlideIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastSlideOut {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Stock Insider Button */
.stock-insider-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 6px;
  margin-top: 4px;
}
.stock-insider-btn:active { background: rgba(255,215,64,0.2); }
.stock-insider-btn:disabled { opacity: 0.4; }

/* Wealth Tax Notice */
.tax-notice {
  background: rgba(255,82,82,0.15);
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin: 0 4px;
  animation: debtPulse 2s ease-in-out infinite;
}

/* Pet Storage Panel */
.storage-panel {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.storage-info {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.storage-slot {
  background: var(--bg);
  border: 1px dashed var(--bg3);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.storage-slot.filled { border-color: var(--green); border-style: solid; }
.storage-slot .pet-mini-icon { font-size: 22px; }
.storage-slot .pet-mini-name { font-weight: 700; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.storage-retrieve-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 5px;
  font-weight: 700;
}
.storage-warning {
  font-size: 12px;
  color: var(--gold);
  text-align: center;
  padding: 4px;
}

/* ====== P2P PLAYER LOANS ====== */

.p2p-loan-panel {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
}
.p2p-loan-header {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: var(--bg3);
}
.p2p-loan-title { font-size: 15px; font-weight: 700; }
.p2p-loan-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.p2p-loan-body.hidden { display: none; }

.p2p-create-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p2p-create-section label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.p2p-create-section input {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  width: 100%;
}
.p2p-input-row {
  display: flex;
  gap: 8px;
}
.p2p-input-row input { flex: 1; }
.p2p-input-row span { align-self: center; font-size: 13px; color: var(--text-dim); white-space: nowrap; }

.p2p-offer-btn {
  padding: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  width: 100%;
}
.p2p-offer-btn:active { opacity: 0.8; }

.p2p-divider {
  height: 1px;
  background: var(--bg3);
  margin: 4px 0;
}
.p2p-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.p2p-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px;
}
.p2p-loan-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--bg3);
}
.p2p-pending { border-left-color: var(--gold); }
.p2p-borrowed { border-left-color: var(--red); }
.p2p-lent { border-left-color: var(--blue); }

.p2p-loan-info { font-size: 13px; line-height: 1.5; }
.p2p-lender { font-weight: 700; }
.p2p-amount { color: var(--gold); font-weight: 700; }
.p2p-owed { color: var(--red); font-weight: 700; }
.p2p-rate { color: var(--text-dim); font-size: 12px; }
.p2p-pending-text { font-size: 12px; color: var(--text-dim); font-style: italic; }

.p2p-loan-actions { display: flex; gap: 8px; }
.p2p-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.p2p-accept { background: var(--green); color: #000; }
.p2p-decline { background: transparent; border: 1px solid var(--text-dim); color: var(--text-dim); }
.p2p-pay { background: var(--green); color: #000; }
.p2p-forgive { background: transparent; border: 1px solid var(--gold); color: var(--gold); }

/* === Admin Leaderboard List === */
.admin-lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.admin-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
}
.admin-lb-name { flex: 1; font-weight: 600; }
.admin-lb-uid { color: var(--text-dim); font-size: 11px; font-weight: 400; }
.admin-lb-earned { color: var(--green); font-weight: 700; min-width: 70px; text-align: right; }
.admin-lb-del { padding: 2px 8px; font-size: 11px; }

/* === P2P Name Combo Dropdown === */
.p2p-name-combo { position: relative; }
.p2p-name-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.p2p-name-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.p2p-name-option:hover { background: var(--bg3); }
.p2p-name-opt-avatar { font-size: 16px; }
.p2p-name-opt-name { flex: 1; font-weight: 600; }
.p2p-name-opt-tag { color: var(--text-dim); font-size: 11px; }

/* === Settings extras === */
.settings-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0 8px;
  line-height: 1.4;
}
.settings-btn {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.settings-btn:hover { opacity: 0.85; }
.settings-divider {
  height: 1px;
  background: var(--bg3);
  margin: 12px 0;
}

/* === Chat unverified name === */
.chat-unverified { color: var(--red); font-size: 11px; font-weight: 700; }

/* === Market Sabotage === */
.stock-attack-btn {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}
.stock-attack-btn:hover { background: var(--red); color: #fff; }
.attack-info {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  text-align: left;
  margin-top: 8px;
}
.attack-cooldown {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.stock-attack-locked {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--text-dim);
  color: var(--text-dim);
}
.stock-attack-locked:hover { background: transparent; color: var(--text-dim); }


/* ===== BOUNTY BOARD ===== */
.bounty-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.bounty-card {
  border-radius: 10px;
  border: 2px solid #ff9100;
  background: var(--bg2);
  padding: 10px 12px;
}
.bounty-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bounty-symbol { font-weight: 800; font-size: 15px; color: var(--text); }
.bounty-pot { margin-left: auto; font-weight: 800; color: var(--gold); font-size: 15px; }
.bounty-card-body { display: flex; gap: 10px; font-size: 12px; color: var(--text-dim); }
.bounty-timer { margin-left: auto; font-family: monospace; }
.bounties-header { padding: 4px 0; }

/* ===== COUNTER-LOAN & NEGOTIATOR ===== */
.counter-loan-active, .counter-loan-form, .negotiator-form, .negotiator-purchased {
  padding: 8px 4px;
}
.cl-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bg3);
}
.cl-note {
  font-size: 11px;
  color: var(--text-dim);
  margin: 6px 0;
  line-height: 1.5;
}
.negotiator-purchased {
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 0;
}

/* ===== SHARK BLACK MARKET ===== */
.bm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg3);
}
.bm-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bm-name { font-weight: 700; font-size: 13px; }
.bm-desc { font-size: 11px; color: var(--text-dim); }
.bm-uses { font-size: 11px; color: var(--green); font-weight: 600; }

/* ===== R5 PANELS (hide until R5) ===== */
.r5-panel.hidden { display: none; }

/* ===== LUCKY OWNER BADGE ===== */
.lucky-owner-badge {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 2px;
  display: inline-block;
}

/* ====== ADMIN TABS ====== */
.admin-tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  flex-shrink: 0;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab-btn {
  background: var(--bg3);
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.admin-tab-btn:active { opacity: 0.7; }
.admin-tab-btn.active {
  background: var(--red);
  color: #fff;
}

/* ====== CHAT BADGE COUNT ====== */
.chat-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border: 2px solid var(--bg);
}

/* ====== STOCK TICKER ====== */
.stock-ticker {
  width: 100%;
  overflow: hidden;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  padding: 5px 0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  position: sticky;
  top: 0;           /* JS will set this to header height */
  z-index: 101;     /* above content; top-bar is 200 so dropdowns clear it */
}
.stock-ticker.hidden { display: none; }

.ticker-track {
  display: inline-block;
  will-change: transform;
}

.ticker-item { margin: 0 14px; }
.ticker-up { color: var(--green); }
.ticker-dn { color: var(--red); }
.ticker-flat { color: var(--text-dim); }
.ticker-sep { color: var(--bg3); margin: 0 2px; }

/* ====== PLAYER COMPANIES ====== */
.companies-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.company-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.company-tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--bg3);
  border-radius: 8px 8px 0 0;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.company-tab-btn.active {
  background: var(--bg3);
  color: var(--green);
  border-color: var(--green);
}

.company-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--bg3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.company-card-sym {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
}
.company-card-name {
  font-size: 12px;
  color: var(--text-dim);
}
.company-card-price {
  font-size: 18px;
  font-weight: 800;
}
.company-card-owner {
  font-size: 11px;
  color: var(--text-dim);
}
.company-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.company-buy-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.company-sell-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.player-stock-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(68, 138, 255, 0.15);
  color: #448aff;
  border-radius: 4px;
  padding: 2px 5px;
}

.company-found-form {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.company-found-form input {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
}
.company-found-btn {
  background: var(--green);
  color: #000;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.company-found-cost {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

/* ── Company card accordion ── */
.co-card { background: var(--bg2); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; border: 1px solid var(--bg3); }
.co-card-open { border-color: var(--accent); }
.co-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; cursor: pointer; gap: 8px; user-select: none; }
.co-card-header:active { background: var(--bg3); }
.co-card-info { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.co-card-name { font-weight: 800; font-size: 14px; }
.co-card-ticker { font-size: 11px; color: var(--accent); background: rgba(187,134,252,0.12); border-radius: 4px; padding: 1px 5px; }
.co-card-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.co-card-chevron { font-size: 12px; color: var(--text-dim); }
.co-sub-tabs { display: flex; border-bottom: 1px solid var(--bg3); background: var(--bg); }
.co-stab { flex: 1; padding: 8px 4px; font-size: 12px; background: none; border: none; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.co-stab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.co-sub-content { padding: 12px; }


.company-manage-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
}
.company-manage-section h3 {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.company-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg3);
}
.company-stock-row:last-child { border-bottom: none; }
.csr-sym { font-weight: 800; color: var(--green); font-size: 14px; }
.csr-industry-badge { display:inline-block; font-size:10px; padding:1px 5px; border-radius:4px; background:var(--bg3); color:var(--text-dim); margin-left:5px; vertical-align:middle; }
.csr-industry-custom { background:#1a2a4a; color:#82b1ff; border:1px solid #82b1ff44; }
.csr-price { font-weight: 700; font-size: 14px; }
.csr-type { font-size: 11px; }
.csr-type-public { color: var(--green); }
.csr-type-private { color: var(--text-dim); }
.csr-toggle-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--bg3);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
}
.add-stock-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--bg3);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.add-stock-btn:hover { border-color: var(--green); color: var(--green); }

/* Player stocks in market / browse tabs */
.player-stocks-market-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 12px 4px 6px;
}
.player-stock-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,230,118,0.15);
  color: var(--green);
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 4px;
}

/* Bankrupt / distressed cards */
.bankrupt-card {
  background: rgba(192,57,43,0.10);
  border: 1px solid #c0392b !important;
}
.distressed-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(192,57,43,0.2);
  color: #e74c3c;
  border-radius: 4px;
  padding: 2px 5px;
}

/* Sell section inside company manage tab */
.company-sale-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg3);
}

/* Slot upgrade wrapper */
.company-upgrade-section {
  margin-top: 8px;
}

/* Per-company upgrade rows */
.company-upgrades-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg3);
}
.company-upgrade-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg3);
}
.company-upgrade-row:last-child { border-bottom: none; }
.upgrade-level-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg3);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 2px 5px;
}
.upgrade-maxed {
  background: rgba(255,193,7,0.2);
  color: var(--gold);
}

/* Insider intel panel */
.company-insider-panel {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0,188,212,0.08);
  border: 1px solid rgba(0,188,212,0.25);
  border-radius: 8px;
  font-size: 12px;
}

/* Inline insider hint on market stock card */
.insider-inline-hint {
  font-size: 10px;
  color: #00bcd4;
  background: rgba(0,188,212,0.10);
  border: 1px solid rgba(0,188,212,0.25);
  border-radius: 4px;
  padding: 2px 5px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== COIN PROMOTIONS ===== */
.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.promo-btn {
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid var(--bg3);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.5;
}

.promo-btn.promo-bull {
  border-color: rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.06);
  color: var(--green);
}

.promo-btn.promo-bear {
  border-color: rgba(255, 82, 82, 0.4);
  background: rgba(255, 82, 82, 0.06);
  color: var(--red);
}

.promo-btn:active {
  opacity: 0.75;
}

.promo-cost {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.85;
}

.promo-icon-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
.promo-icon-btn:hover { opacity: 1; }

.promo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 5px;
}

.promo-badge.promo-bull {
  background: rgba(0, 230, 118, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.promo-badge.promo-bear {
  background: rgba(255, 82, 82, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.promo-active-badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.promo-active-badge.promo-bull {
  background: rgba(0, 230, 118, 0.12);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.promo-active-badge.promo-bear {
  background: rgba(255, 82, 82, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 82, 82, 0.3);
}

/* ===== SCANDALS ===== */
.scandal-alert {
  margin-top: 6px;
  padding: 7px 9px;
  background: rgba(192,57,43,0.13);
  border: 1px solid rgba(192,57,43,0.4);
  border-radius: 7px;
  font-size: 12px;
  color: #e74c3c;
  line-height: 1.4;
}
.scandal-suppress-btn {
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid #e74c3c;
  background: transparent;
  color: #e74c3c;
  font-size: 11px;
  cursor: pointer;
}
.scandal-suppress-btn:hover { background: rgba(231,76,60,0.15); }
.scandal-news-banner {
  margin-top: 5px;
  font-size: 11px;
  color: #e74c3c;
  padding: 4px 7px;
  background: rgba(192,57,43,0.08);
  border-radius: 5px;
}

/* ===== COMPETITOR / SABOTAGE ===== */
.competitor-card { border-color: #e74c3c !important; }
.competitor-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 4px;
}
.competitor-controls {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.competitor-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.competitor-btn.competitor-active {
  border-color: #e74c3c;
  color: #e74c3c;
  background: rgba(231,76,60,0.1);
}
.sabotage-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #e74c3c;
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.sabotage-btn:active { opacity: 0.7; }
.ally-card { border-color: #27ae60 !important; }
.ally-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(39,174,96,0.2);
  color: #27ae60;
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 4px;
}
.ally-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ally-btn.ally-active {
  border-color: #27ae60;
  color: #27ae60;
  background: rgba(39,174,96,0.1);
}
.boost-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #27ae60;
  background: rgba(39,174,96,0.15);
  color: #27ae60;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.boost-btn:active { opacity: 0.7; }

/* ===== COMPANY PROPERTIES ===== */
.company-properties-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--bg3);
}
.company-property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.company-property-card {
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.company-property-card.owned {
  border-color: var(--green);
  background: rgba(0,230,118,0.05);
}
.cprop-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.cprop-income {
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}
.cprop-cost {
  font-size: 11px;
  color: var(--text-dim);
}
.cprop-buy-btn {
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.cprop-buy-btn:active { background: rgba(0,230,118,0.15); }
.cprop-owned-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(0,230,118,0.2);
  color: var(--green);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ===== HUNGER SYSTEM ===== */
.hunger-hud {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--bg3);
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hunger-bar-wrap {
  width: 28px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
#hunger-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.5s ease;
  background: #00e676;
}
#hunger-pct {
  color: var(--text-dim);
  font-size: 10px;
  min-width: 26px;
  text-align: right;
}
.hunger-starving {
  animation: hunger-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes hunger-pulse {
  from { opacity: 1; }
  to { opacity: 0.5; box-shadow: 0 0 8px rgba(255,82,82,0.6); }
}

/* Food Shop */
.food-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.food-item {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.food-item.affordable:hover,
.food-item.affordable:active {
  background: var(--bg3);
  border-color: var(--green);
}
.food-item.unaffordable {
  opacity: 0.45;
  cursor: not-allowed;
}
.food-emoji { font-size: 22px; line-height: 1.2; }
.food-name { font-size: 11px; font-weight: 700; margin: 3px 0 1px; }
.food-restore { font-size: 12px; color: var(--green); font-weight: 700; }
.food-bonus { font-size: 10px; color: var(--gold); margin-top: 1px; }
.food-cost { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.food-cost-cant { color: var(--red) !important; }

/* Coin cards & player coin badge */
.player-coin-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(153,69,255,0.2);
  color: #bb86fc;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
}
.coin-card { }

/* Crypto 4-tab redesign */
.coin-selector {
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--bg3);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 4px;
  margin-top: 4px;
  width: 100%;
}

/* Ticker coin separator */
.ticker-separator {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0 8px;
}

/* ── Coin Slot Tabs ───────────────────────────────────── */
.coin-slot-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 10px 0;
  flex-wrap: wrap;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
}

.coin-slot-tab {
  padding: 6px 14px;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--bg3);
  border-bottom: none;
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.coin-slot-tab.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--gold);
}

.coin-slot-locked {
  padding: 6px 14px;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--bg3);
  border-bottom: none;
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 12px;
  opacity: 0.6;
}

/* ── Banking ──────────────────────────────────────────── */
.bank-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.bank-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.bank-stress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}

.bank-stress-fill {
  height: 100%;
  border-radius: 4px;
  /* On creation: animate from 0 to --stress-w over 2.5s */
  animation: bank-stress-grow 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  /* On in-place updates: smooth transition */
  transition: width 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 1.5s ease;
}

@keyframes bank-stress-grow {
  from { width: 0%; }
  to   { width: var(--stress-w, 0%); }
}

.bank-setup-section {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 10px;
}

.bank-setup-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--gold);
}

.my-deposits-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ====== ONLINE BADGE (top bar) ====== */

#online-badge.online-badge {
  font-size: 11px;
  background: var(--green);
  color: #000;
  border-radius: 10px;
  padding: 2px 7px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

#online-badge.online-badge:empty {
  display: none;
}

.online-player-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 6px 0;
  z-index: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.online-player-row {
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

/* ====== TOP-BAR CHAT BUTTON ====== */

.chat-toggle-btn-bar {
  background: var(--green);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 0;
}

.chat-toggle-btn-bar:active { opacity: 0.7; }

#chat-unread-bar {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 1px solid var(--bg);
  display: none;
}

/* ====== NEWS ORG SECTION ====== */

.news-org-section {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 230, 118, 0.04);
}

.news-org-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent);
}

/* ====== NEWS CHANNEL TAB ====== */

.news-tab-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.news-channel-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
  flex-shrink: 0;
}

.news-channel-bar::-webkit-scrollbar { display: none; }

.news-channel-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

.news-channel-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.08);
}

.news-channel-rep {
  font-size: 10px;
  opacity: 0.7;
}

.news-channel-count {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.news-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* org card grid for the "All News" home view */
.news-org-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.news-org-card {
  background: var(--bg2);
  border-radius: 12px;
  border: 2px solid var(--bg3);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-org-card:active { transform: scale(0.98); }
.news-org-card:hover { border-color: var(--accent); }

.news-org-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.news-org-card-logo {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.news-org-card-info {
  flex: 1;
  min-width: 0;
}

.news-org-card-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-org-card-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.news-org-card-preview {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  border-left: 3px solid var(--bg3);
  padding-left: 10px;
}

/* back button in single org view */
.news-back-btn {
  background: none;
  border: 1px solid var(--bg3);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 13px;
  padding: 5px 14px;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.news-back-btn:hover { border-color: var(--accent); color: var(--accent); }

.news-vote-btn {
  background: var(--bg3);
  border: none;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}

.news-vote-btn.news-vote-up:hover { background: rgba(0,200,80,0.25); }
.news-vote-btn.news-vote-down:hover { background: rgba(200,50,50,0.25); }

.news-org-header {
  border-radius: 10px;
  border: 2px solid var(--accent);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 230, 118, 0.04);
  margin-bottom: 4px;
}

.news-org-header .news-org-icon {
  font-size: 28px;
  line-height: 1;
}

.news-org-header .news-org-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.news-org-header .news-org-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text);
}

.news-org-header .news-org-owner {
  font-size: 11px;
  color: var(--text-dim);
}

.news-org-header .news-org-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ====== NEWS POST CARD (newspaper style) ====== */

.news-post-card {
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--bg3);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-post-masthead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.news-post-logo {
  font-size: 16px;
  line-height: 1;
}

.news-post-orgname {
  font-weight: 700;
  color: var(--accent);
  font-size: 11px;
}

.news-post-byline {
  color: var(--text-dim);
}

.news-post-age {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 10px;
  white-space: nowrap;
}

.news-post-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.news-post-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.news-post-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--bg3);
  flex-wrap: wrap;
}

.news-vote-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-comments-btn {
  background: none;
  border: 1px solid var(--bg3);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  margin-left: auto;
}

.news-comments-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ====== COMMENTS ====== */

.news-comments-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--bg3);
}

.news-comment {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  align-items: baseline;
}

.news-comment-author {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.news-comment-text {
  color: var(--text);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.news-comment-age {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.news-comment-form {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.news-comment-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 20px;
  color: var(--text);
  padding: 5px 12px;
  font-size: 12px;
}

.news-comment-submit {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ====== LOGO PICKER ====== */

.news-logo-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg3);
}

.news-logo-opt {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.news-logo-opt.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 100,200,255), 0.15);
}

/* ====== LOAN FORGIVE ROW ====== */

.loan-forgive-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--bg3);
}

/* ====== PRIVATE ROOM BUTTON ====== */

.mp-private-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 14px;
  background: #2a1a4a;
  color: #bb86fc;
  border: 1px solid #bb86fc55;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.3px;
}
.mp-private-btn:hover { background: #3a2a5a; }

.mp-private-badge {
  background: #2a1a4a;
  color: #bb86fc;
  border-color: #bb86fc55;
}

/* ====== PRIVATE ROOM MODAL ====== */

.private-room-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.private-room-inner {
  background: var(--bg2);
  border: 1px solid #bb86fc55;
  border-radius: var(--radius);
  padding: 18px;
  max-width: 360px;
  width: 100%;
  position: relative;
}
.prm-title {
  font-size: 16px;
  font-weight: 700;
  color: #bb86fc;
  margin-bottom: 14px;
}
.prm-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #bb86fc;
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.prm-btn:hover { filter: brightness(1.1); }
.prm-create { background: linear-gradient(135deg, #bb86fc, #7c4dff); }
.prm-danger { background: #ff5252; color: #fff; margin-top: 6px; }
.prm-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin: 10px 0;
}
.prm-join-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.prm-join-row .prm-btn { flex: 0 0 auto; width: auto; margin: 0; padding: 10px 14px; }
.prm-code-input {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  font-family: monospace;
  text-transform: uppercase;
  background: var(--bg3);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  color: var(--text);
}
.prm-code-display {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.private-room-code {
  font-family: monospace;
  font-size: 22px;
  font-weight: 900;
  color: #bb86fc;
  letter-spacing: 4px;
}
.prm-section-label {
  font-size: 11px;
  color: var(--text-dim);
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.prm-start-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.prm-start-row .prm-btn { width: auto; flex: 1; margin: 0; font-size: 12px; }
.prm-invite-btn {
  background: #bb86fc22;
  color: #bb86fc;
  border: 1px solid #bb86fc55;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
}
.prm-invite-btn:hover { background: #bb86fc44; }
.prm-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

/* ====== ONLINE PICK LIST ====== */

.online-pick-list {
  max-height: 130px;
  overflow-y: auto;
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.online-pick-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--bg3);
}
.online-pick-row:last-child { border-bottom: none; }

/* ====== INVITE OVERLAY ====== */

.invite-overlay {
  position: fixed;
  bottom: 80px;
  left: 12px;
  z-index: 1100;
  transform: translateX(-120%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 300px;
}
.invite-overlay.invite-visible { transform: translateX(0); }
.invite-box {
  background: var(--bg2);
  border: 1px solid #bb86fc66;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.invite-title {
  font-size: 13px;
  font-weight: 700;
  color: #bb86fc;
  margin-bottom: 4px;
}
.invite-body {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.invite-code {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 3px;
  margin-top: 4px;
}
.invite-actions { display: flex; gap: 8px; }
.invite-accept {
  flex: 1;
  padding: 6px;
  background: #00e676;
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.invite-decline {
  flex: 1;
  padding: 6px;
  background: transparent;
  color: #ff5252;
  border: 1px solid #ff525255;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

/* ====== PVP CHALLENGE BUTTON ====== */

.pvp-challenge-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: #1a2a4a;
  color: #82b1ff;
  border: 1px solid #82b1ff55;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pvp-challenge-btn:hover { background: #2a3a5a; }
.pvp-challenge-picker {
  margin-top: 6px;
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  max-height: 140px;
  overflow-y: auto;
  background: var(--bg2);
}

/* ===================================================
   HOUSES
   =================================================== */
.houses-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.houses-tab {
  flex: 1;
  padding: 8px 6px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  min-width: 90px;
}
.houses-tab.active {
  background: var(--green-dark);
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}
.houses-section-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.houses-timer-note { font-weight: 400; opacity: 0.7; }
.houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.house-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.house-card-owned { border-color: var(--green); }
.house-card-icon { font-size: 28px; text-align: center; }
.house-card-name { font-size: 13px; font-weight: 700; text-align: center; }
.house-card-tier { font-size: 11px; color: var(--text-dim); text-align: center; }
.house-specials { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.house-special-tag {
  font-size: 10px;
  background: var(--bg3);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-dim);
}
.house-slots-note { font-size: 10px; color: var(--text-dim); text-align: center; }
.house-buy-btn {
  margin-top: 4px;
  padding: 7px;
  background: var(--green-dark);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.house-buy-btn.unaffordable {
  background: var(--bg3);
  color: var(--text-dim);
  border-color: var(--bg3);
  cursor: not-allowed;
  opacity: 0.6;
}
.house-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.house-action-btn {
  padding: 6px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.house-cancel-btn { color: var(--red); border-color: var(--red); }
.house-listed-badge { font-size: 11px; color: var(--green); font-weight: 600; text-align: center; }
.houses-empty { text-align: center; padding: 30px 16px; color: var(--text-dim); line-height: 1.6; }

/* House Modals */
.house-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.house-modal-box {
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: 14px;
  padding: 20px;
  max-width: 320px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.house-modal-title { font-size: 15px; font-weight: 700; text-align: center; }
.house-modal-input {
  width: 100%;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.house-modal-actions { display: flex; gap: 8px; }
.house-modal-btn {
  flex: 1;
  padding: 10px;
  background: var(--green-dark);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.house-modal-cancel { background: var(--bg3); color: var(--red); border-color: var(--red); }

/* Furnish Modal */
.furnish-modal-box { max-width: 380px; }
.furnish-slots-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.furnish-slot {
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.furnish-slot-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.furnish-slot-item {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.furnish-slot-empty { font-size: 12px; color: var(--text-dim); font-style: italic; }
.furnish-remove-btn {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.furnish-select {
  width: 100%;
  padding: 5px 6px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  font-size: 12px;
}

/* Furniture Shop */
.furniture-stash-info {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--bg2);
  border-radius: 6px;
}
.furniture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.furniture-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.furniture-icon { font-size: 24px; }
.furniture-name { font-size: 12px; font-weight: 700; }
.furniture-bonus { font-size: 11px; color: var(--green); }
.furniture-owned-badge { font-size: 10px; color: var(--green); font-weight: 600; }
.furniture-buy-btn {
  width: 100%;
  padding: 6px;
  background: var(--green-dark);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.furniture-buy-btn.unaffordable {
  background: var(--bg3);
  color: var(--text-dim);
  border-color: var(--bg3);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===================================================
   INVENTORY + CRAFTED ITEMS
   =================================================== */
.inv-equip-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.inv-equip-slot {
  flex: 1;
  border-radius: 10px;
  border: 2px solid var(--bg3);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 70px;
  position: relative;
  background: var(--bg2);
}
.inv-equip-slot-filled { background: var(--bg); }
.inv-equip-icon { font-size: 18px; }
.inv-equip-name { font-size: 10px; font-weight: 700; text-align: center; line-height: 1.2; }
.inv-equip-rarity { font-size: 9px; text-transform: capitalize; }
.inv-equip-unequip {
  position: absolute;
  top: 2px;
  right: 4px;
  background: none;
  border: none;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.inv-equip-empty-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.inv-equip-empty-hint { font-size: 10px; color: var(--text-dim); font-style: italic; }

.inv-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.inv-tab {
  flex: 1;
  padding: 8px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.inv-tab.active {
  background: var(--green-dark);
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}

.inv-item-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inv-item-card {
  background: var(--bg2);
  border: 2px solid var(--bg3);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inv-item-equipped { background: var(--bg); }
.inv-item-top { display: flex; gap: 10px; align-items: flex-start; }
.inv-item-art { flex-shrink: 0; image-rendering: pixelated; }
.inv-item-info { flex: 1; min-width: 0; }
.inv-item-name { font-size: 13px; font-weight: 700; }
.inv-item-rarity { font-size: 11px; text-transform: capitalize; }
.inv-item-crafter { font-size: 10px; color: var(--text-dim); }
.inv-item-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.inv-stat-tag {
  font-size: 10px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
  font-weight: 600;
}
.inv-item-actions { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.inv-equip-select {
  flex: 1;
  padding: 5px 6px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  font-size: 11px;
  min-width: 90px;
}
.inv-edit-art-btn, .inv-sell-btn {
  padding: 5px 8px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.inv-eat-btn {
  padding: 5px 10px;
  background: #1b3a1f;
  color: #4caf50;
  border: 1px solid #4caf5066;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.inv-eat-btn:active { opacity: 0.75; }
.inv-eat-btn.unaffordable { opacity: 0.45; pointer-events: none; }
.inv-menu-btn {
  padding: 5px 8px;
  background: #1a2a3a;
  color: #64b5f6;
  border: 1px solid #64b5f655;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.inv-menu-btn:active { opacity: 0.75; }
.food-menu-type-tag { color: #ffb74d; border-color: #ffb74d44; }
.food-menu-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg3);
  font-size: 12px;
}
/* Custom Pet UI */
.custom-pet-equip-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.custom-pet-slot {
  flex: 1;
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 70px;
  justify-content: center;
}
.custom-pet-slot-filled { background: var(--bg2); }
.custom-pet-slot-empty { background: var(--bg); }
.cps-name { font-size: 10px; font-weight: 700; text-align: center; }

.active-buffs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: #1b3a1f;
  border: 1px solid #4caf5044;
  border-radius: 8px;
  margin-bottom: 10px;
}
.active-buff-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #81c784;
  background: #2a4a2e;
  border-radius: 12px;
  padding: 2px 8px;
}
.buff-timer { font-size: 10px; color: #a5d6a7; opacity: 0.85; }
.inv-equipped-badge { font-size: 11px; color: var(--green); font-weight: 700; }
.inv-empty { text-align: center; padding: 30px 16px; color: var(--text-dim); line-height: 1.6; }

/* ===================================================
   CRAFTING TAB (in companies)
   =================================================== */
.craft-tab-content { display: flex; flex-direction: column; gap: 10px; }
.craft-tab-header { display: flex; justify-content: space-between; align-items: center; }
.craft-tab-title { font-size: 14px; font-weight: 700; }
.craft-tab-cost { font-size: 12px; color: var(--text-dim); }
.craft-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.craft-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}
.craft-type-btn:hover { border-color: var(--green); }
.craft-type-btn.unaffordable { opacity: 0.5; cursor: not-allowed; }
.craft-type-icon { font-size: 22px; }
.craft-type-name { font-size: 11px; font-weight: 700; }
.craft-type-industry { font-size: 9px; color: var(--text-dim); text-transform: capitalize; }
.craft-odds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg2);
  border-radius: 6px;
}
.craft-odds-title { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.craft-odd-tag { font-size: 10px; font-weight: 600; }
.craft-empty { padding: 20px; text-align: center; color: var(--text-dim); }
.craft-recent-label { font-size: 11px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }
.craft-recent-list { display: flex; flex-direction: column; gap: 4px; }
.craft-recent-item {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--bg2);
  border-radius: 6px;
}

/* ===================================================
   PIXEL PAINTER
   =================================================== */
.pixel-painter-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pixel-painter-modal.hidden { display: none; }
.pixel-painter-box {
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  width: 95%;
}
.pp-header { font-size: 16px; font-weight: 700; color: var(--green); }
.pp-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(16, 1fr);
  width: 256px;
  height: 256px;
  border: 1px solid var(--bg3);
  cursor: crosshair;
  image-rendering: pixelated;
  user-select: none;
  touch-action: none;
}
.pp-cell {
  width: 16px;
  height: 16px;
  box-sizing: border-box;
}
.pp-cell-transparent { background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 0 0 / 8px 8px; }
.pp-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 256px;
  justify-content: flex-start;
}
.pp-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.pp-swatch-transparent { background: repeating-conic-gradient(#444 0% 25%, #333 0% 50%) 0 0 / 8px 8px; }
.pp-swatch-active { border-color: #fff; }
.pp-swatch:hover { transform: scale(1.2); }
.pp-color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
}
.pp-tools {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.pp-tool-btn {
  padding: 7px 12px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}
.pp-tool-btn.pp-tool-active { border-color: var(--green); color: var(--green); }
.pp-save-btn {
  padding: 7px 14px;
  background: var(--green-dark);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pp-skip-btn {
  padding: 7px 10px;
  background: none;
  color: var(--text-dim);
  border: none;
  font-size: 12px;
  cursor: pointer;
}
.pixel-art-preview { image-rendering: pixelated; flex-shrink: 0; }

/* =====================================================================
   CARS SYSTEM
   ===================================================================== */

/* Cars tabs */
.cars-tabs { display:flex; gap:4px; margin-bottom:14px; overflow-x:auto; }
.cars-tab {
  flex-shrink:0;
  padding:7px 14px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:8px;
  color:var(--text-dim);
  font-size:13px;
  cursor:pointer;
}
.cars-tab.active { background:var(--green-dark); color:var(--green); border-color:var(--green); }

/* Car grid */
.car-grid { display:flex; flex-direction:column; gap:10px; }

/* Car card */
.car-card {
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:12px;
  padding:12px;
}
.car-card-top { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.car-card-icon { font-size:28px; flex-shrink:0; }
.car-card-info { flex:1; min-width:0; }
.car-card-name { font-weight:700; font-size:14px; }
.car-card-brand { font-size:11px; color:var(--text-dim); }
.car-card-rarity { font-size:11px; font-weight:700; }

/* Mini stat bars */
.car-stats-mini { display:flex; flex-direction:column; gap:4px; margin-bottom:8px; }
.car-mini-stat { display:flex; align-items:center; gap:6px; }
.car-mini-stat-label { font-size:10px; color:var(--text-dim); width:70px; flex-shrink:0; }
.car-mini-bar-wrap { flex:1; height:5px; background:var(--bg3); border-radius:3px; overflow:hidden; }
.car-mini-bar { height:100%; background:var(--green); border-radius:3px; transition:width .3s; }
.car-mini-stat-val { font-size:10px; color:var(--text-dim); width:24px; text-align:right; }

/* Car actions */
.car-card-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.car-btn {
  padding:5px 10px;
  background:var(--bg3);
  border:1px solid var(--bg3);
  border-radius:6px;
  color:var(--text);
  font-size:12px;
  cursor:pointer;
}
.car-btn.green { border-color:var(--green); color:var(--green); }
.car-btn.red { border-color:#f44336; color:#f44336; }
.car-btn:disabled { opacity:0.45; cursor:default; }

/* Flaw badge */
.car-flaw-badge {
  display:inline-block;
  padding:2px 7px;
  background:#3d1500;
  border:1px solid #ff9800;
  color:#ff9800;
  border-radius:5px;
  font-size:10px;
  font-weight:700;
}
.car-condition-bar { height:6px; border-radius:3px; background:var(--bg3); overflow:hidden; margin-top:4px; }
.car-condition-fill { height:100%; border-radius:3px; background:var(--green); }

/* Flaw row in modal */
.flaw-row {
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px;
  background:var(--bg3);
  border-radius:8px;
  margin-bottom:6px;
}
.flaw-emoji { font-size:18px; flex-shrink:0; }
.flaw-info { flex:1; min-width:0; }
.flaw-name { font-weight:700; font-size:13px; }
.flaw-penalty { font-size:11px; color:#ff9800; }
.flaw-maxfix { font-size:10px; color:var(--text-dim); }
.flaw-repair-btn {
  padding:5px 10px;
  background:var(--bg2);
  border:1px solid var(--green);
  color:var(--green);
  border-radius:6px;
  font-size:12px;
  cursor:pointer;
  flex-shrink:0;
}

/* Brand header */
.brand-header {
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:12px;
  margin-bottom:12px;
}
.brand-logo { font-size:32px; }
.brand-info { flex:1; }
.brand-name { font-size:18px; font-weight:800; }
.brand-slogan { font-size:11px; color:var(--text-dim); font-style:italic; }
.brand-stats { font-size:11px; color:var(--text-dim); margin-top:2px; }
.brand-section-label {
  font-size:11px;
  font-weight:700;
  color:var(--text-dim);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin:12px 0 6px;
}

/* Model list */
.model-list { display:flex; flex-direction:column; gap:8px; }
.model-row {
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:10px;
}
.model-icon { font-size:22px; flex-shrink:0; }
.model-info { flex:1; }
.model-name { font-weight:700; font-size:13px; }
.model-desc { font-size:11px; color:var(--text-dim); }
.model-manufacture-btn {
  padding:6px 12px;
  background:var(--green-dark);
  border:1px solid var(--green);
  color:var(--green);
  border-radius:7px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

/* Race panel */
.race-panel { display:flex; flex-direction:column; gap:10px; }
.race-panel-title { font-size:16px; font-weight:800; }
.race-rule { font-size:12px; color:var(--text-dim); }
.race-row { display:flex; flex-direction:column; gap:4px; }
.race-result {
  padding:12px;
  border-radius:10px;
  text-align:center;
  font-weight:700;
  font-size:15px;
  margin-top:8px;
}
.race-result.win { background:#1b4d1e; color:#4caf50; border:1px solid #4caf50; }
.race-result.lose { background:#4d1b1b; color:#f44336; border:1px solid #f44336; }

/* Car design modal */
.car-design-modal-box {
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:14px;
  padding:18px;
  max-width:440px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
}
.car-design-label { font-size:12px; color:var(--text-dim); margin-bottom:3px; }

/* Stat preview in design modal */
.car-stat-preview { margin-top:10px; }
.car-stat-row { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.car-stat-label { font-size:12px; width:80px; flex-shrink:0; }
.car-stat-bar-wrap { flex:1; height:8px; background:var(--bg3); border-radius:4px; overflow:hidden; }
.car-stat-bar { height:100%; background:var(--green); border-radius:4px; }
.car-stat-value { font-size:11px; width:28px; text-align:right; color:var(--text-dim); }

/* Brand discount badge */
.car-brand-discount-badge {
  display:inline-block;
  padding:2px 8px;
  background:#1a3a1a;
  border:1px solid var(--green);
  color:var(--green);
  border-radius:5px;
  font-size:10px;
  font-weight:700;
}

/* Market summary bar */
.mine-summary-bar {
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
  font-size:12px;
  color:var(--text-dim);
}
.mine-summary-bar strong { color:var(--text); }

/* =====================================================================
   VAULT SYSTEM (inside Houses)
   ===================================================================== */

.vault-header {
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:10px;
  margin-bottom:12px;
}
.vault-cap-bar {
  flex:1;
  height:8px;
  background:var(--bg3);
  border-radius:4px;
  overflow:hidden;
}
.vault-cap-fill { height:100%; background:var(--green); border-radius:4px; }
.vault-items-list { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.vault-item-row {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:8px;
}
.vault-item-icon { font-size:18px; flex-shrink:0; }
.vault-item-label { flex:1; font-size:13px; }
.vault-item-qty { font-size:12px; color:var(--text-dim); }
.vault-withdraw-btn {
  padding:4px 10px;
  background:var(--bg3);
  border:1px solid var(--bg3);
  color:var(--text);
  border-radius:6px;
  font-size:11px;
  cursor:pointer;
}
.vault-deposit-section {
  margin-top:12px;
  padding:10px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:10px;
}
.vault-deposit-section h4 { font-size:12px; color:var(--text-dim); margin:0 0 8px; }

/* God mansion extras */
.houses-rebirth-lock {
  text-align:center;
  padding:20px;
  color:var(--text-dim);
  font-size:13px;
}
.house-card-god {
  border-color:#b8860b;
  background:linear-gradient(135deg,#1a1200,var(--bg2));
}
.house-god-desc { font-size:11px; color:#d4af37; margin:4px 0; }
.house-owned-badge {
  display:inline-block;
  padding:2px 8px;
  background:#1b4d1e;
  color:var(--green);
  border:1px solid var(--green);
  border-radius:4px;
  font-size:10px;
  font-weight:700;
}
.house-taken-badge {
  display:inline-block;
  padding:2px 8px;
  background:#3d1515;
  color:#f44336;
  border:1px solid #f44336;
  border-radius:4px;
  font-size:10px;
  font-weight:700;
}

/* =====================================================================
   ADMIN FORGE TAB
   ===================================================================== */

.admin-pe-section-label {
  font-size:10px;
  font-weight:700;
  color:var(--text-dim);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:2px;
  padding-top:4px;
  border-top:1px solid var(--bg3);
}
.admin-forge-stats {
  margin-top:10px;
  padding:10px;
  background:var(--bg);
  border:1px solid var(--bg3);
  border-radius:8px;
}
.admin-forge-preview {
  padding:12px;
  background:var(--bg);
  border:1px solid var(--bg3);
  border-radius:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  text-align:center;
}

/* Cars stat bar */
.cars-stat-bar {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 10px;
  background: var(--bg2);
  border-radius: 8px;
  margin-bottom: 10px;
}

/* =====================================================================
   SH-INPUT (shorthand bet input used across all games)
   ===================================================================== */
.sh-input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--bg3);
  background: var(--bg3);
  color: var(--text);
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
.sh-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* =====================================================================
   VAULT — missing classes
   ===================================================================== */
.vault-empty-msg {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.vault-cap-label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  margin-top: 2px;
}
.vault-public-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  margin: 6px 0;
}
.vault-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0 2px;
  border-top: 1px solid var(--bg3);
  margin-top: 6px;
}
.vault-item-name {
  font-size: 13px;
  flex: 1;
}
.vault-item-val {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 4px;
}
.vault-deposit-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.vault-deposit-block {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vault-deposit-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}
.vault-deposit-select,
.vault-deposit-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.vault-deposit-btn {
  padding: 7px 12px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.vault-deposit-btn:hover { opacity: 0.85; }

/* =====================================================================
   CARS — missing classes
   ===================================================================== */
.cars-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.car-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin: 2px 0;
}
.car-card-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin: 4px 0;
}
.car-passive-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #1a2e1a;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px 0;
}
.car-btn-race {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.car-btn-sell {
  background: var(--bg3);
  color: var(--text);
}
.car-list-value-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.car-mini-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s;
}
.car-mini-val {
  font-size: 10px;
  color: var(--text-dim);
  min-width: 22px;
  text-align: right;
}

/* Design modal */
.car-design-modal-box {
  max-width: 400px;
}
.car-design-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.car-design-select {
  width: 100%;
}
.car-design-preview {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  margin-bottom: 10px;
}
.car-design-cost {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Flaws modal */
.car-flaws-modal-box {
  max-width: 380px;
}
.flaw-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flaw-stat {
  font-size: 11px;
  color: #f44336;
  margin-top: 2px;
}
.flaw-fixability {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}
.flaw-note {
  font-size: 11px;
  color: #ff9800;
  background: #1f1500;
  border: 1px solid #ff9800;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.flaw-repaired {
  color: var(--green);
  font-style: italic;
}
.flaw-done {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  margin-top: 4px;
}
.car-flaw-ok {
  color: var(--green);
  border-color: var(--green);
  background: #0d2010;
}

/* Brand / model */
.brand-found-intro {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 12px;
}
.brand-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0 10px;
  line-height: 1.5;
}
.model-cat {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Race panel */
.race-panel {
  padding: 12px 0;
}
.race-panel-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.race-result {
  text-align: center;
  padding: 20px 16px;
  border-radius: 12px;
  border: 2px solid var(--bg3);
  background: var(--bg2);
  margin-bottom: 12px;
}
.race-win {
  border-color: var(--green);
  background: #0d2010;
}
.race-lose {
  border-color: #f44336;
  background: #200d0d;
}
.race-result-icon { font-size: 36px; margin-bottom: 4px; }
.race-result-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}
.race-result-speeds {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.race-result-payout {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  margin: 4px 0;
}
.race-result-cond {
  font-size: 12px;
  color: #ff9800;
}
.race-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.race-rule {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Craft rebirth bonus labels */
.craft-rebirth-bonus {
  font-size: 11px;
  color: #ff9800;
  font-weight: 700;
  margin: 4px 0;
  text-align: center;
}
.craft-inv-usage {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: 2px 0 8px;
}
.craft-inv-full {
  color: #f44336;
  font-weight: 700;
}

/* Inventory cap bar */
.inv-cap-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg2);
  border-radius: 8px;
  margin-bottom: 8px;
}
.inv-cap-label {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
}
.inv-cap-full {
  font-size: 11px;
  font-weight: 700;
  color: #f44336;
  padding: 2px 8px;
  background: #2d0000;
  border-radius: 4px;
}

/* Properties: sell button, special rows, butler */
.prop-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.prop-btn-row .prop-btn {
  flex: 1;
}
.prop-sell-btn {
  padding: 7px 10px;
  background: #2d0a0a;
  color: #f44336;
  border: 1px solid #f44336;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.prop-sell-btn:hover { opacity: 0.8; }

.prop-special-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
}
.prop-special-label {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.prop-special-select {
  flex: 1;
  padding: 4px 6px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  font-size: 11px;
}
.prop-special-note {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 4px;
  font-style: italic;
}

.prop-butler-bar {
  padding: 8px 14px;
  background: #1a2510;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.prop-butler-locked {
  background: var(--bg2);
  border-color: var(--bg3);
  color: var(--text-dim);
  font-weight: 400;
}

/* Curse stat tag (negative effect on item) */
.inv-stat-curse {
  background: #2d0a0a !important;
  color: #f44336 !important;
  border-color: #f44336 !important;
}

/* ===== Sub-Stock Transfer Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: var(--radius);
  padding: 20px 18px;
  max-width: 320px;
  width: 90%;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.transfer-dest-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s;
}
.transfer-dest-btn:hover { border-color: #bb86fc; color: #bb86fc; }

/* ===== Side Drawer ===== */
.side-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg2);
  transform: translateX(-100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--bg3);
  overflow-y: auto;
}
.side-drawer.open { transform: translateX(0); }
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  display: none;
}
.drawer-overlay.open { display: block; }
.drawer-player-info {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--bg3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.drawer-avatar { font-size: 40px; }
.drawer-name { font-size: 15px; font-weight: 700; color: var(--text); }
.drawer-balance { font-size: 13px; color: var(--green); font-weight: 600; }
.drawer-nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.drawer-nav-link:hover { background: var(--bg3); }
.drawer-nav-link.active { border-left-color: var(--green); color: var(--green); background: rgba(0,230,118,.07); }
.drawer-nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hamburger-btn {
  background: none;
  border: none;
  color: var(--green);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

/* ===== Home Tab Bar ===== */
.home-tabs-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--bg3);
}
.home-tab {
  flex: 1;
  padding: 9px 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.home-tab.active {
  background: var(--bg3);
  color: var(--green);
}
.home-tab-panel { display: block; }
.home-tab-panel.hidden { display: none; }

/* ===== Click Button Pulse ===== */
@keyframes pulse-glow {
  from { box-shadow: 0 0 15px var(--gold); }
  to   { box-shadow: 0 0 50px var(--gold), 0 0 80px rgba(255,215,64,.3); }
}
#click-btn {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 0 30px var(--gold);
  animation: pulse-glow 1.5s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}
@keyframes ripple-out {
  from { transform: scale(0); opacity: .5; }
  to   { transform: scale(3); opacity: 0; }
}
.ripple {
  position: absolute;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  background: rgba(255,215,64,.45);
  pointer-events: none;
  transform: scale(0);
  animation: ripple-out .55s ease-out forwards;
}

/* ===== Casino Category Labels ===== */
.casino-category-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 4px 4px;
  font-weight: 700;
}
.casino-card {
  position: relative;
}
.fav-pin-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  padding: 2px;
  z-index: 2;
  line-height: 1;
}
.casino-favs-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 2px 12px;
}

/* ===== World Event Banner ===== */
.world-event-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-left: 3px solid var(--green);
  background: rgba(0,230,118,.08);
  font-size: 12px;
  flex-wrap: wrap;
  animation: event-slide-in .4s ease;
}
@keyframes event-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.event-label {
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.event-desc {
  color: var(--text-dim);
  flex: 1;
}
.event-timer {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  opacity: .8;
}

/* ===== Cloud Restore Overlay ===== */
.cloud-restore-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.cloud-restore-box {
  background: var(--bg2);
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 20px;
  max-width: 320px;
  width: 90%;
  text-align: center;
}
.cloud-restore-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 10px;
}
.cloud-restore-body {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.5;
}
.cloud-restore-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.cloud-restore-yes, .cloud-restore-no {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.cloud-restore-yes {
  background: var(--green);
  color: #000;
}
.cloud-restore-no {
  background: var(--bg3);
  color: var(--text-dim);
}

/* ===== Player ID Badge ===== */
.lb-player-id {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: 4px;
  opacity: .7;
}
/* .profile-modal-id replaced by .pcard-id */
.settings-player-id {
  font-weight: 700;
  color: var(--green);
  font-size: 14px;
}

/* Event admin badge */
.event-admin-badge {
  background: #e91e63;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .05em;
}

/* ===== Achievements Screen ===== */
.ach-header {
  padding: 12px 16px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.ach-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ach-title { font-size: 18px; font-weight: 700; color: var(--gold); }
.ach-count { font-size: 12px; color: var(--text-dim); }
.ach-bar-outer {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ach-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffd740);
  border-radius: 3px;
  transition: width .4s;
}
.ach-cat-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.ach-cat-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.ach-cat-btn.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  font-weight: 700;
}
.ach-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ach-card {
  display: flex;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  opacity: .7;
}
.ach-card.ach-unlocked { opacity: 1; border-color: var(--gold); }
.ach-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 36px;
}
.ach-icon { font-size: 24px; line-height: 1; }
.ach-tiers-row { display: flex; gap: 3px; }
.ach-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.ach-dot.done { background: var(--gold); }
.ach-body { flex: 1; min-width: 0; }
.ach-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.ach-next-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.ach-prog-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 3px;
}
.ach-prog-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
}
.ach-prog-label { font-size: 11px; color: var(--text-dim); }
.ach-maxed { font-size: 12px; color: var(--gold); font-style: italic; }

/* ===== Weekly Tournament ===== */
.tourney-wrap {
  margin: 8px 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.tourney-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,215,64,.08);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.tourney-reset { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.tourney-mystats {
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.tourney-lb { display: flex; flex-direction: column; }
.tourney-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tourney-row:last-child { border-bottom: none; }
.tourney-row.mine { background: rgba(0,230,118,.06); }
.tourney-rank { min-width: 28px; font-size: 16px; }
.tourney-name { flex: 1; font-weight: 600; }
.tourney-score { color: var(--green); font-size: 12px; }
.tourney-wins { color: var(--text-dim); font-size: 11px; min-width: 30px; text-align: right; }
.tourney-empty { padding: 12px; font-size: 12px; color: var(--text-dim); text-align: center; }

/* ===== CRIME TABS + BLACK MARKET ===== */
.crime-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}
.crime-tab-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.crime-tab-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.bm-header { padding: 16px 12px 8px; }
.bm-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.bm-dirty-balance { font-size: 14px; color: var(--green); font-weight: 600; margin-bottom: 4px; }
.bm-dirty-hint { font-size: 11px; color: var(--text-dim); }
.bm-active-header { padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--accent); }
.bm-active-boosts { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 8px; }
.bm-active-boost { background: rgba(187,134,252,.15); border: 1px solid var(--accent); border-radius: 12px; padding: 3px 10px; font-size: 11px; color: var(--accent); }
.bm-items { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.bm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.bm-item-active { border-color: var(--green); }
.bm-item-icon { font-size: 24px; flex-shrink: 0; }
.bm-item-info { flex: 1; }
.bm-item-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.bm-item-desc { font-size: 11px; color: var(--text-dim); }
.bm-item-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bm-item-cost { font-size: 12px; color: #f39c12; font-weight: 600; }
.bm-buy-btn { padding: 6px 14px; border-radius: 8px; background: var(--accent); color: #000; font-size: 12px; font-weight: 700; border: none; cursor: pointer; }
.bm-buy-btn.unaffordable { background: var(--border); color: var(--text-dim); cursor: default; }
.bm-buy-btn[disabled] { background: var(--green); color: #000; }
.bm-refresh-note { text-align: center; font-size: 11px; color: var(--text-dim); padding: 8px 0 16px; }

/* ===== DONATION / FOUNDATION ===== */
.donation-prize-banner {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: linear-gradient(135deg, #00e67622, #00e67611);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px;
}
.donation-prize-text { font-size: 16px; font-weight: 700; color: var(--green); }
.donation-claim-btn { padding: 8px 20px; background: var(--green); color: #000; font-weight: 700; font-size: 13px; border: none; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.donation-hero { text-align: center; padding: 24px 12px 12px; }
.donation-hero-logo { font-size: 48px; margin-bottom: 8px; }
.donation-hero-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.donation-hero-tagline { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.donation-pool-card {
  margin: 12px;
  background: linear-gradient(135deg, var(--card), var(--bg-secondary, var(--card)));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.donation-pool-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 4px; }
.donation-pool-amount { font-size: 32px; font-weight: 700; color: #f1c40f; margin-bottom: 6px; }
.donation-pool-draw { font-size: 13px; color: var(--text-dim); }
.donation-last-winner { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.donation-stats-row { display: flex; gap: 8px; padding: 8px 12px; }
.donation-stat { flex: 1; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 8px; }
.donation-stat-v { font-size: 16px; font-weight: 700; color: var(--accent); }
.donation-stat-l { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.donation-form { margin: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.donation-form-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.donation-disclaimer { font-size: 10px; color: var(--text-dim); font-style: italic; margin-bottom: 12px; }
.donation-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.donation-input-row .sh-input { flex: 1; }
.donation-quick-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.donation-quick-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); font-size: 12px; cursor: pointer; }
.donation-donate-btn {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  color: #000; border: none; border-radius: var(--radius); cursor: pointer;
}
.donation-warning { font-size: 10px; color: var(--text-dim); text-align: center; margin-top: 10px; line-height: 1.4; }
.donation-leaderboard { margin: 8px 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.donation-lb-title { padding: 10px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.donation-donor { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.donation-donor:last-child { border-bottom: none; }
.donation-donor-rank { min-width: 28px; font-size: 14px; }
.donation-donor-name { flex: 1; font-weight: 600; }
.donation-donor-amt { color: var(--green); font-size: 12px; }

/* ===== AUCTION HOUSE ===== */
.auction-tabs { display: flex; gap: 6px; padding: 12px 12px 0; flex-wrap: wrap; }
.auction-tab-btn {
  flex: 1; min-width: 70px; padding: 8px 6px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.auction-tab-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.auction-tab-prizes { border-color: var(--green) !important; color: var(--green) !important; }
.auction-tab-prizes.active { background: var(--green); color: #000; }
.auction-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.auction-empty { padding: 32px; text-align: center; color: var(--text-dim); font-size: 14px; }
.auction-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.auction-card.auction-ended { opacity: 0.55; }
.auction-card.auction-winning { border-color: var(--green); }
.auction-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary, var(--card));
}
.auction-type-icon { font-size: 18px; flex-shrink: 0; }
.auction-title { flex: 1; font-weight: 700; font-size: 14px; }
.auction-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.auction-time-ended { color: var(--red); }
.auction-card-body { padding: 10px 12px; }
.auction-bid-info { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.auction-label { font-size: 11px; color: var(--text-dim); }
.auction-bid-val { font-size: 18px; font-weight: 700; color: var(--green); }
.auction-bidder { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.auction-seller { font-size: 11px; color: var(--text-dim); }
.auction-bid-row { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }
.auction-bid-row .sh-input { flex: 1; font-size: 13px; }
.auction-bid-btn { padding: 8px 18px; background: var(--accent); color: #000; font-weight: 700; font-size: 13px; border: none; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.auction-cancel-btn { width: calc(100% - 24px); margin: 0 12px 10px; padding: 7px; font-size: 12px; background: transparent; border: 1px solid var(--red); color: var(--red); border-radius: 8px; cursor: pointer; }
.auction-list-type-tabs { display: flex; gap: 8px; padding: 12px; }
.auction-list-type { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); font-size: 13px; cursor: pointer; }
.auction-list-type.active { background: var(--accent); color: #000; border-color: var(--accent); }
.auction-list-form { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.auction-list-field { display: flex; flex-direction: column; gap: 4px; }
.auction-list-field label { font-size: 12px; color: var(--text-dim); }
.auction-list-field .sh-input { width: 100%; }
.auction-list-btn { padding: 12px; background: var(--accent); color: #000; font-weight: 700; font-size: 14px; border: none; border-radius: var(--radius); cursor: pointer; }
.auction-prizes-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.auction-prize-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--green); border-radius: var(--radius); padding: 12px; }
.auction-prize-icon { font-size: 28px; flex-shrink: 0; }
.auction-prize-info { flex: 1; }
.auction-prize-desc { font-size: 13px; color: var(--text-dim); }
.auction-prize-amount { font-size: 16px; font-weight: 700; color: var(--green); }
.auction-claim-btn { padding: 8px 18px; background: var(--green); color: #000; font-weight: 700; font-size: 13px; border: none; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.auction-claim-all-btn { width: 100%; padding: 10px; background: var(--accent); color: #000; font-weight: 700; font-size: 13px; border: none; border-radius: var(--radius); cursor: pointer; }

/* ===== COLLECTIBLE CARDS ===== */
.cards-tabs { display: flex; gap: 8px; padding: 12px 12px 0; }
.cards-tab { flex: 1; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.cards-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }
.cards-empty { padding: 48px 16px; text-align: center; color: var(--text-dim); font-size: 14px; line-height: 1.6; }
/* Loadout */
.cards-loadout { margin: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.cards-loadout-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.cards-loadout-slots { display: flex; gap: 8px; }
.cards-slot {
  flex: 1; min-height: 70px; border: 2px dashed var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px; font-size: 11px; color: var(--text-dim); cursor: pointer; text-align: center; position: relative;
}
.cards-slot.equipped { border-style: solid; }
.cards-slot-art { font-size: 22px; }
.cards-slot-name { font-size: 10px; font-weight: 700; margin-top: 2px; }
.cards-slot-stat { font-size: 10px; font-weight: 600; }
.cards-slot-remove { position: absolute; top: 2px; right: 4px; background: none; border: none; color: var(--text-dim); font-size: 11px; cursor: pointer; padding: 0; line-height: 1; }
.cards-loadout-summary { margin-top: 8px; font-size: 11px; color: var(--accent); }
/* Card grid */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; }
.cards-card {
  border: 2px solid var(--border); border-radius: 10px; padding: 10px 6px 8px;
  text-align: center; cursor: pointer; position: relative; transition: transform 0.1s;
  background: var(--card);
}
.cards-card:active { transform: scale(0.95); }
.cards-card.selected { box-shadow: 0 0 0 2px var(--accent); }
.cards-card.large { padding: 16px 10px 12px; }
.cards-card-rarity {
  position: absolute; top: 4px; left: 4px; width: 16px; height: 16px;
  border-radius: 50%; font-size: 9px; font-weight: 800; color: #000;
  display: flex; align-items: center; justify-content: center;
}
.cards-card-art { font-size: 28px; margin: 4px 0; }
.cards-card-name { font-size: 10px; font-weight: 700; margin-bottom: 3px; line-height: 1.2; }
.cards-card-stat { font-size: 13px; font-weight: 800; }
.cards-card-type { font-size: 9px; color: var(--text-dim); }
.cards-card-equipped-badge { position: absolute; top: 4px; right: 4px; background: var(--green); color: #000; font-size: 9px; font-weight: 800; width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
/* Card detail */
.cards-detail {
  margin: 8px 12px; background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start;
}
.cards-detail-art { font-size: 40px; flex-shrink: 0; }
.cards-detail-info { flex: 1; }
.cards-detail-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.cards-detail-rarity { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.cards-detail-stat { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cards-detail-flavor { font-size: 11px; color: var(--text-dim); font-style: italic; }
.cards-detail-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.cards-equip-btn { padding: 7px 14px; background: var(--accent); color: #000; font-weight: 700; font-size: 12px; border: none; border-radius: 8px; cursor: pointer; }
.cards-unequip-btn { padding: 6px 10px; background: transparent; border: 1px solid var(--red); color: var(--red); font-size: 11px; border-radius: 8px; cursor: pointer; }
/* Pack shop */
.cards-shop { padding: 8px 12px 16px; }
.cards-shop-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.cards-pack-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.cards-pack-icon { font-size: 32px; flex-shrink: 0; }
.cards-pack-info { flex: 1; }
.cards-pack-name { font-size: 15px; font-weight: 700; }
.cards-pack-desc { font-size: 11px; color: var(--text-dim); margin: 2px 0; }
.cards-pack-count { font-size: 11px; color: var(--accent); }
.cards-pack-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.cards-pack-cost { font-size: 13px; font-weight: 700; color: #f1c40f; }
.cards-pack-btn { padding: 8px 18px; background: var(--accent); color: #000; font-weight: 700; font-size: 13px; border: none; border-radius: 8px; cursor: pointer; }
.cards-pack-btn.unaffordable { background: var(--border); color: var(--text-dim); cursor: default; }
.cards-rates { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 4px; }
/* Pack result */
.cards-pack-result { padding: 16px 12px; }
.cards-pack-result-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.cards-pack-result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cards-pack-close-btn { width: 100%; margin-top: 16px; padding: 12px; background: var(--accent); color: #000; font-weight: 700; font-size: 14px; border: none; border-radius: var(--radius); cursor: pointer; }

/* ── Seasonal Events ── */
.season-halloween { --green: #ff6d00; --green-dark: #e65100; }
.season-halloween #top-bar { background: linear-gradient(135deg, #1a0a00, #2d1500) !important; }
.season-halloween .balance-display { color: #ff6d00 !important; }

.season-christmas { --green: #00c853; --green-dark: #00a040; }
.season-christmas #top-bar { background: linear-gradient(135deg, #001a0d, #003320) !important; }

.season-newyear { --green: #ffd740; --green-dark: #ffc400; }
.season-newyear #top-bar { background: linear-gradient(135deg, #1a1500, #2d2500) !important; }

.season-summer { --green: #ff9800; --green-dark: #f57c00; }
.season-summer #top-bar { background: linear-gradient(135deg, #1a0d00, #2d1a00) !important; }
