/* ============================================
   BULLION — Mining Terminal CSS
   Robinhood Chain Theme
   ============================================ */

/* Wallet Adapter Modal Positioning - Top Right */
.wallet-adapter-modal-wrapper {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  max-width: 400px !important;
  width: 90vw !important;
  z-index: 11000 !important;
}

.wallet-adapter-modal-container {
  position: relative !important;
  transform: none !important;
}

.wallet-adapter-modal {
  position: relative !important;
  transform: none !important;
}

/* Mobile positioning */
@media (max-width: 768px) {
  .wallet-adapter-modal-wrapper {
    top: 50% !important;
    left: 50% !important;
    max-width: calc(100vw - 20px) !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* CSS Variables — Robinhood Chain */
:root {
  --rh-green: #00C805;
  --rh-green-dark: #00A004;
  --rh-green-light: #33D437;
  --rh-neon: #CCFF00;

  --bg-dark: #000000;
  --bg-panel: #0a0a0a;
  --bg-input: #111;

  --primary: #00C805;
  --secondary: #CCFF00;
  --accent: #FFD700;

  --text-main: #eee;
  --text-muted: #8a8a8a;

  --border-color: rgba(0, 200, 5, 0.28);
  --success: #00C805;
  --warning: #FFD700;
  --danger: #FF4444;

  --font-pixel: 'Press Start 2P', monospace;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;

  --glow-green: 0 0 20px rgba(0, 200, 5, 0.35), 0 0 60px rgba(0, 200, 5, 0.15);
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--rh-green-dark), var(--rh-green));
  border-radius: 4px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary); /* Hover effect */
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rh-green) var(--bg-dark);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(0, 200, 5, 0.35);
  color: var(--accent);
}

/* Robinhood gradient mesh background */
.gradient-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.4;
  will-change: transform;
}

.orb-green-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 200, 5, 0.14) 0%, transparent 70%);
  top: -100px;
  right: 0;
  animation: orbPulse 10s ease-in-out infinite;
}

.orb-neon-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(204, 255, 0, 0.08) 0%, transparent 70%);
  bottom: -100px;
  left: 0;
  animation: orbPulse 12s ease-in-out infinite reverse;
}

.orb-gold-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbPulseCenter 15s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(0, 0) scale(1.1); opacity: 0.6; }
}

@keyframes orbPulseCenter {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.35; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.55; }
}

/* Effects */
.scanlines {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, rgba(0,200,5,0.025) 0px, rgba(0,200,5,0.025) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
  z-index: 10;
}
.vignette {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.8) 100%);
  pointer-events: none;
  z-index: 11;
}

/* App Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  padding-bottom: 62px; /* bottom nav only — no extra sticky bar reserve */
  position: relative;
  z-index: 1;
}

/* ========================================
   TOP HEADER - PIXEL STATS BAR
   ======================================== */
.app-header {
  background: linear-gradient(180deg, rgba(0,200,5,0.12) 0%, transparent 100%);
  border-bottom: 2px solid var(--primary);
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(0,200,5,0.2);
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 0;
}

.header-brand .header-title {
  font-size: 11px;
  letter-spacing: 0.14em;
}

.header-logo {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.header-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.header-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 6px;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: rgba(0,200,5,0.1);
  border: 1px solid rgba(0,200,5,0.35);
  border-radius: 4px;
  padding: 3px 6px;
}

.chain-badge img {
  width: 10px;
  height: auto;
}

.top-stats-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  flex: 1;
  max-width: none;
  margin: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 8px;
  opacity: 0.7;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 12px;
  letter-spacing: 0.5px;
}

.gold-text {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.pixel-text {
  font-family: var(--font-pixel);
  text-transform: uppercase;
}

.pixel-text-lg {
  font-family: var(--font-pixel);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-item--wallet {
  min-width: 0;
  align-items: flex-end;
}

.wallet-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.btn-connect--prominent,
#btn-connect-wallet {
  background: var(--primary) !important;
  color: #001a00 !important;
  border: 2px solid var(--secondary) !important;
  padding: 10px 16px !important;
  font-size: 9px !important;
  font-weight: bold;
  min-width: 96px;
  min-height: 34px;
  box-shadow: 0 0 14px rgba(0, 200, 5, 0.45), 3px 3px 0 rgba(0, 0, 0, 0.9) !important;
  letter-spacing: 0.08em;
}

.btn-connect--prominent:hover,
#btn-connect-wallet:hover {
  background: var(--rh-green-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 200, 5, 0.65), 3px 3px 0 rgba(0, 0, 0, 0.9) !important;
}

.btn-connect--large {
  min-width: 200px;
  min-height: 44px;
  font-size: 10px !important;
  padding: 14px 24px !important;
}

.btn-disconnect {
  background: rgba(255, 80, 80, 0.15);
  color: #ff8888;
  border: 2px solid rgba(255, 120, 120, 0.7);
  padding: 6px 10px;
  font-size: 7px;
  cursor: pointer;
  font-family: var(--font-pixel);
  text-transform: uppercase;
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
  transition: transform 0.08s steps(2, end);
}

.btn-disconnect:hover {
  background: rgba(255, 80, 80, 0.28);
  color: #ffaaaa;
  transform: translateY(-1px);
}

.wallet-header-connected[hidden],
.wallet-header-actions[hidden] {
  display: none !important;
}

.wallet-header-addr {
  font-size: 8px;
  color: var(--accent);
  letter-spacing: 0.04em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 215, 0, 0.45);
}

.wallet-disconnect-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px 12px;
  font-size: 8px;
}

.wallet-connect-prompt {
  text-align: center;
  padding: 12px 8px 4px;
}

.wallet-connect-prompt .wallet-hint {
  margin-bottom: 14px;
  font-size: 8px;
  line-height: 1.8;
  opacity: 0.85;
}

.wallet-connected-panel[hidden] {
  display: none !important;
}

.btn-connect {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,200,5,0.35);
  border-radius: 0;
  font-family: var(--font-pixel);
  text-transform: uppercase;
}

.btn-connect:hover {
  background: var(--rh-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,200,5,0.5);
}

.btn-connect.is-connected {
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 215, 0, 0.45);
  color: var(--accent);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.85);
  font-size: 7px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-connect.is-connected:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--accent);
}

/* ========================================
   MINE VIEW - NEW LAYOUT
   ======================================== */
.mine-header,
.shop-header,
.profile-header-section {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.mine-subtitle,
.shop-subtitle,
.profile-subtitle {
  margin-top: 8px;
  opacity: 0.7;
  font-size: 14px;
}

/* Active Room Display */
.active-room-display {
  background: var(--bg-panel);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,200,5,0.15);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--accent);
}

.room-capacity {
  background: rgba(255,215,0,0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

.room-visual {
  min-height: 200px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 16px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  justify-items: center;
}

.room-slot {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.05);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.room-slot:hover {
  border-color: var(--primary);
  background: rgba(0,200,5,0.1);
  transform: translateY(-2px);
}

.room-slot.occupied {
  background: linear-gradient(135deg, rgba(0,200,5,0.2), rgba(204,255,0,0.12));
  border: 2px solid var(--secondary);
  border-style: solid;
}

.room-slot.occupied:hover {
  border-color: var(--accent);
}

.room-slot .slot-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.room-slot .slot-label {
  font-size: 8px;
  font-family: var(--font-pixel);
  opacity: 0.7;
  text-align: center;
}

.room-slot .miner-info {
  font-size: 10px;
  font-family: var(--font-pixel);
  color: var(--accent);
  text-align: center;
}

.empty-room-msg {
  text-align: center;
  padding: 40px 20px;
  opacity: 0.4;
  font-size: 10px;
  color: var(--text-muted);
}

/* Mining Controls */
.mining-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.mining-controls .action-btn {
  font-size: 10px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mining-controls .action-btn .ui-icon-wrap .ui-icon {
  width: 18px;
  height: 18px;
}

/* Mine Stats Grid */
.mine-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.mine-stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mine-stat-card .stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  flex-shrink: 0;
}

.mine-stat-card .stat-icon .ui-icon {
  width: 28px;
  height: 28px;
}

.stat-card .stat-icon,
.equipment-icon,
.wallet-avatar,
.item-icon,
.slot-icon,
.room-icon,
.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.stat-card .stat-icon .ui-icon {
  width: 24px;
  height: 24px;
}

.equipment-icon .ui-icon,
.wallet-avatar .ui-icon {
  width: 22px;
  height: 22px;
}

.item-icon .ui-icon,
.slot-icon .ui-icon {
  width: 40px;
  height: 40px;
}

.room-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.empty-state-icon .ui-icon {
  width: 48px;
  height: 48px;
  opacity: 0.35;
}

.ui-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.action-btn .ui-icon-wrap,
.shop-tab .ui-icon-wrap {
  margin-right: 6px;
}

.action-btn .ui-icon-wrap .ui-icon,
.shop-tab .ui-icon-wrap .ui-icon {
  width: 14px;
  height: 14px;
}

.ui-icon-close {
  display: inline-flex;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.sync-status-bar .ui-icon-wrap {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
}

.sync-status-bar .ui-icon-wrap .ui-icon {
  width: 10px;
  height: 10px;
}

.mine-stat-card .stat-info {
  flex: 1;
}

.mine-stat-card .stat-label {
  font-size: 11px;
  opacity: 1;
  margin-bottom: 4px;
  color: var(--accent);
  -webkit-text-stroke: 0.5px #000;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.mine-stat-card .stat-value {
  font-size: 14px;
  color: var(--accent);
  -webkit-text-stroke: 0.6px #000;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

/* Console Log - Improved */
.console-log {
  background: #000;
  border: 2px solid var(--secondary);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  max-height: 150px;
  overflow-y: auto;
}

.console-header {
  color: var(--secondary);
  margin-bottom: 8px;
  font-size: 10px;
  border-bottom: 1px solid var(--secondary);
  padding-bottom: 4px;
}

.log-content {
  color: #0f0;
}

.log-line {
  margin-bottom: 4px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes goldPulse {
  0%, 100% { 
    transform: scale(1);
    text-shadow: 0 0 8px rgba(255,215,0,0.5);
  }
  50% { 
    transform: scale(1.05);
    text-shadow: 0 0 16px rgba(255,215,0,0.8), 0 0 24px rgba(255,215,0,0.4);
  }
}

/* View Switching Logic */
.view {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

.view > * {
  padding-right: 0;
}

@media (min-width: 768px) {
  .view {
    padding: 24px 28px;
  }
}

@media (min-width: 1200px) {
  .view {
    padding: 28px 36px;
  }
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Header */
.app-header {
  min-height: auto;
  height: auto;
  display: block;
  padding: 0 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 10px 0;
}

.header-controls {
  display: flex;
  align-items: center;
}

/* Legacy header-controls connect — do not override prominent wallet buttons */
.header-controls .btn-connect {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  text-transform: uppercase;
}

.header-controls .btn-connect:hover {
  background: rgba(153, 69, 255, 0.1);
  box-shadow: 0 0 10px rgba(153, 69, 255, 0.2);
}

/* Dashboard / Mine View */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Center and fill content better on desktop */
.content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.status-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 4px;
  text-align: center;
}
.card-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.card-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.status-text { color: var(--success); }

.miner-visual-container {
  grid-column: 1 / -1;
  background: #111;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.miner-sprite {
  width: 120px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}
.miner-info-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  text-align: right;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
}
.miner-info-overlay span { display: block; margin-top: 4px; }

.console-log {
  grid-column: 1 / -1;
  background: #000;
  border: 1px solid var(--border-color);
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  color: var(--success);
  height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.log-line { margin-bottom: 2px; }

.action-bar {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
.action-btn {
  padding: 12px 20px;
  font-family: var(--font-pixel);
  font-size: 10px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  transition: all 0.2s;
  flex: 1;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 10px rgba(153, 69, 255, 0.4);
}
.btn-primary:hover { filter: brightness(1.2); }
.btn-init-user {
  background: var(--accent);
  color: #111;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}
.btn-init-user:hover { filter: brightness(1.1); }
.btn-init-user.needs-init {
  animation: initPulse 1.4s ease-in-out infinite;
}
.btn-secondary {
  background: #333;
  color: white;
  border: 1px solid #444;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-secondary:disabled, .btn-outline:disabled, .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.mine-user-not-ready .rooms-container,
.mine-user-not-ready .mine-stats-grid,
.mine-user-not-ready .console-log {
  opacity: 0.45;
  filter: grayscale(0.25);
}

.mine-user-not-ready .mining-controls .action-btn:not(.btn-init-user) {
  opacity: 0.35;
}

/* Tour Guide */
#tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  background: transparent;
  pointer-events: auto;
  display: none;
}
#tour-backdrop.active { display: block; }

#tour-spotlight {
  position: absolute;
  z-index: 13001;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  border: 2px solid var(--accent);
  opacity: 0;
}
#tour-spotlight.active { opacity: 1; }

.tour-tooltip {
  position: fixed; /* Changed to fixed for better viewport locking */
  z-index: 13002;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  width: 260px;
  max-width: 90vw; /* Prevent overflow on small screens */
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.tour-tooltip.active {
  opacity: 1;
  transform: translateY(0);
}
.tour-text {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: #eee;
  margin-bottom: 16px;
}
.tour-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tour-step-count {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-muted);
}
.tour-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 14px;
  border: none;
  background: #333;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
}
.tour-btn.primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 10px rgba(153, 69, 255, 0.3);
}
.tour-btn:hover { filter: brightness(1.2); }

@keyframes initPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.35); }
  50% { box-shadow: 0 0 22px rgba(255, 215, 0, 0.75); }
}

/* Shop View */
.shop-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.shop-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 15px;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 10px;
  cursor: pointer;
}
.shop-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.shop-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 15px;
  width: 100%;
}
.shop-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s;
}
.shop-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.item-icon {
  width: 48px; height: 48px;
  margin: 0 auto 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-name {
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 5px;
}
.item-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.item-price {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 10px;
}
.btn-buy {
  width: 100%;
  padding: 8px;
  background: var(--primary);
  border: none;
  color: white;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  width: min(560px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.modal-close {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 13px;
}
.modal-line .muted {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.modal-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 0;
}
.modal-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.modal-actions .btn-buy {
  font-size: 9px;
  padding: 10px;
  border-radius: 6px;
}
.modal-btn-secondary {
  background: #222;
  color: #ddd;
}
.modal-btn-primary {
  background: var(--primary);
}

.claim-cooldown-status {
  margin-top: 10px;
  text-align: center;
  font-size: 8px;
  color: var(--text-muted);
}

.fuel-room-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.fuel-room-preview {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px;
  background: #111;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fuel-room-preview-img {
  width: 92px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  image-rendering: pixelated;
}

.fuel-room-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #aaa;
}

.fuel-room-preview-meta .pixel-text {
  font-size: 9px;
  color: #eee;
}

.fuel-room-btn {
  width: 100%;
  padding: 7px 8px !important;
  font-size: 8px !important;
}

.fuel-tier-btn {
  padding: 7px 9px !important;
  font-size: 8px !important;
}

/* Profile View */
.profile-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.profile-avatar {
  width: 60px; height: 60px;
  background: #222;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.profile-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  margin-bottom: 4px;
}
.profile-addr {
  font-family: monospace;
  color: var(--text-muted);
  font-size: 12px;
}
.stats-row {
  display: flex;
  gap: 10px;
}
.stat-box {
  flex: 1;
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 4px;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  margin-bottom: 5px;
}
.stat-value {
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--success);
}
.stat-unit {
  font-size: 8px;
  color: var(--text-muted);
}

.section-heading {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: white;
  margin-bottom: 15px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-heading::before {
  content: '';
  width: 12px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.referral-box {
  background: rgba(20, 241, 149, 0.05);
  border: 1px solid var(--success);
  padding: 15px;
  border-radius: 4px;
}
.referral-text {
  color: var(--success);
  font-family: var(--font-pixel);
  font-size: 10px;
  margin-bottom: 5px;
}
.referral-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.referral-link-box {
  display: flex;
  gap: 10px;
}
.referral-link-box input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid #333;
  color: var(--text-muted);
  padding: 8px;
  font-family: monospace;
}
.btn-copy {
  background: var(--warning);
  color: black;
  border: none;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 0 15px;
  cursor: pointer;
}

/* Leaderboard */
.leaderboard-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}
.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}
.leaderboard-table th {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.leaderboard-table td {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-main);
}
.leaderboard-table td:nth-child(1) {
  width: 48px;
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 9px;
}
.muted-cell {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 16px 10px;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 24px rgba(0,200,5,0.12);
}
.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  width: 100%;
  height: 100%;
  justify-content: center;
}
.nav-item.active {
  color: var(--primary);
  background: rgba(0,200,5,0.08);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}
.nav-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  font-weight: bold;
}
.nav-icon { position: relative; }

/* Responsive */
@media (min-width: 768px) {
  #app {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 80px;
    padding-bottom: 0;
    overflow: hidden;
  }
  
  .app-header {
    grid-row: 1;
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border-color);
  }

  .content-area {
    grid-row: 2;
    grid-column: 1;
    padding: 0;
    overflow: hidden;
    width: 100%;
    margin: 0;
    max-width: none;
  }

  .dashboard-grid {
    max-width: 1000px;
    margin: 0 auto;
    gap: 30px;
  }

  .bottom-nav {
    grid-row: 2;
    grid-column: 2;
    position: static;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: center;
    border-top: none;
    border-left: 1px solid var(--border-color);
    padding: 20px 0;
  }
  
  .nav-item.active::after {
    width: 2px;
    height: 40%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}

