/* ============================================
   RECRUITER vs CV — Dark Fantasy Card Game
   Features: Gold cards, HP hearts, drag & drop,
   hover enlarge, improved readability
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap');

@property --gold-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  /* Colors — boosted for visibility */
  --gold: #e0b44a;
  --gold-light: #f5d98a;
  --gold-dark: #a07a1a;
  --crimson: #d44030;
  --crimson-light: #f06050;
  --crimson-dark: #8b2020;
  --emerald: #30b868;
  --emerald-light: #40d878;
  --emerald-dark: #1a8048;
  --green-table: #1e4530;
  --green-table-light: #28583e;
  --green-table-dark: #122a1c;
  --bg-dark: #0c0f0a;
  --bg-surface: #171c14;
  --bg-card: #1e2618;
  --border-gold: rgba(224, 180, 74, 0.35);
  --border-dim: rgba(255, 255, 255, 0.08);
  --text-primary: #f0eade;
  --text-secondary: #bfb8a0;
  --text-dim: #7a7060;
  --text-gold: var(--gold);

  /* Fonts */
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Glows — brighter */
  --glow-gold: 0 0 20px rgba(224, 180, 74, 0.5), 0 0 40px rgba(224, 180, 74, 0.15);
  --glow-crimson: 0 0 20px rgba(212, 64, 48, 0.55), 0 0 40px rgba(212, 64, 48, 0.2);
  --glow-emerald: 0 0 20px rgba(48, 184, 104, 0.55), 0 0 40px rgba(48, 184, 104, 0.2);

  /* Card dimensions — slightly larger for readability */
  --card-w: 155px;
  --card-h: 215px;
  --card-w-battle: 210px;
  --card-h-battle: 290px;
}

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

html,
body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold);
  color: var(--bg-dark);
}

/* === Canvas & Overlays === */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 99;
}

/* === Screen System === */
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 30px;
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #6a4a10, #4a3008);
  color: var(--gold-light);
  border-color: var(--gold);
}

.btn-primary:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #7a5a18, #5a3a0e);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, #1a3a5c, #0d2440);
  color: #7ac0ff;
  border-color: #3a7bd5;
}

.btn-accent:hover {
  box-shadow: 0 0 18px rgba(58, 123, 213, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #5a1a1a, #3a1010);
  color: #ff8a80;
  border-color: #8b3030;
}

.btn-danger:hover {
  box-shadow: var(--glow-crimson);
  transform: translateY(-2px);
  border-color: var(--crimson);
}

.btn-icon {
  font-size: 18px;
}

.btn-icon-only {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
}

.btn-icon-only:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.6);
}

/* ============================================
   TITLE SCREEN
   ============================================ */
#title-screen {
  background:
    radial-gradient(ellipse at 50% 30%, var(--green-table) 0%, var(--green-table-dark) 50%, var(--bg-dark) 100%);
}

.title-content {
  text-align: center;
  z-index: 2;
  padding: 20px;
}

.title-ornament {
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 16px;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeIn 1s 0.2s forwards;
}

.title-main {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 88px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7), var(--glow-gold);
  line-height: 1.15;
  opacity: 0;
  animation: fadeSlideUp 1s 0.4s forwards;
}

.title-vs {
  display: block;
  font-size: 0.3em;
  color: var(--text-dim);
  letter-spacing: 10px;
  margin: 8px 0;
  text-shadow: none;
}

.title-subtitle {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 500;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 10px;
  opacity: 0;
  animation: fadeIn 1s 0.8s forwards;
}

.title-divider {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 28px auto;
  opacity: 0;
  animation: fadeIn 1s 1s forwards;
}

.title-flavor {
  font-family: var(--font-body);
  font-size: clamp(15px, 2vw, 20px);
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeIn 1s 1.2s forwards;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 44px;
  opacity: 0;
  animation: fadeSlideUp 0.8s 1.5s forwards;
}

.title-credit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  margin-top: 52px;
  opacity: 0;
  animation: fadeIn 1s 2s forwards;
}

/* ============================================
   BATTLE SCREEN
   ============================================ */
#battle-screen {
  background:
    radial-gradient(ellipse at 50% 50%, var(--green-table) 0%, var(--green-table-dark) 60%, var(--bg-dark) 100%);
  justify-content: space-between;
  padding: 0;
}

/* Top bar */
.battle-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border-gold);
  z-index: 10;
  flex-shrink: 0;
}

.battle-score {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

.score-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
  min-width: 32px;
  text-align: center;
}

.score-sep {
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 16px;
}

.battle-round {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* ============================================
   HP HEARTS
   ============================================ */
.hp-display {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 180px;
}

.heart {
  font-size: 16px;
  transition: all 0.4s ease;
  line-height: 1;
}

.heart-full {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(224, 180, 74, 0.6);
  animation: heartPulse 2s ease-in-out infinite;
}

.heart-empty {
  color: rgba(255, 255, 255, 0.12);
  text-shadow: none;
  animation: none;
  transform: scale(0.85);
}

.recruiter-heart.heart-full {
  color: var(--crimson-light);
  text-shadow: 0 0 8px rgba(212, 64, 48, 0.5);
}

@keyframes heartPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

/* Heart break animation */
.heart-break {
  animation: heartBreak 0.5s ease-in forwards !important;
}

@keyframes heartBreak {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  40% {
    transform: scale(1.3);
    opacity: 1;
    color: #fff;
  }

  100% {
    transform: scale(0.5);
    opacity: 0.2;
    color: rgba(255, 255, 255, 0.12);
  }
}

/* Battle sides */
.battle-side {
  width: 100%;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  flex-shrink: 0;
}

.christos-side {
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-dim);
  min-height: 80px;
}

.recruiter-side {
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--border-dim);
  min-height: 120px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.side-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  flex-shrink: 0;
}

.side-label-sub {
  font-size: 9px;
  font-weight: 400;
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
}

/* Deck area */
.deck-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.deck-stack {
  position: relative;
  width: 62px;
  height: 86px;
}

.deck-card-back {
  position: absolute;
  width: 62px;
  height: 86px;
  border-radius: 6px;
  border: 2px solid var(--emerald-dark);
  background:
    linear-gradient(135deg, #1a3a28, #0f2218),
    repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.02) 5px, rgba(255, 255, 255, 0.02) 10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.deck-card-back::after {
  content: '◆';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  font-size: 20px;
  opacity: 0.4;
}

.deck-card-back:nth-child(1) {
  top: 0;
  left: 0;
}

.deck-card-back:nth-child(2) {
  top: -3px;
  left: 2px;
}

.deck-card-back:nth-child(3) {
  top: -6px;
  left: 4px;
}

.deck-card-back.recruiter-back {
  border-color: var(--crimson-dark);
  background: linear-gradient(135deg, #3a1a1a, #221010);
}

.deck-card-back.recruiter-back::after {
  color: var(--crimson);
  content: '✕';
}

.deck-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Battle zone */
.battle-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px;
  position: relative;
}

.battle-slot {
  width: var(--card-w-battle);
  height: var(--card-h-battle);
  position: relative;
  perspective: 900px;
}

.slot-outline {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

/* Drop zone highlighting for drag & drop */
.drop-target-active .slot-outline {
  border-color: var(--gold-dark);
  background: rgba(224, 180, 74, 0.05);
}

.drop-target-hover .slot-outline {
  border-color: var(--gold);
  border-style: solid;
  box-shadow: var(--glow-gold);
  background: rgba(224, 180, 74, 0.12);
  animation: dropPulse 0.8s ease-in-out infinite;
}

@keyframes dropPulse {

  0%,
  100% {
    box-shadow: var(--glow-gold);
  }

  50% {
    box-shadow: 0 0 30px rgba(224, 180, 74, 0.7), 0 0 60px rgba(224, 180, 74, 0.25);
  }
}

.battle-vs {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
  letter-spacing: 6px;
  flex-shrink: 0;
}

/* Hand area */
.hand-area {
  display: flex;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
  padding: 6px 0;
  scroll-behavior: smooth;
  align-items: flex-end;
}

.hand-area::-webkit-scrollbar {
  height: 4px;
}

.hand-area::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 2px;
}

.hand-area::-webkit-scrollbar-track {
  background: transparent;
}

/* Surrender area */
.surrender-area {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 16px;
}

/* ============================================
   CARD STYLES — HOVER ENLARGE + GOLD CARDS
   ============================================ */
.game-card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s, z-index 0s;
  transform-style: preserve-3d;
  perspective: 600px;
  flex-shrink: 0;
  user-select: none;
}

/* === HOVER — Card lifts up in hand; full preview spawned by JS === */
.game-card:hover {
  transform: translateY(-18px) scale(1.06);
  z-index: 20;
}

.game-card.objection-card,
.card-preview.objection-card {
  --card-color: var(--crimson);
  --card-color-light: var(--crimson-light);
  --card-color-dark: var(--crimson-dark);
  --card-glow: var(--glow-crimson);
  --card-bg-1: #3a1818;
  --card-bg-2: #1e0c0c;
}

.game-card.counter-card,
.card-preview.counter-card {
  --card-color: var(--emerald);
  --card-color-light: var(--emerald-light);
  --card-color-dark: var(--emerald-dark);
  --card-glow: var(--glow-emerald);
  --card-bg-1: #183a22;
  --card-bg-2: #0c1e12;
}

/* ========== GOLD CARD STYLES ========== */
.game-card.gold-card,
.card-preview.gold-card {
  --card-color: #ffd700;
  --card-color-light: #fff4b3;
  --card-color-dark: #b8860b;
  --card-glow: 0 0 25px rgba(255, 215, 0, 0.6), 0 0 50px rgba(255, 215, 0, 0.2);
  --card-bg-1: #3a2e10;
  --card-bg-2: #2a1e08;
}

.game-card.gold-card .card-inner {
  border-color: #b8860b;
  background: linear-gradient(170deg, #3a2e10 0%, #2a1e08 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 215, 0, 0.15);
}

.game-card.gold-card:hover .card-inner {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 0 50px rgba(255, 215, 0, 0.2), 0 8px 30px rgba(0, 0, 0, 0.7);
}

.game-card.gold-card .card-art {
  background: radial-gradient(circle at center, rgba(184, 134, 11, 0.5), transparent 70%);
}

.game-card.gold-card .card-art::before {
  background: linear-gradient(135deg, transparent 30%, rgba(255, 215, 0, 0.15) 50%, transparent 70%);
  animation: goldShimmer 3s ease-in-out infinite;
}

@keyframes goldShimmer {

  0%,
  100% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }
}

.game-card.gold-card .card-power {
  background: linear-gradient(135deg, #b8860b, #8b6914);
  border-color: #ffd700;
  color: #fff;
}

.game-card.gold-card .card-type-badge {
  color: #ffd700;
  border-color: #b8860b;
  background: rgba(184, 134, 11, 0.3);
  font-weight: 900;
}

.game-card.gold-card .card-title {
  color: #fff4b3;
}

.game-card.gold-card .card-icon-badge {
  border-color: #b8860b;
  background: rgba(184, 134, 11, 0.3);
}

/* Gold card constant decorative glow */
.game-card.gold-card::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 12px;
  background: conic-gradient(from var(--gold-angle), transparent, rgba(255, 215, 0, 0.15), transparent, rgba(255, 215, 0, 0.1), transparent);
  animation: goldRotate 6s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes goldRotate {
  0% {
    --gold-angle: 0deg;
  }

  100% {
    --gold-angle: 360deg;
  }
}

/* Gold back for flippable cards */
.card-face-back.gold-back {
  border-color: #b8860b !important;
  background: linear-gradient(135deg, #3a2e10, #2a1e08) !important;
}

.card-face-back.gold-back::after {
  content: '✦' !important;
  color: #ffd700 !important;
  opacity: 0.6 !important;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
  border: 2px solid var(--card-color-dark);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.game-card:hover .card-inner {
  border-color: var(--card-color);
  box-shadow: var(--card-glow), 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* Card header */
.card-header {
  position: relative;
  padding: 10px 12px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-icon-badge {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  border: 1px solid var(--card-color-dark);
  flex-shrink: 0;
}

.card-power {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  background: var(--card-color-dark);
  border: 2px solid var(--card-color);
  border-radius: 50%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Card art */
.card-art {
  height: 42px;
  margin: 2px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--card-color-dark) 50%, transparent), transparent 70%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 28px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.card-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }
}

/* Card text — KEY FIX: text fitting */
.card-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  padding: 8px 12px 3px;
  line-height: 1.25;
  flex-shrink: 0;
  /* Clamp to 2 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-secondary);
  padding: 2px 12px 6px;
  line-height: 1.4;
  flex: 1;
  /* Clamp to prevent overflow */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.card-footer {
  padding: 5px 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.card-source {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-type-badge {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--card-color-light);
  padding: 2px 7px;
  border: 1px solid var(--card-color-dark);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
}

/* Battle-sized cards — larger text */
.battle-card {
  width: var(--card-w-battle);
  height: var(--card-h-battle);
  position: absolute;
  top: 0;
  left: 0;
}

.battle-card:hover {
  transform: none;
}

.battle-card .card-header {
  padding: 14px 16px 8px;
}

.battle-card .card-icon-badge {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.battle-card .card-power {
  width: 34px;
  height: 34px;
  font-size: 17px;
  top: 12px;
  right: 12px;
}

.battle-card .card-art {
  height: 56px;
  margin: 4px 16px;
  font-size: 34px;
}

.battle-card .card-title {
  font-size: 15px;
  padding: 12px 16px 5px;
  -webkit-line-clamp: 2;
}

.battle-card .card-desc {
  font-size: 14px;
  padding: 2px 16px 10px;
  line-height: 1.5;
  -webkit-line-clamp: 4;
}

.battle-card .card-footer {
  padding: 8px 16px 12px;
}

.battle-card .card-source {
  font-size: 9px;
}

.battle-card .card-type-badge {
  font-size: 8px;
}

/* Card flip */
.card-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.card-flipper.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
}

.card-face-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, var(--green-table-dark), var(--green-table)),
    repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.015) 8px, rgba(255, 255, 255, 0.015) 16px);
  border: 2px solid var(--emerald-dark);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.card-face-back::after {
  content: '◆';
  color: var(--emerald);
  font-size: 38px;
  opacity: 0.35;
}

.card-face-front {
  transform: rotateY(180deg);
}

/* ============================================
   DRAG & DROP — Hearthstone Style
   ============================================ */
.drag-clone {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: scale(1.15) rotate(-2deg);
  opacity: 0.92;
  filter: brightness(1.1) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7));
  transition: transform 0.05s ease;
}

.drag-origin {
  opacity: 0.3 !important;
  transform: scale(0.9) !important;
  filter: grayscale(0.5);
}

/* Drag trail glow on the clone */
.drag-clone::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(224, 180, 74, 0.2), transparent 70%);
  pointer-events: none;
  animation: dragGlow 0.8s ease-in-out infinite alternate;
}

@keyframes dragGlow {
  from {
    opacity: 0.5;
  }

  to {
    opacity: 1;
  }
}

/* ============================================
   CARD HOVER PREVIEW — Hearthstone Style
   Large readable card that appears on hover
   ============================================ */
.card-preview {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.7) translateY(20px);
  transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 14px;
  filter: drop-shadow(0 16px 48px rgba(0, 0, 0, 0.8)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));

  /* Fix Aspect Ratio to match cards (155/215) */
  width: 300px;
  aspect-ratio: 155/215;
  height: auto;
}

.card-preview.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Preview card inner — full readable content, NO text clamping */
.card-preview .preview-inner {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
  border: 2px solid var(--card-color);
  box-shadow: var(--card-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-preview .card-header {
  padding: 16px 18px 10px;
}

.card-preview .card-icon-badge {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.card-preview .card-power {
  width: 40px;
  height: 40px;
  font-size: 20px;
  top: 14px;
  right: 14px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.card-preview .card-art {
  height: 64px;
  margin: 4px 18px;
  font-size: 40px;
  border-radius: 8px;
}

/* KEY: No text clamping on preview — show everything */
.card-preview .card-title {
  font-size: 17px;
  font-weight: 900;
  padding: 12px 18px 6px;
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
  line-height: 1.3;
  letter-spacing: 0.3px;
  color: #fff;
}

.card-preview .card-desc {
  font-size: 15px;
  font-weight: 500;
  padding: 4px 18px 14px;
  line-height: 1.6;
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
  color: var(--text-secondary);
  flex: 1;
}

.card-preview .card-footer {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.card-preview .card-type-badge {
  font-size: 9px;
  padding: 3px 10px;
  letter-spacing: 2px;
}

.card-preview .card-source {
  font-size: 10px;
  max-width: none;
}

/* Gold card preview extras */
.card-preview.gold-card .preview-inner {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5), 0 0 50px rgba(255, 215, 0, 0.15), inset 0 1px 0 rgba(255, 215, 0, 0.15);
}

.card-preview.gold-card .card-title {
  color: #fff4b3;
}

.card-preview.gold-card .card-type-badge {
  color: #ffd700;
  border-color: #b8860b;
  background: rgba(184, 134, 11, 0.3);
}

/* Card animations */
.card-enter-hand {
  animation: cardEnterHand 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardEnterHand {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.85) rotate(-3deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.card-counter-anim {
  animation: cardCounterReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardCounterReveal {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.7);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-destroyed {
  animation: cardDestroy 0.8s ease-in forwards;
}

@keyframes cardDestroy {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
  }

  25% {
    transform: scale(1.06);
    filter: brightness(1.8) saturate(2);
  }

  100% {
    transform: scale(0.2) rotate(12deg);
    opacity: 0;
    filter: brightness(3) saturate(0);
  }
}

.card-victory-anim {
  animation: cardVictory 0.7s ease-out forwards;
  z-index: 10;
  position: relative;
}

@keyframes cardVictory {
  0% {
    transform: scale(1);
    box-shadow: none;
  }

  40% {
    transform: scale(1.18);
    filter: brightness(1.6);
    box-shadow: 0 0 50px rgba(224, 180, 74, 1), 0 0 100px rgba(224, 180, 74, 0.5);
  }

  100% {
    transform: scale(1.1);
    filter: brightness(1.25);
    box-shadow: 0 0 30px rgba(224, 180, 74, 0.9), 0 0 70px rgba(224, 180, 74, 0.4);
  }
}

/* ============================================
   NARRATOR BAR — Better visibility
   ============================================ */
.narrator-bar {
  width: 100%;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  flex-shrink: 0;
}

.narrator-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.narrator-text {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}

.narrator-text .narrator-cursor {
  display: inline-block;
  width: 2px;
  height: 17px;
  background: var(--gold-light);
  animation: blinkCursor 0.6s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blinkCursor {
  50% {
    opacity: 0;
  }
}

/* ============================================
   CLASH OVERLAY
   ============================================ */
.clash-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.clash-overlay.active {
  opacity: 1;
}

.clash-burst {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 180, 74, 0.5), transparent 70%);
  animation: clashBurst 0.6s ease-out;
}

@keyframes clashBurst {
  from {
    transform: scale(0);
    opacity: 1;
  }

  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

.clash-text {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(224, 180, 74, 0.9), 0 4px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 8px;
  animation: clashTextPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

@keyframes clashTextPop {
  from {
    transform: scale(0.2);
    opacity: 0;
  }

  70% {
    transform: scale(1.25);
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   VICTORY SCREEN
   ============================================ */
#victory-screen {
  background:
    radial-gradient(ellipse at 50% 40%, var(--green-table) 0%, var(--green-table-dark) 50%, var(--bg-dark) 100%);
  overflow-y: auto;
}

.victory-content {
  text-align: center;
  padding: 40px 30px;
  max-width: 620px;
}

.victory-ornament {
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 16px;
  margin-bottom: 24px;
  animation: fadeIn 0.6s;
}

.victory-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
  letter-spacing: 4px;
  margin-bottom: 14px;
  animation: fadeSlideUp 0.8s 0.2s both;
}

.victory-subtitle {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-secondary);
  animation: fadeIn 0.8s 0.5s both;
}

.victory-stats {
  display: flex;
  justify-content: center;
  gap: 44px;
  margin: 36px 0;
  animation: fadeSlideUp 0.8s 0.7s both;
}

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

.v-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
}

.v-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
}

.victory-divider {
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 28px auto;
  animation: fadeIn 1s 1s both;
}

.victory-cta-text {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 28px;
  animation: fadeIn 1s 1.2s both;
}

.victory-contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
  animation: fadeSlideUp 0.8s 1.5s both;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-dim);
  transition: border-color 0.3s, transform 0.3s;
}

.contact-row:hover {
  border-color: var(--gold-dark);
  transform: translateX(4px);
}

.contact-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold-light);
  text-decoration: none;
  transition: color 0.3s;
}

.contact-link:hover {
  color: #fff;
  text-decoration: underline;
}

.contact-text {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

.victory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  animation: fadeSlideUp 0.8s 1.8s both;
}

/* ============================================
   MODAL — Improved readability
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  width: 90%;
  max-width: 950px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 26px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 5;
  transition: color 0.3s;
  line-height: 1;
}

.modal-close:hover {
  color: var(--gold);
}

.modal-tabs {
  display: flex;
  border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}

.modal-tab {
  flex: 1;
  padding: 18px 12px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.modal-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.modal-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
  background: rgba(255, 255, 255, 0.02);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

/* Deck grid in modal */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
}

.deck-grid .game-card {
  cursor: default;
}

.deck-grid .game-card:hover {
  transform: translateY(-6px) scale(1.08);
}

/* Deck divider for gold cards section */
.deck-divider {
  width: 100%;
  text-align: center;
  padding: 24px 0 16px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.deck-divider span {
  padding: 0 20px;
  position: relative;
}

.deck-divider span::before,
.deck-divider span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b8860b, transparent);
}

.deck-divider span::before {
  right: 100%;
}

.deck-divider span::after {
  left: 100%;
}

/* CV viewer in modal */
.cv-section {
  margin-bottom: 36px;
}

.cv-section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(224, 180, 74, 0.2);
}

.cv-role {
  margin-bottom: 24px;
}

.cv-role-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cv-role-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.cv-role-dates {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 12px;
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.cv-role-company {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.cv-achievements-list {
  list-style: none;
  padding: 0;
}

.cv-achievements-list li {
  padding: 7px 0 7px 22px;
  position: relative;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cv-achievements-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 8px;
  top: 12px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Screen shake */
.screen-shake {
  animation: screenShake 0.4s ease-out;
}

@keyframes screenShake {

  0%,
  100% {
    transform: translate(0);
  }

  10% {
    transform: translate(-4px, 2px);
  }

  20% {
    transform: translate(4px, -2px);
  }

  30% {
    transform: translate(-3px, -1px);
  }

  40% {
    transform: translate(3px, 1px);
  }

  50% {
    transform: translate(-2px, 2px);
  }

  60% {
    transform: translate(2px, -1px);
  }

  70% {
    transform: translate(-1px, 1px);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  :root {
    --card-w: 130px;
    --card-h: 185px;
    --card-w-battle: 165px;
    --card-h-battle: 235px;
  }

  .battle-zone {
    gap: 18px;
  }

  .hand-area {
    gap: 8px;
  }

  .battle-vs {
    font-size: 18px;
  }

  .game-card:hover {
    transform: translateY(-14px) scale(1.04);
  }

  .heart {
    font-size: 13px;
  }

  .hp-display {
    max-width: 130px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  :root {
    --card-w: 110px;
    --card-h: 160px;
    --card-w-battle: 135px;
    --card-h-battle: 195px;
  }

  .battle-side {
    padding: 8px 10px;
  }

  .side-label {
    font-size: 9px;
  }

  .battle-top-bar {
    padding: 8px 10px;
  }

  .narrator-bar {
    padding: 10px 14px;
  }

  .narrator-text {
    font-size: 14px;
  }

  .battle-zone {
    gap: 10px;
    padding: 8px;
  }

  .battle-vs {
    font-size: 14px;
    letter-spacing: 3px;
  }

  .card-title {
    font-size: 10px;
    padding: 6px 8px 2px;
  }

  /* Hand cards are 110px wide — desc at 10px is unreadable noise; battle cards keep it */
  .card-desc {
    display: none;
  }

  /* Battle card: shrink art so title/desc actually fit in 195px */
  .battle-card .card-art {
    height: 36px;
    font-size: 20px;
    margin: 2px 10px;
  }

  /* Tighten title so it fits in 195px-tall card */
  .battle-card .card-title {
    font-size: 12px;
    padding: 6px 10px 2px;
  }

  .battle-card .card-desc {
    display: block;
    font-size: 11px;
    padding: 2px 8px 4px;
    -webkit-line-clamp: 3;
  }

  .card-header {
    padding: 8px 8px 4px;
  }

  .card-icon-badge {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .card-power {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .card-art {
    height: 30px;
    margin: 2px 8px;
    font-size: 20px;
  }

  .card-footer {
    padding: 3px 8px 5px;
  }

  .card-source {
    font-size: 6px;
  }

  .modal-content {
    width: 96%;
    max-height: 92vh;
  }

  .deck-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .modal-body {
    padding: 16px;
  }

  .victory-stats {
    gap: 20px;
    flex-wrap: wrap;
  }

  .v-stat-value {
    font-size: 28px;
  }

  .btn {
    font-size: 12px;
    padding: 12px 20px;
  }

  .surrender-area {
    padding-left: 8px;
  }

  .game-card:hover {
    transform: translateY(-10px) scale(1.03);
  }

  .heart {
    font-size: 11px;
  }

  /* On phones, hearts wrap and break the top bar layout — hide them
     and replace with a single ♥ glyph prefix via ::before */
  .hp-display {
    display: none;
  }

  /* Single heart indicator next to each HP number */
  #christos-score::before {
    content: '♥ ';
    font-size: 11px;
    color: var(--gold-light);
    vertical-align: 1px;
  }

  #recruiter-score::before {
    content: '♥ ';
    font-size: 11px;
    color: var(--crimson-light);
    vertical-align: 1px;
  }

  /* Round count not needed on phones — saves top-bar space */
  .battle-round {
    display: none;
  }

  .battle-score {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .score-label {
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: 1px;
  }

  .score-value {
    font-size: 20px;
    min-width: 20px;
  }

  /* Mobile Layout Fix: Stack controls above hand */
  .recruiter-side {
    display: grid;
    grid-template-areas:
      "label surrender deck"
      "hand hand hand";
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding-bottom: 8px;
    align-items: center;
  }

  .side-label {
    grid-area: label;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    margin: 0;
    font-size: 10px;
    transform: none;
  }

  .surrender-area {
    grid-area: surrender;
    margin: 0;
    justify-self: center;
    padding: 0;
  }

  .deck-area {
    grid-area: deck;
    margin: 0;
  }

  .hand-area {
    grid-area: hand;
    width: 100%;
    min-width: 0;
    /* Allow grid item to shrink/scroll */
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 10px;
    /* Extra bottom padding for scrollbar/touch */
    min-height: 185px;
    align-items: flex-end;
  }
}

/* Very Small Mobile (Portrait) */
@media (max-width: 400px) {
  :root {
    --card-w: 85px;
    --card-h: 120px;
    --card-w-battle: 100px;
    --card-h-battle: 140px;
  }

  .battle-side {
    padding: 4px 6px;
    min-height: 70px;
  }

  /* Make Christos side tighter */
  .christos-side {
    min-height: 60px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .battle-zone {
    gap: 6px;
    padding: 4px;
  }

  .narrator-bar {
    padding: 8px 10px;
    min-height: 40px;
  }

  .narrator-text {
    font-size: 12px;
    line-height: 1.3;
  }

  /* Adjust Modal for tiny screens */
  .modal-content {
    width: 98%;
    height: 95%;
  }

  .deck-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  /* Ensure text is readable even on tiny cards by removing some padding */
  .card-header {
    padding: 4px 4px 2px;
  }

  .card-title {
    font-size: 9px;
    padding: 2px 4px;
  }

  .card-desc {
    display: none;
    /* Hide description on tiny cards in hand, rely on preview */
  }

  .battle-card .card-desc {
    display: block;
    /* Show in battle */
    font-size: 9px;
    padding: 2px 6px;
    -webkit-line-clamp: 2;
  }

  /* Optimize Preview Position for Mobile */
  .card-preview {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(0.85);
    width: 280px !important;
    max-width: 90vw;
    margin: 0;
  }

  .card-preview.active {
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Mobile Landscape (Short screens) */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --card-w: 80px;
    --card-h: 110px;
    --card-w-battle: 90px;
    --card-h-battle: 125px;
  }

  .battle-top-bar {
    padding: 4px 10px;
    height: 32px;
  }

  .battle-score {
    gap: 6px;
  }

  .score-value {
    font-size: 18px;
  }

  .christos-side {
    min-height: 60px;
    padding: 2px 10px;
  }

  .recruiter-side {
    min-height: 100px;
    padding-bottom: 4px;
  }

  .narrator-bar {
    display: none;
    /* Hide narrator in super short landscape to save space */
  }

  .battle-zone {
    padding: 2px;
  }

  .battle-vs {
    font-size: 14px;
  }

  .hand-area {
    padding: 2px 0;
  }

  /* Shift position to fit */
  .card-preview {
    transform: scale(0.75) translateY(0);
    left: 50% !important;
    top: 50% !important;
    margin-left: -130px;
    margin-top: -185px;
    position: fixed;
  }
}

/* ============================================
   MULTIPLAYER — Lobby & Host Styles
   ============================================ */

/* Multiplayer button on title screen */
.btn-multiplayer {
  background: linear-gradient(135deg, #1a4a3a, #2a6a5a);
  color: var(--text-primary);
  border: 2px solid var(--emerald);
  box-shadow: 0 0 20px rgba(48, 184, 104, 0.2);
}

.btn-multiplayer:hover {
  background: linear-gradient(135deg, #2a6a5a, #3a8a6a);
  box-shadow: 0 0 30px rgba(48, 184, 104, 0.35);
  transform: translateY(-2px);
}

/* ================================
   Lobby screen
   ================================ */
#lobby-screen {
  background: radial-gradient(ellipse at center, var(--bg-surface) 0%, var(--bg-dark) 100%);
}

.lobby-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 500px;
  width: 100%;
}

.lobby-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 36px);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(224, 180, 74, 0.3);
}

.lobby-qr-container {
  background: var(--bg-dark);
  border: 2px solid var(--border-gold);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(224, 180, 74, 0.1);
}

.lobby-qr-container canvas {
  display: block;
  border-radius: 4px;
}

.lobby-qr-fallback {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
  padding: 20px;
}

.lobby-room-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lobby-code-label {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.lobby-code {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 12px;
  text-shadow: 0 0 30px rgba(224, 180, 74, 0.4);
}

.lobby-players {
  width: 100%;
  min-height: 60px;
}

.lobby-waiting {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}

.lobby-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 12px 16px;
  animation: lobby-player-enter 0.3s ease;
}

@keyframes lobby-player-enter {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lobby-player.disconnected {
  opacity: 0.4;
  border-color: var(--border-dim);
}

.lobby-player-icon {
  font-size: 20px;
}

.lobby-player-name {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text-primary);
  flex: 1;
}

.lobby-player-status {
  font-size: 12px;
  color: var(--crimson-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lobby-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.lobby-error {
  color: var(--crimson-light);
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

/* ================================
   Multiplayer player bar (battle screen)
   ================================ */
.multi-players-bar {
  width: 100%;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.multi-players-label {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.multi-players-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.multi-player-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  padding: 6px 14px;
  transition: all 0.3s ease;
}

.multi-player-chip.picked {
  border-color: var(--emerald);
  background: rgba(48, 184, 104, 0.1);
}

.multi-player-chip.disconnected {
  opacity: 0.3;
}

.multi-player-name {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-primary);
}

.multi-player-status {
  font-size: 14px;
  color: var(--text-dim);
}

.multi-player-chip.picked .multi-player-status {
  color: var(--emerald);
}

.multi-player-chip.disconnected .multi-player-status {
  color: var(--crimson-light);
}

.multi-player-chip.knocked-out {
  opacity: 0.45;
  border-color: var(--crimson);
  background: rgba(212, 64, 48, 0.08);
}

.multi-player-chip.knocked-out .multi-player-name {
  text-decoration: line-through;
  color: var(--text-dim);
}

.multi-player-hp {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--crimson-light);
  background: rgba(212, 64, 48, 0.15);
  padding: 1px 6px;
  border-radius: 6px;
}

/* Per-player HP badges in the HP bar (multi mode) */
.multi-hp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--crimson-light);
  background: rgba(212, 64, 48, 0.2);
  border: 1px solid rgba(212, 64, 48, 0.4);
  border-radius: 8px;
  width: 34px;
  height: 30px;
  margin: 0 2px;
  transition: all 0.3s ease;
}

.multi-hp-badge.knocked-out {
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--border-dim);
  font-size: 16px;
}

/* ============================================
   WINNER CARD PREVIEW OVERLAY
   Shown momentarily when a card wins a clash
   ============================================ */
#winner-preview-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#winner-preview-overlay.active {
  opacity: 1;
}

#winner-preview-label {
  font-family: var(--font-display);
  font-size: clamp(13px, 2vw, 20px);
  letter-spacing: 4px;
  color: var(--gold-light);
  text-shadow: 0 0 24px rgba(224, 180, 74, 0.9), 0 2px 8px rgba(0, 0, 0, 1);
  text-transform: uppercase;
}

/* Override .card-preview fixed positioning when used as winner card */
#winner-preview-card.card-preview {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  width: 280px;
  opacity: 1;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#winner-preview-overlay.active #winner-preview-card.card-preview {
  transform: scale(1) translateY(0);
}