/* ============================================
   筋肉ローグライク | Muscle Roguelike
   MuscleLove Dark Neon Theme
   ============================================ */

/* --- CSS VARIABLES --- */
:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --surface-2: #1a1a2e;
  --surface-3: #222240;
  --neon-pink: #ff1493;
  --neon-cyan: #00e5ff;
  --neon-green: #39ff14;
  --neon-gold: #ffd700;
  --neon-red: #ff3333;
  --neon-purple: #bf00ff;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-dark: #555;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-neon-pink: 0 0 20px rgba(255, 20, 147, 0.4);
  --shadow-neon-cyan: 0 0 20px rgba(0, 229, 255, 0.4);
  --shadow-neon-gold: 0 0 20px rgba(255, 215, 0, 0.4);
  --shadow-neon-green: 0 0 20px rgba(57, 255, 20, 0.4);
  --shadow-neon-red: 0 0 20px rgba(255, 51, 51, 0.4);
  --transition: 0.3s ease;
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

/* --- SCREEN SYSTEM --- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px 16px;
  position: relative;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- BILINGUAL TEXT --- */
.title-jp, .name-jp, .desc-jp, .btn-jp, .subtitle-jp,
.inst-jp, .label-jp, .floor-jp, .type-jp, .diff-jp,
.log-jp, .text-jp {
  display: block;
  font-weight: 700;
}

.title-en, .name-en, .desc-en, .btn-en, .subtitle-en,
.inst-en, .label-en, .floor-en, .type-en, .diff-en,
.log-en, .text-en {
  display: block;
  font-size: 0.7em;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* --- BUTTONS --- */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.3;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #fff;
  box-shadow: var(--shadow-neon-pink);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(255, 20, 147, 0.6);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--text-dark);
}

.btn-secondary:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.btn-twitter {
  background: #000;
  color: #fff;
  border: 1px solid #333;
}

.btn-twitter:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.btn-lg {
  padding: 18px 48px;
  font-size: 1.2rem;
  border-radius: 60px;
}

/* Pulse glow animation for START button */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: var(--shadow-neon-pink); }
  50% { box-shadow: 0 0 40px rgba(255, 20, 147, 0.7), 0 0 80px rgba(255, 20, 147, 0.3); }
}

/* --- ACTION BUTTONS (Battle) --- */
.action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  padding: 0 4px;
}

.btn-attack {
  background: linear-gradient(135deg, var(--neon-pink), #cc1177);
  color: #fff;
  box-shadow: var(--shadow-neon-pink);
}

.btn-guard {
  background: linear-gradient(135deg, var(--neon-cyan), #0099cc);
  color: #fff;
  box-shadow: var(--shadow-neon-cyan);
}

.btn-skill {
  background: linear-gradient(135deg, var(--neon-gold), #cc9900);
  color: #111;
  box-shadow: var(--shadow-neon-gold);
}

.btn-item {
  background: linear-gradient(135deg, var(--neon-green), #22aa00);
  color: #111;
  box-shadow: var(--shadow-neon-green);
}

.btn-attack:hover { box-shadow: 0 0 30px rgba(255, 20, 147, 0.6); }
.btn-guard:hover { box-shadow: 0 0 30px rgba(0, 229, 255, 0.6); }
.btn-skill:hover { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); }
.btn-item:hover { box-shadow: 0 0 30px rgba(57, 255, 20, 0.6); }

.action-btns .btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================
   1. TITLE SCREEN
   ============================================ */
#title-screen {
  gap: 12px;
  overflow: hidden;
}

.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 2;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 2rem;
  animation: flexPump 1.5s ease-in-out infinite;
}

@keyframes flexPump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(-5deg); }
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-pink);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
}

.game-title {
  text-align: center;
}

.game-title .title-jp {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 10px rgba(255, 20, 147, 0.3));
}

.game-title .title-en {
  font-size: 1rem;
  color: var(--neon-cyan);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 4px;
}

.subtitle {
  text-align: center;
}

.subtitle .subtitle-jp {
  font-size: 1rem;
  color: var(--text);
}

.subtitle .subtitle-en {
  font-size: 0.75rem;
}

/* Animated muscle emoji background */
.muscle-bg-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  font-size: 2rem;
  opacity: 0.08;
  animation: floatParticle 15s linear infinite;
}

.particle:nth-child(1)  { left: 5%;  animation-delay: 0s;    font-size: 1.5rem; }
.particle:nth-child(2)  { left: 15%; animation-delay: -2s;   font-size: 2.5rem; }
.particle:nth-child(3)  { left: 25%; animation-delay: -4s;   font-size: 1.8rem; }
.particle:nth-child(4)  { left: 35%; animation-delay: -1s;   font-size: 2rem;   }
.particle:nth-child(5)  { left: 45%; animation-delay: -6s;   font-size: 1.6rem; }
.particle:nth-child(6)  { left: 55%; animation-delay: -3s;   font-size: 2.2rem; }
.particle:nth-child(7)  { left: 65%; animation-delay: -8s;   font-size: 1.4rem; }
.particle:nth-child(8)  { left: 75%; animation-delay: -5s;   font-size: 2rem;   }
.particle:nth-child(9)  { left: 85%; animation-delay: -7s;   font-size: 1.7rem; }
.particle:nth-child(10) { left: 10%; animation-delay: -9s;   font-size: 2.3rem; }
.particle:nth-child(11) { left: 40%; animation-delay: -10s;  font-size: 1.5rem; }
.particle:nth-child(12) { left: 60%; animation-delay: -11s;  font-size: 2rem;   }
.particle:nth-child(13) { left: 80%; animation-delay: -12s;  font-size: 1.8rem; }
.particle:nth-child(14) { left: 20%; animation-delay: -13s;  font-size: 2.1rem; }
.particle:nth-child(15) { left: 50%; animation-delay: -14s;  font-size: 1.6rem; }
.particle:nth-child(16) { left: 70%; animation-delay: -3.5s; font-size: 2rem;   }
.particle:nth-child(17) { left: 30%; animation-delay: -7.5s; font-size: 1.9rem; }
.particle:nth-child(18) { left: 90%; animation-delay: -1.5s; font-size: 2.4rem; }

@keyframes floatParticle {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.08; }
  90% { opacity: 0.08; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* --- PATREON LINK --- */
.patreon-link {
  margin-top: 12px;
}

.patreon-link a {
  color: var(--neon-pink);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 8px 20px;
  border: 1px solid rgba(255, 20, 147, 0.3);
  border-radius: 30px;
  transition: all var(--transition);
  display: inline-block;
}

.patreon-link a:hover {
  background: rgba(255, 20, 147, 0.1);
  border-color: var(--neon-pink);
  box-shadow: var(--shadow-neon-pink);
}

/* ============================================
   2. CHARACTER SELECT SCREEN
   ============================================ */
.screen-header {
  margin-bottom: 20px;
  text-align: center;
}

.screen-title .title-jp {
  font-size: 1.6rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.screen-title .title-en {
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.char-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.char-card {
  background: var(--surface);
  border: 2px solid var(--surface-3);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.char-card.unlocked:hover {
  border-color: var(--neon-pink);
  box-shadow: var(--shadow-neon-pink);
  transform: translateY(-4px);
}

.char-card.unlocked:active {
  transform: scale(0.97);
}

.char-card.selected {
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
  background: var(--surface-2);
}

.char-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.char-name .name-jp {
  font-size: 1.1rem;
  color: var(--neon-gold);
}

.char-name .name-en {
  font-size: 0.7rem;
}

.char-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 8px 0;
}

.stat {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
}

.stat-hp { color: var(--neon-red); }
.stat-atk { color: var(--neon-pink); }
.stat-def { color: var(--neon-cyan); }

.char-desc .desc-jp {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

.char-desc .desc-en {
  font-size: 0.65rem;
}

/* Locked Character Card */
.char-card.locked {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.5);
}

.char-card.locked:hover {
  transform: none;
  border-color: var(--surface-3);
  box-shadow: none;
}

.char-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
  border-radius: var(--radius);
}

/* ============================================
   3. MAP SCREEN
   ============================================ */
#map-screen {
  justify-content: flex-start;
  padding-top: 0;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hud-floor {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-gold);
}

.hud-floor .floor-jp,
.hud-floor .floor-en {
  display: inline;
  font-size: inherit;
}

.hud-floor .floor-en {
  color: var(--text-dim);
  font-size: 0.65rem;
  margin-left: 2px;
}

.hud-left,
.hud-right {
  flex-shrink: 0;
  white-space: nowrap;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.hud-char-icon {
  font-size: 1.5rem;
}

.hud-hp-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}

.hud-gold {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-gold);
}

.map-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  width: 100%;
}

.map-title .title-jp {
  font-size: 1.3rem;
  color: var(--text);
  text-align: center;
}

.map-title .title-en {
  text-align: center;
}

.map-paths {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.path-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 2px solid var(--surface-3);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.path-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
  transform: translateX(8px);
}

.path-card:active {
  transform: scale(0.98);
}

.path-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.path-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.path-type .type-jp {
  font-size: 1rem;
}

.path-type .type-en {
  display: inline;
  font-size: 0.7rem;
  margin-left: 4px;
}

.path-difficulty {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}

.path-difficulty .diff-en {
  display: inline;
  font-size: 0.65rem;
  margin-left: 4px;
}

.difficulty-easy {
  background: rgba(57, 255, 20, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.3);
}

.difficulty-medium {
  background: rgba(255, 215, 0, 0.15);
  color: var(--neon-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.difficulty-hard {
  background: rgba(255, 51, 51, 0.15);
  color: var(--neon-red);
  border: 1px solid rgba(255, 51, 51, 0.3);
}

.difficulty-mystery {
  background: rgba(191, 0, 255, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(191, 0, 255, 0.3);
}

.difficulty-boss {
  background: rgba(255, 51, 51, 0.2);
  color: var(--neon-red);
  border: 1px solid rgba(255, 51, 51, 0.5);
  animation: bossDiffPulse 1.5s ease-in-out infinite;
  font-weight: 900;
}

@keyframes bossDiffPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 51, 51, 0.3); }
  50% { box-shadow: 0 0 15px rgba(255, 51, 51, 0.6); }
}

/* Floor Indicator */
.floor-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 20px;
}

.floor-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: all var(--transition);
}

.floor-dot.active {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--shadow-neon-cyan);
  background: var(--surface);
}

.floor-dot.cleared {
  border-color: var(--neon-green);
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.1);
}

.floor-dot.boss-dot {
  font-size: 1rem;
  width: 40px;
  height: 40px;
}

.floor-dot.boss-dot.active {
  border-color: var(--neon-red);
  box-shadow: var(--shadow-neon-red);
  animation: bossFloorPulse 1.5s ease-in-out infinite;
}

@keyframes bossFloorPulse {
  0%, 100% { box-shadow: var(--shadow-neon-red); }
  50% { box-shadow: 0 0 30px rgba(255, 51, 51, 0.6); }
}

.floor-connector {
  width: 24px;
  height: 2px;
  background: var(--surface-3);
}

/* ============================================
   4. BATTLE SCREEN
   ============================================ */
#battle-screen {
  justify-content: space-between;
  padding: 12px 16px;
  gap: 8px;
}

.battle-hud {
  width: 100%;
  text-align: center;
  padding: 4px;
}

.battle-floor {
  font-size: 0.85rem;
  color: var(--neon-gold);
  font-weight: 700;
}

.battle-floor .floor-jp,
.battle-floor .floor-en {
  display: inline;
  font-size: inherit;
}

.battle-floor .floor-en {
  color: var(--text-dim);
  font-size: 0.65rem;
}

/* Enemy Area */
.enemy-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  position: relative;
  border: 2px solid var(--surface-3);
  transition: all var(--transition);
}

.enemy-icon {
  font-size: 4rem;
  transition: transform 0.1s;
}

.enemy-info {
  text-align: center;
  width: 100%;
}

.enemy-name .name-jp {
  font-size: 1.1rem;
  color: var(--neon-red);
}

.enemy-name .name-en {
  font-size: 0.7rem;
}

/* HP Bars */
.hp-bar {
  width: 100%;
  height: 12px;
  background: var(--surface-3);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
}

.hp-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease, background 0.5s ease;
  background: linear-gradient(90deg, var(--neon-green), #66ff66);
  position: relative;
}

.hp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px 6px 0 0;
}

/* HP color transitions */
.hp-fill.hp-medium {
  background: linear-gradient(90deg, var(--neon-gold), #ffee55);
}

.hp-fill.hp-low {
  background: linear-gradient(90deg, var(--neon-red), #ff6666);
  animation: hpPulse 0.8s ease-in-out infinite;
}

@keyframes hpPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.hp-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  display: block;
  margin-top: 2px;
}

.enemy-hp-bar {
  height: 10px;
}

/* Status Effects */
.status-effects {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.status-icon {
  font-size: 1.2rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  position: relative;
}

.status-icon.buff {
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
}

.status-icon.debuff {
  border: 1px solid var(--neon-red);
  box-shadow: 0 0 6px rgba(255, 51, 51, 0.3);
}

.status-count {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.55rem;
  background: var(--neon-cyan);
  color: #000;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Battle Log */
.battle-log {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid var(--surface-3);
  scroll-behavior: smooth;
}

.log-entry {
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: logSlideIn 0.3s ease;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry .log-jp {
  font-size: 0.85rem;
  font-weight: 600;
}

.log-entry .log-en {
  font-size: 0.65rem;
}

@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Player Area */
.player-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.player-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.player-name {
  font-weight: 700;
  color: var(--neon-cyan);
  font-size: 1rem;
  flex-shrink: 0;
}

.player-info .hp-bar {
  flex: 1;
}

.player-info .hp-text {
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

.player-stats-inline {
  display: flex;
  gap: 16px;
}

.stat-inline {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Damage Numbers */
.damage-numbers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.damage-num {
  position: absolute;
  font-size: 1.8rem;
  font-weight: 900;
  animation: damageFloat 1s ease-out forwards;
  text-shadow: 0 0 10px currentColor, 2px 2px 0 #000;
  pointer-events: none;
}

.damage-num.damage-dealt {
  color: var(--neon-red);
}

.damage-num.damage-heal {
  color: var(--neon-green);
}

.damage-num.damage-blocked {
  color: var(--neon-cyan);
  font-size: 1.2rem;
}

@keyframes damageFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  20% {
    transform: translateY(-20px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0.8);
  }
}

/* Relic Bar */
.relic-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-3);
  min-height: 40px;
}

.relic-label .label-jp {
  font-size: 0.7rem;
  color: var(--neon-gold);
  white-space: nowrap;
}

.relic-label .label-en {
  font-size: 0.55rem;
  white-space: nowrap;
}

.relic-icons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.relic-icon {
  font-size: 1.2rem;
  padding: 2px 4px;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--neon-gold);
  animation: relicAppear 0.5s ease;
}

@keyframes relicAppear {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* Boss Mode */
#battle-screen.boss-mode .enemy-area {
  border-color: var(--neon-red);
  box-shadow: var(--shadow-neon-red);
  animation: bossBorderPulse 2s ease-in-out infinite;
}

#battle-screen.boss-mode .enemy-icon {
  font-size: 5rem;
  animation: bossIdle 2s ease-in-out infinite;
}

@keyframes bossBorderPulse {
  0%, 100% {
    border-color: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
  }
  50% {
    border-color: #ff6600;
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.5), 0 0 80px rgba(255, 51, 51, 0.2);
  }
}

@keyframes bossIdle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Battle Animations */
@keyframes enemyShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.shake {
  animation: enemyShake 0.4s ease !important;
}

@keyframes playerHit {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(8px); }
  50% { transform: translateX(-8px); }
  75% { transform: translateX(4px); }
}

.hit {
  animation: playerHit 0.4s ease !important;
}

@keyframes flashRed {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(255, 51, 51, 0.2); }
}

.flash-red {
  animation: flashRed 0.3s ease;
}

@keyframes guardFlash {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.15); }
  50% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.6); }
}

.guard-flash {
  animation: guardFlash 0.5s ease;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
  animation: slideInRight 0.5s ease;
}

/* ============================================
   5. REWARD SCREEN
   ============================================ */
#reward-screen {
  gap: 20px;
}

.victory-text .title-jp {
  font-size: 2rem;
  color: var(--neon-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.victory-text .title-en {
  font-size: 1rem;
  letter-spacing: 3px;
}

.reward-instruction .inst-jp {
  font-size: 1rem;
  color: var(--text);
}

.reward-instruction .inst-en {
  font-size: 0.75rem;
}

.reward-cards {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.reward-card {
  flex: 1;
  max-width: 140px;
  perspective: 600px;
  cursor: pointer;
}

.reward-card-inner {
  background: var(--surface);
  border: 2px solid var(--surface-3);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  transition: all 0.4s ease;
  transform-style: preserve-3d;
}

.reward-card:hover .reward-card-inner {
  border-color: var(--neon-gold);
  box-shadow: var(--shadow-neon-gold);
  transform: translateY(-8px) rotateY(5deg);
}

.reward-card.selected .reward-card-inner {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
  background: var(--surface-2);
}

.reward-card.not-selected .reward-card-inner {
  opacity: 0.3;
  transform: scale(0.95);
}

.reward-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reward-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.reward-name .name-jp {
  font-size: 0.85rem;
  color: var(--neon-gold);
}

.reward-name .name-en {
  font-size: 0.6rem;
}

.reward-desc {
  margin: 6px 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.reward-desc .desc-en {
  font-size: 0.6rem;
}

.reward-stats {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-green);
  margin-top: 6px;
}

/* Reward card flip animation */
@keyframes cardFlip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

.reward-card.flip .reward-card-inner {
  animation: cardFlip 0.6s ease;
}

/* ============================================
   7. GAME OVER SCREEN
   ============================================ */
#gameover-screen {
  background: radial-gradient(ellipse at center, rgba(255, 51, 51, 0.08) 0%, var(--bg) 70%);
}

.gameover-title .title-jp {
  font-size: 2rem;
  color: var(--neon-red);
  text-shadow: 0 0 20px rgba(255, 51, 51, 0.5);
}

.gameover-title .title-en {
  font-size: 1rem;
  letter-spacing: 5px;
  color: var(--neon-red);
  opacity: 0.7;
}

.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 2;
}

.run-stats {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-3);
}

.stat-label .label-jp {
  font-size: 0.9rem;
  font-weight: 600;
}

.stat-label .label-en {
  font-size: 0.6rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--neon-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.result-buttons .btn {
  width: 100%;
}

/* ============================================
   8. VICTORY SCREEN
   ============================================ */
#victory-screen {
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.08) 0%, var(--bg) 70%);
  overflow: hidden;
}

.victory-title .title-jp {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--neon-gold), var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: victoryShimmer 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

@keyframes victoryShimmer {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4)) brightness(1); }
  50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) brightness(1.2); }
}

.victory-title .title-en {
  font-size: 1rem;
  letter-spacing: 5px;
  color: var(--neon-gold);
}

/* Unlock Notification */
.unlock-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 20, 147, 0.15));
  border: 2px solid var(--neon-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-neon-gold);
  animation: unlockPulse 1.5s ease-in-out infinite;
}

.unlock-notification.hidden {
  display: none;
}

@keyframes unlockPulse {
  0%, 100% { box-shadow: var(--shadow-neon-gold); }
  50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); }
}

.unlock-icon {
  font-size: 1.8rem;
  animation: unlockSpin 1s ease forwards;
}

@keyframes unlockSpin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
  to { transform: rotate(360deg) scale(1); }
}

.unlock-text .text-jp {
  font-size: 0.95rem;
  color: var(--neon-gold);
}

.unlock-text .text-en {
  font-size: 0.65rem;
}

.unlock-char-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--neon-cyan);
}

/* Confetti Animation */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti {
  position: absolute;
  font-size: 1.8rem;
  animation: confettiFall linear infinite;
  opacity: 0.8;
}

.confetti:nth-child(1)  { left: 5%;  animation-duration: 3s;   animation-delay: 0s;   }
.confetti:nth-child(2)  { left: 15%; animation-duration: 3.5s; animation-delay: -0.5s; }
.confetti:nth-child(3)  { left: 25%; animation-duration: 4s;   animation-delay: -1s;   }
.confetti:nth-child(4)  { left: 35%; animation-duration: 3.2s; animation-delay: -1.5s; }
.confetti:nth-child(5)  { left: 50%; animation-duration: 3.8s; animation-delay: -0.3s; }
.confetti:nth-child(6)  { left: 60%; animation-duration: 4.2s; animation-delay: -2s;   }
.confetti:nth-child(7)  { left: 70%; animation-duration: 3.3s; animation-delay: -0.8s; }
.confetti:nth-child(8)  { left: 80%; animation-duration: 3.6s; animation-delay: -1.2s; }
.confetti:nth-child(9)  { left: 88%; animation-duration: 4s;   animation-delay: -0.6s; }
.confetti:nth-child(10) { left: 95%; animation-duration: 3.4s; animation-delay: -1.8s; }
.confetti:nth-child(11) { left: 42%; animation-duration: 3.7s; animation-delay: -2.2s; }
.confetti:nth-child(12) { left: 73%; animation-duration: 3.1s; animation-delay: -0.2s; }

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ============================================
   RESPONSIVE / MOBILE-FIRST
   ============================================ */
@media (max-width: 380px) {
  .game-title .title-jp {
    font-size: 1.7rem;
  }

  .char-grid {
    gap: 8px;
  }

  .char-card {
    padding: 12px 8px;
  }

  .char-icon {
    font-size: 2rem;
  }

  .char-stats {
    gap: 3px;
  }

  .stat {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .action-btns {
    gap: 6px;
  }

  .action-btns .btn {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .reward-cards {
    gap: 6px;
  }

  .reward-card-inner {
    padding: 12px 6px;
  }

  .enemy-icon {
    font-size: 3rem;
  }

  #battle-screen.boss-mode .enemy-icon {
    font-size: 4rem;
  }
}

@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--surface-3);
    border-right: 1px solid var(--surface-3);
  }

  .char-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .reward-card {
    max-width: 160px;
  }

  .action-btns {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (min-width: 768px) {
  #app {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
}

/* ============================================
   UTILITY
   ============================================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
