/* ============================================
   ODYSSEY — THEME V2 "BRONZE ARCADE"
   Dark-HUD overlay loaded AFTER style.css.
   Overrides shell visuals only; all class names,
   layout and game logic stay untouched.
   ============================================ */

:root {
  /* semantic tokens */
  --t2-bg: #17100c;
  --t2-surface: #281a12;
  --t2-surface-2: #3a271b;
  --t2-glass: rgba(28, 20, 11, 0.88);
  --t2-border: #795031;
  --t2-border-soft: #5c3e2b;
  --t2-text: #e8ecf5;
  --t2-muted: #c5aa93;
  --t2-primary: #d69a62;
  --t2-primary-soft: rgba(214, 154, 98, 0.16);
  --t2-gold: #ffc857;
  --t2-success: #d69a62;
  --t2-info: #54a0ff;
  --t2-radius: 10px;
  --t2-radius-sm: 6px;
  --t2-glow: 0 0 0 1px rgba(214, 154, 98, 0.35), 0 4px 24px rgba(214, 154, 98, 0.18);
  --t2-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);

  /* Vars referenced by modal markup (were never defined → text inherited the
     light body color and became unreadable on the cream modal). Dark-on-paper. */
  --font-display: 'Press Start 2P', monospace;
  --accent-primary: #84502b;
  --text-primary: #1a1a1a;
  --text-secondary: #2b2b2b;
  --text-muted: #6a6a5a;
  --border-subtle: #c8b888;
  --bg-elevated: #efe6cc;
  --danger: #c03434;
  --success: #84502b;
  --warning: #d4a017;
}

/* ---- BASE ---- */
html, body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(214, 154, 98, 0.10), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(214, 154, 98, 0.08), transparent 60%),
    var(--t2-bg);
  color: var(--t2-text);
}

/* soften the global square-corner reset for shell pieces */
.menu-btn, .deploy-btn, .panel-title, .town-card, .chat-msg,
.chat-input-bar input, .chat-send-btn, .modal-box, .pixel-btn,
.hud-social, .hud-ca, .hud-holder, .menu-logo {
  border-radius: var(--t2-radius-sm) !important;
}
.town-card, .modal-box { border-radius: var(--t2-radius) !important; }

/* dim the photographic backdrop a bit more for contrast */
.content-bg::after { background: rgba(17, 12, 6, 0.72); }
.content { background: rgba(17, 12, 6, 0.35); }

/* ---- LOADING SCREEN ---- */
.loading-screen { background: var(--t2-bg); }

.loading-logo {
  color: var(--t2-primary);
  text-shadow: 4px 4px 0 #563620, -2px -2px 0 #ffe0b6;
}

.loading-subtitle { color: #edb77e; }

.loading-bar-wrap { border-color: var(--t2-border); background: var(--t2-surface); }
.loading-bar { background: var(--t2-primary); }

.press-start-btn { color: #edb77e; }
.press-start-btn:hover { color: #fff; text-shadow: 0 0 8px var(--t2-primary); }

/* ---- HUD BAR ---- */
.hud-bar {
  background: var(--t2-glass) !important;
  border-bottom: 1px solid var(--t2-border) !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4) !important;
  color: var(--t2-muted) !important;
  backdrop-filter: blur(10px);
}

/* ---- LEFT MENU ---- */
.menu {
  background: var(--t2-glass);
  border-right: 1px solid var(--t2-border);
  backdrop-filter: blur(10px);
  padding: 10px;
  gap: 5px;
}

.menu-logo {
  color: var(--t2-primary);
  text-shadow: 0 0 18px rgba(214, 154, 98, 0.55);
  border-bottom: 1px solid var(--t2-border);
}

.menu-btn {
  background: transparent;
  color: var(--t2-muted);
  border: 1px solid transparent;
  padding: 10px 10px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.menu-btn:hover {
  background: var(--t2-surface-2);
  color: var(--t2-text);
}

.menu-btn.active {
  background: var(--t2-primary-soft);
  border: 1px solid rgba(214, 154, 98, 0.45);
  color: #edb77e;
  box-shadow: inset 3px 0 0 var(--t2-primary);
}

.menu-btn:focus-visible,
.chat-send-btn:focus-visible,
.chat-input-bar input:focus-visible {
  outline: 2px solid var(--t2-info);
  outline-offset: 2px;
}

.deploy-btn {
  background: linear-gradient(180deg, #e7ac72, #84502b) !important;
  color: #23140b !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: var(--t2-glow) !important;
  text-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.deploy-btn:hover {
  background: linear-gradient(180deg, #f3bc82, #cf8c52) !important;
  transform: translateY(-1px);
}

.deploy-btn:active { transform: translateY(0) scale(0.98); }

.deploy-btn.deployed {
  background: var(--t2-primary-soft) !important;
  color: #edb77e !important;
  border: 1px solid rgba(214, 154, 98, 0.45) !important;
  box-shadow: none !important;
}

/* ---- SCROLLBARS ---- */
.content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.activity-log::-webkit-scrollbar-track { background: var(--t2-bg); }

.content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.activity-log::-webkit-scrollbar-thumb {
  background: var(--t2-border);
  border: none;
  border-radius: 4px !important;
}

/* ---- PANEL TITLES ---- */
.panel-title {
  background: var(--t2-surface);
  border: 1px solid var(--t2-border);
  color: var(--t2-text);
  box-shadow: inset 3px 0 0 var(--t2-primary);
  letter-spacing: 1px;
}

.pixel-icon { color: var(--t2-primary); }

/* ---- TOWN CARDS ---- */
.town-card {
  background: var(--t2-surface);
  border: 1px solid var(--t2-border);
  box-shadow: var(--t2-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.town-card:hover {
  border-color: rgba(214, 154, 98, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 18px rgba(214, 154, 98, 0.12);
}

.town-card.current {
  background: var(--t2-surface-2);
  border-color: var(--t2-primary);
  box-shadow: var(--t2-glow);
}

.town-card-bg { border-bottom: 1px solid var(--t2-border-soft); }

.town-card-bg::after {
  height: 48px;
  background: linear-gradient(transparent, rgba(23, 16, 12, 0.85));
}

.town-name { color: var(--t2-text); }
.town-info { color: var(--t2-muted); }
.town-card.cleared::after { color: var(--t2-gold); text-shadow: 0 0 10px rgba(255, 200, 87, 0.6); }

.town-gym {
  background: var(--t2-surface-2);
  border: 1px solid var(--t2-border-soft);
  color: var(--t2-text);
}

.town-gym-type { color: #edb77e; }
.town-route { color: #d5a876; }
.town-badge { color: var(--t2-gold); }

/* ---- WORLD CHAT ---- */
.chat {
  background: var(--t2-glass);
  border-left: 1px solid var(--t2-border);
  backdrop-filter: blur(10px);
}

.chat-header {
  background: var(--t2-surface);
  border-bottom: 1px solid var(--t2-border);
  color: var(--t2-text);
  box-shadow: none;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-msg {
  background: var(--t2-surface);
  border: 1px solid var(--t2-border-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chat-msg:hover {
  border-color: rgba(214, 154, 98, 0.5);
  background: var(--t2-surface-2);
}

.chat-trainer-name { color: var(--t2-info) !important; }
.chat-text { color: var(--t2-text) !important; }
.chat-badge-count { color: var(--t2-gold) !important; }

.chat-input-bar {
  background: var(--t2-surface);
  border-top: 1px solid var(--t2-border);
}

.chat-input-bar input {
  background: var(--t2-bg);
  border: 1px solid var(--t2-border);
  color: var(--t2-text);
  transition: border-color 0.15s ease;
}

.chat-input-bar input::placeholder { color: var(--t2-muted); }
.chat-input-bar input:focus { border-color: var(--t2-primary); }

.chat-send-btn {
  background: linear-gradient(180deg, #e7ac72, #84502b);
  color: #23140b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.chat-send-btn:hover { filter: brightness(1.1); }
.chat-send-btn:active { transform: scale(0.96); box-shadow: none; }

/* ---- MODALS ---- */
.modal { background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(6px); }

.modal-box {
  border: 1px solid var(--t2-border) !important;
  box-shadow: var(--t2-shadow) !important;
}

/* ---- MOBILE TAB BAR ---- */
@media (max-width: 768px) {
  .menu { background: var(--t2-surface) !important; border-top: 1px solid var(--t2-border) !important; }

  .menu-btn { border-radius: 0 !important; padding: 0 2px !important; }
  .menu-btn::after { color: var(--t2-muted) !important; }
  .menu-btn.active { background: var(--t2-primary-soft) !important; box-shadow: none !important; border: none !important; }
  .menu-btn.active::after { color: #edb77e !important; }

  /* DEPLOY tab: keep the tiny data-mobile label only — no big text, no glow */
  .menu-btn.deploy-btn {
    font-size: 0 !important;
    background: linear-gradient(180deg, #e7ac72, #84502b) !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
  }
  .menu-btn.deploy-btn::after { color: #23140b !important; font-size: 6px !important; }

  .menu-btn.deploy-btn.deployed {
    background: var(--t2-primary-soft) !important;
    pointer-events: none;
  }
  .menu-btn.deploy-btn.deployed::after { color: #edb77e !important; font-size: 5px !important; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  .town-card, .deploy-btn, .menu-btn, .chat-send-btn, .chat-msg {
    transition: none !important;
  }
  .town-card:hover, .deploy-btn:hover { transform: none; }
}

/* Odyssey network and wallet controls */
.odyssey-network { text-decoration: none; border-color: #be874e; }
.odyssey-network .hud-ca-addr { color: #f3c492; }
.wallet-card { min-height: 56px; font: inherit; color: var(--text-primary); }
.wallet-card:focus-visible, .odyssey-network:focus-visible { outline: 2px solid #f3c492; outline-offset: 3px; }


.odyssey-shop-banner { display: block; width: 100%; height: auto; }

.loading-logo { display: grid; justify-items: center; gap: 8px; }
.loading-logo img { width: clamp(48px, 12vh, 88px); height: auto; }
@media (min-width: 769px) { .menu-logo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; } }
.menu-logo img { width: 32px; height: 32px; }

#cloud-sync-button[hidden] { display: none; }
#cloud-sync-button { white-space: nowrap; font-size: 8px; width: auto; padding: 0 6px; }
