/* ===== NexHero – Roguelike Auto-Battler ===== */

.nh-page {
  padding-top: 1.5rem !important;
}

/* --- Header --- */
.nh-header {
  text-align: center;
  margin-bottom: 1.2rem;
}
.nh-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #BAE6FD;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.nh-back-btn:hover { color: #fff; }
.nh-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f9fafb;
  font-weight: 800;
  margin: 0;
}
.nh-title span {
  background: linear-gradient(120deg, #c084fc, #7c3aed, #e5e7eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nh-title i { margin-right: 0.3rem; }
.nh-subtitle {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Game Container --- */
.nh-game-container {
  max-width: 900px;
  margin: 0 auto;
}

/* --- Stats Bar --- */
.nh-stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  padding: 0.5rem 1rem;
  background: rgba(15,23,42,0.95);
  border-radius: 10px;
  border: 1px solid rgba(139,92,246,0.34);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.35);
}
.nh-topbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}
.nh-topbar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}
.nh-topbar-item span:last-child {
  font-size: 1.15rem;
  font-weight: 800;
  color: #c084fc;
  font-variant-numeric: tabular-nums;
}
.nh-topbar-gold span:last-child { color: #fbbf24; }

/* --- XP Bar --- */
.nh-xp-wrap {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}
.nh-xp-bar {
  flex: 1;
  height: 18px;
  background: rgba(15,23,42,0.95);
  border-radius: 10px;
  border: 1px solid rgba(139,92,246,0.32);
  overflow: hidden;
  position: relative;
}
.nh-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.18);
}
.nh-xp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e0f2fe;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* --- Top Row: Arena + Stats side by side --- */
.nh-top-row {
  display: flex;
  gap: 0.8rem;
  align-items: stretch;
  margin-bottom: 0.6rem;
}

/* Arena */
.nh-arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(139,92,246,0.34);
  border-radius: 12px;
  padding: 1rem 0.8rem;
  min-height: 170px;
  position: relative;
}

.nh-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100px;
  position: relative;
}
.nh-fighter-name {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #BAE6FD;
}
.nh-fighter-icon {
  font-size: 2.8rem;
  transition: transform 0.15s;
}
.nh-hero.nh-shielded::after {
  content: '';
  position: absolute;
  width: 78px;
  height: 78px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -42%);
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45), inset 0 0 10px rgba(125, 211, 252, 0.35);
  background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, rgba(56,189,248,0.04) 55%, rgba(56,189,248,0) 80%);
  pointer-events: none;
  animation: nh-shield-pulse 1.4s ease-in-out infinite;
}

@keyframes nh-shield-pulse {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -42%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -42%) scale(1.04); }
}
.nh-hero .nh-fighter-icon { color: #60a5fa; }
.nh-enemy .nh-fighter-icon { color: #f87171; }
.nh-fighter-icon.nh-boss-icon { color: #c084fc; font-size: 3.2rem; text-shadow: 0 0 14px rgba(192,132,252,0.5); }

/* Attack animation */
.nh-hero.nh-attacking .nh-fighter-icon { animation: nh-atk-right 0.25s ease; }
.nh-enemy.nh-attacking .nh-fighter-icon { animation: nh-atk-left 0.25s ease; }
.nh-fighter.nh-hit .nh-fighter-icon { animation: nh-shake 0.3s ease; }

@keyframes nh-atk-right {
  0%, 100% { transform: translateX(0); }
  40% { transform: translateX(14px); }
}
@keyframes nh-atk-left {
  0%, 100% { transform: translateX(0); }
  40% { transform: translateX(-14px); }
}
@keyframes nh-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* HP Bar */
.nh-hp-bar {
  width: 100%;
  height: 6px;
  background: rgba(15,23,42,0.95);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.12);
}
.nh-hp-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.nh-hp-hero { background: linear-gradient(90deg, #22c55e, #4ade80); width: 100%; }
.nh-hp-enemy { background: linear-gradient(90deg, #ef4444, #f87171); width: 100%; }

/* Damage Popup */
.nh-dmg-popup {
  position: absolute;
  top: -5px;
  font-size: 1rem;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
}
.nh-dmg-popup.nh-dmg-show {
  animation: nh-dmg-float 0.8s ease-out forwards;
}
.nh-dmg-popup.nh-dmg-crit { font-size: 1.3rem; color: #fbbf24 !important; }

@keyframes nh-dmg-float {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-24px); }
}

/* VS */
.nh-vs {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* --- Stats Panel (beside arena) --- */
.nh-stats-panel {
  width: 220px;
  flex-shrink: 0;
  background: rgba(15,23,42,0.95);
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,0.34);
  padding: 0.7rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nh-stats-panel h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #BAE6FD;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.nh-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem 0.4rem;
}
.nh-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
.nh-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nh-stat-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: #d8b4fe;
  font-variant-numeric: tabular-nums;
}

/* Stats Panel Buttons */
.nh-stats-buttons {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.nh-stats-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.nh-stats-btn:hover {
  transform: translateY(-1px);
}
.nh-start-btn {
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.1);
  color: #fde68a;
}
.nh-start-btn:hover {
  background: rgba(251,191,36,0.2);
  border-color: #fbbf24;
}
.nh-class-btn {
  border: 1px solid rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.08);
  color: #d8b4fe;
}
.nh-class-btn:hover {
  background: rgba(139,92,246,0.15);
  border-color: #8b5cf6;
}

/* --- Active Buffs + Abilities (centered row) --- */
.nh-active-buffs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 0;
  margin-bottom: 0.3rem;
}
.nh-buff-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.08);
  color: #fbbf24;
  animation: nh-buff-pulse 2s ease-in-out infinite;
}
@keyframes nh-buff-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(251,191,36,0); }
  50% { box-shadow: 0 0 6px rgba(251,191,36,0.15); }
}

.nh-abilities {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 0;
  margin-bottom: 0.4rem;
}
.nh-ability-btn {
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(15,23,42,0.8);
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  position: relative;
}
.nh-ability-btn:hover {
  background: rgba(139,92,246,0.15);
  border-color: #8b5cf6;
  transform: translateY(-1px);
}
.nh-ability-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}
.nh-ability-btn .nh-cd {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fbbf24;
}

/* --- Bottom Row: Shop + Log side by side --- */
.nh-bottom-row {
  display: flex;
  gap: 0.8rem;
  align-items: stretch;
}

.nh-log-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Gold Shop */
.nh-gold-shop {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(15,23,42,0.95);
  border-radius: 12px;
  border: 1px solid rgba(251,191,36,0.38);
  padding: 0.7rem 0.8rem;
  max-height: none;
  overflow: visible;
}
.nh-panel-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fbbf24;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nh-gold-shop-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  overflow-y: auto;
}

/* Potion Card */
.nh-potion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: rgba(120,80,0,0.1);
  border-radius: 8px;
  border: 1px solid rgba(251,191,36,0.15);
  transition: border-color 0.2s, background 0.2s;
}
.nh-potion:hover {
  border-color: rgba(251,191,36,0.45);
  background: rgba(120,80,0,0.2);
}
.nh-potion-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.nh-potion-info {
  flex: 1;
  min-width: 0;
}
.nh-potion-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fef3c7;
}
.nh-potion-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.nh-potion-stock {
  font-size: 0.68rem;
  color: #fbbf24;
  margin-top: 0.05rem;
}
.nh-potion-buy {
  flex-shrink: 0;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #fbbf24;
  background: rgba(120,80,0,0.3);
  color: #fef3c7;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.nh-potion-buy:hover:not(:disabled) {
  background: rgba(251,191,36,0.2);
  transform: translateY(-1px);
}
.nh-potion-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Combat Log */
.nh-log {
  flex: 1;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(139,92,246,0.34);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.55;
}
.nh-log > div {
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(30,41,59,0.36);
  transition: border-color 0.2s, background 0.2s;
}
.nh-log > div:empty {
  display: none;
}
.nh-log > div:last-child {
  margin-bottom: 0;
}
.nh-log::-webkit-scrollbar,
.nh-gold-shop::-webkit-scrollbar { width: 4px; }
.nh-log::-webkit-scrollbar-track,
.nh-gold-shop::-webkit-scrollbar-track { background: transparent; }
.nh-log::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.25); border-radius: 2px; }
.nh-gold-shop::-webkit-scrollbar-thumb { background: rgba(251,191,36,0.25); border-radius: 2px; }
.nh-log-hero { color: #60a5fa; border-color: rgba(96,165,250,0.35) !important; background: rgba(30,58,138,0.22) !important; }
.nh-log-enemy { color: #f87171; border-color: rgba(248,113,113,0.35) !important; background: rgba(127,29,29,0.2) !important; }
.nh-log-heal { color: #4ade80; border-color: rgba(74,222,128,0.35) !important; background: rgba(20,83,45,0.2) !important; }
.nh-log-crit { color: #fbbf24; font-weight: 700; border-color: rgba(251,191,36,0.4) !important; background: rgba(120,53,15,0.24) !important; }
.nh-log-boss { color: #c084fc; font-weight: 700; border-color: rgba(192,132,252,0.4) !important; background: rgba(88,28,135,0.22) !important; }
.nh-log-shop { color: #38bdf8; border-color: rgba(56,189,248,0.35) !important; background: rgba(7,89,133,0.22) !important; }

/* --- Toast Notification --- */
.nh-toast {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 2500;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: rgba(15,23,42,0.95);
  border: 1px solid #fbbf24;
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  animation: nh-toast-in 0.3s ease, nh-toast-out 0.3s ease 2.5s forwards;
}
@keyframes nh-toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes nh-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* --- Overlays --- */
.nh-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2,6,23,0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.nh-overlay.hidden { display: none; }
.nh-class-grid.hidden { display: none; }
.nh-overlay-box {
  background: rgba(15,23,42,0.95); border: 1px solid rgba(148,163,184,0.25);
  border-radius: 18px; padding: 2rem 1.8rem; text-align: center;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.nh-overlay-box h2 {
  font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.5rem;
}
.nh-overlay-box p {
  color: var(--text-muted); line-height: 1.6; margin-bottom: 1.2rem; font-size: 0.92rem;
}

.nh-play-btn {
  padding: 0.7rem 2rem; border: 1px solid rgba(148,163,184,0.6);
  border-radius: 999px; background: transparent; color: #e5e7eb;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.nh-play-btn:hover {
  background: rgba(148,163,184,0.12); border-color: rgba(148,163,184,1);
  transform: translateY(-2px);
}

/* Level-Up Choices */
.nh-choices {
  display: flex; flex-direction: column; gap: 0.7rem;
}
.nh-choice-btn {
  padding: 0.8rem 1.2rem; border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px; background: rgba(15,23,42,0.9); cursor: pointer;
  text-align: left; transition: background 0.2s, border-color 0.2s, transform 0.15s;
  display: flex; align-items: center; gap: 0.8rem;
}
.nh-choice-btn:hover {
  background: rgba(59,130,246,0.1); border-color: #3b82f6;
  transform: translateY(-2px);
}
.nh-choice-icon {
  font-size: 1.5rem; width: 40px; text-align: center; flex-shrink: 0;
}
.nh-choice-info { flex: 1; }
.nh-choice-name { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.nh-choice-desc { font-size: 0.8rem; color: #cbd5e1; line-height: 1.45; }
.nh-choice-rarity {
  font-size: 0.65rem; text-transform: uppercase; font-weight: 700;
  letter-spacing: 0.1em; margin-top: 0.15rem;
}
.nh-rarity-common { color: #94a3b8; }
.nh-rarity-uncommon { color: #4ade80; }
.nh-rarity-rare { color: #3b82f6; }
.nh-rarity-epic { color: #c084fc; }
.nh-rarity-legendary { color: #fbbf24; }

/* Prestige Shop */
.nh-prestige-shop {
  margin: 1.2rem 0; text-align: left;
}
.nh-prestige-shop h3 {
  font-size: 0.95rem; font-weight: 700; color: var(--text-main);
  margin-bottom: 0.6rem; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.nh-shop-items {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.nh-shop-btn {
  padding: 0.6rem 0.7rem; border: 1px solid rgba(148,163,184,0.2);
  border-radius: 10px; background: rgba(15,23,42,0.8); cursor: pointer;
  text-align: center; transition: background 0.2s, border-color 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.nh-shop-btn:hover {
  background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.5);
}
.nh-shop-btn:disabled { opacity: 0.35; cursor: default; }
.nh-shop-name { font-size: 0.78rem; font-weight: 600; color: var(--text-main); }
.nh-shop-cost { font-size: 0.7rem; color: #c084fc; }
.nh-shop-level { font-size: 0.65rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 600px) {
  .nh-page {
    padding: 0.8rem 0.4rem 2rem !important;
  }
  .nh-header { margin-bottom: 0.8rem; }
  .nh-subtitle { font-size: 0.82rem; }

  .nh-game-container { padding: 0; }

  /* Stats Bar compact */
  .nh-stats-bar {
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
  }
  .nh-topbar-label { font-size: 0.6rem; }
  .nh-topbar-item { min-width: 45px; }
  .nh-topbar-item span:last-child { font-size: 0.85rem; }

  /* XP bar slimmer */
  .nh-xp-bar { height: 14px; }
  .nh-xp-text { font-size: 0.6rem; }
  .nh-xp-wrap { margin-bottom: 0.5rem; }

  /* Stack top row */
  .nh-top-row { flex-direction: column; gap: 0.5rem; }
  .nh-stats-panel { width: 100%; flex-direction: column; }
  .nh-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 0.2rem 0.3rem; }
  .nh-stat-label { font-size: 0.6rem; }
  .nh-stat-val { font-size: 0.8rem; }
  .nh-stats-buttons { margin-top: 0.35rem; }
  .nh-stats-btn { font-size: 0.68rem; padding: 0.42rem 0.5rem; min-height: 36px; }

  /* Arena compact */
  .nh-arena { padding: 0.7rem 0.4rem; min-height: 110px; border-radius: 10px; }
  .nh-fighter { width: 75px; gap: 0.2rem; }
  .nh-fighter-name { font-size: 0.65rem; }
  .nh-fighter-icon { font-size: 1.8rem; }
  .nh-hero.nh-shielded::after {
    width: 56px;
    height: 56px;
    border-width: 2px;
  }
  .nh-fighter-icon.nh-boss-icon { font-size: 2.1rem; }
  .nh-vs { font-size: 1.1rem; }
  .nh-dmg-popup { font-size: 0.85rem; }
  .nh-dmg-popup.nh-dmg-crit { font-size: 1rem; }

  /* Abilities & Buffs compact */
  .nh-active-buffs { gap: 0.25rem; margin-bottom: 0.2rem; }
  .nh-buff-tag { font-size: 0.6rem; padding: 0.15rem 0.4rem; }
  .nh-abilities { gap: 0.3rem; margin-bottom: 0.3rem; }
  .nh-ability-btn { font-size: 0.72rem; padding: 0.45rem 0.6rem; min-height: 36px; }

  /* Stack bottom row */
  .nh-bottom-row { flex-direction: column; gap: 0.5rem; }
  .nh-gold-shop, .nh-log {
    max-height: 280px;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
  }
  .nh-gold-shop {
    overflow-y: auto;
  }
  .nh-panel-title { font-size: 0.75rem; margin-bottom: 0.35rem; }
  .nh-potion { padding: 0.3rem 0.4rem; gap: 0.35rem; }
  .nh-potion-icon { font-size: 1rem; width: 20px; }
  .nh-potion-name { font-size: 0.72rem; }
  .nh-potion-desc { font-size: 0.62rem; }
  .nh-potion-buy { font-size: 0.68rem; padding: 0.4rem 0.55rem; min-height: 34px; }
  .nh-log { font-size: 0.68rem; }

  /* Overlays */
  .nh-overlay-box { padding: 1.2rem 1rem; border-radius: 14px; }
  .nh-overlay-box h2 { font-size: 1.3rem; }
  .nh-overlay-box p { font-size: 0.82rem; margin-bottom: 0.8rem; }
  .nh-class-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .nh-class-card { padding: 0.5rem 0.4rem; gap: 0.25rem; }
  .nh-class-card-icon { font-size: 1.4rem; }
  .nh-class-card-name { font-size: 0.75rem; }
  .nh-class-card-desc { font-size: 0.6rem; }
  .nh-class-card-stats { font-size: 0.55rem; }
  .nh-play-btn { font-size: 0.88rem; padding: 0.55rem 1.4rem; }
  .nh-choice-btn { padding: 0.6rem 0.8rem; gap: 0.5rem; }
  .nh-choice-icon { font-size: 1.2rem; width: 30px; }
  .nh-choice-name { font-size: 0.8rem; }
  .nh-choice-desc { font-size: 0.7rem; }
  .nh-shop-items { grid-template-columns: 1fr; }
  .nh-shop-btn { padding: 0.5rem; }

  /* Toast mobile */
  .nh-toast { top: 70px; right: 10px; font-size: 0.72rem; padding: 0.4rem 0.7rem; }
}

/* Class Selection */
.nh-start-box { max-width: 560px; }
.nh-class-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem;
  margin-bottom: 1.2rem;
}
.nh-class-card {
  padding: 0.9rem 0.6rem; border: 2px solid rgba(148,163,184,0.2);
  border-radius: 14px; background: rgba(15,23,42,0.8); cursor: pointer;
  text-align: center; transition: background 0.2s, border-color 0.3s, transform 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.nh-class-card:hover {
  background: rgba(148,163,184,0.08); transform: translateY(-2px);
}
.nh-class-card.nh-class-selected {
  background: rgba(59,130,246,0.1);
  transform: translateY(-3px);
  box-shadow: 0 0 16px rgba(59,130,246,0.2);
}
.nh-class-card-icon {
  font-size: 2rem; margin-bottom: 0.1rem;
}
.nh-class-card-name {
  font-size: 0.85rem; font-weight: 700; color: var(--text-main);
}
.nh-class-card-desc {
  font-size: 0.68rem; color: var(--text-muted); line-height: 1.4;
}
.nh-class-card-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem;
  margin-top: 0.2rem; font-size: 0.62rem; color: var(--text-muted);
}
.nh-class-card-stats span {
  font-weight: 700; color: var(--text-main);
}
.nh-play-btn:disabled {
  opacity: 0.35; cursor: default; transform: none;
}

.nh-stats-btn:focus-visible,
.nh-ability-btn:focus-visible,
.nh-potion-buy:focus-visible,
.nh-choice-btn:focus-visible,
.nh-play-btn:focus-visible,
.nh-class-card:focus-visible,
.nh-back-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
