* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: "Impact", "Arial Black", sans-serif;
  letter-spacing: 1px;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #111;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: auto;
}
.hidden { display: none !important; }

/* MENU */
.menu {
  background:
    radial-gradient(ellipse at center, rgba(255,80,0,0.25), transparent 60%),
    linear-gradient(#1a0000 0%, #000 70%);
}
.logo {
  text-align: center;
  margin-bottom: 60px;
  text-shadow:
    0 0 10px #ff3300,
    0 0 25px #ff7a00,
    0 0 50px #ff3300;
}
.logo-line-1 {
  font-size: clamp(60px, 13vw, 180px);
  color: #ffd400;
  -webkit-text-stroke: 2px #b30000;
  line-height: 0.95;
}
.logo-line-2 {
  font-size: clamp(70px, 16vw, 220px);
  color: #ff2200;
  -webkit-text-stroke: 3px #ffea00;
  line-height: 0.95;
  filter: drop-shadow(0 0 15px #ff3300);
}
.logo-sub {
  margin-top: 12px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 4px;
  color: #ffaa66;
  font-weight: normal;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.btn {
  background: linear-gradient(#3a0000, #1a0000);
  color: #ffd400;
  border: 2px solid #ff5500;
  padding: 16px 56px;
  font-family: inherit;
  font-size: 32px;
  letter-spacing: 4px;
  cursor: pointer;
  text-shadow: 0 0 8px #ff5500;
  box-shadow: 0 0 25px rgba(255,90,0,0.4) inset;
  transition: transform 0.1s, box-shadow 0.1s, color 0.1s;
}
.btn:hover, .btn:focus {
  transform: scale(1.05);
  color: #fff;
  box-shadow: 0 0 35px rgba(255,200,0,0.7) inset, 0 0 25px #ff5500;
  outline: none;
}
.btn.small { font-size: 18px; padding: 8px 28px; }

.hint {
  margin-top: 30px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #888;
  letter-spacing: 2px;
}

/* PANEL (controls) */
.panel { background: rgba(0,0,0,0.95); }
.panel h2 { font-size: 60px; color: #ffd400; margin-bottom: 30px; text-shadow: 0 0 15px #ff3300; }
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 30px;
  font-family: "Arial", sans-serif;
  font-weight: normal;
  letter-spacing: 1px;
}
.ctrl h3 { color: #ff5500; font-size: 28px; margin-bottom: 14px; letter-spacing: 4px; }
.ctrl ul { list-style: none; font-size: 18px; line-height: 1.8; color: #ddd; }
.ctrl b { color: #ffd400; display: inline-block; min-width: 60px; font-weight: bold; }

/* CHARACTER SELECT */
.select { background: linear-gradient(#0a0014 0%, #000 80%); padding: 30px; }
.select h2 { font-size: clamp(28px, 4vw, 48px); color: #ffd400; margin-bottom: 25px; text-shadow: 0 0 15px #ff3300; }
.roster {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1100px;
  width: 100%;
}
.fighter-card {
  position: relative;
  aspect-ratio: 1 / 1.1;
  background: linear-gradient(#1a0a00, #000);
  border: 2px solid #444;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  transition: all 0.15s;
  overflow: hidden;
}
.fighter-card canvas {
  width: 100%;
  flex: 1;
  display: block;
}
.fighter-card .fc-name {
  font-size: clamp(11px, 1.1vw, 16px);
  color: #ffd400;
  text-align: center;
  margin-top: 4px;
  text-shadow: 0 0 5px #ff5500;
}
.fighter-card.active {
  border-color: #ff5500;
  box-shadow: 0 0 25px rgba(255,90,0,0.7) inset, 0 0 20px #ff5500;
  transform: scale(1.05);
}
.fighter-card.locked-p1 { border-color: #2299ff; }
.fighter-card.locked-p1::after { content: "P1"; position: absolute; top: 6px; left: 8px; color: #2299ff; font-size: 14px; }
.fighter-card.locked-p2 { border-color: #ff3344; }
.fighter-card.locked-p2::after { content: "P2"; position: absolute; top: 6px; right: 8px; color: #ff3344; font-size: 14px; }

.select-footer {
  margin-top: 18px;
  text-align: center;
}
.sel-name {
  font-size: clamp(28px, 3.5vw, 44px);
  color: #ffd400;
  text-shadow: 0 0 15px #ff3300;
  letter-spacing: 4px;
}
.sel-power {
  font-family: "Arial", sans-serif;
  font-weight: normal;
  font-size: 16px;
  color: #ff8855;
  margin-top: 4px;
  letter-spacing: 2px;
}

/* VS screen */
.vs {
  background: radial-gradient(circle at 50% 50%, #500 0%, #000 80%);
  flex-direction: row;
}
.vs-side { display: flex; flex-direction: column; align-items: center; flex: 1; }
.vs-side canvas { width: 320px; height: 320px; }
.vs-side div { font-size: 44px; color: #ffd400; text-shadow: 0 0 15px #ff3300; letter-spacing: 4px; margin-bottom: 20px; }
.vs-side.left canvas { transform: scaleX(1); }
.vs-side.right canvas { transform: scaleX(-1); }
.vs-mid {
  font-size: 200px;
  color: #ff2200;
  -webkit-text-stroke: 4px #ffea00;
  text-shadow: 0 0 40px #ff3300;
  animation: vs-pulse 0.8s infinite alternate;
}
@keyframes vs-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* HUD */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 12px 20px;
  z-index: 6;
  pointer-events: none;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.hp-wrap { flex: 1; }
.hp-wrap.right { text-align: right; }
.hp-name {
  font-size: 18px;
  letter-spacing: 4px;
  color: #ffd400;
  text-shadow: 0 0 6px #ff3300;
  margin-bottom: 4px;
}
.hp-bar {
  height: 20px;
  background: #220;
  border: 2px solid #ffd400;
  position: relative;
  box-shadow: 0 0 10px rgba(255,212,0,0.5) inset;
}
.hp-fill {
  height: 100%;
  background: linear-gradient(#fff200, #ffaa00 50%, #ff2200);
  width: 100%;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px #ff5500;
}
.hp-wrap.right .hp-bar { transform: scaleX(-1); }
.hp-wrap.right .hp-name { /* keep readable */ }

.timer {
  font-size: 38px;
  color: #ffd400;
  text-shadow: 0 0 12px #ff3300;
  min-width: 70px;
  text-align: center;
}

.round-pip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 6px;
}
.rp-side { display: flex; gap: 6px; }
.rp-side:last-child { flex-direction: row-reverse; }
.rp {
  width: 14px;
  height: 14px;
  border: 2px solid #ffd400;
  border-radius: 50%;
}
.rp.on { background: #ff3300; box-shadow: 0 0 8px #ff5500; }
.rp-mid {
  font-size: 16px;
  color: #aaa;
  letter-spacing: 4px;
}

/* Announcer */
.announcer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
  font-size: clamp(80px, 14vw, 220px);
  color: #ffea00;
  -webkit-text-stroke: 3px #b30000;
  text-shadow: 0 0 40px #ff3300;
  letter-spacing: 8px;
}

/* End screen */
.end { background: rgba(0,0,0,0.85); }
.end h2 { font-size: 100px; color: #ff2200; -webkit-text-stroke: 3px #ffea00; text-shadow: 0 0 40px #ff3300; }
.end #end-sub { font-size: 28px; color: #ffd400; margin: 20px 0 40px; letter-spacing: 4px; }
.end-buttons { display: flex; gap: 20px; }

/* Responsive roster */
@media (max-width: 700px) {
  .roster { grid-template-columns: repeat(2, 1fr); }
  .controls-grid { grid-template-columns: 1fr; gap: 30px; }
  .vs { flex-direction: column; }
  .vs-mid { font-size: 100px; }
  .vs-side canvas { width: 200px; height: 200px; }
}
