/* Rogue Aliens: Intergalactic Fugitive — UI stylesheet */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.35);
  --danger: #ff4455;
  --gold: #ffd54a;
  --panel: rgba(6, 12, 20, 0.72);
  --panel-border: rgba(0, 229, 255, 0.28);
}

html, body { width: 100%; height: 100%; overflow: hidden; background: #000000; }

/* ================= Star canvas ================= */
#star-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

body {
  font-family: "Segoe UI", "Arial", sans-serif;
  color: #c8eeff;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; z-index: 1; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

/* ================= Screens ================= */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(4, 6, 8, 0.88) 0%, rgba(0, 0, 0, 0.97) 100%);
  z-index: 40;
  padding: 30px;
  text-align: center;
  pointer-events: auto;
}
.screen.translucent { background: rgba(2, 5, 10, 0.6); backdrop-filter: blur(3px); }

.menu-title h1 {
  font-size: clamp(38px, 7vw, 72px);
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 24px var(--accent), 0 0 60px rgba(0, 229, 255, 0.4);
  font-weight: 800;
}
.menu-title h2 {
  font-size: clamp(14px, 2vw, 22px);
  letter-spacing: 0.55em;
  color: var(--accent);
  margin-top: 6px;
  font-weight: 400;
}

.screen-title {
  font-size: 34px; letter-spacing: 0.3em; color: #fff;
  text-shadow: 0 0 18px var(--accent-dim);
}
.danger-text { color: var(--danger); text-shadow: 0 0 24px rgba(255, 68, 85, 0.6); }
.accent-text { color: var(--accent); text-shadow: 0 0 24px var(--accent-dim); }

.menu-buttons { display: flex; flex-direction: column; gap: 12px; min-width: 320px; margin-top: 10px; }

.menu-btn {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: #dffef5;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.22em;
  padding: 14px 34px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.menu-btn:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
  transform: translateX(4px);
}
.menu-btn.danger { border-color: rgba(255, 68, 85, 0.4); }
.menu-btn.danger:hover { background: rgba(255, 68, 85, 0.12); border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 68, 85, 0.3); }
.menu-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
/* Anchor tags used as menu buttons need block display to fill the flex column */
a.menu-btn { display: block; }

/* ---- Menu wallet bar (top-right of main menu) ---- */
#menu-wallet-bar {
  position: absolute; top: 18px; right: 20px;
  display: flex; align-items: center; gap: 8px;
  z-index: 10;
}
#mwb-disconnected, #mwb-picker, #mwb-connected {
  display: flex; align-items: center; gap: 8px;
}
.mwb-btn {
  font-family: inherit; font-size: 10px; letter-spacing: 0.22em;
  padding: 6px 14px; cursor: pointer;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--accent); border-radius: 3px;
  text-transform: uppercase; white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}
.mwb-btn:hover { background: rgba(0, 229, 255, 0.14); box-shadow: 0 0 10px rgba(0, 229, 255, 0.2); }
.mwb-btn-dim { color: rgba(180, 230, 255, 0.45); border-color: rgba(180, 230, 255, 0.2); background: transparent; }
.mwb-btn-dim:hover { color: rgba(180, 230, 255, 0.7); background: rgba(180, 230, 255, 0.05); box-shadow: none; }
#mwb-display-name {
  font-size: 11px; letter-spacing: 0.18em; color: var(--accent);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.menu-foot, .screen-foot { position: absolute; bottom: 52px; font-size: 12px; letter-spacing: 0.3em; color: rgba(180, 230, 255, 0.4); }

/* ---- Site-wide footer ---- */
.site-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px 18px;
  padding: 8px 20px;
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  background: rgba(0, 0, 0, 0.45);
  font-size: 10px; letter-spacing: 0.16em; color: rgba(180, 230, 255, 0.3);
  pointer-events: auto;
}
.site-footer-copy { white-space: nowrap; }
.site-footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.site-footer-links a {
  color: rgba(0, 229, 255, 0.4); text-decoration: none;
  letter-spacing: 0.16em; font-size: 10px;
  transition: color 0.15s;
}
.site-footer-links a:hover { color: var(--accent); }

/* Settings */
.settings-grid {
  display: grid; grid-template-columns: 220px 280px; gap: 20px 24px;
  align-items: center; background: var(--panel); border: 1px solid var(--panel-border); padding: 30px 40px;
}
.settings-grid label { text-align: right; letter-spacing: 0.15em; font-size: 13px; color: var(--accent); }
.settings-grid input[type=range] { accent-color: var(--accent); height: 22px; }
#quality-buttons { display: flex; gap: 8px; }
#quality-buttons button {
  flex: 1; background: transparent; border: 1px solid var(--panel-border); color: #c8eeff;
  padding: 8px 0; cursor: pointer; font-family: inherit; letter-spacing: 0.1em; font-size: 12px;
}
#quality-buttons button.active { background: rgba(0, 229, 255, 0.18); border-color: var(--accent); color: #fff; }

/* How to play */
#howto-body {
  max-height: 70vh; overflow-y: auto; padding-right: 8px;
  display: flex; flex-direction: column; gap: 28px;
}
.howto-section-title {
  font-size: 10px; letter-spacing: 0.35em; color: var(--accent);
  margin-bottom: 12px; border-bottom: 1px solid var(--panel-border); padding-bottom: 6px;
}
.howto-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 10px 28px; background: var(--panel); border: 1px solid var(--panel-border); padding: 22px 28px; font-size: 13px; text-align: left; }
.howto-text { max-width: 720px; line-height: 1.7; font-size: 13px; color: rgba(180, 230, 255, 0.85); }
.howto-booster-list { display: flex; flex-direction: column; gap: 10px; }
.howto-booster-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--panel); border: 1px solid var(--panel-border); padding: 12px;
}
.howto-booster-row img {
  width: 52px; height: 52px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--panel-border);
}
.howto-booster-row div {
  font-size: 12px; line-height: 1.6; color: rgba(180, 230, 255, 0.85);
  padding-top: 2px;
}
.howto-booster-row b { color: #fff; letter-spacing: 0.05em; }
.key {
  display: inline-block; background: rgba(0, 229, 255, 0.12); border: 1px solid var(--panel-border);
  border-radius: 4px; padding: 2px 9px; margin-right: 8px; font-size: 12px; color: var(--accent);
  letter-spacing: 0.08em; font-weight: 600;
}

/* Leaderboard */
/* The banner image sets the width — all table content matches it */
#leaderboard-content { display: flex; flex-direction: column; align-items: center; gap: 0; }
#leaderboard-banner-wrap { width: min(820px, 94vw); }
#leaderboard-default-banner { width: 100%; height: auto; display: block; }
#leaderboard-month { width: min(820px, 94vw); letter-spacing: 0.3em; color: var(--gold); font-size: 14px; padding: 10px 0 6px; }
#leaderboard-list { width: min(820px, 94vw); max-height: 55vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--panel-border); }
.lb-row { display: grid; grid-template-columns: 46px 1fr 100px 1fr 90px; padding: 8px 18px; font-size: 14px; border-bottom: 1px solid rgba(0, 229, 255, 0.08); text-align: left; align-items: center; }
.lb-row .lb-boosters { display: flex; width: 100%; gap: 3px; align-items: center; justify-content: center; flex-wrap: nowrap; }
.lb-perm-icon { width: 20px; height: 20px; border-radius: 3px; object-fit: cover; border: 1px solid rgba(0,229,255,0.3); flex-shrink: 0; }
.lb-row.lb-head { color: var(--accent); font-size: 11px; letter-spacing: 0.2em; padding: 10px 18px; }
.lb-row .lb-score { text-align: right; color: var(--gold); }
.lb-row .lb-world { text-align: right; color: rgba(180,230,255,0.7); }
.lb-loading { padding: 30px; letter-spacing: 0.25em; color: rgba(180, 230, 255, 0.5); font-size: 13px; text-align: center; }
.lb-row.lb-first { background: rgba(255, 213, 74, 0.06); border-left: 2px solid var(--gold); }
.lb-row.lb-first .lb-rank { color: var(--gold); font-weight: 700; }
/* Connected player self-highlight */
.lb-row.lb-me { background: rgba(0, 229, 255, 0.08); border-left: 2px solid var(--accent); }
.lb-row.lb-me .lb-rank { color: var(--accent); font-weight: 700; }
.lb-row.lb-me .lb-name-text { color: var(--accent); font-weight: 700; }
/* Name cell: flex row with avatar + text */
.lb-name { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.lb-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
/* Circular avatar — shown for every row */
.lb-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(0,229,255,0.22); background: rgba(0,229,255,0.07); }
/* SVG placeholder when no PFP is set */
.lb-avatar-ph { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,229,255,0.18); background: rgba(0,229,255,0.07); display: flex; align-items: center; justify-content: center; }
.lb-addr { font-size: 11px; color: rgba(180, 230, 255, 0.45); margin-left: 7px; letter-spacing: 0.05em; }

/* Shop */
#shop-header {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 4px;
}
/* Entry button (disconnected, before picker expands) */
.shop-wallet-btn {
  font-size: 13px !important; padding: 10px 22px !important;
  border-color: rgba(255, 213, 74, 0.5) !important; color: var(--gold) !important;
  letter-spacing: 0.2em !important;
}
/* Picker row — two sub-options */
#shop-connect-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.shop-wc-btn {
  font-size: 11px !important; padding: 10px 18px !important;
  border-color: rgba(180, 230, 255, 0.25) !important;
  color: rgba(180, 230, 255, 0.55) !important;
  letter-spacing: 0.15em !important;
}
.shop-wc-btn:hover {
  border-color: rgba(180, 230, 255, 0.5) !important;
  color: rgba(180, 230, 255, 0.85) !important;
}
/* Connected row */
#shop-connected-row {
  display: flex; align-items: center; gap: 20px;
}
#shop-address {
  font-size: 12px; letter-spacing: 0.18em; color: var(--accent);
  border: 1px solid rgba(62, 230, 196, 0.35); padding: 10px 18px;
  background: rgba(62, 230, 196, 0.06);
}
#shop-obs-balance {
  font-size: 13px; letter-spacing: 0.2em; color: var(--gold);
  border: 1px solid rgba(255, 213, 74, 0.35); padding: 10px 18px;
  background: rgba(255, 213, 74, 0.06);
}
#shop-obs-amount { font-weight: 700; font-size: 15px; }
.shop-disconnect-btn {
  font-size: 10px !important; padding: 8px 14px !important;
  border-color: rgba(255, 80, 80, 0.35) !important; color: rgba(255, 120, 120, 0.7) !important;
  letter-spacing: 0.2em !important;
}
.shop-disconnect-btn:hover {
  border-color: rgba(255, 80, 80, 0.7) !important; color: rgba(255, 150, 150, 1) !important;
}
#shop-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--panel-border); margin-bottom: 12px;
}
.shop-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: rgba(180, 230, 255, 0.5); font-family: inherit; font-size: 13px;
  letter-spacing: 0.25em; padding: 10px 28px; cursor: pointer;
  transition: all 0.15s; text-transform: uppercase;
}
.shop-tab:hover { color: #fff; }
.shop-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.shop-tab-panel { overflow-y: auto; max-height: 55vh; }
#shop-perm-grid, #shop-temp-grid {
  display: grid; grid-template-columns: repeat(3, 240px); gap: 14px; padding: 4px;
}
/* ---- booster item image ---- */
.shop-item-img {
  width: 100%; aspect-ratio: 1; overflow: hidden; margin-bottom: 10px;
  border: 1px solid var(--panel-border);
}
.shop-item-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.shop-item.owned .shop-item-img { border-color: var(--gold); }
.shop-item.locked .shop-item-img { filter: grayscale(0.7); }

/* ---- loadout row image ---- */
.loadout-row-img {
  width: 48px; height: 48px; object-fit: cover;
  border: 1px solid var(--panel-border); flex-shrink: 0;
}
.loadout-row-locked .loadout-row-img { filter: grayscale(1); }

/* ---- HUD booster slot image ---- */
.bs-img {
  display: block; width: 28px; height: 28px; object-fit: cover;
  margin: 2px auto 3px; border: 1px solid rgba(255,255,255,0.1);
}

.shop-item {
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 16px; text-align: left; position: relative;
}
.shop-item.locked { opacity: 0.5; pointer-events: none; }
.shop-item.owned { border-color: var(--gold); }
.shop-item h4 { font-size: 13px; letter-spacing: 0.12em; color: #fff; margin-bottom: 5px; }
.shop-item .shop-category { font-size: 10px; letter-spacing: 0.25em; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; }
.shop-item p { font-size: 12px; color: rgba(180, 230, 255, 0.75); line-height: 1.5; min-height: 32px; }
.shop-item .shop-price { margin-top: 10px; font-size: 12px; color: var(--gold); letter-spacing: 0.15em; }
.shop-item .shop-owned-tag { font-size: 10px; color: var(--gold); letter-spacing: 0.2em; margin-top: 6px; display: block; }
.shop-item .shop-req { font-size: 11px; color: #ff8866; margin-top: 4px; display: block; }
.shop-item .shop-buy-btn {
  margin-top: 10px; width: 100%; background: transparent;
  border: 1px solid var(--panel-border); color: #c8eeff;
  font-family: inherit; font-size: 11px; letter-spacing: 0.15em;
  padding: 7px 0; cursor: pointer; transition: all 0.15s; text-transform: uppercase;
}
.shop-item .shop-buy-btn:hover { background: rgba(0, 229, 255, 0.12); border-color: var(--accent); }
.shop-item .shop-qty { font-size: 13px; color: #fff; font-weight: 700; margin-top: 8px; letter-spacing: 0.1em; }
.shop-section-label {
  grid-column: 1 / -1; font-size: 11px; letter-spacing: 0.35em; color: var(--accent);
  padding: 14px 4px 4px; border-bottom: 1px solid var(--panel-border); margin-bottom: 2px;
}
.shop-partner-block {
  grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--panel-border);
  padding: 18px 22px; color: rgba(180, 230, 255, 0.5); font-size: 13px; letter-spacing: 0.15em;
  text-align: center;
}
/* Partner subheader under section label */
.shop-partner-sub {
  font-size: 11px; letter-spacing: 0.08em; color: rgba(180,230,255,0.55);
  text-transform: none; font-weight: 400; margin-top: 2px;
}
/* Empty state placeholder */
.shop-partner-empty {
  grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--panel-border);
  padding: 28px 22px; text-align: center;
}
.shop-partner-empty-title {
  font-size: 12px; letter-spacing: 0.3em; color: rgba(180,230,255,0.45); margin-bottom: 8px;
}
.shop-partner-empty-sub {
  font-size: 11px; letter-spacing: 0.1em; color: rgba(180,230,255,0.3);
}
/* Active partner row */
.shop-partner-row {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 14px 18px; flex-wrap: wrap;
}
.shop-partner-logo-wrap {
  width: 48px; height: 48px; flex-shrink: 0;
  background: rgba(0,0,0,0.3); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.shop-partner-logo { width: 40px; height: 40px; object-fit: contain; }
.shop-partner-name {
  flex: 1; min-width: 120px; font-size: 13px; letter-spacing: 0.15em;
  color: #fff; font-weight: 700;
}
.shop-partner-items { display: flex; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.shop-partner-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--panel-border);
  padding: 10px 14px; min-width: 130px;
}
.shop-partner-item-label {
  font-size: 9px; letter-spacing: 0.3em; color: var(--accent); text-transform: uppercase;
}
.shop-partner-item-price { font-size: 11px; color: var(--gold); letter-spacing: 0.12em; }

/* Loadout */
#screen-loadout { overflow-y: auto; justify-content: flex-start; padding-top: 40px; }
#loadout-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  width: min(860px, 92vw); max-height: calc(100vh - 160px); overflow-y: auto;
}
.loadout-section {
  background: var(--panel); border: 1px solid var(--panel-border); padding: 18px 20px;
}
.loadout-section-title {
  font-size: 10px; letter-spacing: 0.35em; color: var(--accent);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--panel-border);
}
.loadout-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid rgba(0, 229, 255, 0.06);
  gap: 10px;
}
.loadout-row:last-child { border-bottom: none; }
.loadout-row-info { flex: 1; }
.loadout-row-name { font-size: 13px; color: #fff; letter-spacing: 0.08em; }
.loadout-row-desc { font-size: 11px; color: rgba(180, 230, 255, 0.6); margin-top: 2px; }
.loadout-row-qty { font-size: 13px; color: var(--gold); font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; }
.loadout-row-locked { opacity: 0.38; }
.loadout-row-locked .loadout-row-name { color: rgba(180, 230, 255, 0.55); }
.loadout-locked-label { font-size: 10px; letter-spacing: 0.25em; color: rgba(180, 230, 255, 0.4); border: 1px solid rgba(180, 230, 255, 0.18); padding: 5px 10px; white-space: nowrap; }
.loadout-empty { font-size: 12px; color: rgba(180, 230, 255, 0.35); letter-spacing: 0.2em; padding: 10px 0; }
.loadout-toggle {
  background: transparent; border: 1px solid var(--panel-border); color: #c8eeff;
  font-family: inherit; font-size: 10px; letter-spacing: 0.15em; padding: 6px 12px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; text-transform: uppercase;
}
.loadout-toggle:hover { border-color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.loadout-toggle.active { border-color: var(--gold); background: rgba(255, 213, 74, 0.12); color: var(--gold); }
.loadout-toggle.equipped { border-color: var(--accent); background: rgba(0, 229, 255, 0.15); color: var(--accent); }
.loadout-toggle.loadout-toggle-empty { opacity: 0.38; cursor: not-allowed; pointer-events: none; }
.loadout-slot-badge {
  font-size: 10px; color: rgba(180, 230, 255, 0.5); letter-spacing: 0.12em; white-space: nowrap;
}

/* Death / world complete stats */
#death-stats, #wc-stats, #victory-stats { background: var(--panel); border: 1px solid var(--panel-border); padding: 22px 44px; font-size: 15px; line-height: 2; letter-spacing: 0.08em; min-width: 380px; }
#death-stats .big, #wc-stats .big, #victory-stats .big { font-size: 30px; color: var(--gold); letter-spacing: 0.15em; }
#victory-text { max-width: 640px; line-height: 1.8; color: rgba(180, 230, 255, 0.9); }
#continue-info { letter-spacing: 0.1em; color: rgba(180, 230, 255, 0.85); line-height: 1.8; }

/* Loading screen — transparent so the Three.js starfield/planet show behind */
#loading {
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.72) 100%);
  gap: 0;
  justify-content: center;
}
#loading-ui {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 32px; width: min(520px, 82vw);
}
#loading-bar-track {
  width: 100%; height: 3px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.22);
  position: relative; overflow: hidden;
}
#loading-bar-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(0, 229, 255, 0.5);
  transition: width 0.35s ease-out;
}
#loading-status {
  display: flex; align-items: baseline; gap: 14px;
}
#loading-text {
  letter-spacing: 0.35em; font-size: 12px; color: var(--accent);
  animation: loading-blink 1.6s ease-in-out infinite;
}
#loading-count {
  letter-spacing: 0.2em; font-size: 11px; color: rgba(0, 229, 255, 0.45);
}
@keyframes loading-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
/* ENTER button fades in when ready */
#loading-start { animation: loading-fadein 0.7s ease-out both; margin-top: 10px; }
@keyframes loading-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* subtle scan-line overlay on the loading screen title */
#loading .menu-title { position: relative; }
#loading .menu-title::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 4px);
}

/* ================= HUD ================= */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
#hud button { pointer-events: auto; }

#wave-indicator {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  text-align: center; background: var(--panel); border: 1px solid var(--panel-border);
  padding: 8px 34px; min-width: 300px;
}
#world-name { font-size: 12px; letter-spacing: 0.35em; color: var(--accent); }
#wave-num { font-size: 20px; letter-spacing: 0.25em; color: #fff; font-weight: 700; margin: 2px 0; }
#area-name { font-size: 11px; letter-spacing: 0.25em; color: rgba(180, 230, 255, 0.65); }

#score-display {
  position: absolute; top: 18px; right: 22px;
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 10px 22px; font-size: 13px; letter-spacing: 0.25em; color: var(--accent);
}
#score-value { color: var(--gold); font-size: 19px; font-weight: 700; margin-left: 10px; }

#task-panel {
  position: absolute; right: 22px; top: 110px; width: 270px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-right: 3px solid var(--gold);
  padding: 14px 18px; text-align: left;
}
.panel-title { font-size: 10px; letter-spacing: 0.35em; color: var(--accent); margin-bottom: 8px; }
#task-image {
  width: 100%; height: 72px; margin-bottom: 10px;
  border: 1px solid var(--panel-border);
  overflow: hidden; display: block;
}
#task-name { font-size: 14px; color: #fff; line-height: 1.5; }
#task-progress { font-size: 13px; color: var(--gold); margin-top: 6px; letter-spacing: 0.1em; }
#task-enemies { font-size: 12px; color: var(--danger); margin-top: 8px; letter-spacing: 0.12em; }

#health-wrap {
  position: absolute; left: 22px; bottom: 24px; width: 300px;
  background: var(--panel); border: 1px solid var(--panel-border); padding: 12px 16px;
}
#health-bar { display: flex; gap: 3px; height: 16px; }
#health-bar .seg { flex: 1; background: var(--accent); box-shadow: 0 0 8px rgba(0, 229, 255, 0.5); transition: background 0.2s, opacity 0.2s; }
#health-bar .seg.empty { background: rgba(255, 255, 255, 0.07); box-shadow: none; }
#health-wrap.low #health-bar .seg { background: var(--danger); box-shadow: 0 0 10px rgba(255, 68, 85, 0.8); animation: pulse 0.8s infinite; }
#health-wrap.low #health-bar .seg.empty { background: rgba(255, 255, 255, 0.07); animation: none; }
#health-num { position: absolute; right: 16px; top: 10px; font-size: 12px; color: rgba(180, 230, 255, 0.7); letter-spacing: 0.1em; }

#powerup-indicator {
  position: absolute; right: 246px; bottom: 30px;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--gold); padding: 10px 18px;
}
#powerup-icon { font-size: 24px; }
#powerup-name { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); }
#powerup-timer { font-size: 17px; color: #fff; font-weight: 700; }

#perm-booster-bar-wrap {
  position: absolute; left: 22px; bottom: 210px;
  display: flex; gap: 0; pointer-events: none;
}
#perm-booster-bar { display: flex; gap: 5px; }
.perm-slot {
  width: 32px; height: 32px; border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(8, 18, 26, 0.82);
  overflow: hidden;
}
.perm-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }

#booster-bar-wrap {
  position: absolute; left: 22px; bottom: 92px; width: 360px;
  background: var(--panel); border: 1px solid var(--panel-border); padding: 8px 12px;
}
#booster-bar-wrap .panel-title { margin-bottom: 6px; }
#booster-bar-wrap .bb-hint { color: rgba(180, 230, 255, 0.5); letter-spacing: 0.15em; }
#booster-bar { display: flex; gap: 6px; }
.booster-slot {
  position: relative; flex: 1; min-width: 0;
  background: rgba(8, 18, 26, 0.9); border: 1px solid var(--panel-border);
  color: #c8eeff; font-family: inherit; cursor: pointer;
  padding: 6px 2px 5px; text-align: center; transition: border-color 0.15s, background 0.15s;
}
.booster-slot:hover { background: rgba(0, 229, 255, 0.12); border-color: var(--accent); }
.booster-slot .bs-key {
  position: absolute; top: 2px; left: 3px; font-size: 9px;
  color: rgba(180, 230, 255, 0.55); letter-spacing: 0.05em;
}
.booster-slot .bs-icon { display: block; font-size: 18px; line-height: 1; margin: 2px 0 3px; }
.booster-slot .bs-name { display: block; font-size: 7.5px; letter-spacing: 0.04em; color: rgba(180, 230, 255, 0.75); text-transform: uppercase; }
.booster-slot .bs-count {
  position: absolute; top: 2px; right: 4px; font-size: 12px; font-weight: 700; color: #fff;
}
.booster-slot .bs-state { display: block; font-size: 8px; letter-spacing: 0.1em; color: var(--gold); min-height: 9px; margin-top: 1px; }
.booster-slot.empty { opacity: 0.4; }
.booster-slot.empty:hover { background: rgba(8, 18, 26, 0.9); border-color: var(--panel-border); }
.booster-slot.active {
  border-color: var(--gold); background: rgba(255, 213, 74, 0.14);
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.35);
}

#minimap-wrap {
  position: absolute; right: 22px; bottom: 24px; width: 200px; height: 200px;
  border-radius: 50%; border: 2px solid var(--panel-border);
  overflow: hidden; background: rgba(4, 10, 18, 0.72);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}
#minimap { width: 100%; height: 100%; }

#hud-buttons { position: absolute; left: 22px; top: 18px; display: flex; gap: 8px; }
#hud-buttons button {
  background: var(--panel); border: 1px solid var(--panel-border); color: var(--accent);
  font-family: inherit; font-size: 11px; letter-spacing: 0.15em; padding: 8px 14px; cursor: pointer;
}
#hud-buttons button:hover { background: rgba(0, 229, 255, 0.15); }
#btn-mute.muted { color: rgba(180, 230, 255, 0.35); border-color: rgba(180, 230, 255, 0.12); }

#death-note { color: rgba(180, 230, 255, 0.7); font-size: 13px; letter-spacing: 0.05em; margin: 4px 0 10px; max-width: 460px; }

#interact-prompt {
  position: absolute; left: 50%; bottom: 32%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--gold);
  padding: 10px 22px; font-size: 14px; letter-spacing: 0.1em; color: #fff;
  box-shadow: 0 0 20px rgba(255, 213, 74, 0.25);
}
#interact-prompt .key { border-color: var(--gold); color: var(--gold); }

#channel-wrap { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); width: 320px; text-align: center; }
#channel-label { font-size: 12px; letter-spacing: 0.25em; color: var(--gold); margin-bottom: 6px; }
#channel-bar { height: 10px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--gold); }
#channel-fill { height: 100%; width: 0%; background: var(--gold); box-shadow: 0 0 12px rgba(255, 213, 74, 0.7); transition: width 0.1s linear; }

#boss-bar-wrap { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); width: min(620px, 70vw); text-align: center; }
#boss-name { font-size: 16px; letter-spacing: 0.4em; color: var(--danger); text-shadow: 0 0 14px rgba(255, 68, 85, 0.6); margin-bottom: 6px; }
#boss-bar { height: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 68, 85, 0.5); }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff2233, #ff7755); box-shadow: 0 0 16px rgba(255, 68, 85, 0.6); transition: width 0.15s; }
#boss-phase { font-size: 10px; letter-spacing: 0.3em; color: rgba(255, 120, 100, 0.9); margin-top: 5px; }

#crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.ch-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
#crosshair::before, #crosshair::after {
  content: ""; position: absolute; background: rgba(0, 229, 255, 0.8);
}
#crosshair::before { width: 1.5px; height: 18px; left: 1.5px; top: -24px; box-shadow: 0 42px 0 rgba(0, 229, 255, 0.8); }
#crosshair::after { width: 18px; height: 1.5px; top: 1.5px; left: -24px; box-shadow: 42px 0 0 rgba(0, 229, 255, 0.8); }

#hitmarker {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(45deg);
  width: 22px; height: 22px; border: 2px solid #fff; border-radius: 2px;
  opacity: 0.9; pointer-events: none;
}

#damage-vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 20, 40, 0.55) 100%);
  transition: opacity 0.12s;
}

#wave-banner {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  font-size: 42px; letter-spacing: 0.4em; color: #fff; font-weight: 800;
  text-shadow: 0 0 30px var(--accent), 0 0 60px rgba(0, 229, 255, 0.4);
  animation: bannerIn 0.5s ease-out;
  text-align: center; white-space: nowrap;
}
#wave-banner .sub { display: block; font-size: 15px; letter-spacing: 0.35em; color: var(--gold); font-weight: 400; margin-top: 10px; }
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) scale(1.3); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

#pickup-toast {
  position: absolute; left: 50%; bottom: 42%; transform: translateX(-50%);
  font-size: 15px; letter-spacing: 0.2em; color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 213, 74, 0.8);
  animation: toastUp 1.6s ease-out;
}
@keyframes toastUp { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px); } }

/* ---- Guest mode HUD banner ---- */
#guest-hud-banner {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  background: rgba(4, 10, 18, 0.9); border-bottom: 1px solid rgba(0,229,255,0.18);
  padding: 7px 18px; pointer-events: none; z-index: 50;
}
#guest-banner-text {
  font-size: 11px; letter-spacing: 0.2em; color: rgba(180,230,255,0.85);
}
.guest-banner-key {
  font-size: 11px; letter-spacing: 0.15em; color: var(--accent);
  display: flex; align-items: center; gap: 5px;
}
.guest-banner-key kbd {
  font-family: inherit; font-size: 11px; letter-spacing: 0.2em;
  background: rgba(0,229,255,0.12); border: 1px solid var(--accent);
  color: var(--accent); padding: 2px 8px;
}

/* ---- Partner tournament banner on leaderboard ---- */
#leaderboard-tournament-banner {
  width: min(820px, 94vw);
  min-height: 100px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(0,229,255,0.06); border: 1px solid rgba(0,229,255,0.2);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  padding: 16px 24px;
  position: relative;
}
.lb-tournament-row { display: flex; align-items: center; gap: 14px; }
#leaderboard-tournament-banner img {
  width: 48px; height: 48px; object-fit: contain;
}
.lb-tournament-name {
  font-size: 20px; letter-spacing: 0.25em; color: #fff; font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.lb-tournament-label {
  font-size: 10px; letter-spacing: 0.35em; color: var(--accent);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

#hud-blackout { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#blind-overlay { position: absolute; inset: 0; background: #d8ffe8; opacity: 0; pointer-events: none; transition: opacity 0.4s; }

#music-notify {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-size: 18px; letter-spacing: 0.35em; color: var(--accent);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.8);
  background: rgba(4, 10, 18, 0.75); border: 1px solid var(--panel-border);
  padding: 10px 28px; pointer-events: none;
  white-space: nowrap;
}
#music-notify.music-notify-fade { animation: musicNotifyFade 2s ease-out forwards; }
@keyframes musicNotifyFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ================= Map overlay ================= */
#map-overlay { z-index: 30; gap: 10px; }
#map-title { font-size: 18px; letter-spacing: 0.45em; color: var(--accent); }
#bigmap-canvas {
  width: min(70vh, 90vw); height: min(70vh, 90vw);
  border: 1px solid var(--panel-border); background: rgba(3, 8, 14, 0.9);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.1);
}
#map-hint { font-size: 13px; color: var(--gold); letter-spacing: 0.08em; max-width: 560px; min-height: 20px; }
.map-legend { display: flex; gap: 26px; font-size: 11px; letter-spacing: 0.15em; }
.lg-player { color: #00e5ff; } .lg-obj { color: var(--gold); } .lg-done { color: rgba(180,230,255,0.5); } .lg-enemy { color: var(--danger); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); }

/* ================= Profile screen ================= */
.profile-gate-msg, .shop-gate-msg {
  font-size: 13px; letter-spacing: 0.15em; color: rgba(180, 230, 255, 0.6);
  margin-bottom: 16px;
}
#profile-layout {
  display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap;
}
#profile-avatar-col {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 140px;
}
#profile-avatar-wrap {
  width: 120px; height: 120px; border: 1px solid var(--panel-border);
  background: var(--panel); overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
#profile-avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
#profile-avatar-img.hidden { display: none; }
#profile-avatar-placeholder {
  font-size: 10px; letter-spacing: 0.2em; color: rgba(180, 230, 255, 0.3);
}
.profile-upload-btn {
  font-size: 10px; letter-spacing: 0.2em; color: rgba(180, 230, 255, 0.6);
  border: 1px solid rgba(180, 230, 255, 0.2); padding: 7px 14px;
  cursor: pointer; transition: all 0.15s;
}
.profile-upload-btn:hover {
  border-color: var(--accent); color: var(--accent);
}
#profile-wallet-addr {
  font-size: 10px; letter-spacing: 0.15em; color: var(--accent);
  margin-top: 4px;
}
#profile-fields-col {
  display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 220px;
}
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-label {
  font-size: 10px; letter-spacing: 0.25em; color: rgba(180, 230, 255, 0.55);
}
.profile-input {
  background: var(--panel); border: 1px solid var(--panel-border);
  color: #fff; font-family: inherit; font-size: 13px; letter-spacing: 0.1em;
  padding: 10px 12px; outline: none; transition: border-color 0.15s; width: 100%;
  box-sizing: border-box;
}
.profile-input:focus { border-color: var(--accent); }
.profile-input-prefix-wrap {
  display: flex; align-items: center; border: 1px solid var(--panel-border);
  background: var(--panel); transition: border-color 0.15s;
}
.profile-input-prefix-wrap:focus-within { border-color: var(--accent); }
.profile-input-prefix {
  font-size: 13px; letter-spacing: 0.05em; color: rgba(180, 230, 255, 0.45);
  padding: 10px 0 10px 12px;
}
.profile-input-prefixed {
  border: none !important; flex: 1; background: transparent;
}
.profile-input-prefixed:focus { border: none !important; }
#profile-save-row {
  display: flex; align-items: center; gap: 14px; margin-top: 4px;
}
.profile-save-btn {
  font-size: 12px !important; padding: 10px 24px !important;
  border-color: rgba(62, 230, 196, 0.5) !important; color: var(--accent) !important;
  letter-spacing: 0.2em !important;
}
#profile-save-status {
  font-size: 11px; letter-spacing: 0.2em; color: var(--accent);
}

/* ================= Transaction status overlay ================= */
#tx-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px);
}
#tx-overlay.hidden { display: none; }
#tx-panel {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 40px 48px; min-width: 320px; max-width: 480px;
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.12);
  text-align: center;
}
#tx-icon { font-size: 32px; line-height: 1; min-height: 36px; }
#tx-title {
  font-size: 14px; letter-spacing: 0.3em; color: #fff;
  text-transform: uppercase;
}
#tx-msg {
  font-size: 12px; letter-spacing: 0.12em; color: rgba(180, 230, 255, 0.7);
  line-height: 1.6; max-width: 360px;
}
#tx-panel[data-state="pending"] #tx-title { color: var(--gold); }
#tx-panel[data-state="confirmed"] #tx-title { color: var(--accent); }
#tx-panel[data-state="failed"] #tx-title { color: var(--danger); }
#tx-hash-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.1em; color: rgba(180, 230, 255, 0.5);
}
#tx-hash-row.hidden { display: none; }
#tx-hash-link {
  color: var(--accent); font-size: 11px; letter-spacing: 0.05em;
  text-decoration: none; border-bottom: 1px solid var(--accent);
  word-break: break-all;
}
#tx-hash-link:hover { opacity: 0.8; }
/* spinner for pending state */
@keyframes tx-spin { to { transform: rotate(360deg); } }
.tx-spinner {
  width: 32px; height: 32px; border: 2px solid rgba(255,213,74,0.25);
  border-top-color: var(--gold); border-radius: 50%;
  animation: tx-spin 0.9s linear infinite;
}

/* ============================================================
   Admin Overlay
   ============================================================ */
#admin-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: #020609; color: #c8eeff;
  font-family: "Segoe UI", Arial, sans-serif; font-size: 14px;
  flex-direction: column; overflow-y: auto;
}

/* Gate */
#adm-gate {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
#adm-gate h1 { font-size: 24px; letter-spacing: .3em; color: #00e5ff; }
#adm-gate p  { font-size: 12px; letter-spacing: .15em; color: rgba(180,230,255,.55); }
#adm-gate-btn, #adm-back-gate-btn {
  font-family: inherit; font-size: 12px; letter-spacing: .2em; padding: 10px 28px;
  background: transparent; cursor: pointer;
}
#adm-gate-btn       { border: 1px solid #00e5ff; color: #00e5ff; }
#adm-gate-btn:hover { background: rgba(0,229,255,.1); }
#adm-back-gate-btn       { border: 1px solid rgba(180,230,255,.3); color: rgba(180,230,255,.5); }
#adm-back-gate-btn:hover { color: #00e5ff; border-color: #00e5ff; }

/* Shell */
#adm-shell { display: flex; flex-direction: column; min-height: 100%; width: 100%; }
#adm-topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 28px;
  border-bottom: 1px solid rgba(0,229,255,.22); background: rgba(4,8,14,.9); flex-shrink: 0;
}
#adm-topbar h1    { font-size: 14px; letter-spacing: .35em; color: #fff; }
#adm-tb-wallet    { font-size: 11px; color: #00e5ff; letter-spacing: .1em; background: rgba(0,229,255,.07); border: 1px solid rgba(0,229,255,.22); padding: 4px 12px; }
#adm-back-btn     { margin-left: auto; font-family: inherit; font-size: 11px; letter-spacing: .2em; background: transparent; border: none; color: rgba(180,230,255,.55); cursor: pointer; }
#adm-back-btn:hover { color: #00e5ff; }

#adm-tabs { display: flex; border-bottom: 1px solid rgba(0,229,255,.22); background: rgba(4,8,14,.7); flex-shrink: 0; }
.adm-tab { padding: 12px 24px; font-size: 11px; letter-spacing: .25em; cursor: pointer; border-bottom: 2px solid transparent; color: rgba(180,230,255,.55); user-select: none; }
.adm-tab:hover { color: #c8eeff; }
.adm-tab.adm-tab-active { color: #00e5ff; border-bottom-color: #00e5ff; }

#adm-content { flex: 1; padding: 28px 32px; max-width: 1100px; margin: 0 auto; width: 100%; }
.adm-section { display: none; }
.adm-section.adm-section-active { display: block; }

/* Cards */
.adm-stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.adm-stat-card { flex: 1; min-width: 160px; background: rgba(6,12,20,.85); border: 1px solid rgba(0,229,255,.22); padding: 18px 22px; }
.adm-lbl { font-size: 10px; letter-spacing: .3em; color: rgba(180,230,255,.55); margin-bottom: 6px; }
.adm-val { font-size: 26px; color: #00e5ff; font-weight: 700; }
.adm-sub { font-size: 11px; color: rgba(180,230,255,.55); margin-top: 4px; }

/* Section headings */
.adm-sh { font-size: 11px; letter-spacing: .35em; color: #00e5ff; margin-bottom: 12px; border-bottom: 1px solid rgba(0,229,255,.22); padding-bottom: 6px; }

/* Tables */
.adm-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.adm-table th { font-size: 10px; letter-spacing: .25em; color: rgba(180,230,255,.55); text-align: left; padding: 8px 12px; border-bottom: 1px solid rgba(0,229,255,.22); }
.adm-table td { padding: 9px 12px; border-bottom: 1px solid rgba(0,229,255,.06); font-size: 13px; }
.adm-table tr:hover td { background: rgba(0,229,255,.04); }

/* Buttons */
.adm-btn { font-family: inherit; font-size: 11px; letter-spacing: .2em; padding: 8px 18px; background: transparent; border: 1px solid rgba(0,229,255,.22); color: #c8eeff; cursor: pointer; }
.adm-btn:hover { border-color: #00e5ff; color: #00e5ff; }
.adm-btn-primary { border-color: #00e5ff; color: #00e5ff; }
.adm-btn-primary:hover { background: rgba(0,229,255,.1); }
.adm-btn-danger { border-color: #ff4455; color: #ff4455; }
.adm-btn-danger:hover { background: rgba(255,68,85,.1); }
.adm-btn:disabled { opacity: .4; cursor: default; }

/* Forms */
.adm-form-box { background: rgba(6,12,20,.85); border: 1px solid rgba(0,229,255,.22); padding: 20px 24px; margin-bottom: 24px; }
.adm-form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-form-row label { font-size: 10px; letter-spacing: .2em; color: rgba(180,230,255,.55); display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.adm-form-row input, .adm-sel { font-family: inherit; font-size: 13px; background: rgba(0,0,0,.4); border: 1px solid rgba(0,229,255,.22); color: #c8eeff; padding: 8px 12px; }
.adm-form-row input:focus, .adm-sel:focus { outline: none; border-color: #00e5ff; }
.adm-form-actions { margin-top: 6px; }

/* Partner card */
.adm-partner-card { background: rgba(6,12,20,.85); border: 1px solid rgba(0,229,255,.22); padding: 16px 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.adm-toggle { font-size: 10px; letter-spacing: .2em; padding: 4px 12px; border: 1px solid rgba(0,229,255,.22); cursor: pointer; background: transparent; color: rgba(180,230,255,.55); font-family: inherit; }
.adm-toggle.adm-toggle-on { border-color: #00e5ff; color: #00e5ff; background: rgba(0,229,255,.06); }

/* Item tags */
.adm-item-tag { display: inline-block; font-size: 10px; letter-spacing: .15em; padding: 3px 10px; border: 1px solid rgba(0,229,255,.22); color: rgba(180,230,255,.55); margin: 3px; }
.adm-revoke-x { cursor: pointer; color: #ff4455; margin-left: 6px; }

/* Settings rows */
.adm-settings-row { display: flex; align-items: center; gap: 20px; background: rgba(6,12,20,.85); border: 1px solid rgba(0,229,255,.22); padding: 16px 22px; margin-bottom: 12px; }
.adm-sr-lbl { font-size: 10px; letter-spacing: .3em; color: rgba(180,230,255,.55); min-width: 220px; }

/* Empty / loading */
.adm-empty   { padding: 28px; text-align: center; color: rgba(180,230,255,.55); letter-spacing: .2em; font-size: 12px; }
.adm-loading { color: rgba(180,230,255,.55); font-size: 12px; letter-spacing: .2em; padding: 20px 0; }

/* Toast */
#adm-toast {
  position: fixed; bottom: 28px; right: 28px; padding: 12px 22px;
  background: rgba(6,12,20,.95); font-size: 12px; letter-spacing: .15em;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10010;
  border: 1px solid rgba(0,229,255,.22);
}
#adm-toast.adm-toast-show  { opacity: 1; }
#adm-toast.adm-toast-ok    { border-color: #00e5ff; color: #00e5ff; }
#adm-toast.adm-toast-err   { border-color: #ff4455; color: #ff4455; }

/* Confirm dialog */
#adm-confirm { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 10020; display: none; align-items: center; justify-content: center; }
#adm-confirm.adm-confirm-open { display: flex; }
.adm-confirm-box { background: #020609; border: 1px solid rgba(0,229,255,.22); padding: 28px 36px; max-width: 420px; width: 90%; display: flex; flex-direction: column; gap: 16px; }
.adm-confirm-box strong { font-size: 13px; letter-spacing: .3em; color: #00e5ff; }
.adm-confirm-box p { font-size: 13px; color: rgba(180,230,255,.75); line-height: 1.5; }
.adm-cbtns { display: flex; gap: 10px; }

/* =============================================================================
   MOBILE — virtual gamepad, orientation overlay, responsive HUD/menus
   ============================================================================= */

/* ---- Orientation overlay — only shown by JS during gameplay in portrait ---- */
#orient-overlay {
  display: none; /* mobile.js sets display:flex when needed */
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(2, 6, 9, 0.96);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; color: #fff; text-align: center;
  font-family: var(--font, 'Rajdhani', sans-serif);
  pointer-events: all;
}
#orient-icon {
  font-size: 56px; line-height: 1;
  color: var(--accent, #00e5ff);
  animation: orient-spin 2s ease-in-out infinite;
}
@keyframes orient-spin {
  0%   { transform: rotate(0deg);   }
  40%  { transform: rotate(-90deg); }
  60%  { transform: rotate(-90deg); }
  100% { transform: rotate(-90deg); }
}
#orient-msg {
  font-size: 14px; letter-spacing: 0.35em;
  color: rgba(180, 230, 255, 0.75);
}

/* ---- Virtual gamepad container ---- */
#virtual-gamepad {
  position: fixed; inset: 0; z-index: 500;
  pointer-events: none; /* children opt in */
  touch-action: none;
}
#virtual-gamepad.hidden { display: none; }

/* ---- Joystick zones — bottom half, split 50/50 ---- */
#vg-left-zone,
#vg-right-zone {
  position: absolute; bottom: 0;
  width: 50%; height: 55%;
  pointer-events: all;
  touch-action: none;
}
#vg-left-zone  { left: 0; }
/* Right zone shrinks at the right edge to leave room for buttons */
#vg-right-zone { right: 0; padding-right: 110px; box-sizing: border-box; }

/* ---- Joystick bases (floating, repositioned on touchstart) ---- */
#vg-left-base,
#vg-right-base {
  position: absolute;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.08);
  border: 2px solid rgba(0, 229, 255, 0.25);
  opacity: 0;
  pointer-events: none;
  touch-action: none;
}

/* ---- Joystick thumbs ---- */
#vg-left-thumb,
#vg-right-thumb {
  position: absolute; top: 50%; left: 50%;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.35);
  border: 2px solid rgba(0, 229, 255, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  touch-action: none;
}

/* ---- Action buttons: horizontal row at bottom-right, order right-to-left: FIRE, JUMP, USE ---- */
#vg-buttons {
  position: absolute;
  right: 12px; bottom: 12px;
  display: flex;
  flex-direction: row-reverse; /* FIRE rightmost, then JUMP, then USE */
  align-items: flex-end;
  gap: 12px;
  pointer-events: all;
  touch-action: none;
}

/* Pause is separate — top center, never overlaps anything */
#vg-btn-pause {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  pointer-events: all;
  touch-action: none;
}

/* Mobile connect wallet button — top-right corner, shown only when guest */
#vg-btn-connect {
  position: absolute;
  top: 12px; right: 12px;
  width: auto; height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
  touch-action: none;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}

.vg-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(2, 6, 9, 0.75);
  border: 2px solid rgba(0, 229, 255, 0.4);
  color: rgba(180, 230, 255, 0.9);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  transition: background 0.1s, border-color 0.1s;
}
.vg-btn:active, .vg-btn.pressed {
  background: rgba(0, 229, 255, 0.25);
  border-color: rgba(0, 229, 255, 0.9);
}
/* Fire — biggest, most prominent */
.vg-btn-fire {
  width: 72px; height: 72px; font-size: 12px;
  border-color: rgba(255, 68, 85, 0.7); color: #ff4455;
  background: rgba(30, 4, 8, 0.8);
}
.vg-btn-fire:active { background: rgba(255, 68, 85, 0.3); border-color: #ff4455; }
.vg-btn-jump     { border-color: rgba(0, 229, 255, 0.5); }
.vg-btn-interact { border-color: rgba(255, 213, 74, 0.5); color: var(--gold, #ffd54a); }
/* Pause — small, top-center */
.vg-btn-pause {
  width: 40px; height: 40px; font-size: 14px;
  border-color: rgba(180, 230, 255, 0.25);
  background: rgba(2, 6, 9, 0.6);
}

/* ---- Mobile landscape gameplay HUD — only on narrow-height screens ---- */
/* Targets landscape phones (e.g. 844x390, 667x375). Does NOT affect desktop. */
@media (max-height: 500px) and (orientation: landscape) {

  /* Menu wallet bar: flow it below the title and above the buttons.
     align-self: flex-end pins it to the right without covering the title. */
  #menu-wallet-bar {
    position: static !important;
    order: 1;
    align-self: flex-end;
    margin: 6px 0 0 0;
  }
  .menu-title { order: 0; }
  .menu-buttons { order: 2; }
  .mwb-btn { font-size: 9px; padding: 5px 10px; letter-spacing: 0.15em; }
  #main-menu { padding-top: 10px; }

  /* All screens: allow vertical scroll, compact padding, start from top */
  .screen {
    justify-content: flex-start;
    padding: 10px 12px 80px;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 8px;
  }
  .screen-title { font-size: 20px; letter-spacing: 0.2em; }
  .menu-title h1 { font-size: clamp(22px, 5vw, 36px); }
  .menu-title h2 { font-size: 12px; }
  .menu-buttons { min-width: 240px; gap: 7px; margin-top: 4px; }
  .menu-btn { font-size: 13px; padding: 10px 24px; }
  /* Tagline: remove absolute so it flows below buttons and cannot cover SETTINGS */
  .menu-foot, .screen-foot { position: static; font-size: 9px; margin-top: 6px; text-align: center; }

  /* Shop/loadout: 2-column grids */
  .shop-grid, .upgrade-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  /* Hide keyboard-only hints */
  .key-hint, #map-hint, #booster-bar-wrap .bb-hint { display: none !important; }

  /* --- HUD gameplay elements: compact, non-overlapping --- */

  /* Wave indicator: smaller, stays top-center */
  #wave-indicator {
    padding: 4px 14px; min-width: 0;
    font-size: 9px;
  }
  #wave-num { font-size: 13px; margin: 0; }
  #world-name, #area-name { font-size: 8px; }

  /* Score: top-right, very compact */
  #score-display { padding: 5px 10px; font-size: 9px; top: 4px; right: 4px; }
  #score-value { font-size: 13px; margin-left: 6px; }

  /* HUD map/music buttons: top-left, small */
  #hud-buttons { top: 4px; left: 4px; gap: 4px; }
  #hud-buttons button { font-size: 8px; padding: 4px 8px; letter-spacing: 0.1em; }

  /* Health bar: bottom-left, narrow */
  #health-wrap { left: 4px; bottom: 4px; width: 160px; padding: 6px 10px; }
  #health-bar { height: 10px; gap: 2px; }
  #health-num { font-size: 9px; top: 6px; right: 8px; }

  /* Booster bar: above health, left side -- icon + count only, no description text */
  #booster-bar-wrap { left: 4px; bottom: 54px; width: auto; max-width: 200px; padding: 3px 6px; }
  .booster-slot { padding: 2px 3px; min-width: 30px; }
  .booster-slot .bs-icon { font-size: 14px; margin: 0; }
  /* Hide description text (bs-name) and state label to save space */
  .booster-slot .bs-name  { display: none; }
  .booster-slot .bs-state { display: none; }
  .booster-slot .bs-count { font-size: 10px; }
  .booster-slot .bs-key   { display: none; }

  /* Perm bar: above booster bar */
  #perm-booster-bar-wrap { left: 4px; bottom: 100px; }
  .perm-slot { width: 24px; height: 24px; }

  /* Task panel: top-right below score, small */
  #task-panel {
    right: 4px; top: 44px; width: 140px;
    padding: 6px 10px; font-size: 9px;
  }
  #task-image { height: 36px; margin-bottom: 5px; }
  #task-name { font-size: 10px; }
  #task-progress, #task-enemies { font-size: 9px; margin-top: 3px; }
  .panel-title { font-size: 7px; margin-bottom: 4px; }

  /* Minimap: top-left below MAP/MUSIC buttons, clears action buttons at bottom-right */
  #minimap-wrap { left: 4px; top: 44px; right: auto; bottom: auto; width: 80px; height: 80px; }

  /* Boss bar: below wave indicator, full width */
  #boss-bar-wrap { top: 52px; width: min(420px, 70vw); }
  #boss-name { font-size: 11px; letter-spacing: 0.2em; }
  #boss-bar { height: 8px; }

  /* Guest/connect wallet banner: hidden on mobile -- replaced by #vg-btn-connect */
  #guest-hud-banner { display: none !important; }

  /* Death/result screens: buttons must be tappable */
  #screen-death button,
  #screen-worldcomplete button,
  #screen-victory button,
  #screen-pause button { pointer-events: auto !important; }

  /* Footer: un-float it from bottom so it cannot cover menu buttons.
     Collapse to a single compact row below all content. */
  .site-footer {
    position: static !important;
    flex-shrink: 0;
    padding: 4px 8px;
    gap: 4px 10px;
    font-size: 8px;
    border-top: 1px solid rgba(0, 229, 255, 0.06);
    background: transparent;
    margin-top: 6px;
    order: 99;
  }
  .site-footer-copy { display: none; }
  .site-footer-links { gap: 10px; }
  .site-footer-links a { font-size: 8px; letter-spacing: 0.1em; }

  /* Leaderboard: cap banner height so content is visible */
  #leaderboard-banner-wrap { width: min(600px, 92vw); }
  #leaderboard-default-banner,
  #leaderboard-tournament-banner { max-height: 100px; object-fit: contain; }
  #leaderboard-list { max-height: 30vh; }
  #leaderboard-month { font-size: 10px; padding: 4px 0 3px; }
  .lb-row { font-size: 11px; padding: 5px 10px; }
  .lb-row.lb-head { font-size: 9px; padding: 6px 10px; }

  /* Shop: compact card layout */
  .shop-card { padding: 8px !important; }
  .shop-card-img { height: 60px !important; }

  /* Settings: sliders and quality buttons stacked */
  #quality-buttons { flex-wrap: wrap; gap: 6px !important; }
  #quality-buttons button { font-size: 10px; padding: 6px 10px !important; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 4px !important; }
}

/* Portrait mobile: wallet bar pinned top-right above title, footer collapsed below buttons. */
@media (max-width: 900px) {
  /* Menu wallet bar: flow it below the title and above the buttons.
     align-self: flex-end pins it to the right without covering the title. */
  #menu-wallet-bar {
    position: static !important;
    order: 1;
    align-self: flex-end;
    margin: 8px 0 0 0;
  }
  .menu-title { order: 0; }
  .menu-buttons { order: 2; }
  .mwb-btn { font-size: 9px; padding: 5px 10px; letter-spacing: 0.15em; }
  #main-menu { padding-top: 10px; }
  /* Tagline: remove absolute so it flows below buttons and cannot cover SETTINGS */
  .menu-foot, .screen-foot { position: static; font-size: 10px; margin-top: 8px; text-align: center; }
  .site-footer {
    position: static !important;
    flex-shrink: 0;
    padding: 6px 12px;
    gap: 4px 12px;
    font-size: 9px;
    border-top: 1px solid rgba(0, 229, 255, 0.06);
    background: transparent;
    margin-top: 8px;
    order: 99;
  }
  .site-footer-copy { display: none; }
  .site-footer-links { gap: 12px; }
  .site-footer-links a { font-size: 9px; letter-spacing: 0.1em; }
}
