/* ============================================
   NINJA SHADOW — GAME STYLES
   Pure darkness, fire accents, Orbitron font
   ============================================ */

:root {
  --black:    #000000;
  --bg:       #080808;
  --bg-2:     #0f0f0f;
  --surface:  #1a1a1a;
  --border:   rgba(255,255,255,0.07);
  --fire:     #FF6B2B;
  --fire-2:   #ff3a00;
  --gold:     #FFD700;
  --red:      #ff2244;
  --blue:     #4488ff;
  --green:    #00ff88;
  --text:     #e8e4df;
  --muted:    #666;
  --radius:   8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--black);
  color: var(--text);
  user-select: none;
}

/* ── SCREENS ── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.screen.hidden { display: none !important; }

.screen__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,107,43,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(68,136,255,0.06) 0%, transparent 50%),
    linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}

.screen__particles {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
}
.particle {
  position: absolute; border-radius: 50%;
  background: var(--fire); opacity: 0;
  animation: particleFly linear infinite;
}
@keyframes particleFly {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

.screen__content {
  width: 100%; max-width: 900px;
  padding: 40px 24px;
  display: flex; flex-direction: column;
  align-items: center; gap: 32px;
  position: relative; z-index: 1;
}
.screen__content--center { text-align: center; }

/* ── GAME LOGO ── */
.game-logo { text-align: center; position: relative; }
.logo-shadow {
  font-size: 8rem; line-height: 1;
  color: rgba(255,107,43,0.15);
  position: absolute; top: -20px; left: 50%;
  transform: translateX(-50%);
  font-family: serif; pointer-events: none;
  animation: logoGlow 3s ease-in-out infinite;
}
@keyframes logoGlow {
  0%,100% { color: rgba(255,107,43,0.12); text-shadow: none; }
  50% { color: rgba(255,107,43,0.25); text-shadow: 0 0 60px rgba(255,107,43,0.3); }
}
.game-logo h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900; line-height: 0.9;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative; z-index: 1;
}
.game-logo h1 span {
  -webkit-text-stroke: 2px var(--fire);
  color: transparent;
  display: block;
}
.logo-sub {
  font-size: 0.85rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--muted);
  margin-top: 12px;
}

/* ── BUTTONS ── */
.game-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 36px; border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
}
.game-btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s;
}
.game-btn:hover::before { transform: translateX(0); }
.game-btn--primary {
  background: var(--fire);
  color: #fff;
  box-shadow: 0 0 20px rgba(255,107,43,0.4);
}
.game-btn--primary:hover {
  background: #ff7d42;
  box-shadow: 0 0 40px rgba(255,107,43,0.6), 0 4px 20px rgba(255,107,43,0.4);
  transform: translateY(-2px);
}
.game-btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
}
.game-btn--secondary:hover { border-color: var(--fire); color: var(--fire); }
.game-btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.game-btn--ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

/* ── START CONTROLS ── */
.start-controls { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ── CONTROLS HINT ── */
.controls-hint {
  display: flex; align-items: center; gap: 40px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 40px;
  margin-top: 8px;
}
.hint-col {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.85rem; color: var(--muted);
}
.hint-col h4 { color: var(--text); font-size: 0.9rem; margin-bottom: 4px; }
.hint-col span { display: flex; align-items: center; gap: 6px; }
.hint-divider {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem; font-weight: 900;
  color: var(--fire); opacity: 0.6;
}
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px;
  background: var(--surface); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; font-size: 0.72rem; font-family: monospace;
  color: var(--text); font-weight: 700;
}

/* ── SCREEN TITLE ── */
.screen-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900; letter-spacing: 0.1em;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, var(--fire) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── HOW TO PLAY ── */
.howto-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; width: 100%; max-width: 700px;
}
.howto-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  transition: border-color 0.2s;
}
.howto-card:hover { border-color: rgba(255,107,43,0.3); }
.howto-icon { font-size: 2rem; margin-bottom: 10px; }
.howto-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.howto-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ── DIFFICULTY ── */
.difficulty-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.diff-card {
  background: var(--bg-2); border: 2px solid var(--border);
  border-radius: 16px; padding: 32px 28px;
  cursor: pointer; transition: all 0.25s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 160px; font-family: 'Rajdhani', sans-serif;
}
.diff-card:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.2); }
.diff-card--mid:hover { border-color: var(--fire); box-shadow: 0 0 30px rgba(255,107,43,0.2); }
.diff-card--hard:hover { border-color: var(--red); box-shadow: 0 0 30px rgba(255,34,68,0.2); }
.diff-icon { font-size: 2.5rem; }
.diff-card h3 {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em;
}
.diff-card p { font-size: 0.8rem; color: var(--muted); text-align: center; }
.diff-tag {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.08); color: var(--muted);
}
.diff-card--mid .diff-tag { background: rgba(255,107,43,0.15); color: var(--fire); }
.diff-card--hard .diff-tag { background: rgba(255,34,68,0.15); color: var(--red); }

/* ── HUD ── */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
}
.hud__player {
  flex: 1; display: flex; align-items: center; gap: 10px;
}
.hud__player--2 { flex-direction: row-reverse; }
.hud__name {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; white-space: nowrap;
  color: var(--text);
}
.hud__health-bar {
  flex: 1; height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 7px; overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}
.hud__health-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #00ff88, #44ff44);
  border-radius: 7px;
  transition: width 0.15s ease-out;
  position: absolute; left: 0; top: 0;
}
.hud__player--2 .hud__health-fill {
  background: linear-gradient(270deg, #ff4488, #ff2244);
  right: 0; left: auto;
}
.hud__health-damage {
  height: 100%;
  background: rgba(255,200,0,0.5);
  border-radius: 7px;
  position: absolute; left: 0; top: 0;
  transition: width 0.4s ease-out 0.1s;
}
.hud__hp-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem; font-weight: 700;
  min-width: 32px; text-align: center;
  color: var(--text);
}
.hud__center {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 100px;
}
.hud__timer {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem; font-weight: 900;
  color: var(--text); line-height: 1;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.hud__timer.urgent { color: var(--red); animation: timerPulse 0.5s ease-in-out infinite; }
@keyframes timerPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.hud__rounds { display: flex; gap: 6px; }
.round-pip {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s;
}
.round-pip.won { background: var(--fire); box-shadow: 0 0 8px var(--fire); border-color: var(--fire); }

/* ── CANVAS ── */
#gameCanvas {
  display: block;
  width: 100vw; height: 100vh;
  image-rendering: pixelated;
}

/* ── HIT TEXT ── */
.hit-text {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem; font-weight: 900;
  pointer-events: none; z-index: 30;
  opacity: 0; text-align: center;
  text-shadow: 0 0 30px currentColor;
  transition: none;
}
.hit-text.show {
  animation: hitAnim 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes hitAnim {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(0.5); }
  30%  { opacity: 1; transform: translate(-50%,-60%) scale(1.2); }
  70%  { opacity: 0.8; transform: translate(-50%,-65%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-80%) scale(0.8); }
}

/* ── SPECIAL FLASH ── */
.special-flash {
  position: fixed; inset: 0; z-index: 25;
  pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,107,43,0.3) 0%, transparent 70%);
}
.special-flash.flash {
  animation: flashAnim 0.4s ease-out forwards;
}
@keyframes flashAnim {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── PAUSE BUTTON ── */
.pause-btn {
  position: fixed; top: 16px; right: 20px; z-index: 25;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--muted); font-size: 1rem;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.pause-btn:hover { background: rgba(255,255,255,0.15); color: var(--text); }

/* ── ROUND RESULT ── */
.round-result { text-align: center; margin-bottom: 8px; }
.round-result__label {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem; letter-spacing: 0.2em;
  color: var(--muted); margin-bottom: 12px;
}
.round-result__winner {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900; letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 0%, var(--fire) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: winnerPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes winnerPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.round-result__sub {
  font-size: 1rem; color: var(--gold); margin-top: 8px;
  letter-spacing: 0.1em;
}

/* ── GAME OVER ── */
.gameover-art { font-size: 5rem; animation: artBounce 1s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes artBounce { 0%{transform:scale(0) rotate(-20deg)} 100%{transform:scale(1) rotate(0)} }
.gameover-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold) 0%, var(--fire) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.gameover-sub { font-size: 1.1rem; color: var(--muted); }
.gameover-stats {
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 32px;
}
.stat-item { text-align: center; }
.stat-val {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem; font-weight: 900; color: var(--fire);
}
.stat-label { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.1em; margin-top: 4px; }
.gameover-btns { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ── PAUSE MENU ── */
.pause-menu { display: flex; flex-direction: column; gap: 14px; width: 260px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .controls-hint { flex-direction: column; gap: 20px; padding: 20px; }
  .howto-grid { grid-template-columns: 1fr; }
  .difficulty-cards { flex-direction: column; align-items: center; }
  .hud__name { display: none; }
  .hud { padding: 8px 12px; }
}
