/* ============================================
   DISASTER MEDICINE SURVIVAL GAME — V4
   Manga Character + Narrative Upgrade
   Mobile-first, QR-accessible, gamified
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg: #06080d;
  --surface: #0e1118;
  --surface-2: #161a24;
  --surface-3: #1e2330;
  --border: rgba(255,255,255,0.06);
  --border-active: rgba(255,255,255,0.14);
  --text: #eef0f6;
  --text-muted: #6b7394;
  --text-faint: #3d4560;

  --red: #ff3b5c;
  --red-glow: rgba(255,59,92,0.35);
  --yellow: #ffca28;
  --yellow-glow: rgba(255,202,40,0.35);
  --green: #00e676;
  --green-glow: rgba(0,230,118,0.35);
  --black-tag: #455a64;

  --blue: #448aff;
  --blue-glow: rgba(68,138,255,0.3);
  --purple: #b388ff;
  --purple-glow: rgba(179,136,255,0.3);
  --cyan: #00e5ff;
  --cyan-glow: rgba(0,229,255,0.25);
  --orange: #ff9100;
  --amber: #f59e0b;
  --amber-glow: rgba(245,158,11,0.3);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 200ms var(--ease);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* Particle background */
#particles-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.15;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% { transform: translateY(100dvh) scale(0); opacity: 0; }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-10dvh) scale(1); opacity: 0; }
}

/* ============================================
   MANGA CHARACTER SYSTEM
   ============================================ */

.char-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.char-container.right {
  flex-direction: row-reverse;
}

.char-avatar-wrap {
  flex-shrink: 0;
  position: relative;
}

.char-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-active);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.char-avatar svg {
  width: 100%;
  height: 100%;
}

.char-avatar .char-emoji {
  font-size: 32px;
  line-height: 1;
}

.char-name-tag {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.55rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 2;
}

.char-name-tag.mentor { background: var(--blue); color: #fff; }
.char-name-tag.nurse { background: var(--green); color: #000; }
.char-name-tag.paramedic { background: var(--orange); color: #fff; }
.char-name-tag.villain { background: var(--red); color: #fff; }
.char-name-tag.patient { background: var(--yellow); color: #000; }
.char-name-tag.commander { background: var(--purple); color: #fff; }

/* Speech Bubble */
.speech-bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-active);
  border-radius: 16px;
  padding: 12px 16px;
  max-width: calc(100% - 80px);
  animation: bubble-in 0.35s var(--ease) both;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: 12px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.char-container:not(.right) .speech-bubble::before {
  left: -15px;
  border-right-color: var(--border-active);
}

.char-container.right .speech-bubble::before {
  right: -15px;
  border-left-color: var(--border-active);
}

.speech-bubble.urgent {
  border-color: var(--red);
  background: rgba(255,59,92,0.06);
  animation: bubble-in 0.35s var(--ease) both, bubble-pulse 2s ease infinite;
}

.speech-bubble.urgent::before {
  border-right-color: var(--red);
}

.char-container.right .speech-bubble.urgent::before {
  border-right-color: transparent;
  border-left-color: var(--red);
}

.speech-bubble.success {
  border-color: var(--green);
  background: rgba(0,230,118,0.06);
}

.speech-bubble.warn {
  border-color: var(--yellow);
  background: rgba(255,202,40,0.06);
}

.speech-bubble .char-dialogue {
  font-size: 0.88rem;
  line-height: 1.55;
  font-weight: 500;
}

.speech-bubble .char-dialogue strong {
  color: var(--cyan);
  font-weight: 700;
}

.speech-bubble .char-dialogue em {
  color: var(--yellow);
  font-style: normal;
  font-weight: 600;
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bubble-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,59,92,0.15); }
  50% { box-shadow: 0 0 20px 4px rgba(255,59,92,0.08); }
}

/* Thought bubble */
.thought-bubble {
  background: var(--surface-2);
  border: 1px dashed var(--border-active);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: calc(100% - 80px);
  animation: bubble-in 0.4s var(--ease) both;
}

/* Typewriter effect for dramatic dialogue */
.typewriter-text {
  overflow: hidden;
  white-space: normal;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  animation: cursor-blink 0.7s ease infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   NARRATIVE PANEL (Manga-style)
   ============================================ */

.narrative-panel {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.narrative-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.narrative-panel.danger::before { background: linear-gradient(90deg, var(--red), var(--orange)); }
.narrative-panel.info::before { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.narrative-panel.success::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.narrative-panel.warning::before { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.narrative-panel.purple::before { background: linear-gradient(90deg, var(--purple), var(--blue)); }

.narrative-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.narrative-icon {
  font-size: 20px;
}

.narrative-tag {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.narrative-tag.emergency { background: rgba(255,59,92,0.15); color: var(--red); }
.narrative-tag.situation { background: rgba(68,138,255,0.15); color: var(--blue); }
.narrative-tag.alert { background: rgba(255,202,40,0.15); color: var(--yellow); }
.narrative-tag.mission { background: rgba(179,136,255,0.15); color: var(--purple); }

.narrative-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

.narrative-text .highlight {
  color: var(--cyan);
  font-weight: 600;
}

/* Dramatic scene transition */
.scene-transition {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  pointer-events: none;
  animation: scene-flash 1.2s ease both;
}

.scene-transition .scene-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px currentColor;
}

.scene-transition .scene-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@keyframes scene-flash {
  0% { background: rgba(6,8,13,1); opacity: 1; }
  20% { background: rgba(6,8,13,0.95); opacity: 1; }
  80% { background: rgba(6,8,13,0.95); opacity: 1; }
  100% { background: rgba(6,8,13,0); opacity: 0; }
}

/* ============================================
   DRAMATIC EFFECTS
   ============================================ */

/* Impact frame */
.impact-frame {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  border: 6px solid var(--red);
  animation: impact-flash 0.5s ease both;
}

@keyframes impact-flash {
  0% { opacity: 1; border-width: 6px; }
  50% { opacity: 0.8; border-width: 3px; }
  100% { opacity: 0; border-width: 0; }
}

.impact-frame.green { border-color: var(--green); }
.impact-frame.blue { border-color: var(--blue); }

/* Dramatic reveal */
.dramatic-reveal {
  animation: dramatic-in 0.6s var(--ease) both;
}

@keyframes dramatic-in {
  0% { opacity: 0; transform: scale(1.1); filter: brightness(2); }
  50% { opacity: 1; transform: scale(1.02); filter: brightness(1.3); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

/* Danger pulse overlay */
.danger-pulse {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: danger-glow 2s ease infinite;
}

@keyframes danger-glow {
  0%,100% { box-shadow: inset 0 0 60px rgba(255,59,92,0); }
  50% { box-shadow: inset 0 0 60px rgba(255,59,92,0.08); }
}

/* Speed lines (manga action effect) */
.speed-lines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-conic-gradient(
    rgba(255,255,255,0.02) 0deg 2deg,
    transparent 2deg 4deg
  );
  animation: speed-rotate 0.5s linear;
  opacity: 0;
}

.speed-lines.active {
  animation: speed-rotate 0.5s linear, speed-fade 0.5s ease;
}

@keyframes speed-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(5deg); }
}

@keyframes speed-fade {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* Heartbeat effect for critical moments */
.heartbeat-effect {
  animation: heartbeat 1s ease infinite;
}

@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  15% { transform: scale(1.04); }
  30% { transform: scale(1); }
  45% { transform: scale(1.02); }
}

/* Glitch effect for villain */
.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  color: var(--red);
  animation: glitch-1 0.3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after {
  color: var(--cyan);
  animation: glitch-2 0.3s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
}

@keyframes glitch-2 {
  0%,100% { transform: translateX(0); }
  40% { transform: translateX(2px); }
  80% { transform: translateX(-2px); }
}

/* Countdown dramatic */
.countdown-dramatic {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 2rem;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
  animation: count-shake 0.15s ease infinite;
}

@keyframes count-shake {
  0%,100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-1px) rotate(-0.5deg); }
  75% { transform: translateX(1px) rotate(0.5deg); }
}

/* Achievement toast */
.achievement-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 200;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,145,0,0.1));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.5s var(--ease) forwards, toast-out 0.4s var(--ease) 2.5s forwards;
  backdrop-filter: blur(20px);
}

@keyframes toast-in {
  to { transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  to { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}

.achievement-toast .toast-icon {
  font-size: 24px;
}

.achievement-toast .toast-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--yellow);
}

.achievement-toast .toast-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================
   INTRO / NICKNAME SCREEN
   ============================================ */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;          /* allow flex child to shrink below content */
}

/* Prevent flex from compressing game content — let .screen scroll instead */
.screen > * {
  flex-shrink: 0;
}

.intro-screen {
  align-items: center;
  justify-content: safe center;
  padding: 24px;
  text-align: center;
  gap: 14px;
  overflow-y: auto;
}

.intro-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.game-logo {
  width: 100px;
  height: 100px;
  position: relative;
  margin-bottom: 8px;
}

.game-logo svg { width: 100%; height: 100%; }

.pulse-ring {
  position: absolute;
  inset: -8px;
  border: 2px solid var(--red);
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

.game-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.game-title .em { color: var(--red); }

.game-subtitle {
  font-size: clamp(0.85rem, 3vw, 1rem);
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.5;
}

/* QR Section */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-box {
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qr-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(68,138,255,0.08);
  pointer-events: none;
}

.qr-box svg {
  width: 100%;
  height: 100%;
}

.qr-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

@media (max-height: 700px) {
  .qr-box {
    width: 120px;
    height: 120px;
    padding: 8px;
  }
  .intro-screen { gap: 10px; }
  .game-logo { width: 64px; height: 64px; }
  .game-title { font-size: clamp(1.4rem, 5vw, 2rem); }
}

/* Nickname Input */
.nick-input-wrap {
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
}

.nick-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.nick-input::placeholder { color: var(--text-faint); }
.nick-input:focus { border-color: var(--blue); box-shadow: 0 0 20px var(--blue-glow); }

.enter-btn {
  width: 100%;
  max-width: 320px;
  padding: 18px;
  background: linear-gradient(135deg, var(--red), #ff6b3b);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(255,59,92,0.3);
  margin-top: 4px;
}

.enter-btn:active { transform: scale(0.97); }
.enter-btn:disabled { opacity: 0.4; pointer-events: none; }

.badge-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-badge {
  padding: 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   GAME HEADER (sticky)
   ============================================ */

.game-hud {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6,8,13,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.hud-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hud-stat .icon { font-size: 14px; }

.streak-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  animation: streak-pop 0.3s var(--ease);
}

@keyframes streak-pop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-timer {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.hud-timer.urgent { color: var(--red); animation: timer-blink 0.5s ease infinite; }

@keyframes timer-blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   MODE SELECT (HOME)
   ============================================ */

.mode-screen {
  padding: 20px 16px;
  gap: 16px;
  padding-bottom: 40px;
}

.mode-header {
  text-align: center;
  padding: 12px 0;
}

.mode-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  letter-spacing: -0.02em;
}

.mode-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.mode-card::after {
  content: '\2192';
  position: absolute;
  right: 20px;
  font-size: 1.2rem;
  color: var(--text-faint);
  transition: all var(--transition);
}

.mode-card:active { transform: scale(0.98); }
.mode-card:active::after { right: 16px; color: var(--text); }

.mode-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.mode-card[data-mode="triage"] .mode-icon { background: rgba(255,59,92,0.12); }
.mode-card[data-mode="mci"] .mode-icon { background: rgba(255,202,40,0.12); }
.mode-card[data-mode="cbrne"] .mode-icon { background: rgba(179,136,255,0.12); }
.mode-card[data-mode="quiz"] .mode-icon { background: rgba(0,230,118,0.12); }
.mode-card[data-mode="boss"] .mode-icon { background: rgba(255,145,0,0.12); }
.mode-card[data-mode="ethics"] .mode-icon { background: rgba(0,229,255,0.12); }
.mode-card[data-mode="leadership"] .mode-icon { background: rgba(179,136,255,0.12); }
.mode-card[data-mode="teamwork"] .mode-icon { background: rgba(245,158,11,0.12); }

.mode-info h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}

.mode-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mode-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
}

.mode-card[data-mode="triage"] .mode-tag { background: rgba(255,59,92,0.1); color: var(--red); }
.mode-card[data-mode="mci"] .mode-tag { background: rgba(255,202,40,0.1); color: var(--yellow); }
.mode-card[data-mode="cbrne"] .mode-tag { background: rgba(179,136,255,0.1); color: var(--purple); }
.mode-card[data-mode="quiz"] .mode-tag { background: rgba(0,230,118,0.1); color: var(--green); }
.mode-card[data-mode="boss"] .mode-tag { background: rgba(255,145,0,0.1); color: var(--orange); }
.mode-card[data-mode="ethics"] .mode-tag { background: rgba(0,229,255,0.1); color: var(--cyan); }
.mode-card[data-mode="leadership"] .mode-tag { background: rgba(179,136,255,0.1); color: var(--purple); }
.mode-card[data-mode="teamwork"] .mode-tag { background: rgba(245,158,11,0.1); color: var(--amber); }

/* Leaderboard */
.leaderboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.leaderboard-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.lb-row:last-child { border-bottom: none; }

.lb-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.lb-rank.gold { background: linear-gradient(135deg, #ffd700, #ffab00); color: #000; }
.lb-rank.silver { background: linear-gradient(135deg, #b0bec5, #78909c); color: #000; }
.lb-rank.bronze { background: linear-gradient(135deg, #d7a86e, #a1887f); color: #000; }
.lb-rank.normal { background: var(--surface-2); color: var(--text-muted); }

.lb-name { flex: 1; font-weight: 500; }
.lb-name.me { color: var(--cyan); font-weight: 700; }

.lb-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
}

/* ============================================
   TRIAGE GAME
   ============================================ */

.triage-game {
  padding: 0 16px 24px;
  gap: 12px;
}

/* Countdown overlay */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6,8,13,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.countdown-number {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(5rem, 20vw, 10rem);
  color: var(--red);
  text-shadow: 0 0 60px var(--red-glow), 0 0 120px var(--red-glow);
  animation: count-pop 0.4s var(--ease);
  line-height: 1;
}

@keyframes count-pop {
  0% { transform: scale(2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Scene Banner */
.scene-banner {
  background: linear-gradient(135deg, rgba(255,59,92,0.08), rgba(255,145,0,0.04));
  border: 1px solid rgba(255,59,92,0.15);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scene-alert {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,59,92,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  animation: alert-pulse 2s ease infinite;
}

@keyframes alert-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,59,92,0.3); }
  50% { box-shadow: 0 0 24px 4px rgba(255,59,92,0.15); }
}

.scene-text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.scene-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Patient Card */
.patient-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.patient-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.patient-avatar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.patient-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.patient-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.patient-meta { font-size: 0.72rem; color: var(--text-muted); }

.patient-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Vitals */
.vitals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px;
}

.vital-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.vital-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}

.vital-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vital-box.critical .vital-val { color: var(--red); }
.vital-box.warning .vital-val { color: var(--yellow); }
.vital-box.normal .vital-val { color: var(--green); }

/* Findings */
.findings {
  padding: 0 16px 14px;
}

.findings h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.finding-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.finding-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}

/* Triage Buttons */
.triage-action-area {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.triage-action-area h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
  text-align: center;
}

.triage-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.t-btn {
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 2px solid var(--btn-c);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.t-btn .t-label {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: var(--btn-c);
  display: block;
}

.t-btn .t-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.t-btn:active { transform: scale(0.96); }

.t-btn.selected {
  background: var(--btn-c);
  box-shadow: 0 0 30px var(--btn-glow);
}

.t-btn.selected .t-label,
.t-btn.selected .t-sub { color: #fff; }

.t-btn[data-t="red"] { --btn-c: var(--red); --btn-glow: var(--red-glow); }
.t-btn[data-t="yellow"] { --btn-c: var(--yellow); --btn-glow: var(--yellow-glow); }
.t-btn[data-t="green"] { --btn-c: var(--green); --btn-glow: var(--green-glow); }
.t-btn[data-t="black"] { --btn-c: var(--black-tag); --btn-glow: rgba(69,90,100,0.4); }

.t-btn[data-t="yellow"].selected .t-label,
.t-btn[data-t="yellow"].selected .t-sub { color: #000; }

.go-btn {
  width: 100%;
  padding: 16px;
  margin-top: 10px;
  background: var(--blue);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  transition: all var(--transition);
  opacity: 0.35;
  pointer-events: none;
  /* Phase F: 모바일·작은 화면에서도 항상 보이도록 sticky 적용 */
  position: sticky;
  bottom: 8px;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.go-btn.ready { opacity: 1; pointer-events: auto; }
.go-btn.ready:active { transform: scale(0.97); box-shadow: 0 0 24px var(--blue-glow); }

/* ============================================
   FEEDBACK POPUP
   ============================================ */

.feedback-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: safe center;
  justify-content: center;
  background: rgba(6,8,13,0.8);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
}

.feedback-layer.show { opacity: 1; pointer-events: auto; }

.fb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s var(--ease);
}

.feedback-layer.show .fb-card { transform: scale(1) translateY(0); }

.fb-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.fb-icon.correct { background: rgba(0,230,118,0.12); box-shadow: 0 0 40px var(--green-glow); }
.fb-icon.wrong { background: rgba(255,59,92,0.12); box-shadow: 0 0 40px var(--red-glow); }

.fb-card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.fb-answer {
  font-weight: 600;
  color: var(--red);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.fb-explain {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: left;
}

.fb-points {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.fb-points.plus { color: var(--green); }
.fb-points.minus { color: var(--red); }

.fb-combo {
  font-size: 0.78rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 16px;
}

/* Character in feedback */
.fb-char-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
}

.fb-char-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 2px solid var(--blue);
}

.fb-char-dialogue {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  position: relative;
}

.fb-char-dialogue::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 12px;
  border: 5px solid transparent;
  border-right-color: var(--surface-2);
}

.fb-next {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  transition: all var(--transition);
}

.fb-next:active { transform: scale(0.97); }

/* Screen shake */
.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Correct flash */
.flash-green { animation: flash-g 0.4s ease; }
@keyframes flash-g {
  0% { box-shadow: inset 0 0 100px rgba(0,230,118,0.3); }
  100% { box-shadow: inset 0 0 0 transparent; }
}

.flash-red { animation: flash-r 0.4s ease; }
@keyframes flash-r {
  0% { box-shadow: inset 0 0 100px rgba(255,59,92,0.3); }
  100% { box-shadow: inset 0 0 0 transparent; }
}

/* ============================================
   QUIZ GAME
   ============================================ */

.quiz-game {
  padding: 0 16px 24px;
  gap: 12px;
}

.quiz-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-pbar-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.pbar-track {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease);
}

.quiz-q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.quiz-q-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.15rem);
  line-height: 1.45;
  margin-bottom: 18px;
}

.quiz-opts { display: flex; flex-direction: column; gap: 10px; }

.q-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: left;
}

.q-opt:active { transform: scale(0.98); }

.q-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.q-opt-text { font-size: 0.85rem; font-weight: 500; line-height: 1.35; }

.q-opt.selected { border-color: var(--blue); background: rgba(68,138,255,0.06); }
.q-opt.selected .q-letter { background: var(--blue); border-color: var(--blue); color: #fff; }

.q-opt.correct { border-color: var(--green); background: rgba(0,230,118,0.06); }
.q-opt.correct .q-letter { background: var(--green); border-color: var(--green); color: #fff; }

.q-opt.wrong { border-color: var(--red); background: rgba(255,59,92,0.06); }
.q-opt.wrong .q-letter { background: var(--red); border-color: var(--red); color: #fff; }

.quiz-explanation {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  animation: fadeSlide 0.3s var(--ease);
}

.quiz-next-btn {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  background: var(--blue);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  transition: all var(--transition);
}

.quiz-next-btn:active { transform: scale(0.97); }

/* ============================================
   CBRNE GAME
   ============================================ */

.cbrne-game {
  padding: 0 16px 24px;
  gap: 12px;
}

.cbrne-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.cbrne-tab {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}

.cbrne-tab.active { background: rgba(179,136,255,0.15); border-color: var(--purple); color: var(--purple); }

.cbrne-brief {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.cbrne-brief .threat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background: rgba(179,136,255,0.1);
  color: var(--purple);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.cbrne-brief h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.cbrne-brief p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cbrne-progress-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cbrne-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cb-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.cb-step:active:not(.done) { transform: scale(0.98); }

.cb-step.done { opacity: 0.5; pointer-events: none; }
.cb-step.done.ok { border-color: var(--green); }
.cb-step.done.nope { border-color: var(--red); }

.cb-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.cb-step.done.ok .cb-num { background: var(--green); color: #fff; }
.cb-step.done.nope .cb-num { background: var(--red); color: #fff; }

.cb-step h4 { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.cb-step p { font-size: 0.73rem; color: var(--text-muted); line-height: 1.4; }

/* ============================================
   MCI GAME
   ============================================ */

.mci-game {
  padding: 0 16px 24px;
  gap: 12px;
}

.mci-stats-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mci-stat-chip {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}

.mci-stat-chip .num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.mci-stat-chip .lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.mci-q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.mci-q-card .q-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mci-q-card .q-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.45;
  margin-bottom: 16px;
}

.mci-opts { display: flex; flex-direction: column; gap: 10px; }

.mci-opt {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  transition: all var(--transition);
}

.mci-opt:active { transform: scale(0.98); }

/* ============================================
   ETHICS / LEADERSHIP / TEAMWORK
   ============================================ */

.ethics-game,
.leadership-game,
.teamwork-game {
  padding: 0 16px 24px;
  gap: 12px;
}

.dilemma-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.dilemma-card .dilemma-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.dilemma-card .dilemma-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.45;
  margin-bottom: 16px;
}

.dilemma-opts { display: flex; flex-direction: column; gap: 10px; }

.dilemma-opt {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  transition: all var(--transition);
}

.dilemma-opt:active { transform: scale(0.98); }

.dilemma-opt.best { border-color: var(--green); background: rgba(0,230,118,0.06); }
.dilemma-opt.ok { border-color: var(--yellow); background: rgba(255,202,40,0.06); }
.dilemma-opt.bad { border-color: var(--red); background: rgba(255,59,92,0.06); }

/* ============================================
   RESULTS SCREEN
   ============================================ */

.results-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 16px;
}

.result-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 5rem);
  background: linear-gradient(135deg, var(--blue), var(--cyan), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.result-sub {
  font-size: 1rem;
  color: var(--text-muted);
}

.result-grade {
  display: inline-flex;
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

.result-grade.s { background: linear-gradient(135deg, #ffd700, #ff9100); color: #000; box-shadow: 0 0 30px rgba(255,215,0,0.3); }
.result-grade.a { background: rgba(0,230,118,0.15); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.result-grade.b { background: rgba(68,138,255,0.15); color: var(--blue); border: 1px solid rgba(68,138,255,0.3); }
.result-grade.c { background: rgba(255,202,40,0.15); color: var(--yellow); border: 1px solid rgba(255,202,40,0.3); }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.r-stat {
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.r-stat .val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.r-stat .lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.result-actions button {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.result-actions button:active { transform: scale(0.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ============================================
   BOSS ROUND
   ============================================ */

.boss-banner {
  background: linear-gradient(135deg, rgba(255,145,0,0.1), rgba(255,59,92,0.05));
  border: 1px solid rgba(255,145,0,0.2);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.boss-banner h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--orange);
  margin-bottom: 4px;
}

.boss-banner p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.anim-in {
  animation: fadeSlide 0.35s var(--ease) both;
}

.stagger > :nth-child(1) { animation-delay: 0ms; }
.stagger > :nth-child(2) { animation-delay: 50ms; }
.stagger > :nth-child(3) { animation-delay: 100ms; }
.stagger > :nth-child(4) { animation-delay: 150ms; }
.stagger > :nth-child(5) { animation-delay: 200ms; }
.stagger > :nth-child(6) { animation-delay: 250ms; }
.stagger > :nth-child(7) { animation-delay: 300ms; }
.stagger > :nth-child(8) { animation-delay: 350ms; }

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  z-index: 200;
  pointer-events: none;
  animation: confetti-fall 1.5s ease forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100dvh) rotate(720deg); opacity: 0; }
}

/* Scrollbar hide */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* XP bar */
.xp-bar-wrap {
  width: 100%;
  max-width: 360px;
}

.xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.xp-bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

/* ============================================
   CHARACTER EXPRESSION OVERLAYS
   ============================================ */

.char-expression {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 16px;
  animation: expression-pop 0.3s var(--ease);
}

@keyframes expression-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mentor thinking dots */
.thinking-dots {
  display: inline-flex;
  gap: 3px;
  padding: 0 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-bounce 1.4s ease infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Emergency siren effect */
.siren-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue), var(--red), var(--blue));
  background-size: 200% 100%;
  animation: siren-scroll 1s linear infinite;
}

@keyframes siren-scroll {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ============================================
   RPG UPGRADE — CSS v5
   ============================================ */

/* ---- XP PROGRESS BAR (below HUD) ---- */
.xp-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  position: sticky;
  top: 56px;
  z-index: 90;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4fc3f7, #00e676);
  transition: width 0.6s cubic-bezier(.23,1,.32,1);
  box-shadow: 0 0 8px #4fc3f755;
}

/* ---- HUD CLASS BADGE ---- */
.hud-class-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- CLASS SELECT SCREEN ---- */
.class-select-screen {
  text-align: center;
  padding: 20px 16px 40px;
}
.class-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 16px 0 12px;
  background: linear-gradient(135deg, #ffca28, #ff3b5c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.class-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.class-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  color: var(--text);
}
.class-card:hover, .class-card:active {
  border-color: var(--class-color, #4fc3f7);
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--class-color, #4fc3f7) 30%, transparent);
}
.class-icon-big {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 8px var(--class-color, #4fc3f7));
}
.class-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--class-color, #fff);
}
.class-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.class-passive {
  font-size: 0.68rem;
  color: var(--class-color, #4fc3f7);
  opacity: 0.8;
  margin-top: 4px;
}
.skip-class {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ---- CUTSCENE SCREEN ---- */
.cutscene-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  text-align: center;
  gap: 16px;
}
.cut-act-label {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ff3b5c, #ffca28);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
.cut-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
}
.cut-dialogue-area {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cut-modes-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.cut-mode-chip {
  background: rgba(255,255,255,0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
}
.cut-start {
  padding: 14px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 14px;
  margin-top: 8px;
  animation-delay: 1800ms;
}

/* ---- RPG NAV BAR (mode select) ---- */
.rpg-nav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.rpg-nav-btn {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rpg-nav-btn:hover, .rpg-nav-btn:active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}
.sp-dot {
  background: #ff3b5c;
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.achieve-count {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 400;
}

/* ---- STORY ACT BANNER ---- */
.story-act-banner {
  background: linear-gradient(135deg, rgba(255,59,92,0.08), rgba(255,202,40,0.08));
  border: 1px solid rgba(255,59,92,0.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.act-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff3b5c, #ffca28);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.act-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.act-progress {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: center;
}
.act-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  transition: all 0.3s;
}
.act-dot.done {
  background: #00e67633;
  border-color: #00e676;
  color: #00e676;
}
.act-dot.current {
  background: #ff3b5c33;
  border-color: #ff3b5c;
  color: #ff3b5c;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ---- MODE CARD RPG ENHANCEMENTS ---- */
.mode-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}
.mode-bonus-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(79,195,247,0.15);
  color: #4fc3f7;
  font-weight: 600;
}
.act-mode-tag {
  display: inline-block;
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255,59,92,0.15);
  color: #ff3b5c;
  font-weight: 600;
}
.mode-card.act-highlight {
  border-color: rgba(255,59,92,0.3);
  box-shadow: 0 0 0 1px rgba(255,59,92,0.1) inset;
}
.mode-card.boss-card {
  border-color: rgba(255,59,92,0.3);
  background: linear-gradient(135deg, rgba(255,59,92,0.05), rgba(139,0,0,0.05));
}

/* ---- SKILL TREE SCREEN ---- */
.skilltree-screen {
  padding: 16px;
}
.st-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
  flex-shrink: 0;
}
.st-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
}
.sp-display {
  font-size: 0.8rem;
  background: rgba(255,202,40,0.12);
  color: #ffca28;
  padding: 6px 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.st-branches {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.st-branch {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
}
.st-branch-header {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--branch-color, #fff);
}
.st-skill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.st-skill.unlocked {
  border-left-color: #00e676;
  background: rgba(0,230,118,0.06);
}
.st-skill.available {
  border-left-color: var(--branch-color, #ffca28);
  background: rgba(255,202,40,0.06);
}
.st-skill.locked {
  opacity: 0.45;
}
.st-skill-name {
  font-size: 0.82rem;
  font-weight: 700;
  flex: 1;
  min-width: 80px;
}
.st-skill-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex: 2;
  min-width: 100px;
}
.st-skill-req {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.st-unlock-btn {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffca28, #ff9800);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.st-unlock-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px #ffca2855;
}
.st-check {
  font-size: 0.8rem;
}

/* ---- ACHIEVEMENTS SCREEN ---- */
.achieve-screen {
  padding: 16px;
}
.achieve-cat {
  margin-bottom: 18px;
}
.achieve-cat h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 6px;
}
.achieve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.achieve-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.3s;
}
.achieve-card.earned {
  border-color: #ffca2855;
  background: linear-gradient(135deg, rgba(255,202,40,0.06), rgba(255,59,92,0.04));
}
.achieve-card.earned .achieve-icon {
  filter: drop-shadow(0 0 6px #ffca28);
}
.achieve-card.locked {
  opacity: 0.4;
}
.achieve-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.achieve-name {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.achieve-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ---- PARTICLE EFFECTS ON CORRECT ---- */
@keyframes particle-burst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); }
}

/* ---- ENHANCED ANIMATIONS ---- */
@keyframes cinematic-wipe {
  0% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.dramatic-reveal {
  animation: cinematic-wipe 0.6s cubic-bezier(.23,1,.32,1) forwards;
}

/* Heartbeat for boss banner */
.heartbeat-effect {
  animation: heartbeat 1.2s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.06); }
  28% { transform: scale(1); }
  42% { transform: scale(1.04); }
  70% { transform: scale(1); }
}

/* ---- MOBILE ADJUSTMENTS FOR RPG ---- */
@media (max-width: 480px) {
  .class-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .class-card {
    padding: 14px 8px;
  }
  .class-icon-big {
    font-size: 2rem;
  }
  .class-name {
    font-size: 0.82rem;
  }
  .class-desc {
    font-size: 0.65rem;
  }
  .cut-act-label {
    font-size: 1.2rem;
  }
  .st-skill {
    flex-direction: column;
    align-items: flex-start;
  }
  .achieve-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rpg-nav-btn {
    font-size: 0.75rem;
    padding: 8px 10px;
  }
  .story-act-banner {
    padding: 10px 12px;
  }
}

/* Admin link button on intro */
.admin-link-wrap {
  margin-top: 18px;
}
.admin-link-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s;
}
.admin-link-btn:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

/* Ensure RPG screens scroll properly on mobile */
.class-select-screen,
.skilltree-screen,
.achieve-screen,
.cutscene-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.class-select-screen > *,
.skilltree-screen > *,
.achieve-screen > *,
.cutscene-screen > * {
  flex-shrink: 0;
}

/* =============================================
   SURGE CHAIN MODE STYLES
   ============================================= */

/* Surge badge */
.surge-badge, .er-badge {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.surge-tag {
  background: linear-gradient(135deg, #3b82f6, #06b6d4) !important;
  color: #fff !important;
}

/* Surge select screen */
.surge-header {
  text-align: center;
  padding: 20px 0 10px;
}
.surge-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 4px;
}
.surge-header p {
  color: var(--text2);
  font-size: 0.9rem;
}

/* Scenario cards */
.surge-scenario-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}
.surge-scenario-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
}
.surge-scenario-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}
.esc-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.esc-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.esc-info p {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.4;
  margin-bottom: 8px;
}
.esc-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.esc-tag {
  font-size: 0.72rem;
  background: var(--bg);
  color: var(--text2);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Surge mode card in grid */
.surge-card {
  border-color: #3b82f6 !important;
  position: relative;
  overflow: hidden;
}
.surge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

/* Phase bar */
.surge-phase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(6,182,212,0.1));
  border-radius: 10px;
  margin-bottom: 12px;
}
.phase-icon {
  font-size: 1.3rem;
}
.phase-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.phase-progress {
  font-size: 0.85rem;
  color: #3b82f6;
  font-weight: 600;
}

/* Patient card */
.surge-patient-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.surge-patient-card.mini {
  padding: 12px;
}
.epc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.epc-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.epc-info strong {
  font-size: 1rem;
  color: var(--text);
}
.epc-appearance {
  font-size: 0.8rem;
  color: var(--text2);
  font-style: italic;
  margin-top: 2px;
}
.epc-id {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text2);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.epc-timer-warn {
  margin-left: auto;
  font-size: 0.75rem;
  color: #f59e0b;
  font-weight: 600;
}

/* Vitals grid */
.epc-vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.epc-vital {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v-label {
  font-size: 0.7rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.v-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.v-val.bad {
  color: #ef4444;
}
.v-val.warn {
  color: #f59e0b;
}
.v-val.good {
  color: #10b981;
}

/* Injuries */
.epc-injuries {
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
}
.epc-injury {
  font-size: 0.82rem;
  color: var(--text2);
  padding: 2px 0;
  line-height: 1.4;
}

/* Triage buttons */
.surge-triage-buttons, .surge-sort-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.etb {
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.etb.red { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.etb.red:hover { background: rgba(239,68,68,0.25); }
.etb.yellow, .etb.t2 { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.etb.yellow:hover, .etb.t2:hover { background: rgba(245,158,11,0.25); }
.etb.green, .etb.t3 { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.3); }
.etb.green:hover, .etb.t3:hover { background: rgba(16,185,129,0.25); }
.etb.black { background: rgba(100,100,100,0.15); color: #888; border-color: rgba(100,100,100,0.3); }
.etb.black:hover { background: rgba(100,100,100,0.25); }
.etb.t1 { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.etb.t1:hover { background: rgba(239,68,68,0.25); }

/* Hint box */
.surge-hint {
  margin-top: 8px;
}
.surge-hint details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.surge-hint summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #3b82f6;
  font-weight: 600;
}
.surge-hint p {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 8px;
  line-height: 1.5;
}

/* Feedback flash */
.surge-feedback {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 100;
  pointer-events: none;
  animation: feedbackPop 0.8s ease-out forwards;
}
.surge-feedback.correct {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
}
.surge-feedback.wrong {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}
@keyframes feedbackPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Treatment grid */
.surge-treat-grid {
  margin-bottom: 8px;
}
.treat-instruction {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 10px;
}
.treat-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.treat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.treat-btn:hover {
  border-color: #3b82f6;
}
.treat-btn.selected {
  border-color: #10b981;
  background: rgba(16,185,129,0.1);
}
.tb-icon { font-size: 1.4rem; }
.tb-name { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.tb-time { font-size: 0.7rem; color: var(--text2); }

/* Decon / Transport list */
.surge-decon-info, .surge-transport-info {
  text-align: center;
  padding: 10px 0;
  color: var(--text2);
  font-size: 0.88rem;
}
.surge-decon-list, .surge-transport-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.decon-patient-btn, .transport-patient-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.decon-patient-btn:hover, .transport-patient-btn:hover {
  border-color: #3b82f6;
  transform: translateX(4px);
}
.dp-icon, .tp-icon { font-size: 1.3rem; flex-shrink: 0; }
.dp-name, .tp-name { font-weight: 600; color: var(--text); font-size: 0.9rem; min-width: 60px; }
.dp-triage, .tp-triage { font-size: 0.72rem; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.triage-red { background: rgba(239,68,68,0.2); color: #ef4444; }
.triage-yellow { background: rgba(245,158,11,0.2); color: #f59e0b; }
.triage-green { background: rgba(16,185,129,0.2); color: #10b981; }
.triage-black { background: rgba(100,100,100,0.2); color: #888; }
.dp-injury, .tp-injury { font-size: 0.78rem; color: var(--text2); flex: 1; }
.tp-urgency { font-size: 0.75rem; color: #f59e0b; font-weight: 600; flex-shrink: 0; }

/* ED actions */
.surge-ed-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.surge-ed-actions > p {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 4px;
}
.ed-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.ed-action-btn:hover {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.05);
}
.ea-icon { font-size: 1.5rem; flex-shrink: 0; }
.ea-info { display: flex; flex-direction: column; }
.ea-info strong { color: var(--text); font-size: 0.95rem; }
.ea-info span { color: var(--text2); font-size: 0.8rem; }

/* Phase transition */
.surge-transition-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
  text-align: center;
}
.surge-phase-complete .epc-check {
  font-size: 3rem;
  margin-bottom: 8px;
}
.surge-phase-complete h2 {
  font-size: 1.3rem;
  color: var(--text);
}
.surge-next-phase {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 400px;
}
.enp-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.surge-next-phase h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.surge-next-phase p {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 12px;
}
.enp-resources {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.enp-res {
  font-size: 0.8rem;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--text);
}

/* Final results */
.surge-results-screen {
  padding: 20px 16px;
}
.surge-results-header {
  text-align: center;
  margin-bottom: 12px;
}
.surge-results-header h2 {
  font-size: 1.2rem;
  color: var(--text);
  margin-top: 6px;
}
.surge-result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.ers-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.ers-card.death { border-color: rgba(239,68,68,0.3); }
.ers-card.warn { border-color: rgba(245,158,11,0.3); }
.ers-card.good { border-color: rgba(16,185,129,0.3); }
.ers-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}
.ers-label {
  font-size: 0.7rem;
  color: var(--text2);
  margin-top: 2px;
}
.ers-icon {
  font-size: 1rem;
  margin-top: 4px;
}

/* Patient outcomes list */
.surge-patient-outcomes {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.surge-patient-outcomes h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
}
.epo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.epo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.epo-row.dead { background: rgba(239,68,68,0.08); }
.epo-row.alive { background: rgba(16,185,129,0.08); }
.epo-triage {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Debrief */
.surge-debrief {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.surge-debrief h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
}
.debrief-text {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.6;
}

/* SURGE screens mobile scroll */
.surge-screen > *,
.surge-play-screen > *,
.surge-results-screen > * {
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .surge-result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .treat-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .epc-vitals {
    grid-template-columns: repeat(2, 1fr);
  }
  .surge-triage-buttons, .surge-sort-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   JRPG CAMPAIGN ENGINE STYLES
   ============================================ */

/* World Map */
.world-map { position: relative; padding: 20px; min-height: 80vh; background: radial-gradient(ellipse at center, #1a1d2e 0%, #0d0f1a 100%); }
.world-map-title { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; background: linear-gradient(135deg, #ffd700, #ff8c00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; }
.world-map-subtitle { text-align: center; color: #8b8fa3; font-size: 0.85rem; margin-bottom: 24px; }

/* Campaign nodes on world map - like FF world map locations */
.campaign-nodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 1000px; margin: 0 auto; }
.campaign-node { background: linear-gradient(135deg, rgba(30,33,50,0.95), rgba(20,22,35,0.95)); border: 2px solid rgba(255,215,0,0.2); border-radius: 16px; padding: 20px; cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; }
.campaign-node::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--node-color, #ffd700); }
.campaign-node:hover { transform: translateY(-4px); border-color: rgba(255,215,0,0.5); box-shadow: 0 8px 32px rgba(255,215,0,0.15); }
.campaign-node.locked { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.8); }
.campaign-node.locked:hover { transform: none; }
.campaign-node.completed { border-color: rgba(0,230,118,0.4); }
.campaign-node.completed::after { content: '✅'; position: absolute; top: 12px; right: 12px; font-size: 1.2rem; }
.campaign-node .node-icon { font-size: 2.5rem; margin-bottom: 8px; }
.campaign-node .node-title { font-size: 1.1rem; font-weight: 700; color: #eef0f6; margin-bottom: 4px; }
.campaign-node .node-subtitle { font-size: 0.8rem; color: #8b8fa3; margin-bottom: 12px; }
.campaign-node .node-meta { display: flex; gap: 12px; font-size: 0.75rem; color: #6b7080; }
.campaign-node .node-difficulty { color: #ffd700; }
.campaign-node .node-progress { margin-top: 12px; }
.campaign-node .progress-bar-bg { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.campaign-node .progress-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s; }

/* Role Selection - like FF character select */
.role-select { padding: 20px; max-width: 900px; margin: 0 auto; }
.role-select-title { text-align: center; font-size: 1.5rem; font-weight: 800; color: #ffd700; margin-bottom: 4px; }
.role-select-subtitle { text-align: center; color: #8b8fa3; font-size: 0.85rem; margin-bottom: 24px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.role-card { background: linear-gradient(135deg, #1e2132, #161928); border: 2px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px; cursor: pointer; transition: all 0.3s; text-align: center; }
.role-card:hover { border-color: rgba(255,215,0,0.4); transform: translateY(-2px); }
.role-card.selected { border-color: #ffd700; background: linear-gradient(135deg, #2a2d45, #1e2138); box-shadow: 0 0 20px rgba(255,215,0,0.15); }
.role-card .role-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.role-card .role-name { font-size: 1rem; font-weight: 700; color: #eef0f6; }
.role-card .role-desc { font-size: 0.75rem; color: #8b8fa3; margin-top: 4px; }
.role-card .role-special { font-size: 0.7rem; color: #ffd700; margin-top: 8px; font-style: italic; }
.role-confirm-btn { display: block; margin: 20px auto 0; padding: 14px 48px; background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; font-size: 1rem; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; transition: transform 0.2s; }
.role-confirm-btn:hover { transform: scale(1.05); }
.role-confirm-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* Chapter Map - like Zelda dungeon map */
.chapter-map { padding: 20px; max-width: 800px; margin: 0 auto; }
.chapter-map-header { text-align: center; margin-bottom: 24px; }
.chapter-map-header .campaign-icon { font-size: 2rem; }
.chapter-map-header h2 { font-size: 1.3rem; color: #ffd700; margin: 4px 0; }
.chapter-path { position: relative; }
.chapter-node { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 4px; border-radius: 12px; cursor: pointer; transition: all 0.3s; background: rgba(30,33,50,0.5); border: 1px solid transparent; }
.chapter-node:hover:not(.locked) { background: rgba(40,43,65,0.8); border-color: rgba(255,215,0,0.3); }
.chapter-node.active { background: rgba(255,215,0,0.08); border-color: rgba(255,215,0,0.4); }
.chapter-node.completed { opacity: 0.7; }
.chapter-node.completed .ch-status { color: #00e676; }
.chapter-node.locked { opacity: 0.35; cursor: not-allowed; }
.chapter-node .ch-number { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.chapter-node.completed .ch-number { background: rgba(0,230,118,0.2); color: #00e676; }
.chapter-node.active .ch-number { background: rgba(255,215,0,0.2); color: #ffd700; }
.chapter-node.locked .ch-number { background: rgba(255,255,255,0.05); color: #555; }
.chapter-node .ch-info { flex: 1; }
.chapter-node .ch-title { font-weight: 600; font-size: 0.95rem; }
.chapter-node .ch-subtitle { font-size: 0.75rem; color: #8b8fa3; }
.chapter-node .ch-status { font-size: 0.75rem; color: #8b8fa3; text-align: right; }

/* Cinematic / Cutscene - like FF cutscenes */
.cinematic { padding: 20px; max-width: 700px; margin: 0 auto; animation: fadeIn 1s ease; }
.cinematic-chapter-tag { text-align: center; font-size: 0.75rem; color: #ffd700; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px; }
.cinematic-title { text-align: center; font-size: 1.4rem; font-weight: 800; color: #eef0f6; margin-bottom: 24px; }
.cinematic-text { background: rgba(20,22,35,0.8); border: 1px solid rgba(255,215,0,0.15); border-radius: 12px; padding: 24px; font-size: 0.95rem; line-height: 1.8; color: #c8cad8; white-space: pre-line; margin-bottom: 16px; }
.cinematic-dialogue { background: rgba(255,215,0,0.05); border-left: 3px solid #ffd700; border-radius: 0 8px 8px 0; padding: 16px 20px; margin-bottom: 16px; }
.cinematic-dialogue .speaker { font-size: 0.8rem; color: #ffd700; font-weight: 600; margin-bottom: 4px; }
.cinematic-dialogue .speech { font-size: 0.9rem; color: #c8cad8; line-height: 1.6; font-style: italic; }
.cinematic-continue { display: block; margin: 16px auto 0; padding: 12px 32px; background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.3); color: #ffd700; border-radius: 8px; cursor: pointer; font-size: 0.9rem; transition: all 0.3s; }
.cinematic-continue:hover { background: rgba(255,215,0,0.2); }

/* Briefing Panel */
.briefing { padding: 20px; max-width: 700px; margin: 0 auto; }
.briefing-card { background: rgba(20,22,35,0.9); border: 1px solid rgba(68,138,255,0.3); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.briefing-card h3 { font-size: 0.85rem; color: #448aff; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.briefing-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; }
.briefing-item .label { color: #8b8fa3; }
.briefing-item .value { color: #eef0f6; font-weight: 600; }
.briefing-list { list-style: none; }
.briefing-list li { padding: 4px 0; font-size: 0.85rem; color: #c8cad8; }
.briefing-list li::before { content: '⚠️ '; }
.briefing-start-btn { display: block; width: 100%; margin-top: 16px; padding: 14px; background: linear-gradient(135deg, #ff3b5c, #ff1744); color: #fff; font-size: 1rem; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; transition: transform 0.2s; }
.briefing-start-btn:hover { transform: scale(1.02); }

/* Turn-Based Battle UI - like FF combat */
.battle-screen { padding: 16px; max-width: 750px; margin: 0 auto; }
.battle-enemy { text-align: center; margin-bottom: 16px; }
.battle-enemy .enemy-sprite { font-size: 4rem; animation: enemyFloat 3s ease-in-out infinite; }
@keyframes enemyFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.battle-enemy .enemy-name { font-size: 1rem; font-weight: 700; color: #ff3b5c; margin-top: 4px; }
.battle-hp-bar { background: rgba(255,255,255,0.1); border-radius: 4px; height: 8px; overflow: hidden; margin: 8px auto; max-width: 300px; }
.battle-hp-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.battle-hp-fill.enemy { background: linear-gradient(90deg, #ff3b5c, #ff1744); }
.battle-hp-fill.player { background: linear-gradient(90deg, #00e676, #69f0ae); }

/* Battle Question Area */
.battle-question { background: rgba(20,22,35,0.95); border: 1px solid rgba(255,215,0,0.2); border-radius: 12px; padding: 20px; margin-bottom: 12px; }
.battle-question .q-category { font-size: 0.7rem; color: #ffd700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.battle-question .q-text { font-size: 0.95rem; color: #eef0f6; line-height: 1.6; }

/* Battle Options - styled like FF menu */
.battle-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.battle-option { background: rgba(30,33,50,0.9); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px 16px; cursor: pointer; transition: all 0.2s; text-align: left; font-size: 0.85rem; color: #c8cad8; display: flex; align-items: center; gap: 8px; }
.battle-option:hover { border-color: rgba(255,215,0,0.5); background: rgba(255,215,0,0.08); color: #eef0f6; }
.battle-option .opt-label { color: #ffd700; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.battle-option.correct { border-color: #00e676; background: rgba(0,230,118,0.1); }
.battle-option.wrong { border-color: #ff3b5c; background: rgba(255,59,92,0.1); }
.battle-option:disabled { cursor: default; opacity: 0.6; }

/* Player HUD - bottom bar like FF */
.player-hud { position: fixed; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(10,12,20,0.98), rgba(10,12,20,0.9)); border-top: 1px solid rgba(255,215,0,0.2); padding: 12px 20px; display: flex; align-items: center; gap: 16px; z-index: 100; }
.hud-avatar { font-size: 1.5rem; }
.hud-info { flex: 1; }
.hud-name { font-size: 0.85rem; font-weight: 700; color: #eef0f6; }
.hud-title { font-size: 0.65rem; color: #ffd700; }
.hud-bars { flex: 2; }
.hud-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.hud-bar .bar-label { font-size: 0.65rem; color: #8b8fa3; width: 24px; }
.hud-bar .bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.hud-bar .bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.hud-bar .bar-fill.hp { background: linear-gradient(90deg, #ff3b5c, #69f0ae); }
.hud-bar .bar-fill.xp { background: linear-gradient(90deg, #448aff, #b388ff); }
.hud-bar .bar-value { font-size: 0.65rem; color: #eef0f6; width: 50px; text-align: right; }
.hud-items { display: flex; gap: 6px; }
.hud-item { width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.hud-item:hover { border-color: #ffd700; background: rgba(255,215,0,0.1); }
.hud-item.empty { opacity: 0.3; cursor: default; }
.hud-level { text-align: center; }
.hud-level .lv-num { font-size: 1.2rem; font-weight: 800; color: #ffd700; }
.hud-level .lv-label { font-size: 0.6rem; color: #8b8fa3; }

/* Battle Result / Chapter Complete */
.chapter-result { padding: 20px; max-width: 600px; margin: 0 auto; text-align: center; }
.chapter-result .result-icon { font-size: 3rem; margin-bottom: 8px; }
.chapter-result h2 { font-size: 1.3rem; color: #ffd700; margin-bottom: 4px; }
.chapter-result .result-narrative { background: rgba(20,22,35,0.8); border-radius: 12px; padding: 20px; margin: 16px 0; font-size: 0.9rem; color: #c8cad8; line-height: 1.7; white-space: pre-line; text-align: left; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.result-stat { background: rgba(30,33,50,0.8); border-radius: 8px; padding: 12px; }
.result-stat .rs-value { font-size: 1.3rem; font-weight: 700; }
.result-stat .rs-label { font-size: 0.7rem; color: #8b8fa3; margin-top: 2px; }
.result-rewards { background: rgba(255,215,0,0.05); border: 1px solid rgba(255,215,0,0.2); border-radius: 12px; padding: 16px; margin: 16px 0; }
.result-rewards h3 { font-size: 0.85rem; color: #ffd700; margin-bottom: 8px; }
.reward-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.85rem; color: #c8cad8; }
.level-up-banner { background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,140,0,0.1)); border: 1px solid rgba(255,215,0,0.4); border-radius: 12px; padding: 16px; margin: 16px 0; animation: levelUpGlow 2s ease-in-out infinite; }
@keyframes levelUpGlow { 0%,100% { box-shadow: 0 0 10px rgba(255,215,0,0.1); } 50% { box-shadow: 0 0 25px rgba(255,215,0,0.3); } }
.level-up-banner h3 { color: #ffd700; font-size: 1rem; margin-bottom: 4px; }
.level-up-banner p { color: #c8cad8; font-size: 0.85rem; }

/* Campaign Complete / Credits */
.campaign-complete { padding: 40px 20px; text-align: center; max-width: 600px; margin: 0 auto; }
.campaign-complete .trophy { font-size: 4rem; margin-bottom: 16px; animation: trophyBounce 1s ease; }
@keyframes trophyBounce { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.campaign-complete h1 { font-size: 1.5rem; background: linear-gradient(135deg, #ffd700, #ff8c00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.campaign-complete .final-title { font-size: 1.1rem; color: #ffd700; margin-bottom: 24px; }

/* Inventory Panel */
.inventory-panel { background: rgba(20,22,35,0.95); border: 1px solid rgba(255,215,0,0.2); border-radius: 12px; padding: 16px; margin: 12px 0; }
.inventory-panel h3 { font-size: 0.85rem; color: #ffd700; margin-bottom: 8px; }
.inventory-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inv-slot { aspect-ratio: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.inv-slot:hover:not(.empty) { border-color: #ffd700; background: rgba(255,215,0,0.08); }
.inv-slot .item-icon { font-size: 1.3rem; }
.inv-slot .item-count { font-size: 0.6rem; color: #ffd700; }

/* Damage/Heal animations */
@keyframes damageFlash { 0% { background: transparent; } 50% { background: rgba(255,59,92,0.2); } 100% { background: transparent; } }
@keyframes healFlash { 0% { background: transparent; } 50% { background: rgba(0,230,118,0.2); } 100% { background: transparent; } }
.damage-flash { animation: damageFlash 0.5s ease; }
.heal-flash { animation: healFlash 0.5s ease; }

/* Battle attack animations */
@keyframes playerAttack { 0% { transform: translateX(0); } 30% { transform: translateX(30px); } 100% { transform: translateX(0); } }
@keyframes enemyHit { 0% { transform: translateX(0); } 20% { transform: translateX(-15px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-5px); } 100% { transform: translateX(0); } }
@keyframes enemyAttack { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(20px) scale(1.1); } 100% { transform: translateY(0) scale(1); } }

/* Fade animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Back button */
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #8b8fa3; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; margin-bottom: 16px; }
.back-btn:hover { border-color: rgba(255,215,0,0.3); color: #eef0f6; }

/* Campaign screen padding for player HUD */
.campaign-screen-wrap { padding-bottom: 80px; overflow-y: auto; height: 100dvh; }

/* Footer credit branding */
.game-footer-credit { margin-top: 24px; padding: 16px 12px 8px; text-align: center; border-top: 1px solid rgba(255,255,255,0.08); }
.game-footer-credit p { margin: 0; font-size: 0.65rem; color: #5a5e72; line-height: 1.6; letter-spacing: 0.02em; }
.game-footer-credit p:first-child { color: #6b6f85; }
