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

/* Crawlable text for SEO, visually hidden (not display:none, so search engines still read it) */
.seo-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  background: #0d0d0d;
  color: #fff;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

#topBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #2a1a3a, #1a0d2b);
  border-bottom: 1px solid #9b30ff;
  color: #9b30ff;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 12px;
  text-decoration: none;
  display: block;
  pointer-events: auto;
  transition: background 0.2s;
}
#topBanner:hover {
  background: linear-gradient(90deg, #2e1a3a, #221233);
  color: #c77dff;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

@keyframes arcadeGlow {
  0%, 100% { text-shadow: 0 0 3px #b14fff, 0 0 8px #b14fff99; }
  50%       { text-shadow: 0 0 2px #b14fff, 0 0 5px #b14fff55; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Menu ── */
#menu {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(6, 10, 6, 0.96);
  border: 2px solid #b14fff;
  box-shadow: 0 0 0 1px #0d0d0d, 0 0 24px #b14fff44, inset 0 0 40px rgba(0,0,0,0.6);
  padding: 28px 56px 26px;
  border-radius: 4px;
  pointer-events: all;
  width: min(660px, calc(100vw - 24px));
  max-width: 800px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

#menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  border-radius: inherit;
}

#arcadeTitle {
  display: block;
  max-width: 440px;
  width: 80%;
  height: auto;
  margin: 0 auto 16px;
  animation: arcadeGlow 2.4s ease-in-out infinite;
}

.subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.44rem;
  color: #5c3a6e;
  letter-spacing: 1px;
  margin-bottom: 32px;
}

/* ── Event banner ── */
@keyframes bannerPulse {
  0%, 100% { border-color: #ffd70066; box-shadow: 0 0 8px #ffd70044; }
  50%       { border-color: #ffd700cc; box-shadow: 0 0 16px #ffd70099; }
}

#eventBanner {
  display: block;
  text-decoration: none;
  border: 1px solid #ffd70088;
  border-radius: 3px;
  background: rgba(10, 12, 10, 0.85);
  padding: 12px 14px 10px;
  margin-bottom: 14px;
  animation: bannerPulse 2.6s ease-in-out infinite;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
#eventBanner:hover {
  border-color: #ffd700cc;
  background: rgba(20, 18, 5, 0.92);
}
.eb-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.44rem;
  color: #ffd700;
  letter-spacing: 1px;
  margin-top: 8px;
  opacity: 0.75;
}

.eb-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #ffd700;
  letter-spacing: 1px;
  margin-bottom: 7px;
  text-shadow: 0 0 4px #ffd70088;
}

.eb-date {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 7px;
}

.eb-sub {
  font-size: 0.72rem;
  color: #cccccc;
  letter-spacing: 0.5px;
}

#faucetBanner {
  border: 1px solid #b14fff88;
  border-radius: 3px;
  background: rgba(6, 14, 8, 0.88);
  padding: 12px 14px 10px;
  margin-bottom: 14px;
  animation: bannerPulse 3.2s ease-in-out infinite;
}

.fb-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #b14fff;
  letter-spacing: 1px;
  margin-bottom: 7px;
  text-shadow: 0 0 4px #b14fff88;
}

.fb-date {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 7px;
}

.fb-remaining {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.56rem;
  color: #b14fff;
  letter-spacing: 1px;
  margin-bottom: 7px;
  text-shadow: 0 0 6px #b14fff66;
}

.fb-sub {
  font-size: 0.72rem;
  color: #c9aadd;
  letter-spacing: 0.5px;
}

/* ── Customize screen ── */
#customizeScreen {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(6, 10, 6, 0.96);
  border: 2px solid #b14fff;
  box-shadow: 0 0 0 1px #0d0d0d, 0 0 24px #b14fff44, inset 0 0 40px rgba(0,0,0,0.6);
  padding: 40px 44px 32px;
  border-radius: 4px;
  pointer-events: all;
  min-width: 300px;
}

.cs-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: #b14fff;
  margin-bottom: 20px;
  animation: arcadeGlow 2.4s ease-in-out infinite;
}

#previewCanvas {
  display: block;
  width: 100%;
  height: 150px;
  border-radius: 6px;
  background: #09070e;
  border: 1px solid #241a2e;
  margin-bottom: 24px;
}

.cs-section {
  margin-bottom: 28px;
}

.cs-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: #5c3a6e;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.cp-swatches {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cp-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  outline: none;
  pointer-events: all;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}

.cp-swatch:hover { transform: scale(1.15); }
.cp-swatch.selected {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

.hc-swatch, .bc-locked, .sg-swatch, .helmet-swatch { position: relative; }
.hc-swatch.hc-locked::after, .bc-locked::after, .sg-swatch.sg-locked::after, .helmet-swatch.helmet-locked::after {
  content: '🔒';
  position: absolute;
  font-size: 13px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  line-height: 1;
}

.shape-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.shape-btn {
  position: relative;
  width: 84px;
  padding: 12px 0 10px;
  border-radius: 8px;
  border: 2px solid #2a1a3a;
  background: #09070e;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  pointer-events: all;
}
.shape-btn:hover {
  border-color: #b14fff;
  background: #150a1a;
  transform: scale(1.04);
}
.shape-btn.selected {
  border-color: #b14fff;
  background: #1a0d20;
  box-shadow: 0 0 12px rgba(177,79,255,0.25);
}
.shape-btn.locked::after {
  content: '🔒';
  position: absolute;
  top: 5px; right: 6px;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}
.shape-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: #b14fff;
}
.shape-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.3rem;
  letter-spacing: 0.5px;
  color: #5c3a6e;
}
.shape-btn:hover .shape-label,
.shape-btn.selected .shape-label { color: #b14fff; }

.sg-none {
  background: #0d0d0d;
  color: #555;
  font-size: 1.1rem;
  border: 2px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-none.selected { border-color: #fff; color: #fff; }

.cp-swatches { flex-wrap: wrap; }

#hcModal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(4, 10, 6, 0.95);
  border: 1px solid #ffd70066;
  padding: 40px 44px;
  border-radius: 4px;
  pointer-events: all;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.15);
  min-width: 300px;
  max-width: 420px;
}
#hcPayBtn, #hcCopyBtn, #hcBackBtn {
  display: block;
  margin: 10px auto;
  padding: 12px 28px;
  background: none;
  border: 1px solid #ffd700;
  border-radius: 4px;
  color: #ffd700;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}
#hcPayBtn:hover, #hcCopyBtn:hover { background: rgba(255,215,0,0.1); }
#hcBackBtn { border-color: #444; color: #888; margin-top: 18px; }
#hcBackBtn:hover { background: rgba(255,255,255,0.05); }
#hcInvoiceQR { display: flex; justify-content: center; margin: 14px 0 10px; }
#hcInvoiceText {
  font-size: 0.32rem;
  color: #555;
  word-break: break-all;
  max-width: 300px;
  margin: 0 auto 10px;
  line-height: 1.6;
}
#hcMsg { font-size: 0.5rem; color: #ff6b6b; margin-top: 10px; min-height: 14px; }

.name-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #b14fff;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 6px;
  opacity: 0.8;
}

#nameInput {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #0b080e;
  border: 2px solid #7a4a9a;
  border-radius: 2px;
  color: #b14fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  outline: none;
  letter-spacing: 1px;
  text-align: center;
  caret-color: #b14fff;
  border-color: #ffd70088;
  box-shadow: 0 0 8px #ffd70044;
  animation: bannerPulse 2.6s ease-in-out infinite;
}

#nameInput::placeholder { color: #6a4a8a; }
#nameInput:focus {
  border-color: #ffd700cc;
  box-shadow: 0 0 16px #ffd70099;
  animation: none;
}

button {
  font-family: 'Press Start 2P', monospace;
  padding: 14px 28px;
  border: 2px solid currentColor;
  border-radius: 2px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  letter-spacing: 1px;
}
button:hover  { transform: scale(1.03); }
button:active { transform: scale(0.96); }

#playBtn {
  width: 100%;
  background: #b14fff;
  color: #0a040c;
  border-color: #b14fff;
  margin-bottom: 20px;
  box-shadow: 0 0 16px #b14fff66;
}
#playBtn:hover { box-shadow: 0 0 28px #b14fffaa; }
#playBtn { margin-bottom: 12px; }

#roomChoice {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.room-sq {
  flex: 1 1 0;
  aspect-ratio: 7 / 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: transparent;
  color: #b14fff;
  border: 2px solid #3e2a4a;
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
}
.room-sq:hover { border-color: #b14fff; box-shadow: 0 0 18px #b14fff55; }
.room-sq .room-sq-icon  { font-size: 1.9rem; line-height: 1; }
.room-sq .room-sq-label { font-size: 0.62rem; letter-spacing: 1px; }
#mainRoomBtn.selected {
  border-color: #b14fff;
  background: #b14fff22;
  box-shadow: 0 0 20px #b14fff66, inset 0 0 18px #b14fff22;
}
#tutorialBtn { color: #ffd700; border-color: #4a4022; }
#tutorialBtn:hover { border-color: #ffd700; box-shadow: 0 0 18px #ffd70055; }
#tutorialBtn.selected {
  border-color: #ffd700;
  background: #ffd70022;
  box-shadow: 0 0 20px #ffd70066, inset 0 0 18px #ffd70022;
}

#customizeBtn {
  width: 100%;
  background: transparent;
  color: #b14fff;
  border-color: #3e2a4a;
  margin-bottom: 10px;
}
#customizeBtn:hover { border-color: #b14fff; }

#backBtn {
  width: 100%;
  background: transparent;
  color: #b14fff;
  border-color: #3e2a4a;
  margin-top: 8px;
}
#backBtn:hover { border-color: #b14fff; }

#menuTabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid #241a2e;
  padding-bottom: 0;
  width: 100%;
}

.menu-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #5c3a6e;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  letter-spacing: 1px;
  padding: 8px 0 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.menu-tab:hover { color: #b14fff; }
.menu-tab.active { color: #b14fff; border-bottom: 2px solid #b14fff; }

.tab-panel { width: 100%; }

/* Leaderboard tab */
#lbDate {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #5c3a6e;
  text-align: right;
  margin-bottom: 12px;
}
#lbLoading {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #5c3a6e;
  text-align: center;
  padding: 30px 0;
}
#lbTable {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72rem;
}
#lbTable thead th {
  color: #b14fff;
  text-align: left;
  padding: 6px 4px 9px;
  border-bottom: 1px solid #241a2e;
  white-space: nowrap;
}
#lbTable thead th.lb-num,
#lbTable thead th:last-child { text-align: right; }
#lbTable tbody td {
  padding: 7px 4px;
  color: #ddc8e6;
  vertical-align: middle;
}
#lbTable tbody tr.lb-even td { background: rgba(255,255,255,0.03); }
.lb-rank   { color: #5c3a6e; width: 28px; text-align: center; font-size: 0.9em; }
.lb-rank-1 { color: #ffd700; }
.lb-rank-2 { color: #b0b8c1; }
.lb-rank-3 { color: #cd7f32; }
.lb-name   { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-num    { text-align: right; color: #c9a8d5; }
.lb-sats   { text-align: right; color: #ffd700; white-space: nowrap; }

#lbHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}
#lbDateInfo {
  text-align: center;
  flex: 1;
}
#lbTitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #b14fff;
  letter-spacing: 1.5px;
  text-shadow: 0 0 6px #b14fff66;
  margin-bottom: 4px;
}
#lbDate {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  color: #5c3a6e;
}
.lb-nav {
  background: transparent;
  border: 1px solid #3e2a4a;
  color: #b14fff;
  font-size: 0.6rem;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.lb-nav:hover:not(:disabled) { border-color: #b14fff; }
.lb-nav:disabled { color: #3e2a4a; border-color: #241a2e; cursor: default; }
#lbTableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide detail columns on narrow desktop viewports */
@media (max-width: 480px) { .lb-col-md { display: none; } }

/* Mobile leaderboard: vertical scroll for rows, horizontal scroll for columns */
body.mobile #tabLeaderboard {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.mobile #lbTableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body:not(.mobile) #lbTableWrap {
  overflow-x: visible;
}
body.mobile #lbTitle { font-size: 0.62rem; }
body.mobile #lbDate  { font-size: 0.55rem; }
body.mobile #lbTable thead th { font-size: 0.45rem; padding: 6px 6px 10px; }
body.mobile #lbTable tbody td { font-size: 0.88rem; padding: 13px 6px; }
body.mobile #lbTable tbody tr { border-bottom: 1px solid #241a2e; }
body.mobile .lb-rank { font-size: 1.1rem; width: 32px; }
body.mobile .lb-name { max-width: 170px; font-size: 0.82rem; }
body.mobile .lb-sats { font-size: 0.88rem; }

#howToPlay {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.htp-section {
  background: rgba(0,0,0,0.35);
  border: 1px solid #241a2e;
  border-radius: 6px;
  padding: 10px 14px;
}

.htp-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  color: #5c3a6e;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.htp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.78rem;
}

.htp-key {
  color: #b14fff;
  font-weight: 600;
  white-space: nowrap;
}

.htp-desc {
  color: #5e4a6e;
  font-size: 0.75rem;
  text-align: right;
}

/* ── Settings feature (Login, etc.) ── */
.settings-feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  background: rgba(177, 79, 255, 0.06);
  border: 1px solid #3e2a4a;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: not-allowed;
  opacity: 0.7;
}
.settings-feature .sf-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #b14fff;
}
.settings-feature .sf-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  letter-spacing: 1px;
  color: #5e4a6e;
}

/* ── HUD ── */
#bottomBar {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

#headHealthWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#headHealthBar {
  width: 12px;
  height: 58px;
  background: rgba(0,0,0,0.6);
  border: 1.5px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

#headHealthFill {
  width: 100%;
  height: 100%;
  background: #6bcb77;
  border-radius: 4px;
  transition: height 0.3s ease, background 0.3s ease;
  transform-origin: bottom;
}

#headHealthLabel {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6bcb77;
}

.hh-title {
  font-size: 0.5rem;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Helmet armor bar — shown only while armored (helmetHealth > 0) */
#helmetArmorWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#helmetArmorBar {
  width: 12px;
  height: 58px;
  background: rgba(0,0,0,0.6);
  border: 1.5px solid #1a3a5a;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
#helmetArmorFill {
  width: 100%;
  height: 100%;
  background: #4d96ff;
  border-radius: 4px;
  transition: height 0.3s ease;
  transform-origin: bottom;
  box-shadow: 0 0 8px rgba(77,150,255,0.6);
}
#helmetArmorLabel {
  font-size: 0.65rem;
  font-weight: 700;
  color: #4d96ff;
}

#skillBar {
  display: flex;
  gap: 10px;
}

.skill {
  position: relative;
  width: 58px;
  height: 58px;
  background: rgba(0,0,0,0.6);
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  transition: border-color 0.15s;
}

.skill.active {
  border-color: #b14fff;
}

.skill-icon  { font-size: 1.4rem; line-height: 1; }
.skill-name  { font-size: 0.55rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

.skill-cd-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  transform-origin: top;
  transform: scaleY(0);
  transition: none;
  pointer-events: none;
}

#powerBar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  padding: 8px 22px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(4px);
}

#powerLabel {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#powerVal {
  font-size: 1.4rem;
  font-weight: 800;
  color: #b14fff;
}

#leaderboard {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 210px;
  backdrop-filter: blur(4px);
}

.lb-title {
  font-size: 0.72rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

#boardList {
  list-style: none;
}

#boardList li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.88rem;
  color: #aaa;
  border-bottom: 1px solid #111;
}

#boardList li:last-child { border-bottom: none; }

#boardList li.me {
  color: #b14fff;
  font-weight: 700;
}

#boardList li .rank { color: #444; min-width: 18px; }

.lb-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.lb-power { font-size: 0.88rem; }
.lb-hs    { font-size: 0.65rem; font-weight: 700; }

/* ── Death screen ── */
#deathScreen {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(6, 6, 10, 0.72);
  border: 1px solid #2a2a2a;
  padding: 48px 40px;
  border-radius: 20px;
  pointer-events: all;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
}

#deathScreen h2 {
  font-size: 2rem;
  color: #ff6b6b;
  margin-bottom: 10px;
}

#deathStats {
  margin-bottom: 28px;
  width: 100%;
}

.ds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #1e1e1e;
}
.ds-row:last-child { border-bottom: none; }

.ds-section-title {
  font-size: 0.62rem;
  color: #b14fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  margin-top: 4px;
  text-align: left;
  border-bottom: 1px solid #2e1e3a;
  padding-bottom: 4px;
}

.ds-label {
  font-size: 0.82rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ds-val {
  font-size: 1rem;
  font-weight: 700;
  color: #b14fff;
}

#respawnBtn {
  background: #b14fff;
  color: #000;
  margin-right: 10px;
}

#menuBtn {
  background: #1e1e1e;
  color: #aaa;
}

#claimSatsBtn {
  background: #ff922b;
  color: #000;
  margin-right: 10px;
}

#wosBanner {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
  border: 2px solid #ffd700;
  border-radius: 4px;
  padding: 10px 24px;
  margin: 10px 0;
  text-decoration: none;
  box-shadow: 0 0 10px #ffd70066;
  transition: box-shadow 0.2s;
}
#wosBanner:hover { box-shadow: 0 0 18px #ffd700aa; }
#wosBanner.hidden { display: none; }
.wos-line1 { color: #fff; font-size: 0.55rem; font-family: 'Press Start 2P', monospace; margin-bottom: 5px; }
.wos-line2 { color: #ffd700; font-size: 0.55rem; font-family: 'Press Start 2P', monospace; text-shadow: 0 0 6px #ffd700; }

#donateBtn {
  width: 100%;
  background: transparent;
  color: #ff9500;
  border-color: #ff9500;
  margin-top: 10px;
  font-size: 0.5rem;
}
#donateBtn:hover { color: #ffb340; border-color: #ffb340; }

#musicBtn {
  width: 100%;
  background: transparent;
  color: #888;
  border-color: #444;
  margin-top: 10px;
  font-size: 0.5rem;
}
#musicBtn.on { color: #4d96ff; border-color: #4d96ff; }
#musicBtn:hover { border-color: #aaa; }

.vol-label {
  font-size: 0.55rem;
  color: #aaa;
  margin-top: 12px;
  margin-bottom: 4px;
  text-align: left;
  letter-spacing: 1px;
}
.vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.45rem;
  color: #888;
}
.vol-row input[type=range] {
  flex: 1;
  accent-color: #4d96ff;
  cursor: pointer;
}
.vol-row span { min-width: 34px; text-align: right; }

#donateScreen {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(10, 6, 16, 0.94);
  border: 1px solid #b14fff55;
  padding: 44px 44px 36px;
  border-radius: 20px;
  pointer-events: all;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 60px rgba(177, 79, 255, 0.18);
  min-width: 320px;
  max-width: 440px;
}

#donateAmount {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #eee;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  padding: 14px 16px;
  outline: none;
  margin-bottom: 14px;
  text-align: center;
}
#donateAmount:focus { border-color: #b14fff; box-shadow: 0 0 8px #b14fff44; }
/* numeric field with no spinner arrows */
#donateAmount::-webkit-outer-spin-button,
#donateAmount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#donateAmount { -moz-appearance: textfield; appearance: textfield; }

#generateInvoiceBtn {
  display: block;
  width: 100%;
  background: #b14fff;
  color: #0a040c;
  font-size: 0.7rem;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 0 16px #b14fff66;
}
#generateInvoiceBtn:hover { box-shadow: 0 0 26px #b14fffaa; }

#donateMsg {
  font-size: 0.6rem;
  color: #ff6b6b;
  min-height: 1.2em;
}

#invoiceDisplay { margin: 16px 0 8px; }

#invoiceQR {
  display: inline-block;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 14px;
}

#invoiceText {
  font-size: 0.38rem;
  color: #555;
  word-break: break-all;
  line-height: 1.8;
  margin-bottom: 12px;
  max-height: 48px;
  overflow: hidden;
}

#copyInvoiceBtn {
  background: #2a2a2a;
  color: #aaa;
  font-size: 0.55rem;
  padding: 10px 20px;
  margin-bottom: 4px;
}
#copyInvoiceBtn.copied { background: #2e1e3a; color: #b14fff; }

#donateSuccess { padding: 16px 0 20px; }

#donateSuccessMsg {
  font-size: 1.1rem;
  color: #ffd93d;
  text-shadow: 0 0 24px #ffd93d, 0 0 8px #ffd93d88;
  line-height: 1.8;
  margin-bottom: 4px;
}

#donateBackBtn {
  background: transparent;
  color: #555;
  font-size: 0.5rem;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #222;
  border-radius: 6px;
}

#claimModal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(4, 10, 6, 0.90);
  border: 1px solid #b14fff66;
  padding: 48px 44px;
  border-radius: 20px;
  pointer-events: all;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 60px rgba(177, 79, 255, 0.18);
  min-width: 340px;
  max-width: 460px;
}

.cm-tag {
  font-size: 0.48rem;
  color: #b14fff;
  letter-spacing: 2px;
  text-shadow: 0 0 6px #b14fff88;
  margin-bottom: 10px;
}

.cm-title {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 20px;
}

.cm-sub {
  font-size: 0.6rem;
  color: #888;
  margin-bottom: 20px;
  line-height: 1.8;
}

#lnInput {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #eee;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  padding: 14px 16px;
  outline: none;
  margin-bottom: 14px;
}
#lnInput:focus { border-color: #b14fff; box-shadow: 0 0 8px #b14fff44; }

#claimBtn {
  display: block;
  width: 100%;
  background: #ffd93d;
  color: #000;
  font-size: 0.75rem;
  padding: 14px;
  margin-bottom: 12px;
}
#claimBtn:disabled {
  background: #333;
  color: #555;
  cursor: default;
}

#claimMsg {
  font-size: 0.65rem;
  min-height: 1.4em;
  color: #ff6b6b;
  margin-bottom: 6px;
}

#claimSuccess { padding: 16px 0 24px; }

#claimSuccessMsg {
  font-size: 1.1rem;
  color: #b14fff;
  text-shadow: 0 0 24px #b14fff, 0 0 8px #b14fff88;
  line-height: 1.8;
  margin-bottom: 6px;
}

#claimBackBtn {
  background: #1a1a1a;
  color: #777;
  font-size: 0.55rem;
  margin-top: 4px;
}

.hidden { display: none !important; }

/* ── Portrait rotate overlay ── */
#rotateOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.rotate-inner { text-align: center; }
.rotate-phone {
  font-size: 5rem;
  color: #b14fff;
  display: block;
  margin-bottom: 24px;
  text-shadow: 0 0 20px #b14fff88;
  animation: rotateHint 1.8s ease-in-out infinite;
}
@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  40%, 60%  { transform: rotate(90deg); }
}
.rotate-msg {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: #b14fff;
  line-height: 2.2;
}

/* ── Mobile controls ── */
#mobileControls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 max(16px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-bottom));
  padding-right: max(16px, env(safe-area-inset-right));
  pointer-events: none;
}

#joystickZone {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  flex-shrink: 0;
}

#joystickBase {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(177,79,255,0.3);
  position: relative;
  box-shadow: 0 0 20px rgba(177,79,255,0.1);
}

#joystickKnob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(177,79,255,0.55);
  border: 2px solid #b14fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #b14fff66;
  pointer-events: none;
}

#mobileSkillBar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  pointer-events: all;
  flex-shrink: 0;
}

.mob-skill {
  position: relative;
  width: 72px;
  height: 72px;
  background: rgba(0,0,0,0.6);
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
}
.mob-skill.active {
  border-color: #b14fff;
  box-shadow: 0 0 12px rgba(177,79,255,0.3);
}
.mob-skill .skill-icon { font-size: 1.5rem; line-height: 1; }
.mob-skill .skill-name { font-size: 0.48rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

#mobileActionBtns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: all;
  flex-shrink: 0;
}

#mobileBoostBtn,
#mobileUseBtn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.5px;
  pointer-events: all;
}

#mobileBoostBtn {
  background: rgba(77,150,255,0.2);
  border: 2px solid #4d96ff;
  color: #4d96ff;
  box-shadow: 0 0 12px rgba(77,150,255,0.2);
}
#mobileBoostBtn.pressing {
  background: rgba(77,150,255,0.45);
  box-shadow: 0 0 22px rgba(77,150,255,0.55);
}

#mobileUseBtn {
  background: rgba(255,107,107,0.2);
  border: 2px solid #ff6b6b;
  color: #ff6b6b;
  box-shadow: 0 0 12px rgba(255,107,107,0.2);
}
#mobileUseBtn.pressing {
  background: rgba(255,107,107,0.4);
}

/* ── Mobile menu (full-screen scrollable) ── */
body.mobile #menu {
  position: absolute;
  inset: 0;
  transform: none;
  max-width: 100%;
  min-width: unset;
  border: none;
  border-top: 2px solid #b14fff;
  border-radius: 0;
  padding: 12px 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.mobile #arcadeTitle        { width: 38%; margin-bottom: 10px; }
body.mobile #menuTabs           { margin-bottom: 10px; }
body.mobile #eventBanner        { padding: 7px 10px; margin-bottom: 10px; }
body.mobile #faucetBanner       { padding: 7px 10px; margin-bottom: 10px; }
body.mobile .eb-date,
body.mobile .fb-date            { font-size: 0.52rem; margin-bottom: 4px; }
body.mobile .eb-sub,
body.mobile .fb-sub             { font-size: 0.62rem; }
body.mobile .fb-remaining       { font-size: 0.48rem; margin-bottom: 4px; }
body.mobile #nameInput          { padding: 9px 12px; margin-bottom: 10px; font-size: 0.58rem; }
body.mobile #tabPlay button     { padding: 10px 18px; font-size: 0.58rem; }
body.mobile #customizeBtn       { margin-bottom: 8px; }
body.mobile #playBtn            { margin-bottom: 12px; }
body.mobile #donateBtn          { margin-top: 6px; }
body.mobile #musicBtn           { margin-top: 6px; }
body.mobile .vol-label          { margin-top: 8px; margin-bottom: 2px; }

/* Mobile HUD adjustments */
body.mobile #bottomBar { display: none; }
body.mobile #powerBar  { display: none; }

#mobilePower {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
  pointer-events: none;
  flex-shrink: 0;
}
#mobilePowerVal {
  font-size: 2rem;
  font-weight: 800;
  color: #b14fff;
  line-height: 1;
  text-shadow: 0 0 12px #b14fff66;
}
.mob-pwr-label {
  font-size: 0.42rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Rotate exit button */
#rotateExitBtn {
  margin-top: 28px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  color: #666;
  border: 1px solid #333;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 1px;
}
#rotateExitBtn:active { color: #ff6b6b; border-color: #ff6b6b; }

/* Feedback tab */
.fb-form { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.fb-field { display: flex; flex-direction: column; gap: 5px; }
.fb-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  color: #5c3a6e;
  letter-spacing: 1px;
}
.fb-form input, .fb-form select, .fb-form textarea {
  width: 100%;
  background: #0b080e;
  border: 2px solid #3e2a4a;
  border-radius: 2px;
  color: #b14fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  outline: none;
  letter-spacing: 1px;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: #b14fff;
  box-sizing: border-box;
}
.fb-form input { padding: 10px 12px; }
.fb-form select { padding: 10px 12px; cursor: pointer; appearance: none; }
.fb-form select option { background: #0b080e; }
.fb-form textarea { padding: 10px 12px; resize: vertical; min-height: 90px; }
.fb-form input::placeholder, .fb-form textarea::placeholder { color: #3e2a4a; }
.fb-form input:focus, .fb-form select:focus, .fb-form textarea:focus {
  border-color: #b14fff;
  box-shadow: 0 0 8px #b14fff44;
}
#fbSubmitBtn {
  width: 100%;
  background: #b14fff;
  color: #0a040c;
  border-color: #b14fff;
  margin-top: 4px;
  box-shadow: 0 0 12px #b14fff55;
}
#fbSubmitBtn:disabled { opacity: 0.4; cursor: default; transform: none; }
#fbMsg {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  min-height: 1em;
  letter-spacing: 1px;
  text-align: center;
}
body.mobile .fb-form input,
body.mobile .fb-form select,
body.mobile .fb-form textarea { font-size: 0.52rem; padding: 8px 10px; }
body.mobile .fb-label { font-size: 0.34rem; }
body.mobile #fbSubmitBtn { font-size: 0.55rem; padding: 10px; }
