@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rajdhani:wght@500;700&display=swap');

:root {
  --bg: #0d0715;
  --panel: #1a0f2b;
  --panel-border: #ff2e88;
  --accent: #ff2e88;
  --accent2: #26e0ff;
  --accent3: #ffb703;
  --text: #f3e9ff;
  --text-dim: #a793c4;
  --danger: #ff3b3b;
  --ok: #43e97b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.hidden { display: none !important; }

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255,46,136,0.15), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(38,224,255,0.12), transparent 55%),
    var(--bg);
}

.panel {
  width: min(520px, 92vw);
  background: rgba(26,15,43,0.9);
  border: 2px solid var(--panel-border);
  box-shadow: 0 0 0 4px rgba(255,46,136,0.15), 0 0 40px rgba(255,46,136,0.25);
  border-radius: 6px;
  padding: 32px 28px;
  text-align: center;
}

h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.6rem;
  line-height: 1.6;
  margin: 0 0 8px;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(255,46,136,0.6);
}
h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  margin: 0 0 6px;
}
.accent { color: var(--accent2); text-shadow: 0 0 10px rgba(38,224,255,0.7); }

.subtitle { color: var(--text-dim); margin: 6px 0 24px; font-size: 1.05rem; }

.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 4px;
  border: 2px solid var(--accent2);
  background: transparent;
  color: var(--accent2);
  cursor: pointer;
  transition: all .12s ease;
}
.btn:hover:not(:disabled) { background: rgba(38,224,255,0.15); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  border-color: var(--accent);
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255,46,136,0.55);
}
.btn-primary:hover:not(:disabled) { background: #ff5aa3; }

.menu-actions { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.join-row { display: flex; gap: 8px; }
#input-code {
  width: 130px;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.95rem;
  letter-spacing: 3px;
  padding: 12px 8px;
  background: #120a1e;
  border: 2px solid var(--accent2);
  color: var(--accent2);
  border-radius: 4px;
  text-transform: uppercase;
}
.error-text { color: var(--danger); min-height: 20px; margin-top: 14px; font-weight: 700; }

/* ---------- Lobby ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.class-card {
  border: 2px solid #3a2555;
  background: #150c22;
  border-radius: 6px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: left;
  transition: all .12s ease;
}
.class-card:hover { border-color: var(--accent2); }
.class-card.selected {
  border-color: var(--accent3);
  box-shadow: 0 0 14px rgba(255,183,3,0.4);
  background: #221533;
}
.class-card .cname { font-weight: 700; color: var(--accent3); display: block; margin-bottom: 4px; }
.class-card .cdesc { font-size: 0.78rem; color: var(--text-dim); line-height: 1.3; }

.lobby-status { display: flex; justify-content: space-between; margin: 18px 0 10px; gap: 12px; }
.lobby-player { flex: 1; background: #150c22; border: 1px solid #3a2555; border-radius: 4px; padding: 10px; }
.lobby-player .label { display: block; font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; }
.status-pill { font-weight: 700; }
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 10px; }

/* ---------- Game screen ---------- */
#screen-game {
  flex-direction: column;
  display: flex;
  justify-content: flex-start;
  padding: 10px;
  gap: 6px;
}

#hud-top {
  width: min(960px, 96vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  padding: 4px 6px;
}
.hud-score { color: var(--accent3); }
.hud-vs { color: var(--text-dim); margin: 0 8px; }
#round-info { color: var(--text-dim); }
#phase-timer { color: var(--accent2); min-width: 60px; text-align: right; }

#game-canvas {
  width: min(960px, 96vw);
  aspect-ratio: 960 / 600;
  background: #05030a;
  border: 2px solid #3a2555;
  border-radius: 4px;
  cursor: crosshair;
}

#hud-bottom {
  width: min(960px, 96vw);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 6px;
}
.meter-block { display: flex; align-items: center; gap: 8px; flex: 1; }
.meter-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; width: 46px; }
.meter { flex: 1; height: 10px; background: #1a0f2b; border: 1px solid #3a2555; border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; width: 0%; transition: width .08s linear; }
.meter-fill.nerve { background: linear-gradient(90deg, var(--accent3), var(--danger)); }
.meter-fill.bote { background: var(--accent2); }
.meter-fill.power { background: var(--accent); }
#ammo-indicator { font-size: 1.2rem; color: var(--ok); text-shadow: 0 0 8px currentColor; }
#ammo-indicator.empty { color: #3a2555; text-shadow: none; }

#controls-hint {
  width: min(960px, 96vw);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 2px 6px 8px;
}

.banner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 1.6rem;
  padding: 18px 32px;
  background: rgba(13,7,21,0.92);
  border: 3px solid var(--accent);
  color: var(--accent);
  text-shadow: 0 0 16px currentColor;
  border-radius: 6px;
  z-index: 50;
  text-align: center;
  pointer-events: none;
}

#screen-end .panel { border-color: var(--accent3); }
#end-score { font-size: 1.3rem; color: var(--text); }
