/* ============================================================================
   BID EMPIRE — CLEAN FLAT-VECTOR ARCADE UI (#12121e / #1a1c2e / #f59e0b)
   ============================================================================ */

:root {
  --bg-void: #12121e;
  --bg-card: #1a1c2e;
  --bg-card-2: #22253b;
  --bg-inset: #131424;
  --border: #2e324f;
  --border-hi: #42486e;

  --gold: #f5b932;
  --gold-bright: #fbbf24;
  --gold-deep: #d97706;
  --emerald: #10d88b;
  --coral: #f86168;
  --cyan: #38bdf8;
  --purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Plus Jakarta Sans', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

button,
input {
  font-family: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

.txt-gold { color: var(--gold); }
.txt-emerald { color: var(--emerald); }
.txt-coral { color: var(--coral); }
.txt-cyan { color: var(--cyan); }
.txt-purple { color: #c084fc; }

/* ============================================================================
   APP SHELL & TOPBAR
   ============================================================================ */
#viewport-shell {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--bg-void);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

#app {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  position: relative;
}

#topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #141524;
  border-bottom: 1px solid #23263d;
  flex-shrink: 0;
  z-index: 40;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #16141f;
  display: grid;
  place-items: center;
  font-size: 17px;
  box-shadow: 0 2px 0 #b45309;
}

.brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  gap: 5px;
}

.brand-bid { color: #ffffff; }
.brand-empire { color: var(--gold-bright); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
}

.player-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px 4px 6px;
  cursor: pointer;
  color: var(--text-main);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.player-pill:hover {
  border-color: var(--border-hi);
}

.avatar-circle-cv {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #282c45;
  flex-shrink: 0;
  display: block;
}

.player-pill-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 112px;
  text-align: left;
}

.player-pill-line {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-rank-accent {
  color: var(--gold);
}

.xp-mini-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #2b2f48;
  overflow: hidden;
}

.xp-mini-fill {
  height: 100%;
  background: var(--gold-bright);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.cash-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  white-space: nowrap;
}

.cash-pill.money-pop {
  transform: scale(1.06);
  border-color: var(--emerald);
}

.coin-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 75%);
  border: 2px solid #b45309;
  color: #451a03;
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.cash-val {
  color: var(--emerald);
  font-size: 15px;
  font-weight: 800;
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: var(--gold-bright);
  color: #15141f;
}

.icon-square-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.icon-square-btn:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-2);
}

#btn-mute {
  color: var(--text-main);
}

.top-util-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.top-util-btn:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-2);
  transform: translateY(-1px);
}

.top-util-btn.ready {
  border-color: var(--gold);
  background: rgba(245, 185, 50, 0.14);
  color: #fde68a;
}

.top-util-btn.prestige {
  border-color: rgba(168, 85, 247, 0.42);
  color: #e9d5ff;
}

.top-util-btn.prestige.ready {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(245, 185, 50, 0.2));
  color: #ffffff;
}

.top-util-pp {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #d8b4fe;
  opacity: 0.92;
}

.top-util-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #12121e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* ============================================================================
   MAIN ROUTER & PANES
   ============================================================================ */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 14px;
  min-height: 0;
  overflow: hidden;
}

.tab-pane {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-pane.no-pad {
  margin: -12px -18px -14px;
}

/* ============================================================================
   HQ DASHBOARD (16:9 LOCKED)
   ============================================================================ */
.hq-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(300px, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.hq-left-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.hq-room-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #24293d;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
}

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

.hq-room-plaque-tl {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(20, 22, 36, 0.92);
  border: 1px solid #353957;
  border-radius: 12px;
  padding: 9px 14px;
  pointer-events: none;
}

.hq-plaque-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.hq-plaque-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.hq-tier-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--gold-bright);
  color: #16141f;
  font-weight: 800;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 9px;
  box-shadow: 0 2px 0 #b45309;
  pointer-events: none;
}

.hq-rename-pill {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 36, 0.94);
  border: 1px solid #3a3f60;
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 26px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s;
}

.hq-rename-pill:hover {
  border-color: var(--gold-bright);
  transform: translateX(-50%) translateY(-1px);
}

.hq-relics-overlay {
  position: absolute;
  top: 78px;
  left: 26px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hq-relic-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(18, 19, 32, 0.92);
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s;
}

.hq-relic-badge:hover {
  transform: translateY(-2px);
}

.hq-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex-shrink: 0;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px 13px;
  text-align: left;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 62px;
}

.kpi-clickable {
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.kpi-clickable:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-2);
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.hq-right-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.hq-top-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 0;
}

.ad-top-btn {
  width: 100%;
  min-height: 42px;
  background: var(--bg-card);
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 12.2px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.16s, transform 0.15s, border-color 0.16s;
}

.ad-top-btn:hover {
  background: #232237;
  transform: translateY(-1px);
}

.ad-top-btn.bailout-urgent {
  border-color: var(--coral);
  color: #fecaca;
  background: rgba(248, 97, 104, 0.14);
}

.ad-top-btn.ad-fever-btn {
  border-color: rgba(168, 85, 247, 0.8);
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.12);
}

.ad-top-btn.ad-fever-btn.active-fever {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(245, 185, 50, 0.22));
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18);
}

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
}

.card-micro-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.goal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 13px;
  flex-shrink: 0;
  min-height: 0;
}

.goal-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.goal-head-row .card-micro-kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.goal-story-link {
  background: #242842;
  border: 1px solid #353b5e;
  color: var(--cyan);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.goal-text {
  font-size: 12.2px;
  color: #e2e8f0;
  line-height: 1.35;
}

.hq-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-inset);
  border: 1px solid #262b46;
  border-radius: 10px;
  padding: 6px 8px;
}

.hq-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.3px;
  color: var(--text-muted);
}

.hq-check-row.current {
  color: #f8fafc;
  font-weight: 700;
}

.hq-check-row.done {
  color: var(--emerald);
  opacity: 0.85;
}

.hq-check-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hq-check-go {
  background: var(--gold-bright);
  color: #16141f;
  border: 0;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.goal-dots-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.2px;
  color: var(--text-muted);
}

.goal-dots {
  display: flex;
  gap: 4px;
}

.goal-dot {
  width: 20px;
  height: 5px;
  border-radius: 999px;
  background: #2b304d;
}

.goal-dot.done {
  background: var(--emerald);
}

.vip-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--bg-inset);
  border: 1px solid #282c47;
  font-size: 11px;
}

.vip-reroll-mini {
  background: #252840;
  border: 1px solid #383e60;
  color: var(--text-main);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.vip-reroll-mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.goal-boss-btn {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #a855f7, #7e22ce);
  color: #ffffff;
}

.goal-boss-btn:disabled {
  background: #22253a;
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

.richest-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 10px 13px;
}

.richest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.richest-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.richest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 9px;
  font-size: 12px;
  border: 1px solid transparent;
}

.richest-row.is-me {
  border-color: var(--gold);
  background: rgba(245, 185, 50, 0.08);
}

.richest-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.richest-rank {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.richest-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.richest-cash {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald);
  white-space: nowrap;
}

.hq-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  flex-shrink: 0;
}

.btn-auctions-hero {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #16141f;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b45309;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-auctions-hero:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-auctions-hero:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b45309;
}

.hq-secondary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.btn-dark-tile {
  position: relative;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s, background 0.16s;
}

.btn-dark-tile:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-2);
}

.tile-alert-badge {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-void);
}

/* ============================================================================
   LOCATIONS CAROUSEL (SCREENSHOT 1)
   ============================================================================ */
.locations-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.subview-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.btn-back-pill {
  justify-self: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 11px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

.btn-back-pill:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-2);
}

.subview-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.01em;
}

.subview-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.carousel-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
}

.locations-carousel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 6px 28px 14px;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #323759 transparent;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #23263e;
  border: 1px solid #3f456b;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.carousel-arrow.left { left: 4px; }
.carousel-arrow.right { right: 4px; }

.loc-card {
  position: relative;
  flex: 0 0 clamp(226px, 16.5vw, 272px);
  margin-top: auto;
  margin-bottom: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.loc-card:not(.locked):hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.loc-thumb-wrap {
  width: 100%;
  height: clamp(136px, 18dvh, 184px);
  background: #171a2b;
  overflow: hidden;
  flex-shrink: 0;
}

.loc-thumb-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.loc-card-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.loc-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.loc-stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 6px;
}

.loc-stat-line span {
  color: var(--text-muted);
}

.loc-stat-line strong {
  font-family: var(--font-mono);
  color: #f8fafc;
}

.loc-items-tray {
  background: var(--bg-inset);
  border: 1px solid #262a42;
  border-radius: 11px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  place-items: center;
}

.loc-mini-item-cv {
  width: 38px;
  height: 34px;
  display: block;
}

.loc-stars-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.loc-stars {
  letter-spacing: 1px;
  color: #353a57;
}

.loc-stars .on {
  color: var(--gold-bright);
}

.loc-rivals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.loc-rivals-avatars {
  display: flex;
  align-items: center;
}

.loc-rival-dot-cv {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
  margin-left: -4px;
  background: #2a2f4d;
}

.loc-rival-dot-cv:first-child {
  margin-left: 0;
}

.loc-actions-stack {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.btn-loc-go {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #16141f;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #b45309;
}

.btn-loc-go:disabled {
  background: #23263a;
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-loc-boss {
  width: 100%;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #4c1d95;
  background: #2e1065;
  color: #e9d5ff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-loc-boss.ready {
  background: linear-gradient(180deg, #a855f7, #7e22ce);
  color: #ffffff;
  border-color: #c084fc;
}

.btn-loc-boss:disabled {
  background: #171929;
  color: var(--text-dim);
  border-color: #292d46;
  cursor: not-allowed;
}

.loc-card.locked .loc-thumb-wrap,
.loc-card.locked .loc-card-body {
  opacity: 0.24;
  filter: grayscale(0.6);
}

.loc-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  pointer-events: none;
}

.loc-lock-icon {
  font-size: 30px;
  margin-bottom: 6px;
}

.loc-lock-title {
  font-weight: 800;
  font-size: 13.5px;
  color: #ffffff;
}

.loc-lock-sub {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 2px;
}

/* ============================================================================
   AUCTION ARENA (SCREENSHOTS 2, 3, 4)
   ============================================================================ */
#auction-arena {
  display: none;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

#auction-arena.active {
  display: flex;
}

.arena-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.arena-duel-bar {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid #4c1d95;
  border-radius: 12px;
  padding: 6px 12px;
}

.duel-budget-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duel-budget-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
}

.duel-budget-track {
  height: 6px;
  border-radius: 999px;
  background: #121320;
  overflow: hidden;
}

.duel-budget-fill {
  height: 100%;
  border-radius: 999px;
}

.duel-budget-fill.player-fill { background: var(--emerald); }
.duel-budget-fill.boss-fill { background: var(--coral); }

.duel-center-score {
  text-align: center;
}

.duel-round-pill {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold-bright);
}

.duel-score-pill {
  font-size: 11px;
  color: var(--text-muted);
}

.event-banner {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(245, 185, 50, 0.12);
  border: 1px solid var(--gold);
  color: #fef3c7;
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px;
}

.event-banner.active {
  display: inline-flex;
}

.phase-pill {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.phase-pill.phase-inspect { color: var(--cyan); border-color: rgba(56, 189, 248, 0.45); }
.phase-pill.phase-bid { color: var(--gold-bright); border-color: rgba(251, 191, 36, 0.45); }
.phase-pill.phase-result { color: var(--emerald); border-color: rgba(16, 216, 139, 0.45); }
.phase-pill.phase-paused { color: var(--coral); border-color: rgba(248, 97, 104, 0.45); }

.arena-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.arena-stage-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #141624;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
}

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

.canvas-hand-hint {
  position: absolute;
  right: 16px;
  bottom: 50px;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.canvas-hand-hint.visible {
  opacity: 0.85;
  animation: pulseHint 1.4s ease-in-out infinite;
}

@keyframes pulseHint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.arena-bottom-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.notes-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.note-slot {
  width: 40px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  font-size: 13px;
}

.note-slot.seen {
  border-color: var(--border-hi);
}

.note-slot.scanned {
  border-color: var(--cyan);
}

.note-slot.fake-warn {
  border-color: var(--coral);
}

.note-cond-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 10px;
  background: var(--bg-void);
  border-radius: 999px;
  padding: 0 2px;
}

.skills-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.skill-act-btn {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px 10px;
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 78px;
}

.skill-act-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.skill-act-cd {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--cyan);
}

/* ARENA RIGHT SIDEBAR */
.arena-side-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.inspect-header-card {
  text-align: center;
  padding: 14px 16px;
  flex-shrink: 0;
}

.inspect-countdown-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.1;
  margin: 4px 0;
}

.inspect-help-copy {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.battery-track-slim {
  height: 4px;
  border-radius: 999px;
  background: #252942;
  overflow: hidden;
}

.battery-fill-slim {
  height: 100%;
  background: var(--gold-bright);
  transition: width 0.12s linear;
}

.bid-header-card {
  text-align: center;
  padding: 14px 16px 12px;
  position: relative;
  flex-shrink: 0;
}

.bid-card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gavel-stage-coral {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--coral);
  font-size: 11.5px;
  font-weight: 700;
}

.bid-amount-hero {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.15;
  margin-top: 2px;
}

.bid-leader-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 8px;
  font-weight: 600;
}

.expert-ad-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #202337;
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}

.gavel-track-slim {
  height: 5px;
  border-radius: 999px;
  background: #242840;
  overflow: hidden;
}

.gavel-fill-slim {
  height: 100%;
  background: var(--coral);
  transition: width 0.08s linear;
}

.arena-rivals-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.rivals-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.rival-card.player-self-card {
  flex-shrink: 0;
}

.rival-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  transition: border-color 0.16s, opacity 0.2s, background 0.16s;
}

.rival-card.leading {
  border-color: var(--gold-bright);
  background: #222334;
}

.rival-card.out {
  opacity: 0.42;
}

.rival-card.frozen {
  border-color: var(--cyan);
}

.rival-card.player-self-card {
  border-style: dashed;
  border-color: #3a4063;
  background: rgba(26, 28, 46, 0.55);
}

.rival-card.player-self-card.leading {
  border-style: solid;
  border-color: var(--emerald);
  background: rgba(16, 216, 139, 0.08);
}

.rival-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rival-portrait-cv {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #292d48;
  flex-shrink: 0;
}

.rival-name-txt {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rival-card.has-speech {
  border-color: rgba(245, 185, 50, 0.55);
}

.rival-sub-txt {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rival-sub-txt.speech-live {
  color: #fde68a;
  font-weight: 600;
}

.rival-sub-txt.speech-out {
  color: #fda4af;
}

.rival-sub-txt.speech-warn {
  color: #7dd3fc;
}

.rival-right-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.rival-budget-txt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.arena-inspect-actions,
.arena-bidding-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex-shrink: 0;
}

.btn-start-bidding {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #353a5a;
  background: #272b42;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-start-bidding:hover {
  background: #303552;
  border-color: var(--gold);
}

.btn-bid-hero {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #16141f;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #b45309;
}

.btn-bid-hero:disabled {
  background: #272b40;
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
}

.bid-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto minmax(88px, 1fr);
  gap: 8px;
}

.bid-custom-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #ffffff;
  padding: 0 12px;
  height: 42px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  min-width: 0;
}

.bid-custom-input:focus {
  border-color: var(--gold);
}

.btn-ok-dark {
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  background: #252940;
  border: 1px solid #393f60;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.btn-pass-coral {
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--coral);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-pass-coral:disabled,
.btn-ok-dark:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quick-mult-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-quick-chip {
  height: 30px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-quick-chip:hover {
  color: #ffffff;
  border-color: var(--border-hi);
}

.btn-quick-chip.allin {
  color: var(--coral);
}

/* RESULT PANEL (SCREENSHOT 4) */
.result-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.result-status-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  flex-shrink: 0;
}

.result-status-pill.won {
  border-color: rgba(16, 216, 139, 0.5);
  color: var(--emerald);
}

.result-items-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.result-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.result-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.result-item-cv {
  width: 28px;
  height: 26px;
  flex-shrink: 0;
}

.result-item-name {
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item-val {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.result-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.result-sum-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.result-sum-line.net-row {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
}

.result-flavor-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-actions-stack {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.btn-back-hq-full {
  width: 100%;
  height: 44px;
  border-radius: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-back-hq-full:hover {
  background: var(--bg-card-2);
}

/* ============================================================================
   SKILL TREE VIEW (#tab-skills — DARK INDIGO + AMBER RESTYLE)
   ============================================================================ */
#tab-skills {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.14) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg-void);
}

.skills-topbar {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  pointer-events: none;
}

.skills-topbar > * {
  pointer-events: auto;
}

.skills-sp-pill {
  justify-self: end;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

#tree-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

#tree-viewport:active {
  cursor: grabbing;
}

#tree-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 3800px;
  height: 2800px;
  transform-origin: 0 0;
}

#tree-world.tour-panning {
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

#tree-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#tree-nodes {
  position: absolute;
  inset: 0;
}

.tree-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-hi);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.tree-node:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.tree-node.locked {
  opacity: 0.42;
  background: #141624;
}

.tree-node.unlocked {
  border-color: var(--emerald);
  background: #142a28;
}

.tree-node.affordable {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.tree-node.hybrid-node {
  border-radius: 22px;
  border-color: var(--purple);
}

.tree-node.selected {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.tree-node.tour-focus {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(250, 204, 21, 0.25), 0 0 22px rgba(56, 189, 248, 0.55);
  z-index: 6;
}

.node-ico {
  font-size: 24px;
  line-height: 1;
}

.node-lvl {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.tree-controls {
  position: absolute;
  top: 72px;
  right: 20px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tree-fab-btn {
  min-width: 44px;
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

#node-inspector {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  background: rgba(26, 28, 46, 0.96);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  padding: 14px 16px;
  z-index: 25;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.insp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.insp-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.insp-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 6px 0;
}

.insp-warn {
  display: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 6px;
}

.insp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.insp-eff {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--emerald);
}

#insp-sp-btn.tour-pulse {
  border-color: var(--gold-bright);
  background: rgba(168, 85, 247, 0.26);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.28);
}

.tree-tour-card {
  position: absolute;
  top: 72px;
  left: 18px;
  width: min(372px, calc(100% - 104px));
  background: rgba(20, 22, 38, 0.96);
  border: 1.5px solid var(--gold);
  border-radius: 15px;
  padding: 13px 15px;
  z-index: 28;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tour-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-step-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: var(--gold-bright);
}

.tour-zone-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
}

.tour-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
}

.tour-card-body {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.tour-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.tour-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #334155;
  transition: background 0.15s, width 0.15s;
}

.tour-dot.active {
  width: 16px;
  background: var(--gold-bright);
}

.tour-dot.done {
  background: var(--emerald);
}

/* ============================================================================
   SHARED SMALL BUTTONS / TAGS / MODALS / OVERLAYS
   ============================================================================ */
.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn,
.btn-ghost-sm,
.btn-gold-sm,
.btn-emerald-sm {
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s, filter 0.14s, border-color 0.14s;
}

.btn:hover:not(:disabled),
.btn-ghost-sm:hover:not(:disabled),
.btn-gold-sm:hover:not(:disabled),
.btn-emerald-sm:hover:not(:disabled) {
  border-color: var(--border-hi);
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm,
.btn-ghost-sm,
.btn-gold-sm,
.btn-emerald-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 15px;
}

.btn-gold,
.btn-gold-sm {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #16141f;
  border-color: #d97706;
  font-weight: 800;
}

.btn-emerald,
.btn-emerald-sm {
  background: var(--emerald);
  color: #052e16;
  border-color: #059669;
  font-weight: 800;
}

.btn-coral {
  background: var(--coral);
  color: #ffffff;
  border-color: #dc2626;
  font-weight: 800;
}

.btn-cyan {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

.btn-purple,
.boss-duel-btn {
  background: linear-gradient(180deg, #a855f7, #7e22ce);
  color: #ffffff;
  border-color: #c084fc;
}

.btn-soul {
  background: #222a44;
  color: #bae6fd;
  border-color: #38bdf8;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.tag-common { background: #23273d; color: #cbd5e1; }
.tag-rare { background: rgba(16, 216, 139, 0.14); color: var(--emerald); }
.tag-epic { background: rgba(168, 85, 247, 0.18); color: #e9d5ff; }
.tag-relic { background: rgba(245, 185, 50, 0.16); color: var(--gold-bright); }
.tag-fake { background: rgba(248, 97, 104, 0.16); color: #fca5a5; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }

.num-input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.range-input {
  width: 100%;
  accent-color: var(--gold-bright);
}

/* PROLOGUE OVERLAY */
#prologue-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 19, 0.9);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#prologue-overlay.open {
  display: flex;
}

.prologue-card {
  width: min(760px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

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

.prologue-body {
  padding: 18px 22px 20px;
}

.prologue-kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.prologue-title {
  margin: 4px 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.prologue-copy {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 13.5px;
}

.prologue-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.prologue-pillar {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.prologue-pillar strong {
  color: #ffffff;
  font-size: 12.5px;
}

.prologue-actions {
  display: flex;
  justify-content: flex-end;
}

/* MODAL BACKDROP */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 18, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

#modal-backdrop.open {
  display: flex;
}

#modal-box {
  width: min(680px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

/* MARCOS RPG OVERLAY */
#marcos-rpg-overlay {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(130%);
  width: min(760px, calc(100% - 24px));
  background: rgba(24, 26, 44, 0.97);
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 12px 15px;
  z-index: 95;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
  transition: transform 0.25s ease;
  pointer-events: none;
}

#marcos-rpg-overlay.visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.marcos-rpg-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.marcos-portrait-wrap {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #232740;
  flex-shrink: 0;
}

#marcos-portrait {
  width: 100%;
  height: 100%;
  display: block;
}

.marcos-rpg-content {
  flex: 1;
  min-width: 0;
}

.marcos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.marcos-name {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--gold-bright);
  margin-right: 6px;
}

.marcos-text {
  font-size: 13px;
  color: #f1f5f9;
  margin: 5px 0 8px;
}

.marcos-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rpg-choices-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.rpg-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 8px 11px;
}

/* ALBUM / MISSIONS / STORY / HISTORY / SANCTUARY GRIDS INSIDE MODALS */
.album-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 9px;
  max-height: 52dvh;
  overflow-y: auto;
  padding-right: 4px;
}

.album-card {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.album-card.discovered:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.album-card.undiscovered {
  opacity: 0.48;
}

.album-item-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #f8fafc;
}

.album-item-cat {
  font-size: 11px;
  font-weight: 600;
}

.album-item-val {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--emerald);
}

.missions-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.missions-list-scroll {
  max-height: 48dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.mission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 12px;
}

.mission-row.ready {
  border-color: var(--emerald);
}

.stage-missions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.stage-mission-pill {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.stage-mission-pill.done {
  border-color: var(--emerald);
  color: #a7f3d0;
}

.karma-meter-card {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}

.karma-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f86168 0%, #64748b 50%, #10d88b 100%);
  position: relative;
  margin: 8px 0;
}

.karma-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--bg-void);
  transform: translate(-50%, -50%);
}

.corkboard-wrap {
  background: #171828;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}

.clues-cork-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.clue-pin-card {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 8px 10px;
}

.clue-pin-card.locked-clue {
  border-color: var(--border);
  opacity: 0.55;
}

.story-chapter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 12px;
}

.story-chapter-card.active-ch {
  border-color: var(--gold);
}

.story-chapter-card.done-ch {
  border-color: var(--emerald);
}

.history-summary-strip,
.post-auc-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.post-auc-meta-cell {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 45dvh;
  overflow-y: auto;
}

.history-entry {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.history-entry-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.history-details summary {
  font-size: 12px;
  color: var(--cyan);
  cursor: pointer;
  margin-top: 6px;
}

.post-auc-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}

.post-auc-item-left,
.post-auc-item-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-badge {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.status-impecable { background: rgba(16, 216, 139, 0.14); color: var(--emerald); }
.status-danado { background: rgba(245, 185, 50, 0.14); color: var(--gold); }
.status-replica { background: rgba(248, 97, 104, 0.14); color: var(--coral); }

.boss-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.boss-rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
}

.boss-victory-cinematic {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boss-cin-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.boss-cin-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

#boss-victory-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.boss-cin-progress {
  height: 4px;
  background: #141624;
}

.boss-cin-progress-fill {
  height: 100%;
  background: var(--gold-bright);
  width: 0%;
}

.boss-cin-marcos {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  opacity: 0.35;
  transition: opacity 0.25s;
}

.boss-cin-marcos.revealed {
  opacity: 1;
}

.boss-cinematic-controls {
  display: flex;
  gap: 8px;
}

.scrap-grid,
.trilero-cups-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.trilero-cup {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.legacy-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* FLOATING FX / TOASTS / POINTERS / ADMIN */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 140;
}

#float-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 135;
}

.float-txt {
  position: fixed;
  transform: translate(-50%, 0);
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  animation: floatUp 1.15s ease-out forwards;
  white-space: nowrap;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.95); }
  100% { opacity: 0; transform: translate(-50%, -44px) scale(1.04); }
}

#mission-toast-layer {
  position: fixed;
  top: 66px;
  right: 18px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(350px, calc(100vw - 24px));
  pointer-events: none;
}

@keyframes toastSlideIn {
  0% { opacity: 0; transform: translate3d(24px, -6px, 0) scale(0.96); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.mission-toast-card,
.game-toast-card {
  pointer-events: auto;
  background: rgba(24, 27, 46, 0.96);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--emerald);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.58);
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.game-toast-card.toast-closing,
.mission-toast-card.toast-closing {
  opacity: 0;
  transform: translate3d(18px, 0, 0) scale(0.96);
}

.game-toast-card.toast-chapter { border-color: var(--gold-bright); }
.game-toast-card.toast-boss { border-color: #c084fc; }
.game-toast-card.toast-skill { border-color: var(--cyan); }
.game-toast-card.toast-relic { border-color: var(--gold); }
.game-toast-card.toast-mission { border-color: var(--emerald); }

.toast-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toast-chapter .toast-kicker,
.toast-relic .toast-kicker { color: var(--gold-bright); }
.toast-boss .toast-kicker { color: #d8b4fe; }
.toast-skill .toast-kicker { color: var(--cyan); }
.toast-mission .toast-kicker { color: var(--emerald); }

.toast-title {
  font-weight: 800;
  font-size: 13.2px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-detail {
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.toast-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(15, 17, 30, 0.7);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.toast-close-btn:hover {
  color: #ffffff;
  border-color: var(--border-hi);
}

#guide-pointer,
#spotlight-arrow {
  position: fixed;
  transform: translateX(-50%);
  font-size: 24px;
  z-index: 98;
  pointer-events: none;
  display: none;
}

#spotlight-ring {
  position: fixed;
  border: 2.5px solid var(--gold-bright);
  border-radius: 14px;
  z-index: 94;
  pointer-events: none;
  display: none;
  box-shadow: 0 0 0 9999px rgba(8, 9, 16, 0.55);
}

#admin-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #141626;
  border-top: 1px solid var(--gold);
  padding: 8px 14px;
  display: none;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  z-index: 150;
}

#admin-bar.open {
  display: flex;
}

body.is-fullscreen #btn-fullscreen {
  border-color: rgba(16, 216, 139, 0.55);
  color: var(--emerald);
}

#orientation-guard {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 11, 20, 0.98);
  backdrop-filter: blur(12px);
  padding: 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.orientation-card {
  max-width: 420px;
  width: 100%;
  background: var(--bg-card);
  border: 2px solid rgba(245, 185, 50, 0.48);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.orientation-anim {
  font-size: 48px;
  line-height: 1.1;
  animation: rotatePhoneHint 2.2s ease-in-out infinite;
}

@keyframes rotatePhoneHint {
  0%, 100% { transform: rotate(0deg) scale(1); }
  45%, 75% { transform: rotate(-90deg) scale(1.08); }
}

.orientation-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-bright);
}

.orientation-sub {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.screen-shake {
  animation: shakeMe 0.35s ease;
}

@keyframes shakeMe {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

.gavel-shake {
  animation: shakeMe 0.28s ease;
}

.progress-wrap {
  height: 8px;
  border-radius: 999px;
  background: #121320;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
}

/* ============================================================================
   CASA VIEW (#tab-casa — HABITACIÓN ACOGEDORA CON 5 APARTADOS CLICABLES)
   ============================================================================ */
.casa-room-stage {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #2b211f;
}

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

.casa-floating-bar {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 14;
  pointer-events: none;
}

.casa-floating-bar > * {
  pointer-events: auto;
}

.casa-room-caption {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(20, 16, 15, 0.84);
  border: 1px solid rgba(251, 191, 36, 0.28);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 6px 13px;
}

.casa-room-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fef3c7;
  white-space: nowrap;
}

.casa-room-hint {
  font-size: 11.8px;
  color: #d6c5b3;
}

.casa-hotspot {
  position: absolute;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease;
}

.casa-hotspot:hover,
.casa-hotspot:focus-visible {
  transform: translateY(-2px);
}

.casa-hotspot.spot-fridge { left: 4%; top: 23%; width: 18%; height: 55%; }
.casa-hotspot.spot-board  { left: 25%; top: 12%; width: 30%; height: 41%; }
.casa-hotspot.spot-shelf  { left: 58%; top: 14%; width: 21%; height: 22%; }
.casa-hotspot.spot-boxes  { left: 29%; top: 56%; width: 46%; height: 36%; }
.casa-hotspot.spot-marcos { left: 81%; top: 18%; width: 16%; height: 67%; }

.casa-spot-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 16, 15, 0.90);
  border: 1px solid rgba(251, 191, 36, 0.38);
  border-radius: 10px;
  padding: 5px 10px;
  margin-bottom: -12px;
  color: #fef3c7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.casa-hotspot:hover .casa-spot-label,
.casa-hotspot:focus-visible .casa-spot-label {
  background: #2b211a;
  border-color: var(--gold-bright);
  transform: scale(1.04);
}

.casa-spot-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright);
}

.casa-hotspot.spot-alert .casa-spot-label {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px rgba(16, 216, 139, 0.25), 0 8px 18px rgba(0, 0, 0, 0.45);
}

.casa-hotspot.spot-alert .casa-spot-meta {
  color: var(--emerald);
}

.casa-boss-prep-card {
  background: var(--bg-inset);
  border: 1px solid #2b3150;
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.boss-prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.boss-prep-title {
  font-size: 12.8px;
  font-weight: 800;
  color: #f8fafc;
}

.boss-prep-threat {
  font-size: 11px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #fca5a5;
}

.boss-prep-threat.edged {
  color: var(--emerald);
}

.boss-power-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.boss-meter-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.boss-meter-lbl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.8px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.boss-meter-lbl strong {
  color: #f8fafc;
  font-family: var(--font-mono);
}

.boss-meter-track {
  height: 7px;
  border-radius: 999px;
  background: #141728;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.boss-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease;
}

.boss-meter-fill.boss-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.boss-meter-fill.player-fill {
  background: linear-gradient(90deg, #38bdf8, #10d88b);
}

.boss-prep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.boss-prep-edge-txt {
  font-size: 11px;
  color: #a7f3d0;
  font-variant-numeric: tabular-nums;
}

.haggle-drill-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.haggle-drill-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.haggle-stat-cell {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.haggle-stat-cell span {
  font-size: 11px;
  color: var(--text-muted);
}

.haggle-stat-cell strong {
  font-size: 14px;
  font-family: var(--font-mono);
  color: #ffffff;
}

.haggle-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.haggle-opt-btn {
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.haggle-opt-btn:hover {
  border-color: var(--gold);
  background: rgba(245, 185, 50, 0.08);
  transform: translateY(-1px);
}

.haggle-opt-btn strong {
  font-size: 13px;
}

.haggle-opt-btn span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.haggle-drill-feedback {
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--bg-inset);
}

.haggle-drill-feedback.ok {
  border-color: var(--emerald);
  background: rgba(16, 216, 139, 0.10);
  color: #d1fae5;
}

.haggle-drill-feedback.warn {
  border-color: var(--coral);
  background: rgba(248, 97, 104, 0.10);
  color: #fee2e2;
}

/* ============================================================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (FULL-SCREEN DESKTOP + MOBILE LANDSCAPE + PORTRAIT)
   ============================================================================ */
@media (min-width: 1480px) and (min-height: 820px) {
  #main-content {
    padding: 16px 24px 18px;
  }

  .hq-dashboard,
  .arena-columns {
    gap: 18px;
  }

  .kpi-value {
    font-size: 20px;
  }
}

/* Compact desktop windows (e.g. shorter laptop viewports 501px..679px): keep full desktop sizing while preventing HQ or Topbar overflow */
@media (max-height: 679px) and (min-height: 501px) and (orientation: landscape) and (pointer: fine) {
  .hq-goal-card,
  .goal-card {
    flex: 1 1 auto;
    overflow-y: auto;
  }

  .richest-card {
    flex: 0 1 118px;
  }
}

/* Mobile & touch compact landscape (full-bleed horizontal UI, 100% visible controls, never shrinks PC) */
@media (pointer: coarse) and (orientation: landscape), (max-height: 500px) and (orientation: landscape) {
  #viewport-shell {
    height: 100dvh;
    overflow: hidden;
  }

  #app {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  #topbar {
    height: 40px;
    padding: 0 8px;
    gap: 5px;
  }

  .topbar-right {
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-right::-webkit-scrollbar {
    display: none;
  }

  .brand-badge {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .brand-text {
    font-size: 13.5px;
  }

  .player-pill {
    padding: 2px 7px 2px 4px;
    gap: 5px;
  }

  .avatar-circle-cv {
    width: 23px;
    height: 23px;
  }

  .player-pill-meta {
    min-width: 44px;
  }

  .player-rank-accent,
  .player-pill-sep {
    display: none;
  }

  .top-util-btn {
    height: 28px;
    padding: 0 7px;
    font-size: 11px;
    gap: 3px;
  }

  .cash-pill {
    padding: 2px 8px 2px 4px;
    gap: 4px;
  }

  .coin-badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .cash-val {
    font-size: 12px;
  }

  .icon-square-btn {
    width: 28px;
    height: 28px;
    font-size: 12.5px;
  }

  .lang-btn {
    padding: 3px 5px;
    font-size: 10px;
  }

  #main-content {
    padding: 6px 8px 7px;
    overflow: hidden;
  }

  .tab-pane,
  .tab-pane.no-pad {
    overflow: hidden;
  }

  .tab-pane.no-pad {
    margin: -6px -8px -7px;
  }

  /* HQ: Full-bleed 2 columns with pinned Top Ads & Bottom CTA buttons (never clipped) */
  .hq-dashboard {
    grid-template-columns: minmax(0, 1.24fr) minmax(248px, 1fr);
    gap: 8px;
  }

  .hq-left-col,
  .hq-right-col,
  .arena-stage-col,
  .arena-side-col {
    gap: 5px;
  }

  .hq-room-card,
  .canvas-wrap,
  .casa-room-stage {
    min-height: 0;
    aspect-ratio: auto;
  }

  .hq-room-plaque-tl {
    top: 8px;
    left: 8px;
    padding: 4px 9px;
    border-radius: 9px;
  }

  .hq-plaque-sub {
    font-size: 9.5px;
  }

  .hq-plaque-name {
    font-size: 12.5px;
  }

  .hq-tier-pill {
    top: 8px;
    right: 8px;
    padding: 3px 9px;
    font-size: 10.5px;
  }

  .hq-rename-pill {
    bottom: 8px;
    padding: 4px 14px;
    font-size: 11px;
  }

  .hq-relics-overlay {
    top: 52px;
    left: 10px;
    gap: 5px;
  }

  .hq-relic-badge {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .hq-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .kpi-card {
    min-height: 36px;
    padding: 3px 7px;
    border-radius: 9px;
  }

  .kpi-label {
    font-size: 9.5px;
  }

  .kpi-value {
    font-size: 13px;
  }

  .hq-top-actions-row {
    gap: 5px;
    flex-shrink: 0;
  }

  .ad-top-btn {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 11px;
    border-radius: 9px;
  }

  .side-card {
    padding: 6px 9px;
    border-radius: 10px;
  }

  .goal-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    gap: 4px;
    padding: 6px 9px;
  }

  .goal-text {
    font-size: 11px;
    line-height: 1.25;
  }

  .hq-checklist {
    padding: 4px 6px;
    gap: 2px;
    border-radius: 8px;
  }

  .hq-check-row {
    font-size: 10.5px;
  }

  .hq-check-go {
    padding: 1px 6px;
    font-size: 10px;
  }

  .goal-dots-row {
    font-size: 10.2px;
  }

  .vip-inline-row {
    padding: 3px 6px;
    font-size: 10.2px;
  }

  .goal-boss-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .richest-card {
    display: none;
  }

  .hq-cta-stack {
    gap: 5px;
    flex-shrink: 0;
  }

  .btn-auctions-hero {
    height: 35px;
    font-size: 13.5px;
    border-radius: 10px;
  }

  .hq-secondary-row {
    gap: 5px;
  }

  .btn-dark-tile {
    height: 33px;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 9px;
  }

  /* ARENA: Pinned Top/Bottom Controls + Compact Rivals Scroll */
  .arena-top-strip {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .arena-duel-bar {
    padding: 3px 8px;
    gap: 8px;
  }

  .duel-budget-head,
  .duel-round-pill {
    font-size: 10.5px;
  }

  .duel-score-pill {
    font-size: 10px;
  }

  .phase-pill {
    padding: 3px 9px;
    font-size: 10.5px;
  }

  .arena-columns {
    grid-template-columns: minmax(0, 1.38fr) minmax(242px, 1fr);
    gap: 8px;
  }

  .arena-bottom-tools {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .note-slot {
    width: 30px;
    height: 26px;
    font-size: 11px;
  }

  .skill-act-btn {
    padding: 3px 7px;
    font-size: 10px;
    min-width: 60px;
  }

  .inspect-header-card {
    padding: 7px 10px;
  }

  .inspect-countdown-big {
    font-size: 21px;
    margin: 2px 0;
  }

  .inspect-help-copy {
    font-size: 10.8px;
    margin-bottom: 5px;
  }

  .bid-header-card {
    padding: 6px 10px 7px;
  }

  .bid-amount-hero {
    font-size: 21px;
  }

  .bid-leader-sub {
    font-size: 11px;
    margin: 1px 0 4px;
  }

  .expert-ad-pill {
    padding: 3px 9px;
    font-size: 10.5px;
    margin-bottom: 5px;
  }

  .rival-card {
    padding: 5px 8px;
    gap: 6px;
    border-radius: 9px;
  }

  .rival-portrait-cv {
    width: 24px;
    height: 24px;
  }

  .rival-name-txt {
    font-size: 11.5px;
  }

  .rival-sub-txt,
  .rival-budget-txt {
    font-size: 10px;
  }

  .arena-inspect-actions,
  .arena-bidding-actions {
    gap: 4px;
  }

  .btn-start-bidding {
    height: 36px;
    font-size: 13px;
  }

  .btn-bid-hero {
    height: 36px;
    font-size: 14px;
  }

  .bid-input-row {
    grid-template-columns: minmax(0, 1.2fr) auto minmax(72px, 1fr);
    gap: 5px;
  }

  .bid-custom-input,
  .btn-ok-dark,
  .btn-pass-coral {
    height: 32px;
    font-size: 12px;
  }

  .btn-quick-chip {
    height: 24px;
    font-size: 10.5px;
  }

  .result-stack {
    gap: 5px;
  }

  .result-status-pill {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .result-items-card {
    padding: 6px 9px;
    gap: 5px;
  }

  .result-item-row {
    font-size: 11.5px;
  }

  .result-summary-card {
    padding: 6px 9px;
    gap: 3px;
  }

  .result-sum-line {
    font-size: 11.5px;
  }

  .result-actions-stack {
    gap: 5px;
  }

  .btn-back-hq-full {
    height: 32px;
    font-size: 12px;
  }

  /* LOCATIONS CAROUSEL */
  .locations-screen {
    gap: 5px;
    min-height: 0;
  }

  .subview-header {
    gap: 8px;
    flex-shrink: 0;
  }

  .subview-title {
    font-size: 15px;
  }

  .btn-back-pill {
    padding: 4px 9px;
    font-size: 11.5px;
    border-radius: 8px;
  }

  .btn-ghost-sm {
    padding: 4px 8px;
    font-size: 11px;
  }

  .carousel-stage {
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
  }

  .locations-carousel {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    align-items: flex-start;
    gap: 10px;
    padding: 2px 26px 4px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .carousel-arrow {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .carousel-arrow.left { left: 2px; }
  .carousel-arrow.right { right: 2px; }

  .loc-card {
    flex: 0 0 218px;
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: auto;
    border-radius: 13px;
  }

  .loc-thumb-wrap {
    height: 58px;
    flex-shrink: 0;
  }

  .loc-card-body {
    padding: 6px 9px 7px;
    gap: 3px;
    flex: 0 0 auto;
  }

  .loc-card-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .loc-stat-line {
    font-size: 10.8px;
    line-height: 1.2;
  }

  .loc-items-tray {
    padding: 2px 5px;
    border-radius: 8px;
  }

  .loc-mini-item-cv {
    width: 24px;
    height: 20px;
  }

  .loc-stars-row,
  .loc-rivals-row {
    font-size: 10.2px;
    line-height: 1.15;
  }

  .loc-rival-dot-cv {
    width: 17px;
    height: 17px;
  }

  .loc-actions-stack {
    gap: 3px;
    padding-top: 2px;
    margin-top: 2px;
  }

  .btn-loc-go {
    height: 32px;
    font-size: 12px;
    border-radius: 8px;
  }

  .btn-loc-boss {
    height: 24px;
    padding: 0 6px;
    font-size: 10px;
    border-radius: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .loc-lock-overlay {
    padding: 10px;
  }

  .loc-lock-icon {
    font-size: 22px;
    margin-bottom: 3px;
  }

  .loc-lock-title {
    font-size: 12px;
  }

  .loc-lock-sub {
    font-size: 10.5px;
  }

  /* CASA */
  .casa-floating-bar {
    top: 7px;
    left: 8px;
    right: 8px;
  }

  .casa-room-hint {
    display: none;
  }

  .casa-room-caption {
    padding: 4px 10px;
  }

  .casa-room-title {
    font-size: 12px;
  }

  .casa-spot-label {
    padding: 3px 7px;
    font-size: 10.5px;
    gap: 4px;
    border-radius: 8px;
    margin-bottom: -8px;
  }

  .casa-spot-meta {
    font-size: 10px;
  }

  /* SKILL TREE */
  .skills-topbar {
    top: 8px;
    left: 10px;
    right: 10px;
  }

  .skills-sp-pill {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .tree-controls {
    top: 44px;
    right: 10px;
    gap: 4px;
  }

  .tree-fab-btn {
    min-width: 34px;
    height: 29px;
    padding: 0 7px;
    font-size: 11px;
  }

  #node-inspector {
    bottom: 8px;
    width: min(500px, calc(100% - 20px));
    padding: 8px 11px;
    max-height: 44dvh;
    overflow-y: auto;
    border-radius: 12px;
  }

  .insp-title {
    font-size: 13px;
  }

  .insp-desc {
    font-size: 11.5px;
    margin: 4px 0;
  }

  .tree-tour-card {
    top: 44px;
    left: 10px;
    right: 110px;
    width: auto;
    max-height: 44dvh;
    overflow-y: auto;
    padding: 8px 10px;
    gap: 5px;
  }

  /* PROLOGUE / MODALS / MARCOS / TOASTS */
  #prologue-overlay,
  #modal-backdrop {
    padding: 8px;
  }

  #prologue-canvas {
    max-height: 92px;
    object-fit: cover;
  }

  .prologue-body {
    padding: 10px 14px 12px;
  }

  .prologue-title {
    font-size: 17px;
    margin: 2px 0 4px;
  }

  .prologue-copy {
    font-size: 11.5px;
    margin-bottom: 8px;
  }

  .prologue-pillars {
    gap: 6px;
    margin-bottom: 10px;
  }

  .prologue-pillar {
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .prologue-actions .btn-lg {
    padding: 7px 14px;
    font-size: 12.5px;
  }

  #modal-box {
    max-height: 92dvh;
    padding: 12px 14px;
  }

  .album-grid {
    max-height: 44dvh;
  }

  .missions-list-scroll {
    max-height: 42dvh;
  }

  .history-list {
    max-height: 40dvh;
  }

  #marcos-rpg-overlay {
    bottom: 8px;
    width: min(680px, calc(100% - 16px));
    padding: 8px 11px;
  }

  .marcos-portrait-wrap {
    width: 52px;
    height: 52px;
  }

  .marcos-text {
    font-size: 11.8px;
    margin: 3px 0 5px;
  }

  #btn-marcos-next {
    padding: 6px 12px;
    font-size: 12.5px;
  }

  #mission-toast-layer {
    top: 46px;
    right: 8px;
    width: min(290px, calc(100vw - 16px));
  }
}

@media (max-height: 460px) and (orientation: landscape) {
  .loc-thumb-wrap {
    height: 46px;
  }

  .loc-rivals-row {
    display: none;
  }

  .loc-card-body {
    padding: 5px 8px 6px;
    gap: 2px;
  }

  .loc-items-tray {
    padding: 2px 4px;
  }

  .loc-mini-item-cv {
    width: 21px;
    height: 17px;
  }

  .btn-loc-go {
    height: 30px;
    font-size: 11.5px;
  }

  .btn-loc-boss {
    height: 22px;
  }
}

/* Force horizontal mode: lock portrait mobile / narrow screens behind #orientation-guard */
@media (orientation: portrait) and (max-width: 960px), (pointer: coarse) and (orientation: portrait) {
  #orientation-guard {
    display: flex;
  }
}

body.mobile-portrait-locked #orientation-guard {
  display: flex;
}

@media (max-width: 960px) and (orientation: landscape) {
  .player-rank-accent,
  .player-pill-sep {
    display: none;
  }

  .player-pill-meta {
    min-width: 54px;
  }

  .topbar-right {
    gap: 5px;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .brand-text {
    display: none;
  }
}

/* ============================================================================
   CONTENIDO INDEXABLE SEMÁNTICO + MODAL DE GUÍA Y LEGAL (4 PESTAÑAS)
   ============================================================================ */
.seo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.noscript-seo-card {
  max-width: 820px;
  margin: 24px auto;
  padding: 20px 24px;
  background: #1a1c2e;
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.65;
}

.legal-modal-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.legal-modal-title {
  margin: 0;
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 800;
}

.legal-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  background: #111421;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(168, 184, 216, 0.14);
}

.legal-tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legal-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.legal-tab-btn.active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--gold);
  border-color: rgba(245, 158, 11, 0.45);
}

.legal-panel-scroll {
  max-height: 52dvh;
  overflow-y: auto;
  padding: 12px 14px;
  background: #111421;
  border: 1px solid rgba(168, 184, 216, 0.14);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-section-card {
  background: rgba(26, 28, 46, 0.72);
  border: 1px solid rgba(168, 184, 216, 0.12);
  border-radius: 10px;
  padding: 11px 13px;
}

.legal-section-card h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold);
}

.legal-section-card p,
.legal-section-card li {
  margin: 0 0 7px;
  font-size: 12.6px;
  line-height: 1.58;
  color: #dbe3f4;
}

.legal-section-card p:last-child,
.legal-section-card li:last-child {
  margin-bottom: 0;
}

.legal-section-card ul {
  margin: 4px 0 6px;
  padding-left: 18px;
}

.legal-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(16, 216, 139, 0.1);
  border: 1px solid rgba(16, 216, 139, 0.3);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 960px) and (orientation: landscape) {
  .legal-tabs-bar {
    gap: 4px;
    padding: 4px;
  }

  .legal-tab-btn {
    padding: 5px 4px;
    font-size: 11px;
  }

  .legal-panel-scroll {
    max-height: 44dvh;
    padding: 10px;
  }
}


