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

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

#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 #6bcb77, 0 0 8px #6bcb7799; }
  50%       { text-shadow: 0 0 2px #6bcb77, 0 0 5px #6bcb7755; }
}

@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 #6bcb77;
  box-shadow: 0 0 0 1px #0d0d0d, 0 0 24px #6bcb7744, inset 0 0 40px rgba(0,0,0,0.6);
  padding: 48px 44px 36px;
  border-radius: 4px;
  pointer-events: all;
  min-width: 340px;
  position: absolute;
}

#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: 320px;
  width: 80%;
  height: auto;
  margin: 0 auto 28px;
  animation: arcadeGlow 2.4s ease-in-out infinite;
}

.subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.44rem;
  color: #3a5c3e;
  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 {
  border: 1px solid #ffd70088;
  border-radius: 3px;
  background: rgba(10, 12, 10, 0.85);
  padding: 12px 14px 10px;
  margin-bottom: 22px;
  animation: bannerPulse 2.6s ease-in-out infinite;
}

.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 #6bcb7788;
  border-radius: 3px;
  background: rgba(6, 14, 8, 0.88);
  padding: 12px 14px 10px;
  margin-bottom: 22px;
  animation: bannerPulse 3.2s ease-in-out infinite;
}

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

.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: #6bcb77;
  letter-spacing: 1px;
  margin-bottom: 7px;
  text-shadow: 0 0 6px #6bcb7766;
}

.fb-sub {
  font-size: 0.72rem;
  color: #aaddbb;
  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 #6bcb77;
  box-shadow: 0 0 0 1px #0d0d0d, 0 0 24px #6bcb7744, 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: #6bcb77;
  margin-bottom: 32px;
  animation: arcadeGlow 2.4s ease-in-out infinite;
}

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

.cs-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: #3a5c3e;
  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 { position: relative; }
.hc-swatch.hc-locked::after, .bc-locked::after {
  content: '🔒';
  position: absolute;
  font-size: 13px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  line-height: 1;
}

.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; }

#nameInput {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #080e08;
  border: 2px solid #2a4a2e;
  border-radius: 2px;
  color: #6bcb77;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  outline: none;
  letter-spacing: 1px;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: #6bcb77;
}

#nameInput::placeholder { color: #2a4a2e; }
#nameInput:focus {
  border-color: #6bcb77;
  box-shadow: 0 0 10px #6bcb7744;
}

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: #6bcb77;
  color: #040904;
  border-color: #6bcb77;
  margin-bottom: 20px;
  box-shadow: 0 0 16px #6bcb7766;
}
#playBtn:hover { box-shadow: 0 0 28px #6bcb77aa; }

#customizeBtn {
  width: 100%;
  background: transparent;
  color: #6bcb77;
  border-color: #2a4a2e;
  margin-bottom: 10px;
}
#customizeBtn:hover { border-color: #6bcb77; }

#backBtn {
  width: 100%;
  background: transparent;
  color: #6bcb77;
  border-color: #2a4a2e;
  margin-top: 8px;
}
#backBtn:hover { border-color: #6bcb77; }

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

.menu-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #3a5c3e;
  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: #6bcb77; }
.menu-tab.active { color: #6bcb77; border-bottom: 2px solid #6bcb77; }

.tab-panel { width: 100%; }

#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 #1a2e1c;
  border-radius: 6px;
  padding: 10px 14px;
}

.htp-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  color: #3a5c3e;
  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: #6bcb77;
  font-weight: 600;
  white-space: nowrap;
}

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

/* ── 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;
}

#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: #6bcb77;
}

.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: #6bcb77;
}

#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: #6bcb77;
  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: #6bcb77;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  margin-top: 4px;
  text-align: left;
  border-bottom: 1px solid #1e3a22;
  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: #6bcb77;
}

#respawnBtn {
  background: #6bcb77;
  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 {
  background: transparent;
  color: #ff9500;
  border: 1px solid #ff9500;
  font-size: 0.5rem;
  margin-top: 18px;
  padding: 10px 18px;
}
#donateBtn:hover { color: #ffb340; border-color: #ffb340; }

#donateScreen {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(4, 10, 6, 0.92);
  border: 1px solid #ffd93d44;
  padding: 44px 44px 36px;
  border-radius: 20px;
  pointer-events: all;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 60px rgba(255, 217, 61, 0.12);
  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: #ffd93d; box-shadow: 0 0 8px #ffd93d33; }

#generateInvoiceBtn {
  display: block;
  width: 100%;
  background: #ffd93d;
  color: #000;
  font-size: 0.7rem;
  padding: 14px;
  margin-bottom: 10px;
}

#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: #1e3a22; color: #6bcb77; }

#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 #6bcb7766;
  padding: 48px 44px;
  border-radius: 20px;
  pointer-events: all;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 60px rgba(107, 203, 119, 0.18);
  min-width: 340px;
  max-width: 460px;
}

.cm-tag {
  font-size: 0.48rem;
  color: #6bcb77;
  letter-spacing: 2px;
  text-shadow: 0 0 6px #6bcb7788;
  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: #6bcb77; box-shadow: 0 0 8px #6bcb7744; }

#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: #6bcb77;
  text-shadow: 0 0 24px #6bcb77, 0 0 8px #6bcb7788;
  line-height: 1.8;
  margin-bottom: 6px;
}

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

.hidden { display: none !important; }
