/* light-theme: manual
   NexHero "dungeon fantasy" redesign (nexhero.html, after nexhero.css).
   Cinzel headings, gold accents, a torch-lit dungeon arena, segmented HP/XP
   bars, upgrade cards styled like loot drops by rarity (via :has(), no JS
   change) and a crit shake (class added in assets/js/nexhero.js).
   Only visuals are overridden - the layout of nexhero.css stays. */

:root .nh-page {
  --nh-gold: #f4c152;
  --nh-gold-deep: #b8860b;
  --nh-stone: #14121a;
  --nh-stone-2: #1d1a24;
  --nh-edge: rgba(244, 193, 82, 0.28);
  --nh-head: "Cinzel", Georgia, serif;
}

/* --- title --- */
:root .nh-title { font-family: var(--nh-head); font-weight: 900; letter-spacing: 0.04em; }

:root .nh-title span {
  background: linear-gradient(180deg, #fff3c4, #f4c152 45%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #3b2a05) drop-shadow(0 0 18px rgba(244, 193, 82, 0.35));
}

:root .nh-title i { color: var(--nh-gold); filter: drop-shadow(0 0 10px rgba(244, 193, 82, 0.6)); }

/* --- panels: dark stone with a thin gold rim --- */
:root .nh-stats-bar,
:root .nh-stats-panel,
:root .nh-log-wrap,
:root .nh-gold-shop,
:root .nh-arena {
  border: 1px solid var(--nh-edge);
  background:
    radial-gradient(400px circle at 50% 0%, rgba(244, 193, 82, 0.06), transparent 70%),
    linear-gradient(180deg, var(--nh-stone-2), var(--nh-stone));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.35);
}

:root .nh-stats-panel h3,
:root .nh-panel-title,
:root .nh-topbar-label,
:root .nh-stat-label,
:root .nh-fighter-name {
  font-family: var(--nh-head);
  color: var(--nh-gold);
  letter-spacing: 0.08em;
}

:root .nh-topbar-gold #nh-gold { color: var(--nh-gold); text-shadow: 0 0 10px rgba(244, 193, 82, 0.5); }

/* --- XP bar: gold, segmented --- */
:root .nh-xp-bar {
  height: 16px;
  border-radius: 6px;
  border: 1px solid var(--nh-edge);
  background: #0c0b10;
}

:root .nh-xp-fill {
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(0, 0, 0, 0.35) 18px 20px),
    linear-gradient(90deg, #b8860b, #f4c152, #fff3c4);
  box-shadow: 0 0 14px rgba(244, 193, 82, 0.5);
}

:root .nh-xp-text { font-family: var(--nh-head); font-weight: 700; text-shadow: 0 1px 2px #000; }

/* --- arena: torch-lit dungeon --- */
:root .nh-arena {
  min-height: 210px;
  overflow: hidden;
  background:
    radial-gradient(240px 180px at 8% 20%, rgba(255, 140, 40, 0.18), transparent 70%),
    radial-gradient(240px 180px at 92% 20%, rgba(255, 140, 40, 0.18), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, #1b1822 0%, #110f16 70%, #1a140c 100%);
}

/* flickering torches in both top corners */
:root .nh-arena::before,
:root .nh-arena::after {
  content: "🔥";
  position: absolute;
  top: 10px;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 10px rgba(255, 140, 40, 0.9));
  animation: nh-torch 1.6s ease-in-out infinite alternate;
  pointer-events: none;
}

:root .nh-arena::before { left: 14px; }
:root .nh-arena::after { right: 14px; animation-delay: -0.8s; }

@keyframes nh-torch {
  0% { opacity: 0.75; transform: scale(0.95) rotate(-4deg); }
  50% { opacity: 1; transform: scale(1.08) rotate(3deg); }
  100% { opacity: 0.85; transform: scale(1) rotate(-2deg); }
}

:root .nh-fighter-icon { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
:root .nh-hero .nh-fighter-icon { color: #7dd3fc; text-shadow: 0 0 18px rgba(56, 189, 248, 0.6); }
:root .nh-enemy .nh-fighter-icon { color: #fb7185; text-shadow: 0 0 18px rgba(244, 63, 94, 0.55); }
:root .nh-fighter-icon.nh-boss-icon { color: #c084fc; text-shadow: 0 0 24px rgba(192, 132, 252, 0.8); animation: nh-boss-breathe 2s ease-in-out infinite; }

@keyframes nh-boss-breathe { 50% { transform: scale(1.08); } }

:root .nh-vs {
  font-family: var(--nh-head);
  font-size: 1.6rem;
  filter: drop-shadow(0 0 12px rgba(244, 193, 82, 0.5));
}

/* --- HP bars: chunky with segments --- */
:root .nh-hp-bar {
  height: 11px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  background: #0c0b10;
  box-shadow: 0 0 0 1px rgba(244, 193, 82, 0.15);
}

:root .nh-hp-fill {
  background-image: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 0, 0, 0.35) 9px 10px) !important;
  background-color: transparent;
}

:root .nh-hp-hero { background-color: #22c55e !important; box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
:root .nh-hp-enemy { background-color: #ef4444 !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }

/* --- damage numbers: outlined, bigger, crits golden --- */
:root .nh-dmg-popup {
  font-family: var(--nh-head);
  font-weight: 900;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.75);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
}

:root .nh-dmg-popup.nh-dmg-crit {
  font-size: 1.8rem;
  color: #fde047 !important;
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.9), 0 3px 0 #7c2d12;
}

/* crit: arena jolts and flashes gold */
:root .nh-arena.nh-crit-shake { animation: nh-crit 0.35s ease; }

@keyframes nh-crit {
  0%, 100% { translate: 0 0; box-shadow: inset 0 0 0 rgba(250, 204, 21, 0); }
  25% { translate: -6px 2px; box-shadow: inset 0 0 60px rgba(250, 204, 21, 0.35); }
  50% { translate: 5px -2px; }
  75% { translate: -3px 1px; }
}

/* --- buttons --- */
:root .nh-stats-btn,
:root .nh-play-btn {
  font-family: var(--nh-head);
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 10px;
  border: 1px solid rgba(244, 193, 82, 0.5);
  background: linear-gradient(180deg, #3a2c10, #221a09);
  color: #fde68a;
  box-shadow: inset 0 1px 0 rgba(255, 243, 196, 0.2), 0 4px 0 #120d04;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

:root .nh-stats-btn:hover,
:root .nh-play-btn:hover:not(:disabled) { filter: brightness(1.2); transform: translateY(-1px); }

:root .nh-stats-btn:active,
:root .nh-play-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 243, 196, 0.2), 0 1px 0 #120d04; }

:root .nh-start-btn {
  background: linear-gradient(180deg, #f4c152, #b8860b);
  color: #1f1503;
  border-color: #fff3c4;
}

/* --- level-up cards as loot drops (rarity read from the inner badge) --- */
:root .nh-choice-btn {
  --r: #94a3b8;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--r) 60%, transparent);
  background:
    radial-gradient(220px circle at 0% 0%, color-mix(in srgb, var(--r) 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--nh-stone-2), var(--nh-stone));
  box-shadow: 0 0 18px color-mix(in srgb, var(--r) 22%, transparent);
  animation: nh-loot 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

:root .nh-choice-btn:nth-child(2) { animation-delay: 0.08s; }
:root .nh-choice-btn:nth-child(3) { animation-delay: 0.16s; }
:root .nh-choice-btn:nth-child(4) { animation-delay: 0.24s; }

@keyframes nh-loot {
  from { opacity: 0; transform: translateY(-30px) rotate(-3deg) scale(0.9); }
  to { opacity: 1; transform: none; }
}

:root .nh-choice-btn:has(.nh-rarity-uncommon) { --r: #4ade80; }
:root .nh-choice-btn:has(.nh-rarity-rare) { --r: #3b82f6; }
:root .nh-choice-btn:has(.nh-rarity-epic) { --r: #c084fc; }
:root .nh-choice-btn:has(.nh-rarity-legendary) { --r: #fbbf24; }

:root .nh-choice-btn:hover { transform: translateY(-3px); box-shadow: 0 0 30px color-mix(in srgb, var(--r) 45%, transparent); }

/* legendary: a gold shine sweeps across the card */
:root .nh-choice-btn:has(.nh-rarity-legendary)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 243, 196, 0.28) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: nh-shine 2.2s linear infinite;
}

@keyframes nh-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

:root .nh-choice-name { font-family: var(--nh-head); font-weight: 700; color: #fff7e0; }
:root .nh-choice-rarity { font-family: var(--nh-head); font-weight: 700; letter-spacing: 0.14em; }

/* --- overlays --- */
:root .nh-overlay-box {
  border-radius: 20px;
  border: 1px solid rgba(244, 193, 82, 0.4);
  background:
    radial-gradient(500px circle at 50% 0%, rgba(244, 193, 82, 0.1), transparent 70%),
    linear-gradient(180deg, #1d1a24, #0f0d13);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(244, 193, 82, 0.1);
}

:root .nh-overlay-box h2 { font-family: var(--nh-head); color: var(--nh-gold); letter-spacing: 0.04em; text-shadow: 0 0 20px rgba(244, 193, 82, 0.35); }

:root #nh-death-title { color: #f87171; text-shadow: 0 0 20px rgba(239, 68, 68, 0.45); }

:root .nh-class-card {
  border-radius: 14px;
  border: 1px solid var(--nh-edge);
  background: linear-gradient(180deg, var(--nh-stone-2), var(--nh-stone));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

:root .nh-class-card:hover { transform: translateY(-3px); border-color: var(--nh-gold); }
:root .nh-class-card.nh-class-selected { border-color: var(--nh-gold); box-shadow: 0 0 24px rgba(244, 193, 82, 0.4); }

/* --- log: parchment-ish lines --- */
:root .nh-log { font-size: 0.85rem; border: 1px solid var(--nh-edge); background: rgba(0, 0, 0, 0.3); }
:root .nh-buff-tag { border-radius: 999px; border: 1px solid var(--nh-edge); background: rgba(244, 193, 82, 0.08); }

@media (prefers-reduced-motion: reduce) {
  :root .nh-arena::before, :root .nh-arena::after,
  :root .nh-fighter-icon.nh-boss-icon,
  :root .nh-choice-btn,
  :root .nh-choice-btn:has(.nh-rarity-legendary)::after { animation: none; }
}

/* light theme: the game screen stays dark (it's the dungeon), only the title adapts */
html[data-theme="light"] .nh-title span { filter: drop-shadow(0 2px 0 #fff); background-image: linear-gradient(180deg, #b8860b, #92400e); }
