/* ═══════════════════════════════════════════════════════════════
   OGame: Idle Colony – Styles
   Sci-Fi Game UI Theme (Ultimate Sci-Fi GUI inspired)
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Design Tokens ─────────────────────────────────────── */
:root {
  --bg-deep:       #060a14;
  --bg-primary:    #0a1020;
  --bg-secondary:  #0d1528;
  --bg-tertiary:   #132040;
  --bg-card:       rgba(10, 18, 40, 0.92);
  --bg-glass:      rgba(10, 18, 40, 0.7);

  --text-primary:  #d8e4f0;
  --text-secondary:#8a9bba;
  --text-dim:      #4a5e80;

  --accent-cyan:   #00e5ff;
  --accent-amber:  #f5a623;
  --accent-green:  #00e676;
  --accent-red:    #ff3d3d;
  --accent-purple: #a78bfa;
  --accent-blue:   #42a5f5;

  --neon-glow:     rgba(0, 229, 255, 0.3);
  --amber-glow:    rgba(245, 166, 35, 0.3);

  --frame-color:   rgba(0, 180, 255, 0.35);
  --frame-bright:  rgba(0, 229, 255, 0.6);
  --frame-dim:     rgba(0, 140, 200, 0.15);

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;

  --border-subtle: 1px solid rgba(0, 180, 255, 0.12);
  --border-accent: 1px solid var(--frame-color);
  --border-frame:  1px solid var(--frame-bright);

  --r-sm: 4px;  --r-md: 6px; --r-lg: 10px; --r-xl: 14px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-neon:0 0 20px rgba(0, 229, 255, 0.15);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;

  --dur-fast:   150ms;
  --dur-normal: 250ms;
  --dur-slow:   400ms;
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  width: 100%;
  height: 100vh;
  height: 100dvh; /* handles iOS dynamic address bar */
}

body {
  width: 100%; height: 100%;
  background: #000;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

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

img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: var(--font); }

.hidden { display: none !important; }

/* ─── 3. Phone Frame (portrait, max 430px) ────────────────── */
.app {
  width: min(430px, 100vw);
  height: 100dvh;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 80, 160, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 60, 120, 0.06) 0%, transparent 50%),
    var(--bg-deep);
  border-left: 1px solid var(--frame-dim);
  border-right: 1px solid var(--frame-dim);
}

.game-ui {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
}

/* ─── Sci-Fi Frame Mixin (reusable via class) ─────────────── */
/* Corner accents for panels */
.sci-frame {
  position: relative;
}
.sci-frame::before,
.sci-frame::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}
.sci-frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.sci-frame::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

/* Shine sweep animation (for progress bars and buttons) */
@keyframes shineSweep {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* Scan line effect (subtle) */
@keyframes scanLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ─── 4. Login Screen ──────────────────────────────────────── */
.login-screen {
  position: absolute; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(0, 100, 200, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(0, 60, 180, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #050810 0%, #0a1020 100%);
}

.login-card {
  width: 380px; max-width: 92%;
  background: var(--bg-card);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(0, 180, 255, 0.08),
    inset 0 1px 0 rgba(0, 200, 255, 0.1);
  text-align: center;
  position: relative;
}
/* Corner accents on login card */
.login-card::before,
.login-card::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
}
.login-card::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: var(--r-lg) 0 0 0;
}
.login-card::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 var(--r-lg) 0;
}

.login-logo { margin-bottom: var(--sp-6); }
.logo-icon { font-size: 48px; display: block; margin-bottom: var(--sp-3); }
.login-logo h1 {
  font-size: 22px; font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-cyan), #42a5f5, var(--accent-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: var(--sp-1);
  letter-spacing: 0.5px;
}

.login-form { text-align: left; }

.input-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--sp-1);
  margin-top: var(--sp-4);
}
.input-hint { font-weight: 400; color: var(--text-dim); text-transform: none; letter-spacing: 0; }

.input-field {
  width: 100%; padding: 10px 14px;
  background: rgba(0, 20, 50, 0.6);
  border: 1px solid var(--frame-dim);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--dur-fast) var(--ease);
}
.input-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15), inset 0 0 8px rgba(0, 229, 255, 0.05);
}
.input-field::placeholder { color: var(--text-dim); }

.login-btn {
  width: 100%; margin-top: var(--sp-6);
  padding: 12px; font-size: 15px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-error {
  color: var(--accent-red); font-size: 12px;
  margin-top: var(--sp-2); min-height: 18px; text-align: center;
}

.login-toggle {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: var(--sp-3);
}
.login-toggle a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}
.login-toggle a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

/* ─── 5. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 8px 20px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.96); }

/* Shine sweep on buttons */
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}
.btn:hover::after {
  animation: shineSweep 0.6s ease forwards;
}

.btn-primary {
  background: linear-gradient(180deg, #00c8ff 0%, #0090cc 100%);
  color: #001428;
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 1px 0 rgba(0, 200, 255, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  background: linear-gradient(180deg, #00d4ff 0%, #00a0dd 100%);
}
.btn-primary:disabled {
  background: var(--bg-tertiary); color: var(--text-dim);
  box-shadow: none; cursor: not-allowed; transform: none;
  border-color: var(--frame-dim);
  text-shadow: none;
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(0, 60, 120, 0.4), rgba(0, 40, 80, 0.3));
  color: var(--text-primary);
  border: 1px solid var(--frame-color);
}
.btn-secondary:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--neon-glow);
}

.btn-amber {
  background: linear-gradient(180deg, #f5a623 0%, #cc7a00 100%);
  color: #1a0800;
  border: 1px solid rgba(245, 166, 35, 0.5);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 1px 0 rgba(245, 166, 35, 0.3);
}
.btn-amber:hover {
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.5);
}

.btn-sm { padding: 5px 12px; font-size: 11px; }

/* ─── 6. Resource Bar (portrait 3-col, inline icon+stored+rate) */
.resource-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px 4px;
  padding: max(4px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 3px max(8px, env(safe-area-inset-left, 0px));
  background:
    linear-gradient(180deg, rgba(0, 40, 80, 0.4) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--frame-color);
  flex-shrink: 0;
  position: relative;
}
/* Top glow line */
.resource-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.4;
}

.res-item {
  display: flex; flex-direction: row;
  align-items: center;
  gap: 3px; padding: 2px 1px;
  min-width: 0;
  overflow: hidden;
}

.res-icon {
  width: 18px; height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.3));
}

/* portrait: stored + rate inline in one row */
.res-text {
  display: flex; flex-direction: row;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.res-value {
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #e8f4ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.3), 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.res-cap { display: none; }
.res-rate { color: var(--accent-green); font-size: 9px; line-height: 1; white-space: nowrap; text-shadow: 0 0 4px rgba(0, 230, 118, 0.3); }
.res-rate.negative { color: var(--accent-red); text-shadow: 0 0 4px rgba(255, 61, 61, 0.3); }

/* Worker shortage highlight on resource bar */
.res-item.res-warning .res-value { color: var(--accent-amber); text-shadow: 0 0 6px rgba(245, 166, 35, 0.4); }
.res-item.res-danger .res-value { color: var(--accent-red); text-shadow: 0 0 6px rgba(255, 61, 61, 0.4); }

/* Player name chip: left side of ticker bar */
.player-name-chip {
  flex-shrink: 0;
  background: rgba(0, 180, 255, 0.08);
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: var(--r-sm);
  padding: 1px 8px;
  font-size: 10px;
  color: var(--accent-cyan); font-weight: 700;
  letter-spacing: 0.5px;
  transition: all var(--dur-fast) var(--ease);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.1);
}
.player-name-chip:empty { display: none; }

/* ─── 6b. Ticker Strip (player name left, warnings right) ── */
.ticker-bar {
  display: flex; align-items: center;
  gap: 8px;
  height: 22px;
  padding: 0 8px;
  background: rgba(5, 10, 20, 0.95);
  border-bottom: 1px solid var(--frame-dim);
  font-size: 11px; font-weight: 600;
  color: var(--accent-amber);
  overflow: hidden;
  flex-shrink: 0;
  white-space: nowrap;
}
.ticker-msg { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* ─── 7. Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1; position: relative;
  overflow: hidden;
}

.screen { position: absolute; inset: 0; overflow-y: auto; }
.screen.enter { animation: screenIn var(--dur-slow) var(--ease) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 8. World View ────────────────────────────────────────── */
.world-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050a14;
}

.world-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.world-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.world-image-layer {
  position: absolute;
  z-index: 2;
  overflow: hidden; /* clamp labels within image bounds */
}

.world-building-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ─── 9. Building Hotspots ─────────────────────────────────── */
.building-hotspot {
  position: absolute;
  z-index: 5;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: box-shadow var(--dur-normal) var(--ease);
}

.building-hotspot:hover {
  box-shadow:
    0 0 30px rgba(0, 229, 255, 0.2),
    inset 0 0 20px rgba(0, 229, 255, 0.06);
}

.building-hotspot:active {
  transform: scale(0.97);
}

/* ─── Topbar Left (toggle + username inline) ─────────────── */
.topbar-left {
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.ui-toggle-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: rgba(0, 180, 255, 0.08);
  border: 1px solid rgba(0, 180, 255, 0.25);
  border-radius: 5px;
  color: var(--accent-cyan);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  padding: 0;
}
.ui-toggle-btn:hover { opacity: 1; background: rgba(0, 229, 255, 0.15); }
.ui-toggle-btn.dimmed { opacity: 0.5; color: var(--text-dim); border-color: var(--frame-dim); }

/* Badges dimmed state */
.badges-dimmed .world-label { opacity: 0.12; pointer-events: none; }
.badges-dimmed .upgrade-ready-badge { opacity: 0; }

/* ─── Ad Reward Panels (world view, icon-only 48px) ────────── */
.ad-panels-container {
  position: absolute;
  top: 6px; right: 0;
  z-index: 8;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.ad-panel {
  pointer-events: auto;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  background: rgba(5, 12, 30, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--frame-color);
  border-right: none;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  overflow: hidden;
  animation: adPanelIn 400ms ease-out both, adPanelPulse 3s ease-in-out 600ms infinite;
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.ad-panel:hover {
  border-color: var(--frame-bright);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}
.ad-panel:nth-child(2) { animation-delay: 150ms, 750ms; }
.ad-panel-icon {
  width: 48px; height: 48px;
  object-fit: cover;
  display: block;
}

/* Workers panel accent */
.ad-panel--workers { border-color: rgba(0, 230, 118, 0.35); }

/* Resources panel accent */
.ad-panel--resources { border-color: rgba(245, 166, 35, 0.35); }

@keyframes adPanelIn {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes adPanelPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* Exit animation (applied via JS) */
.ad-panel--exit {
  animation: adPanelOut 300ms ease-in forwards !important;
}
@keyframes adPanelOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

/* Reward burst floating text */
.ad-reward-burst {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 30;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.9), rgba(0, 180, 255, 0.9));
  border-radius: var(--r-md);
  color: #fff;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: adBurst 1.2s ease-out forwards;
}
@keyframes adBurst {
  0%   { opacity: 0; transform: scale(0.5) translateY(0); }
  20%  { opacity: 1; transform: scale(1.1) translateY(0); }
  40%  { transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1) translateY(-40px); }
}

/* ─── World Label — Sci-Fi building tag ────────────────────── */
.world-label {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  background: rgba(5, 12, 30, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 180, 255, 0.1);
}

.world-label-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.world-label-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-cyan), #0090cc);
  color: #001428;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

.world-label-name {
  font-size: 8px;
  font-weight: 700;
  color: rgba(200, 230, 255, 0.85);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.world-label--building {
  border-color: rgba(245, 166, 35, 0.5);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.2);
}

.world-label-build {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid rgba(245, 166, 35, 0.25);
}

/* Debug crosshair for badge anchor positions */
.badge-crosshair {
  position: absolute;
  z-index: 7;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 1px solid red;
  border-radius: 50%;
  background: rgba(255,0,0,0.3);
}

/* ─── 10. World Tooltip ────────────────────────────────────── */
.world-tooltip {
  position: absolute;
  z-index: 60;
  background: rgba(5, 12, 30, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-md);
  padding: 6px 12px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
  box-shadow: 0 0 16px rgba(0, 180, 255, 0.1);
}
.world-tooltip.visible { opacity: 1; }

.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-thumb {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--frame-dim);
  flex-shrink: 0;
}
.tt-info { flex: 1; }
.tt-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.tt-level { font-size: 10px; font-weight: 600; color: var(--accent-cyan); }
.tt-prod { display: block; font-size: 10px; font-weight: 600; color: var(--accent-green); margin-top: 1px; }
.tt-prod.tt-inactive { color: var(--text-dim); }
.tt-energy { display: block; font-size: 10px; font-weight: 600; color: var(--accent-amber); margin-top: 1px; }
.tt-workers { display: block; font-size: 10px; font-weight: 600; color: var(--accent-blue); margin-top: 1px; }

/* ─── 11. Floating Production Numbers ─────────────────────── */
.floating-number {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -100%);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  animation: floatUp 0.8s ease-out forwards;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 6px;
}

@keyframes floatUp {
  0%   { opacity: 0.95; transform: translate(-50%, -100%); }
  30%  { opacity: 0.95; }
  100% { opacity: 0;    transform: translate(-50%, calc(-100% - 20px)); }
}

.floating-number[data-resource="metal"] {
  color: #b8c8e0;
  text-shadow: 0 0 10px rgba(184, 200, 224, 0.8), 0 0 20px rgba(184, 200, 224, 0.4), 0 1px 3px rgba(0,0,0,1);
}
.floating-number[data-resource="crystal"] {
  color: #a78bfa;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.8), 0 0 20px rgba(167, 139, 250, 0.4), 0 1px 3px rgba(0,0,0,1);
}
.floating-number[data-resource="deuterium"] {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.4), 0 1px 3px rgba(0,0,0,1);
}
.floating-number[data-resource="energy"] {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8), 0 0 20px rgba(251, 191, 36, 0.4), 0 1px 3px rgba(0,0,0,1);
}
.floating-number[data-resource="food"] {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.8), 0 0 20px rgba(0, 230, 118, 0.4), 0 1px 3px rgba(0,0,0,1);
}

/* ─── 12. World Status Panel ──────────────────────────────── */
.world-status-panel {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 10;
  max-width: 40%;
  background: rgba(5, 12, 30, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--frame-dim);
  border-radius: var(--r-md);
  padding: 8px 14px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-warning { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent-amber); }
.sp-red { color: var(--accent-red); }
.sp-boost { font-size: 11px; font-weight: 600; color: var(--accent-green); }

/* ─── 13. Bottom Navigation ────────────────────────────────── */
/* portrait: safe-area bottom padding */
.bottom-nav {
  display: flex; align-items: center; justify-content: space-evenly;
  background:
    linear-gradient(0deg, rgba(0, 30, 60, 0.5) 0%, var(--bg-primary) 100%);
  border-top: 1px solid var(--frame-color);
  padding: 0 0 env(safe-area-inset-bottom, 0px) 0;
  flex-shrink: 0;
  min-height: 42px;
  z-index: 10;
  position: relative;
  width: 100%;
  overflow: hidden;
}
/* Bottom glow line */
.bottom-nav::after {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.3;
}

.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1 1 0; min-width: 0;
  padding: var(--sp-1) 2px;
  font-size: 9px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn.active {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.nav-btn.active::after {
  content: '';
  position: absolute; top: -1px; left: 15%; right: 15%;
  height: 2px; border-radius: 1px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--neon-glow), 0 0 20px rgba(0, 229, 255, 0.15);
}

.nav-icon { font-size: 16px; line-height: 1; }
.nav-icon-img {
  width: 20px; height: 20px;
  object-fit: contain;
  opacity: 0.5;
  transition: all var(--dur-fast) var(--ease);
  filter: saturate(0.3);
}
.nav-btn.active .nav-icon-img {
  opacity: 1;
  filter: saturate(1) drop-shadow(0 0 4px rgba(0, 229, 255, 0.4));
}

/* ─── 14. Bottom Sheet ─────────────────────────────────────── */
.sheet-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease);
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 51;
  background:
    linear-gradient(180deg, rgba(10, 20, 50, 0.98) 0%, rgba(5, 12, 30, 0.99) 100%);
  border-top: 2px solid var(--frame-bright);
  border-left: 1px solid var(--frame-color);
  border-right: 1px solid var(--frame-color);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  max-height: 85%;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease);
  display: flex; flex-direction: column;
  box-shadow:
    0 -4px 30px rgba(0, 0, 0, 0.6),
    0 -1px 20px rgba(0, 180, 255, 0.08);
}
.bottom-sheet.open { transform: translateY(0); }
/* Corner accents on sheet */
.bottom-sheet::before,
.bottom-sheet::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}
.bottom-sheet::before {
  top: -2px; left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: var(--r-lg) 0 0 0;
}
.bottom-sheet::after {
  top: -2px; right: -1px;
  border-width: 2px 2px 0 0;
  border-radius: 0 var(--r-lg) 0 0;
}

.sheet-handle {
  width: 40px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  border-radius: 2px;
  margin: var(--sp-3) auto var(--sp-2);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.5;
}

.sheet-content {
  overflow-y: auto;
  padding: 0 var(--sp-6) var(--sp-6);
  flex: 1;
}

.sheet-action-footer {
  position: sticky;
  bottom: 0;
  padding: var(--sp-2) 0 0;
  background: linear-gradient(0deg, rgba(5, 12, 30, 0.98) 70%, rgba(5, 12, 30, 0.9) 85%, transparent);
  z-index: 2;
  flex-shrink: 0;
}

/* ─── 15. Sheet – Building Detail ──────────────────────────── */
.sheet-header {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.sheet-thumb {
  width: 64px; height: 48px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--frame-dim);
  padding: var(--sp-1);
}

.sheet-title {
  font-size: 16px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e8f4ff;
}
.sheet-level {
  color: var(--accent-cyan);
  font-size: 12px; font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}
.sheet-desc { color: var(--text-secondary); font-size: 12px; margin-bottom: var(--sp-3); }

.sheet-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-2); margin-bottom: var(--sp-3);
}

.stat-card {
  background: rgba(0, 20, 50, 0.5);
  border-radius: var(--r-sm);
  padding: var(--sp-2);
  border: 1px solid var(--frame-dim);
}
.stat-label { font-size: 10px; color: var(--text-dim); margin-bottom: 1px; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-value { font-size: 13px; font-weight: 700; }
.stat-value.green { color: var(--accent-green); text-shadow: 0 0 4px rgba(0, 230, 118, 0.3); }
.stat-value.cyan { color: var(--accent-cyan); text-shadow: 0 0 4px rgba(0, 229, 255, 0.3); }
.stat-value.amber { color: var(--accent-amber); text-shadow: 0 0 4px rgba(245, 166, 35, 0.3); }

.sheet-cost {
  background: rgba(0, 20, 50, 0.5);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--frame-dim);
}

.sheet-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  align-items: start;
}
.sheet-detail-left {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sheet-energy-info {
  font-size: 11px; font-weight: 600;
  color: var(--accent-amber);
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
}
.sheet-worker-info {
  font-size: 11px; font-weight: 600;
  color: var(--accent-blue);
  background: rgba(66, 165, 245, 0.08);
  border: 1px solid rgba(66, 165, 245, 0.2);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
}
.sheet-worker-shortage {
  color: var(--accent-red);
  background: rgba(255, 61, 61, 0.08);
  border-color: rgba(255, 61, 61, 0.2);
}

.cost-title { font-size: 11px; color: var(--text-dim); margin-bottom: var(--sp-2); text-transform: uppercase; letter-spacing: 0.3px; }
.cost-row { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; padding: 2px 0; }
.cost-row img { width: 16px; height: 16px; object-fit: contain; }
.cost-affordable { color: var(--accent-green); }
.cost-unaffordable { color: var(--accent-red); }

/* ─── 16. Buildings Grid (Upgrades Screen) ─────────────────── */
.buildings-screen {
  padding: var(--sp-2);
  scrollbar-width: none;
}
.buildings-screen::-webkit-scrollbar { display: none; }

.buildings-screen h2 {
  font-size: 15px; font-weight: 700;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.building-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-1);
}

.building-card {
  display: flex; align-items: center; gap: var(--sp-1);
  background:
    linear-gradient(135deg, rgba(0, 20, 50, 0.6) 0%, rgba(5, 15, 35, 0.8) 100%);
  border: 1px solid var(--frame-dim);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
}
.building-card:hover {
  border-color: var(--frame-color);
  box-shadow: 0 0 16px rgba(0, 180, 255, 0.12), inset 0 0 12px rgba(0, 180, 255, 0.04);
}
.building-card:active { transform: scale(0.98); }

.building-card-thumb {
  width: 28px; height: 22px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--frame-dim);
  flex-shrink: 0;
}
.building-card-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.building-card-info { flex: 1; min-width: 0; }
.building-card-name {
  font-size: 10px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.building-card-level {
  font-size: 9px; color: var(--accent-cyan);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.3);
}
.building-card-output {
  font-size: 9px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.building-card-action {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 9px; font-weight: 800;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.2), rgba(0, 150, 200, 0.1));
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 200, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--dur-fast) var(--ease);
}
.building-card-action:hover {
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.3), rgba(0, 150, 200, 0.15));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}
.building-card-action:disabled {
  background: var(--bg-tertiary);
  color: var(--text-dim);
  border-color: var(--frame-dim);
}

@media (max-width: 480px) {
  .building-grid { grid-template-columns: 1fr; }
}

.upgrade-pulse { animation: upgradePulse 0.6s ease-out; }
@keyframes upgradePulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4); }
  100% { box-shadow: 0 0 0 14px rgba(0, 229, 255, 0); }
}

/* Level-up blow-up effect on world badge */
.levelup-pop {
  animation: levelupPop 600ms ease-out;
  z-index: 20;
}
@keyframes levelupPop {
  0%   { transform: translate(-50%, -50%) scale(1);
         box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
         filter: drop-shadow(0 0 0 transparent); }
  30%  { transform: translate(-50%, -50%) scale(1.35);
         box-shadow: 0 0 20px 6px rgba(0, 229, 255, 0.7), 0 0 40px 12px rgba(0, 229, 255, 0.3);
         filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.8)); }
  60%  { transform: translate(-50%, -50%) scale(1.12);
         box-shadow: 0 0 12px 3px rgba(0, 229, 255, 0.3);
         filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4)); }
  100% { transform: translate(-50%, -50%) scale(1);
         box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
         filter: drop-shadow(0 0 0 transparent); }
}

/* upgrade-ready indicator: pulsing arrow on world badge + building card */
.upgrade-ready-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px; height: 12px;
  font-size: 8px;
  font-weight: 900;
  color: var(--accent-green);
  animation: upgradeReadyPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 230, 118, 0.5);
}
@keyframes upgradeReadyPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ─── 17. Expeditions Screen ───────────────────────────────── */
.expedition-screen { padding: var(--sp-2) var(--sp-3); }

.expedition-screen h2 {
  font-size: 15px; font-weight: 700;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.ship-selector {
  display: flex; gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.ship-card {
  flex: 1;
  background:
    linear-gradient(135deg, rgba(0, 20, 50, 0.6) 0%, rgba(5, 15, 35, 0.8) 100%);
  border: 2px solid var(--frame-dim);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  position: relative;
}
.ship-card:hover {
  border-color: var(--frame-color);
  box-shadow: 0 0 16px rgba(0, 180, 255, 0.1);
}
.ship-card.selected {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.2), inset 0 0 20px rgba(0, 229, 255, 0.05);
}
/* Corner glow on selected ship */
.ship-card.selected::before,
.ship-card.selected::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
}
.ship-card.selected::before {
  top: -2px; left: -2px;
  border-width: 2px 0 0 2px;
}
.ship-card.selected::after {
  bottom: -2px; right: -2px;
  border-width: 0 2px 2px 0;
}

.ship-img {
  width: 60px; height: 60px;
  object-fit: contain;
  margin: 0 auto var(--sp-1);
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.2));
}

.ship-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.ship-duration { font-size: 10px; color: var(--text-secondary); }
.ship-rewards { font-size: 10px; color: var(--accent-green); margin-top: 0; }

.expedition-status {
  background:
    linear-gradient(135deg, rgba(0, 20, 50, 0.7) 0%, rgba(5, 15, 35, 0.9) 100%);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  text-align: center;
  position: relative;
}
/* Corner accents */
.expedition-status::before,
.expedition-status::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
}
.expedition-status::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.expedition-status::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* Progress bar with shine sweep */
.exp-progress {
  width: 100%; height: 8px;
  background: rgba(0, 20, 50, 0.8);
  border: 1px solid var(--frame-dim);
  border-radius: 4px;
  margin: var(--sp-3) 0;
  overflow: hidden;
  position: relative;
}
.exp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0060ff, var(--accent-cyan), #0060ff);
  border-radius: 3px;
  transition: width 1s linear;
  position: relative;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}
/* Shine sweep on progress bar */
.exp-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shineSweep 2s ease-in-out infinite;
}

.exp-timer {
  font-size: 22px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}
.exp-label { font-size: 13px; color: var(--text-secondary); margin-top: var(--sp-1); }

/* ─── 18. Highscore Screen ─────────────────────────────────── */
.highscore-screen { padding: var(--sp-4); }

.highscore-screen h2 {
  font-size: 15px; font-weight: 700;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.leaderboard-table { width: 100%; border-collapse: collapse; }

.leaderboard-table th {
  font-size: 11px; font-weight: 700;
  color: var(--accent-cyan);
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.leaderboard-table td {
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  border-bottom: 1px solid var(--frame-dim);
}

.lb-rank { font-weight: 800; width: 50px; }
.lb-rank-1 { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.lb-rank-2 { color: #c0c8d8; text-shadow: 0 0 6px rgba(192, 200, 216, 0.3); }
.lb-rank-3 { color: #d97706; text-shadow: 0 0 6px rgba(217, 119, 6, 0.3); }

.lb-medal { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.lb-name { font-weight: 700; }
.lb-self { color: var(--accent-cyan); text-shadow: 0 0 6px rgba(0, 229, 255, 0.3); }
.lb-score { font-variant-numeric: tabular-nums; text-align: right; }

.my-rank-card {
  background:
    linear-gradient(135deg, rgba(0, 20, 50, 0.6) 0%, rgba(5, 15, 35, 0.8) 100%);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-2);
  display: flex; align-items: center; gap: var(--sp-2);
  position: relative;
}
/* Corner accents */
.my-rank-card::before,
.my-rank-card::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
}
.my-rank-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.my-rank-card::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.my-rank-number {
  font-size: 20px; font-weight: 900;
  color: var(--accent-cyan);
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}
.my-rank-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.my-rank-score { font-size: 14px; font-weight: 800; }

/* ─── 19. Toast ────────────────────────────────────────────── */
/* toasts below resource bar + ticker (portrait offset) */
.toast-container {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 76px);
  right: var(--sp-3);
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  background: rgba(5, 12, 30, 0.95);
  border: 1px solid var(--frame-color);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-4);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 0 16px rgba(0, 180, 255, 0.1);
  backdrop-filter: blur(8px);
  animation: toastIn var(--dur-normal) var(--ease) both;
  pointer-events: auto;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.toast.out { animation: toastOut var(--dur-normal) var(--ease) both; }
.toast.success { border-color: rgba(0, 230, 118, 0.5); color: var(--accent-green); }
.toast.warning { border-color: rgba(245, 166, 35, 0.5); color: var(--accent-amber); }
.toast.error   { border-color: rgba(255, 61, 61, 0.5); color: var(--accent-red); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ─── 20. Offline Banner (fixed overlay — lives in #modal-root) ── */
.offline-overlay {
  position: fixed; inset: 0;
  z-index: 9990;
  display: flex; align-items: center; justify-content: center;
  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);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.offline-banner {
  background:
    linear-gradient(135deg, rgba(10, 20, 50, 0.98) 0%, rgba(5, 12, 30, 0.99) 100%);
  border: 2px solid var(--frame-bright);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
  max-width: 360px;
  width: 90%;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  box-shadow:
    0 0 40px rgba(0, 180, 255, 0.12),
    var(--shadow-lg);
  animation: screenIn var(--dur-slow) var(--ease) both;
  position: relative;
}

/* Images inside offline-banner: constrain height */
.offline-banner img {
  max-width: 100%;
  max-height: 35dvh;
  object-fit: contain;
}
/* Corner accents */
.offline-banner::before,
.offline-banner::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--accent-cyan);
  border-style: solid;
  pointer-events: none;
}
.offline-banner::before { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-radius: var(--r-lg) 0 0 0; }
.offline-banner::after  { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 var(--r-lg) 0; }

.offline-banner h3 {
  font-size: 16px; margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}
.offline-reward-row {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-size: 14px; padding: 3px 0;
}
.offline-reward-row img { width: 18px; height: 18px; object-fit: contain; }
.offline-reward-value { font-weight: 700; color: var(--accent-green); text-shadow: 0 0 6px rgba(0, 230, 118, 0.3); }

/* ─── 21. Ad Mock Buttons ──────────────────────────────────── */
.ad-section {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--frame-dim);
}

.ad-section h4 {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ad-btn-row {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
}

.ad-btn {
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.15), rgba(245, 166, 35, 0.05));
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 700;
  color: var(--accent-amber);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--dur-fast) var(--ease);
}
.ad-btn:hover {
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.25), rgba(245, 166, 35, 0.1));
  box-shadow: 0 0 14px var(--amber-glow);
}
.ad-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── 22. Connection Status ────────────────────────────────── */
.connection-bar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 300;
  background: rgba(255, 61, 61, 0.9);
  color: white;
  font-size: 12px; font-weight: 700;
  text-align: center;
  padding: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: translateY(-100%);
  transition: transform var(--dur-normal) var(--ease);
}
.connection-bar.visible { transform: translateY(0); }

/* ─── 23. Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--frame-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--frame-color); }

/* ─── 24. Responsive (portrait compact for narrow phones) ─── */
@media (max-width: 360px) {
  .resource-bar { gap: 0 2px; }
  .res-item { gap: 2px; padding: 1px; }
  .res-icon { width: 14px; height: 14px; }
  .res-value { font-size: 9px; }
  .res-rate { font-size: 7px; }
  .ticker-bar { font-size: 9px; height: 18px; }
  .bottom-nav { min-height: 36px; }
  .nav-btn { font-size: 7px; padding: 2px var(--sp-1); }
  .nav-icon-img { width: 16px; height: 16px; }
}

/* ─── 25. Debug Layout (toggled via DEBUG_LAYOUT) ─────────── */
.debug-layout .app          { outline: 2px solid red; }
.debug-layout .resource-bar { outline: 1px dashed lime; }
.debug-layout .main-content { outline: 1px dashed cyan; }
.debug-layout .bottom-nav   { outline: 1px dashed yellow; }
.debug-layout .offline-overlay { outline: 1px dashed magenta; }
.debug-layout .bottom-sheet { outline: 1px dashed orange; }

/* ─── 26. Fake Ad Overlay (mock rewarded video) ────────────── */
.fake-ad-overlay {
  position: absolute; inset: 0;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.9);
}

.fake-ad-box {
  text-align: center;
  padding: var(--sp-8);
}

.fake-ad-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  margin: 0 auto var(--sp-4);
  animation: adSpin 0.8s linear infinite;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

@keyframes adSpin {
  to { transform: rotate(360deg); }
}

.fake-ad-text {
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ad upgrade button (shown when can't afford) */
.ad-upgrade-btn {
  width: 100%;
  margin-top: var(--sp-2);
  padding: 8px 16px;
  font-size: 12px; font-weight: 700;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.15), rgba(245, 166, 35, 0.05));
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--accent-amber);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--dur-fast) var(--ease);
}
.ad-upgrade-btn:hover {
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.25), rgba(245, 166, 35, 0.1));
  box-shadow: 0 0 14px var(--amber-glow);
}

/* Video x2 button (offline + expedition) */
.video-x2-btn {
  width: 100%;
  margin-top: var(--sp-2);
  padding: 8px 16px;
  font-size: 12px; font-weight: 700;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.15), rgba(167, 139, 250, 0.05));
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--accent-purple);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--dur-fast) var(--ease);
}
.video-x2-btn:hover {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.25), rgba(167, 139, 250, 0.1));
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.25);
}

/* ─── 27. Reward VFX ───────────────────────────────────────── */
.vfx-particle {
  position: absolute;
  z-index: 100;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  pointer-events: none;
  animation: vfxParticle 0.6s ease-out forwards;
}
@keyframes vfxParticle {
  0%   { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.3); }
}

.vfx-big-number {
  position: absolute;
  z-index: 100;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 40px;
  font-weight: 900;
  color: var(--accent-green);
  text-shadow: 0 0 16px rgba(0, 230, 118, 0.6), 0 2px 6px rgba(0,0,0,0.8);
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
  animation: vfxBigNum 1.2s ease-out forwards;
}
@keyframes vfxBigNum {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30%  { transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
}

.res-bar-glow {
  animation: resBarGlow 0.8s ease-out;
}
@keyframes resBarGlow {
  0%   { box-shadow: inset 0 0 0 0 rgba(0, 229, 255, 0); }
  30%  { box-shadow: inset 0 0 24px 3px rgba(0, 229, 255, 0.3); }
  100% { box-shadow: inset 0 0 0 0 rgba(0, 229, 255, 0); }
}

/* ─── 29. Building Timers ──────────────────────────────────── */
.building-active {
  border-color: rgba(245, 166, 35, 0.4);
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.06) 0%, rgba(5, 15, 35, 0.8) 100%);
}

.building-card-timer {
  flex-shrink: 0;
  font-size: 10px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-amber);
  padding: 3px 8px;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: var(--r-sm);
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(245, 166, 35, 0.3);
}

.sheet-build-progress {
  text-align: center;
  padding: var(--sp-3);
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
}

.sheet-build-label {
  font-size: 13px; font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sheet-build-timer {
  font-size: 20px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--accent-amber);
  text-shadow: 0 0 10px rgba(245, 166, 35, 0.4);
}

/* ─── 30. Admin Screen ─────────────────────────────────────── */
.admin-screen { padding: var(--sp-4); }

.admin-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.admin-section { margin-bottom: var(--sp-4); }

.admin-section h4 {
  font-size: 12px; font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* admin: nowrap button rows, compact for portrait */
.admin-row {
  display: flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-1) 0;
  flex-wrap: nowrap;
}
.admin-row .btn-sm { padding: 3px 6px; font-size: 10px; white-space: nowrap; }

.admin-res-icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.admin-res-name { font-size: 11px; font-weight: 600; width: 50px; flex-shrink: 0; }
.admin-bld-name { font-size: 11px; font-weight: 600; width: 90px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-bld-level {
  font-size: 11px; font-weight: 800;
  color: var(--accent-cyan);
  width: 36px; flex-shrink: 0;
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.3);
}

/* ─── 31. Expedition Daily Scaling ──────────────────────────── */
.exp-daily-info {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0, 20, 50, 0.5);
  border: 1px solid var(--frame-dim);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.exp-daily-reset {
  font-size: 11px;
  color: var(--accent-amber);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 4px rgba(245, 166, 35, 0.3);
}

/* ─── 32. Reward Rows (unified icon + value) ────────────────── */
.reward-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 3px 0;
  justify-content: center;
}

.reward-icon {
  width: 20px; height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.reward-value {
  font-size: 14px; font-weight: 800;
  color: var(--accent-green);
  text-shadow: 0 0 6px rgba(0, 230, 118, 0.3);
}

/* ─── 33. Logout Button (nav) ──────────────────────────────── */
.nav-btn-logout { color: var(--accent-red); }
.nav-btn-logout:hover { color: #ff5555; text-shadow: 0 0 8px rgba(255, 61, 61, 0.4); }

/* ─── 34. Expedition Status Line (single row, nowrap, ellipsis) */
.exp-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(0, 20, 50, 0.5);
  border: 1px solid var(--frame-dim);
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.exp-status-sep {
  color: var(--frame-color);
  font-weight: 400;
}

.exp-status-line .exp-daily-reset {
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  text-shadow: 0 0 4px rgba(245, 166, 35, 0.3);
}

/* ─── 35. World Build Components (gear + progress + quick-ad) ── */
.world-build-gear {
  font-size: 10px;
  line-height: 1;
  animation: gearSpin 1.2s linear infinite;
  color: var(--accent-amber);
  filter: drop-shadow(0 0 4px rgba(245, 166, 35, 0.6));
}

@keyframes gearSpin {
  to { transform: rotate(360deg); }
}

.world-build-progress {
  flex: 1;
  height: 4px;
  background: rgba(0, 10, 30, 0.8);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.world-build-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-green));
  border-radius: 2px;
  transition: width 1s linear;
  width: 0%;
  box-shadow: 0 0 4px rgba(245, 166, 35, 0.4);
}

.world-build-ad {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-amber), #cc7a00);
  color: #1a0800;
  font-size: 7px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(245, 166, 35, 0.5);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
  transition: all 150ms ease;
  line-height: 1;
  padding: 0;
}

.world-build-ad:hover {
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.6);
  transform: scale(1.15);
}

/* ─── 28. Utility ──────────────────────────────────────────── */
.text-cyan   { color: var(--accent-cyan); }
.text-amber  { color: var(--accent-amber); }
.text-green  { color: var(--accent-green); }
.text-red    { color: var(--accent-red); }
.text-dim    { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-3 { margin-bottom: var(--sp-3); }
.fw-700 { font-weight: 700; }

/* ─── 29. PWA Install Hint (login screen) ─────────────────── */
.pwa-install-hint {
  margin-top: var(--sp-4);
  text-align: center;
}
.pwa-install-btn {
  font-size: 11px;
  padding: 6px 16px;
  opacity: 0.65;
  transition: opacity var(--dur-fast) var(--ease);
  width: 100%;
}
.pwa-install-btn:hover {
  opacity: 1;
}

/* ─── 30. PWA Standalone / Fullscreen ─────────────────────── */
/* Safe areas already in base portrait styles; standalone just goes full-width */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .app { width: 100dvw; border: none; }
}
/* iOS Safari standalone + desktop popup fallback (JS class) */
html.pwa-standalone .app { width: 100dvw; border: none; }

/* ─── 36. Fleet Screen ──────────────────────────────────────── */
.fleet-screen { padding: var(--sp-2) var(--sp-3); }

.fleet-worker-bar {
  font-size: 11px; font-weight: 600;
  color: var(--accent-blue);
  background: rgba(66,165,245,0.08);
  border: 1px solid rgba(66,165,245,0.2);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-2);
}
.fleet-worker-bar--short {
  color: var(--accent-red);
  background: rgba(255,61,61,0.08);
  border-color: rgba(255,61,61,0.2);
}

.fleet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
@media (max-width: 380px) { .fleet-grid { grid-template-columns: 1fr; } }

.fleet-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: linear-gradient(135deg, rgba(0,20,50,0.6) 0%, rgba(5,15,35,0.8) 100%);
  border: 1px solid var(--frame-dim); border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  transition: border-color var(--dur-fast) var(--ease);
}
.fleet-card:hover { border-color: var(--frame-color); box-shadow: 0 0 16px rgba(0,180,255,0.1); }

.fleet-card-header { display: flex; align-items: center; gap: var(--sp-2); }
.fleet-ship-img {
  width: 40px; height: 40px; object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(0,229,255,0.2));
  flex-shrink: 0;
}
.fleet-ship-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.fleet-ship-count { font-size: 13px; font-weight: 800; color: var(--accent-cyan); text-shadow: 0 0 6px rgba(0,229,255,0.3); }
.fleet-crew-badge { font-size: 9px; font-weight: 600; color: var(--text-dim); margin-top: 1px; }

.fleet-cost-row { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.fleet-cost-item { display: flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; }
.fleet-cost-item img { width: 14px; height: 14px; object-fit: contain; }

.fleet-build-row { display: flex; gap: var(--sp-1); }
.fleet-build-btn {
  flex: 1; padding: 4px 0;
  font-size: 11px; font-weight: 800;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(0,200,255,0.2), rgba(0,150,200,0.1));
  color: var(--accent-cyan); border: 1px solid rgba(0,200,255,0.3);
  transition: all var(--dur-fast) var(--ease);
}
.fleet-build-btn:hover {
  background: linear-gradient(180deg, rgba(0,200,255,0.3), rgba(0,150,200,0.15));
  box-shadow: 0 0 10px rgba(0,229,255,0.2);
}
.fleet-build-btn:disabled { background: var(--bg-tertiary); color: var(--text-dim); border-color: var(--frame-dim); }

/* ─── 37. Expedition Send Form (steppers) ───────────────────── */
.fleet-send-form {
  background: linear-gradient(135deg, rgba(0,20,50,0.6) 0%, rgba(5,15,35,0.8) 100%);
  border: 1px solid var(--frame-dim); border-radius: var(--r-md);
  padding: var(--sp-3); margin-bottom: var(--sp-3);
}
.fleet-stepper-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.fleet-stepper-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.fleet-stepper { display: flex; align-items: center; gap: var(--sp-2); }
.fleet-stepper-val {
  font-size: 14px; font-weight: 800; color: var(--accent-cyan);
  width: 24px; text-align: center; font-variant-numeric: tabular-nums;
}
.fleet-stepper-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, rgba(0,200,255,0.15), rgba(0,150,200,0.08));
  border: 1px solid rgba(0,200,255,0.25); border-radius: var(--r-sm);
  color: var(--accent-cyan); transition: all var(--dur-fast) var(--ease);
}
.fleet-stepper-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(0,200,255,0.25), rgba(0,150,200,0.15));
  box-shadow: 0 0 8px rgba(0,229,255,0.2);
}
.fleet-stepper-btn:disabled { color: var(--text-dim); border-color: var(--frame-dim); }

.fleet-scale-preview {
  font-size: 11px; font-weight: 700;
  color: var(--accent-amber); text-shadow: 0 0 6px rgba(245,166,35,0.3);
  text-align: center; margin-top: var(--sp-1); padding: var(--sp-1) 0;
  border-top: 1px solid var(--frame-dim);
}

/* ─── 38. Expedition List Rows ──────────────────────────────── */
.fleet-exp-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.fleet-exp-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px;
}
.fleet-exp-row { border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); }
.fleet-exp-row--running {
  background: linear-gradient(135deg, rgba(0,30,70,0.6), rgba(5,15,35,0.8));
  border: 1px solid rgba(0,200,255,0.2);
}
.fleet-exp-row--finished {
  background: linear-gradient(135deg, rgba(0,40,20,0.5), rgba(5,15,35,0.8));
  border: 1px solid rgba(0,230,118,0.25);
}
.fleet-exp-ships { display: flex; gap: var(--sp-2); font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.fleet-exp-timer {
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--accent-cyan); text-shadow: 0 0 6px rgba(0,229,255,0.3);
  margin-top: 2px;
}
.fleet-exp-action-row { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); }

/* ─── 39. Desktop App-Mode Phone Frame ──────────────────────── */
/* Applied via JS when running as desktop PWA / popup (body.appmode-desktop)    */
/* Overrides the pwa-standalone 100dvw rule and constrains to phone dimensions. */

body.appmode-desktop {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
}

/* Override standalone rules (100dvw) — keep phone width on desktop */
body.appmode-desktop .app,
html.pwa-standalone body.appmode-desktop .app {
  width: 430px !important;
  max-width: 430px !important;
  height: min(932px, 100dvh) !important;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0,200,255,0.08), 0 0 60px rgba(0,0,0,0.9);
}

/* ─── 40. Nav SVG icons ─────────────────────────────────────── */
.nav-icon-svg {
  width: 20px; height: 20px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ─── 40. Fleet-Gated Nav Buttons ───────────────────────────── */
.nav-btn--gated {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

/* ─── 41. Expedition-ready Nav Badge ────────────────────────── */
.nav-btn { position: relative; }
.nav-badge {
  position: absolute;
  top: 5px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 6px rgba(0,230,118,0.8);
  pointer-events: none;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.7; }
}

/* ─── 42. Expedition Ship Labels & Availability Pill ──────── */
.exp-ship-label {
  display: flex; align-items: center; gap: var(--sp-1);
}
.exp-ship-thumb {
  width: 28px; height: 28px; object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(0,229,255,0.25));
  flex-shrink: 0;
}
.exp-avail-pill {
  font-size: 10px; font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0,200,255,0.12);
  border: 1px solid rgba(0,200,255,0.25);
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.5;
}
.exp-ship-thumb-sm {
  width: 18px; height: 18px; object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 0 2px rgba(0,229,255,0.2));
}
.exp-sep { color: var(--text-dim); font-size: 10px; margin: 0 2px; }
