/* styles.css — Neon cyberpunk theme */
:root{
  --ink: #051018;
  --paper: #090d17;
  --paper-2: #0b1020;
  --accent: #00fff0;
  --accent-2: #ff2fd3;
  --good: #2eff7d;
  --warn: #ffca28;
  --info: #66ccff;
  --ghost: rgba(255,255,255,0.06);
  --pill-bg: rgba(6, 192, 255, 0.08);
  --modal-bg: #0a0f1f;
  --card-bg: #0c1228;
  --shadow: 0 0 20px rgba(0,255,240,0.35), 0 0 60px rgba(255,47,211,0.15);
  --white: #ffffff;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  color:#dff6ff;
  font-family: "Comic Sans MS", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(0,255,240,0.08) 0 24%, transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(255,47,211,0.06) 0 20%, transparent 21%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 12px, transparent 12px 24px),
    var(--paper);
}

#gameCanvas{
  display:block;
  margin: 16px auto;
  border: 4px solid #00fff0;
  outline: 2px solid #08131d;
  box-shadow: var(--shadow);
  background: var(--paper-2);
}

.hud-root{
  position: fixed; left: 16px; top: 12px;
  display: flex; flex-wrap: wrap; gap: 8px; z-index: 50;
}
.hud-chip{
  display:flex; align-items:center; gap:8px;
  padding:8px 12px;
  background: rgba(0,255,240,0.08);
  border: 2px solid #00fff0;
  outline: 2px solid #06121c;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,255,240,0.35);
  font-weight: 800;
}
.hud-chip .dot{ width:8px; height:8px; border-radius:50%; background:#00fff0; box-shadow:0 0 8px #00fff0; }

.debug-pill{
  position: fixed; right: 16px; bottom: 12px;
  padding: 8px 12px;
  background: rgba(255,47,211,0.12);
  border: 2px solid #ff2fd3; outline: 2px solid #06121c;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255,47,211,0.35);
  font-weight:800; z-index: 60;
}

/* Overlays / Modals */
.overlay{ position: fixed; inset: 0; display:none; align-items:center; justify-content:center; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); z-index: 100; }
.overlay.show{ display:flex; }
.overlay.hidden{ display:none; }

.modal{
  width: min(960px, 92vw); max-height: 86vh; overflow: auto;
  background: radial-gradient(120% 140% at 20% -20%, rgba(0,255,240,0.12), transparent), var(--modal-bg);
  color: #eaf2ff; padding: 18px 20px;
  border: 2px solid #00fff0; outline: 2px solid #06121c; border-radius: 14px;
  box-shadow: 0 0 20px rgba(0,255,240,0.3), 0 0 60px rgba(255,47,211,0.15);
}
.modal h2{ margin: 4px 0 8px; font-size: 28px; line-height:1.1; text-shadow: 0 0 10px rgba(0,255,240,0.4); }
.modal .sub{ margin: 0 0 12px; opacity: .95; font-weight:800; }

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin: 8px 0 12px; }

.choice-list{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.choice-card{
  text-align:left; padding: 12px 14px;
  background: linear-gradient(180deg, #0f1635, #0b1228);
  border: 2px solid #2d3bff; outline: 2px solid #071224; border-radius: 12px;
  box-shadow: 0 0 12px rgba(45,59,255,0.35), 0 0 30px rgba(0,255,240,0.15);
  cursor:pointer; transition: transform .06s ease, filter .06s ease, box-shadow .06s ease;
  color:#dff6ff; font-weight:700;
}
.choice-card:hover{ transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 0 16px rgba(45,59,255,0.5), 0 0 40px rgba(0,255,240,0.18); }
.choice-card.disabled{ opacity:.55; filter: grayscale(0.4); pointer-events:none; }

.btn{
  appearance:none; border:none; cursor:pointer; padding:10px 14px; font-weight:900; letter-spacing:.3px;
  background: linear-gradient(#00fff0, #4cf5ff);
  color:#041018; border: 2px solid #00fff0; outline: 2px solid #06121c; border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,255,240,0.45);
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 0 18px rgba(0,255,240,0.6); }
.btn:active{ transform: translateY(1px); box-shadow: 0 0 8px rgba(0,255,240,0.4); }
.btn.secondary{ background: linear-gradient(#ff2fd3, #ffa6f2); color:#140414; border-color:#ff2fd3; box-shadow:0 0 12px rgba(255,47,211,0.45); }

.choice-list::-webkit-scrollbar,
.modal::-webkit-scrollbar{ width:10px; height:10px; }
.choice-list::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb{ background: #324; border:2px solid #78d; border-radius:10px; }

@media (max-width: 900px){
  .modal{ width: 96vw; padding: 16px; }
  .choice-list{ grid-template-columns: 1fr; }
}
:focus-visible{ outline: 3px dashed #ff2fd3; outline-offset: 3px; }

/* === Mobile Controls & Overlays === */
#touchControls { display:none; }
@media (pointer: coarse) {
  #touchControls {
    display:block;
    position:fixed;
    inset:0;
    pointer-events:none;
    z-index: 30;
  }
  .joypad {
    position:fixed;
    width: 140px; height: 140px;
    border-radius: 50%;
    bottom: 24px;
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 24px rgba(0,255,255,0.4) inset, 0 0 18px rgba(0,0,0,0.4);
    border: 3px solid rgba(255,255,255,0.85);
    opacity: 0.5;
    pointer-events:auto; /* we still listen on document, but allow taps */
  }
  #joyL { left: 24px; }
  #joyR { right: 24px; }

  .joy-knob {
    position:absolute;
    left:50%; top:50%;
    width: 64px; height:64px;
    margin:-32px 0 0 -32px;
    border-radius:50%;
    background: radial-gradient(ellipse at center, rgba(0,255,255,0.9), rgba(0,255,255,0.2));
    border: 3px solid rgba(255,255,255,0.95);
    box-shadow: 0 0 10px rgba(0,255,255,0.8), 0 0 24px rgba(0,255,255,0.4);
    transition: transform 80ms ease;
    pointer-events:none;
  }

  /* Prevent scroll/zoom on touch while playing */
  html, body { touch-action: none; overscroll-behavior: contain; }
}

/* Rotate / Fullscreen prompt for mobile portrait */
#rotateOverlay.overlay .modal {
  max-width: 520px;
}
/* === Radial Weapon Tree UI ============================================ */
.modal--radial {
  max-width: 820px;
}

.radial-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.radial-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.radial-wrap {
  --radW: 680px;
  --radH: 420px;
  position: relative;
  width: min(90vw, var(--radW));
  height: min(56vw, var(--radH)); /* keep 16:10-ish */
  max-width: var(--radW);
  max-height: var(--radH);
  margin: 6px auto 10px;
  background: radial-gradient(ellipse at center,
              rgba(42,255,255,0.10), rgba(42,255,255,0.02) 60%, transparent 70%);
  border: 2px solid rgba(42,255,255,0.35);
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(10,14,30,0.5) inset,
    0 16px 32px rgba(0,0,0,0.35);
}

.radial-canvas {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* Edge lines under nodes */
.radial-edges {
  position: absolute; inset: 0;
}
.radial-edges .edge {
  stroke: rgba(180, 200, 220, 0.35);
  stroke-width: 2;
}
.radial-edges .edge--avail {
  stroke: rgba(42,255,255, 0.9);
  filter: drop-shadow(0 0 6px rgba(42,255,255,0.6));
}

/* Node buttons */
.node {
  position: absolute;
  min-width: 48px; min-height: 48px;
  transform: translate(-50%,-50%);
  border-radius: 999px;
  padding: 6px 10px;
  border: 2px solid #0a0f18;
  background: linear-gradient(180deg, rgba(22,28,44,0.95), rgba(14,18,30,0.95));
  color: #cfe8ff;
  box-shadow:
    0 0 0 2px rgba(42,255,255,0.16),
    0 0 12px rgba(42,255,255,0.18);
  cursor: pointer;
  text-align: center;
}
.node:hover { box-shadow:
  0 0 0 2px rgba(42,255,255,0.3),
  0 0 14px rgba(42,255,255,0.28); }

.node--locked {
  opacity: 0.55;
  filter: grayscale(0.2);
  cursor: not-allowed;
}
.node--available {
  border-color: #0c1a26;
  box-shadow:
    0 0 0 2px rgba(42,255,255,0.35),
    0 0 16px rgba(42,255,255,0.45);
}
.node--unlocked {
  background: linear-gradient(180deg, rgba(46,255,125,0.14), rgba(22,28,44,0.92));
  box-shadow:
    0 0 0 2px rgba(46,255,125,0.45),
    0 0 18px rgba(46,255,125,0.4);
}

.node__name {
  display:block;
  font-weight:700;
  font-size: 12px;
  letter-spacing: 0.2px;
}
.node__desc {
  display:block;
  margin-top:2px;
  font-size: 11px;
  opacity: 0.85;
}

.empty-note {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  color:#9fb8d0; font-size:14px;
}

/* === Neon / Glow polish + radial tree fixes =========================== */
/* Append to the end of your styles.css */

:root{
  --neon-cyan: #2affff;
  --neon-pink: #ff53d9;
  --neon-green:#2eff7d;
  --ink: #0a0f18;
}

#gameCanvas {
  outline: 3px solid rgba(42,255,255,0.3);
  box-shadow: 0 0 24px rgba(42,255,255,0.18), inset 0 0 48px rgba(10,14,30,0.4);
  border-radius: 12px;
}

/* Overlay base already exists; add glow */
.overlay .modal {
  border: 2px solid rgba(42,255,255,0.35);
  box-shadow:
    0 0 0 2px rgba(10,14,30,0.5) inset,
    0 14px 28px rgba(0,0,0,0.35),
    0 0 24px rgba(42,255,255,0.15);
  background: radial-gradient(ellipse at center, rgba(14,20,32,0.98), rgba(8,12,20,0.98));
}


/* Radial weapon tree layout helpers */
.radial-wrap { position: relative; }
.radial-canvas { position: relative; }
.radial-edges line { stroke-linecap: round; }
.node {
  width: 120px; height: 48px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.node__name { font-size: 12px; }
.node__desc { font-size: 11px; opacity: 0.8; }

/* Prevent text overflow and help anti-overlap readability */
.node { white-space: nowrap; }
