/**
 * rpg-panels.css — RPG UI: character, ship, companion, combat, level-up, stat-check.
 * Matches existing sci-fi frame style (L-corners, --frame-color, diagonal gradients).
 */

/* ═══════════════════════════════════════════════
   RPG HUD BAR (persistent during gameplay)
   ═══════════════════════════════════════════════ */

#rpg-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(6, 5, 8, 0.75);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.25);
  font-family: "Noto Sans", sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Фиксированная полоса при прокрутке */
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.rpg-hud-hp {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  max-width: 120px;
}

.rpg-hud-hp-icon { font-size: 12px; }

.rpg-hud-hp-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(var(--frame-rgb), 0.2);
  overflow: hidden;
}

.rpg-hud-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f87171);
  transition: width 0.4s ease;
}

.rpg-hud-hp-text {
  font-size: 10px;
  min-width: 32px;
  text-align: right;
  color: #f87171;
  font-weight: 600;
}

.rpg-hud-armor {
  font-size: 10px;
  color: #94a3b8;
  margin-left: 2px;
}

.rpg-hud-sep {
  width: 1px;
  height: 14px;
  background: rgba(var(--frame-rgb), 0.2);
}

.rpg-hud-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
}

.rpg-hud-stat-icon { font-size: 11px; }
.rpg-hud-stat-value { font-weight: 600; }

.rpg-hud-level { color: #facc15; }
.rpg-hud-credits { color: #22c55e; }

.rpg-hud-companion {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #a78bfa;
}

.rpg-hud-companion-bar {
  width: 40px;
  height: 4px;
}

/* ═══════════════════════════════════════════════
   WHEEL PICKER ДЛЯ ВЫБОРА КОЛИЧЕСТВА
   (в стиле popup-frame)
   ═══════════════════════════════════════════════ */

.wheel-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 12000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.wheel-picker-overlay.active {
  display: flex;
}

.wheel-picker-container {
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  border: 1px solid rgba(var(--frame-rgb), 0.5);
  box-shadow: 0 0 40px rgba(var(--frame-rgb), 0.3);
  background: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%);
  padding: 30px 20px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  cursor: default;
  pointer-events: auto;
  z-index: 2;
}

.wheel-picker-title {
  color: var(--fg);
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  text-align: center;
}

.wheel-picker-track {
  height: 200px;
  overflow: hidden;
  position: relative;
  margin: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wheel-picker-items {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wheel-picker-item {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.wheel-picker-item.selected {
  color: #fff;
  font-size: 32px;
  text-shadow: 0 0 10px rgba(var(--frame-rgb), 0.8);
}

.wheel-picker-item:hover {
  color: #fff;
}

.wheel-picker-highlight {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 50px;
  transform: translateY(-50%);
  border-top: 2px solid rgba(var(--frame-rgb), 0.5);
  border-bottom: 2px solid rgba(var(--frame-rgb), 0.5);
  background: rgba(var(--frame-rgb), 0.05);
  pointer-events: none;
}

.wheel-picker-btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.wheel-picker-btn {
  flex: 1;
  padding: 12px 20px;
  background: rgba(var(--frame-rgb), 0.15);
  border: 1px solid rgba(var(--frame-rgb), 0.4);
  color: var(--fg);
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.wheel-picker-btn:hover {
  background: rgba(var(--frame-rgb), 0.25);
  transform: translateY(-2px);
}

.wheel-picker-btn:active {
  transform: translateY(0);
}

.wheel-picker-btn.cancel {
  background: rgba(107, 114, 128, 0.15);
  border-color: rgba(107, 114, 128, 0.4);
  color: #9ca3af;
}

.wheel-picker-btn.confirm {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

/* ═══════════════════════════════════════════════
   СТИЛИ ДЛЯ КОЛИЧЕСТВА В ИНВЕНТАРЕ
   ═══════════════════════════════════════════════ */

.key-item .item-count-label {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.key-item .item-count-value {
  color: #22c55e;
  font-weight: bold;
}
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rpg-hud-companion-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  transition: width 0.4s ease;
}

/* Отступ контента под фикс. HUD; фото прилипает под полоской */
#app.rpg-hud-visible { padding-top: 36px; }
#app.rpg-hud-visible .illustration-wrap { top: 36px; }

/* ═══════════════════════════════════════════════
   SHARED RPG PANEL BASE
   ═══════════════════════════════════════════════ */

.rpg-screen {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px 15px;
  text-align: center;
  font-family: "Noto Sans", sans-serif;
  color: var(--fg);
}

.rpg-screen.active { display: block; }

.rpg-screen h2 {
  margin-bottom: 16px;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--frame-color);
}

.rpg-container {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  border-radius: 0 !important;
  background: repeating-linear-gradient(
    45deg,
    rgba(var(--frame-rgb), 0.03),
    rgba(var(--frame-rgb), 0.03) 50px,
    rgba(0, 0, 0, 0.02) 50px,
    rgba(0, 0, 0, 0.02) 70px
  );
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  padding: 20px 16px;
}

.rpg-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 12px; height: 12px;
  border-top: 2px solid var(--frame-color);
  border-left: 2px solid var(--frame-color);
  pointer-events: none;
}

.rpg-container::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-bottom: 2px solid var(--frame-color);
  border-right: 2px solid var(--frame-color);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   HP / SHIELD / XP BARS
   ═══════════════════════════════════════════════ */

.rpg-bar-wrap {
  margin: 8px 0;
  text-align: left;
}

.rpg-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rpg-bar {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(var(--frame-rgb), 0.3);
  overflow: hidden;
  position: relative;
}

.rpg-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.rpg-bar--hp .rpg-bar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.rpg-bar--shield .rpg-bar-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.rpg-bar--heat .rpg-bar-fill { background: linear-gradient(90deg, #f97316, #fb923c); transition: width 2s ease-out; }
.rpg-bar--power .rpg-bar-fill { background: linear-gradient(90deg, #eab308, #facc15); transition: width 2s ease-out; }
.rpg-bar-wrap[data-bar="player-heat"] .rpg-bar-label span:last-child,
.rpg-bar-wrap[data-bar="player-power"] .rpg-bar-label span:last-child { display: none; }
.rpg-bar-wrap[data-bar="player-heat"].rpg-bar--empty .rpg-bar-fill,
.rpg-bar-wrap[data-bar="player-power"].rpg-bar--empty .rpg-bar-fill { transition-duration: 0.25s; }
.rpg-bar-wrap[data-bar="player-heat"].rpg-bar--empty .rpg-bar,
.rpg-bar-wrap[data-bar="player-power"].rpg-bar--empty .rpg-bar { animation: rpg-bar-zero-glow 0.8s ease-in-out infinite; }
@keyframes rpg-bar-zero-glow { 0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.6); } 50% { box-shadow: 0 0 20px rgba(239,68,68,0.9); } }
.rpg-bar--xp .rpg-bar-fill { background: linear-gradient(90deg, #eab308, #facc15); }
.rpg-bar--companion .rpg-bar-fill { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* ═══════════════════════════════════════════════
   STAT GRID
   ═══════════════════════════════════════════════ */

.rpg-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.rpg-stat-box {
  position: relative;
  padding: 10px 6px;
  text-align: center;
  background: rgba(var(--frame-rgb), 0.05);
  border-top: 1px solid rgba(var(--frame-rgb), 0.3);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.3);
}

.rpg-stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-top: 1px solid var(--frame-color);
  border-left: 1px solid var(--frame-color);
}

.rpg-stat-box::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 6px; height: 6px;
  border-bottom: 1px solid var(--frame-color);
  border-right: 1px solid var(--frame-color);
}

.rpg-stat-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}

.rpg-stat-value {
  font-size: 22px;
  font-weight: bold;
  color: var(--fg);
}

.rpg-stat-icon {
  font-size: 14px;
  margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════
   EQUIPMENT SLOTS
   ═══════════════════════════════════════════════ */

.rpg-equip-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--frame-color);
  margin: 14px 0 8px;
  text-align: left;
}

.rpg-equip-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 4px 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(var(--frame-rgb), 0.04),
    rgba(var(--frame-rgb), 0.04) 50px,
    rgba(0,0,0,0.02) 50px,
    rgba(0,0,0,0.02) 70px
  );
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  cursor: pointer;
  transition: background 0.2s, filter 0.2s;
  text-align: left;
}

.rpg-equip-slot::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-top: 1px solid var(--frame-color);
  border-left: 1px solid var(--frame-color);
}

.rpg-equip-slot::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 6px; height: 6px;
  border-bottom: 1px solid var(--frame-color);
  border-right: 1px solid var(--frame-color);
}

.rpg-equip-slot:hover {
  background: repeating-linear-gradient(45deg,rgba(var(--frame-rgb),0.08),rgba(var(--frame-rgb),0.08) 50px,rgba(0,0,0,0.03) 50px,rgba(0,0,0,0.03) 70px) !important;
  filter: brightness(1.05);
}

.rpg-equip-slot--empty {
  opacity: 0.5;
}

.rpg-equip-icon { font-size: 22px; width: 30px; text-align: center; }

.rpg-equip-info { flex: 1; }

.rpg-equip-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.rpg-equip-stats {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

.rpg-equip-arrow {
  width: 18px;
  text-align: right;
  opacity: 0.6;
  font-size: 14px;
  color: rgba(var(--frame-rgb), 0.8);
}

/* rarity colors */
.rpg-rarity-common { }
.rpg-rarity-uncommon .rpg-equip-name { color: #22d3ee; }
.rpg-rarity-rare .rpg-equip-name { color: #a78bfa; }
.rpg-rarity-epic .rpg-equip-name { color: #f59e0b; }
.rpg-rarity-legendary .rpg-equip-name { color: #ef4444; }

/* ═══════════════════════════════════════════════
   CREDITS / LEVEL ROW
   ═══════════════════════════════════════════════ */

.rpg-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.15);
  font-size: 14px;
}

.rpg-info-label { color: rgba(255,255,255,0.6); }
.rpg-info-value { font-weight: bold; color: var(--fg); }
.rpg-info-value--credits { color: #22c55e; }

/* ═══════════════════════════════════════════════
   COMBAT SCREEN
   ═══════════════════════════════════════════════ */

#rpg-combat-screen {
  z-index: 1100;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rpg-combat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.rpg-combatant {
  flex: 1;
  padding: 12px;
  background: rgba(var(--frame-rgb), 0.05);
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  position: relative;
}

.rpg-combatant::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-top: 2px solid var(--frame-color);
  border-left: 2px solid var(--frame-color);
}

.rpg-combatant::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-bottom: 2px solid var(--frame-color);
  border-right: 2px solid var(--frame-color);
}

.rpg-combatant--enemy::before,
.rpg-combatant--enemy::after { border-color: #ef4444; }
.rpg-combatant--enemy {
  border-top-color: rgba(239,68,68,0.4);
  border-bottom-color: rgba(239,68,68,0.4);
}

.rpg-combatant-name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rpg-combatant--player .rpg-combatant-name { color: var(--frame-color); }
.rpg-combatant--enemy .rpg-combatant-name { color: #ef4444; }

.rpg-combat-armor {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.rpg-combat-vs {
  font-size: 18px;
  font-weight: bold;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  padding: 0 4px;
}

/* combat log */
.rpg-combat-log {
  max-height: 180px;
  overflow-y: auto;
  margin: 12px 0;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(var(--frame-rgb), 0.2);
  font-size: 13px;
  text-align: left;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.rpg-combat-log::-webkit-scrollbar { width: 12px; }
.rpg-combat-log::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.rpg-combat-log::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 6px; }
.rpg-combat-log::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.rpg-log-line { padding: 6px 10px 6px 12px; margin: 2px 0; border-radius: 4px; border-left: 3px solid transparent; }
.rpg-log-block--player { background: rgba(0,168,255,0.08); border-left-color: rgba(0,168,255,0.6); }
.rpg-log-block--enemy { background: rgba(239,68,68,0.08); border-left-color: rgba(239,68,68,0.6); }
.rpg-log-block--companion { background: rgba(167,139,250,0.08); border-left-color: rgba(167,139,250,0.6); }
.rpg-log-phrase { color: rgba(255,255,255,0.75); font-style: italic; font-size: 12px; }
.rpg-log-phrase.rpg-log-block--player { color: rgba(0,168,255,0.9); }
.rpg-log-phrase.rpg-log-block--enemy { color: rgba(239,100,100,0.95); }
.rpg-log-dots { color: rgba(255,255,255,0.5); padding: 8px 12px; }
.rpg-log-dots .rpg-dots-dot { animation: rpg-dots-pulse 0.6s ease-in-out infinite; }
.rpg-log-dots .rpg-dots-dot:nth-child(1) { animation-delay: 0s; }
.rpg-log-dots .rpg-dots-dot:nth-child(2) { animation-delay: 0.2s; }
.rpg-log-dots .rpg-dots-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes rpg-dots-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.rpg-log-hit { color: #f87171; }
.rpg-log-miss { color: rgba(255,255,255,0.35); }
.rpg-log-crit { color: #facc15; font-weight: bold; }
.rpg-log-heal { color: #4ade80; }
.rpg-log-player { color: var(--frame-color); }
.rpg-log-companion { color: #a78bfa; }
.rpg-log-flee { color: #fb923c; }

/* Lin typewriter: текст появляется постепенно 1s */
.rpg-log-typewriter { overflow: hidden; }
.rpg-log-typewriter .rpg-typewriter-inner { display: inline; }

/* Числа: эффект удара/тряски */
.rpg-log-impact { animation: rpg-impact-shake 0.4s ease-out; }
@keyframes rpg-impact-shake {
  0% { transform: scale(1.4); opacity: 0.6; }
  15% { transform: scale(1.15) translateX(-4px); }
  30% { transform: scale(1.05) translateX(4px); }
  45% { transform: scale(1.02) translateX(-2px); }
  60% { transform: scale(1.01) translateX(2px); }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}

/* Глитч при попадании по Лин — настройки через COMBAT_GLITCH_CONFIG в index.html */
.rpg-combat-glitch-overlay {
  --glitch-scanline: 0.12;
  --glitch-rgb-opacity: 0.14;
  --glitch-noise-opacity: 0.4;
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(
      rgba(0, 0, 0, 0) 50%,
      rgba(0, 0, 0, var(--glitch-scanline)) 50%
    ),
    repeating-linear-gradient(
      45deg,
      rgba(239, 68, 68, 0.04),
      rgba(239, 68, 68, 0.04) 40px,
      rgba(0, 0, 0, 0.04) 40px,
      rgba(0, 0, 0, 0.04) 60px
    );
  background-size: 100% 3px, auto;
}
/* Шум + смещение слоёв (jump как в badTV) */
.rpg-combat-glitch-overlay .rpg-glitch-noise {
  position: absolute;
  inset: 0;
  opacity: var(--glitch-noise-opacity);
  mix-blend-mode: overlay;
}
.rpg-combat-glitch-overlay::before,
.rpg-combat-glitch-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.rpg-combat-glitch-overlay::before {
  background: rgba(255, 0, 0, var(--glitch-rgb-opacity));
  animation: rpg-glitch-clip-1 0.55s linear forwards;
}
.rpg-combat-glitch-overlay::after {
  background: rgba(0, 100, 255, var(--glitch-rgb-opacity));
  animation: rpg-glitch-clip-2 0.55s linear forwards;
}
/* jump (badTV): смещение строк + RGB split в keyframes */
@keyframes rpg-glitch-clip-1 {
  0%   { clip-path: inset(0 0 100% 0); transform: translate(-3px, 0); }
  4%   { clip-path: inset(12% 0 85% 0); transform: translate(-4px, 2px); }
  8%   { clip-path: inset(48% 0 48% 0); transform: translate(-2px, -3px); }
  12%  { clip-path: inset(64% 0 32% 0); transform: translate(-5px, 1px); }
  16%  { clip-path: inset(23% 0 72% 0); transform: translate(-3px, 3px); }
  20%  { clip-path: inset(75% 0 20% 0); transform: translate(-4px, -2px); }
  24%  { clip-path: inset(35% 0 60% 0); transform: translate(-2px, 2px); }
  28%  { clip-path: inset(5% 0 90% 0); transform: translate(-5px, 0); }
  32%  { clip-path: inset(55% 0 40% 0); transform: translate(-3px, -3px); }
  36%  { clip-path: inset(82% 0 15% 0); transform: translate(-4px, 2px); }
  40%  { clip-path: inset(18% 0 78% 0); transform: translate(-2px, -1px); }
  44%  { clip-path: inset(60% 0 35% 0); transform: translate(-5px, 3px); }
  48%  { clip-path: inset(40% 0 55% 0); transform: translate(-3px, -2px); }
  52%  { clip-path: inset(8% 0 88% 0); transform: translate(-4px, 1px); }
  56%  { clip-path: inset(70% 0 25% 0); transform: translate(-2px, -3px); }
  60%  { clip-path: inset(28% 0 68% 0); transform: translate(-5px, 2px); }
  64%  { clip-path: inset(90% 0 5% 0); transform: translate(-3px, -1px); }
  68%  { clip-path: inset(45% 0 50% 0); transform: translate(-4px, 3px); }
  72%  { clip-path: inset(15% 0 82% 0); transform: translate(-2px, -2px); }
  76%  { clip-path: inset(58% 0 38% 0); transform: translate(-5px, 0); }
  80%  { clip-path: inset(30% 0 65% 0); transform: translate(-3px, 1px); }
  84%  { clip-path: inset(2% 0 95% 0); transform: translate(-4px, -3px); }
  88%  { clip-path: inset(65% 0 30% 0); transform: translate(-2px, 2px); }
  92%  { clip-path: inset(38% 0 58% 0); transform: translate(-5px, -1px); }
  96%  { clip-path: inset(52% 0 44% 0); transform: translate(-3px, 3px); }
  100% { clip-path: inset(0 0 100% 0); transform: translate(-3px, 0); }
}
@keyframes rpg-glitch-clip-2 {
  0%   { clip-path: inset(15% 0 80% 0); transform: translate(3px, 0); }
  4%   { clip-path: inset(0 0 100% 0); transform: translate(4px, -2px); }
  8%   { clip-path: inset(64% 0 32% 0); transform: translate(2px, 3px); }
  12%  { clip-path: inset(42% 0 55% 0); transform: translate(5px, -1px); }
  16%  { clip-path: inset(78% 0 18% 0); transform: translate(3px, -3px); }
  20%  { clip-path: inset(25% 0 70% 0); transform: translate(4px, 2px); }
  24%  { clip-path: inset(55% 0 40% 0); transform: translate(2px, -2px); }
  28%  { clip-path: inset(88% 0 8% 0); transform: translate(5px, 0); }
  32%  { clip-path: inset(18% 0 78% 0); transform: translate(3px, 3px); }
  36%  { clip-path: inset(62% 0 33% 0); transform: translate(4px, -2px); }
  40%  { clip-path: inset(35% 0 60% 0); transform: translate(2px, 1px); }
  44%  { clip-path: inset(5% 0 92% 0); transform: translate(5px, -3px); }
  48%  { clip-path: inset(72% 0 24% 0); transform: translate(3px, 2px); }
  52%  { clip-path: inset(42% 0 54% 0); transform: translate(4px, -1px); }
  56%  { clip-path: inset(12% 0 85% 0); transform: translate(2px, 3px); }
  60%  { clip-path: inset(68% 0 28% 0); transform: translate(5px, -2px); }
  64%  { clip-path: inset(32% 0 64% 0); transform: translate(3px, 1px); }
  68%  { clip-path: inset(95% 0 2% 0); transform: translate(4px, -3px); }
  72%  { clip-path: inset(48% 0 48% 0); transform: translate(2px, 2px); }
  76%  { clip-path: inset(22% 0 75% 0); transform: translate(5px, 0); }
  80%  { clip-path: inset(58% 0 38% 0); transform: translate(3px, -1px); }
  84%  { clip-path: inset(40% 0 56% 0); transform: translate(4px, 3px); }
  88%  { clip-path: inset(8% 0 88% 0); transform: translate(2px, -2px); }
  92%  { clip-path: inset(65% 0 30% 0); transform: translate(5px, 1px); }
  96%  { clip-path: inset(35% 0 62% 0); transform: translate(3px, -3px); }
  100% { clip-path: inset(0 0 100% 0); transform: translate(3px, 0); }
}

/* Горизонтальные полосы — пару раз смещаются (без вращения) */
.rpg-glitch-scatter-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.rpg-glitch-scatter-piece {
  position: absolute;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(239, 68, 68, 0.25);
  animation: rpg-glitch-scatter-jump 0.5s ease-in-out forwards;
}
.rpg-glitch-scatter-piece:nth-child(odd) {
  background: rgba(20, 0, 0, 0.35);
}
@keyframes rpg-glitch-scatter-jump {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(var(--scatter-jump1)); }
  50%  { transform: translateY(0); }
  75%  { transform: translateY(var(--scatter-jump2)); }
  100% { transform: translateY(0); }
}

/* === Sci-Fi Warning Triangle Glitch Effect === */
.rpg-warning-triangle-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  animation: rpg-warning-triangle-pulse 1.15s ease-in-out infinite;
}

@keyframes rpg-warning-triangle-pulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 20px rgba(255,0,0,0.8)); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.08); filter: drop-shadow(0 0 35px rgba(255,0,0,1)); }
}

/* decoy button: red when missile, contain overlay */
.rpg-combat-btn--missile-alert {
  overflow: hidden;
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.8) !important;
}
.rpg-combat-btn--missile-alert::before,
.rpg-combat-btn--missile-alert::after { border-color: rgba(239, 68, 68, 0.9) !important; }

.rpg-combat-btn-decoy-alert {
  position: absolute; top: 4px; right: 6px;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: none;
}
.rpg-combat-btn-decoy-alert .rpg-decoy-rocket-icon {
  width: 36px; height: 36px;
  filter: invert(20%) sepia(90%) saturate(5000%) hue-rotate(350deg);
  animation: rpg-decoy-rocket-blink 0.5s ease-in-out infinite;
}
.rpg-combat-btn-decoy-alert .rpg-decoy-countdown {
  font-size: 14px; font-weight: bold; color: #f87171;
  text-shadow: 0 0 8px #ef4444;
}
.rpg-decoy-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
@keyframes rpg-decoy-rocket-blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}

.rpg-log-turn-sep {
  text-align: center; font-size: 11px; color: rgba(255,255,255,0.5);
  padding: 4px 0; margin: 2px 0;
  border-top: 1px solid rgba(var(--frame-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.2);
}

/* combat actions */
.rpg-combat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.rpg-combat-btn {
  position: relative;
  padding: 14px 12px;
  background: rgba(var(--frame-rgb), 0.08);
  border: 1px solid rgba(var(--frame-rgb), 0.4);
  border-radius: 0 !important;
  color: var(--fg);
  font-family: "Noto Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.rpg-combat-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-top: 1px solid var(--frame-color);
  border-left: 1px solid var(--frame-color);
}

.rpg-combat-btn::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 6px; height: 6px;
  border-bottom: 1px solid var(--frame-color);
  border-right: 1px solid var(--frame-color);
}

.rpg-combat-btn:hover:not(:disabled) {
  background: rgba(var(--frame-rgb), 0.2);
}

.rpg-combat-btn:disabled {
  cursor: default;
}
.rpg-combat-btn:disabled .rpg-combat-btn-content {
  opacity: 0.35;
}

.rpg-combat-btn-blink {
  position: absolute; top: 4px; right: 6px;
  z-index: 2;
  font-size: 28px; pointer-events: none;
  filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 20px currentColor);
  text-shadow: 0 0 16px currentColor, 0 0 32px currentColor;
}
.rpg-combat-btn--overheat .rpg-combat-btn-blink {
  color: #fb923c;
  animation: rpg-blink-fire 0.6s ease-in-out infinite;
}
.rpg-combat-btn--reactor-depleted .rpg-combat-btn-blink {
  color: #facc15;
  animation: rpg-blink-lightning 0.6s ease-in-out infinite;
}
@keyframes rpg-blink-fire {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 10px #fb923c) drop-shadow(0 0 24px #fb923c); }
  50% { opacity: 0.9; filter: drop-shadow(0 0 16px #fb923c) drop-shadow(0 0 32px #fb923c); }
}
@keyframes rpg-blink-lightning {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 10px #facc15) drop-shadow(0 0 24px #facc15); }
  50% { opacity: 0.9; filter: drop-shadow(0 0 16px #facc15) drop-shadow(0 0 32px #facc15); }
}

.rpg-combat-btn-icon { font-size: 18px; display: block; margin-bottom: 4px; }
.rpg-combat-btn-label { font-size: 12px; }

/* low HP red pulse around screen — НЕ менять position (остаётся fixed), иначе узел проступает */
#rpg-combat-screen.rpg-combat-low-hp::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px 20px rgba(239, 68, 68, 0.35);
  animation: rpg-low-hp-pulse 2.5s ease-in-out infinite;
}
@keyframes rpg-low-hp-pulse {
  0%, 100% { opacity: 0.5; box-shadow: inset 0 0 80px 20px rgba(239, 68, 68, 0.25); }
  50% { opacity: 1; box-shadow: inset 0 0 120px 35px rgba(239, 68, 68, 0.45); }
}

/* ═══════════════════════════════════════════════
   COMBAT RESULT OVERLAY
   ═══════════════════════════════════════════════ */

.rpg-combat-result {
  text-align: center;
  padding: 24px 16px;
}

.rpg-result-title {
  font-size: 28px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.rpg-result-title--win { color: #4ade80; }
.rpg-result-title--lose { color: #ef4444; }
.rpg-result-title--fled { color: #fb923c; }

.rpg-result-title.rpg-result-title--win {
  animation: rpg-victory-title 0.5s ease-out forwards;
}
@keyframes rpg-victory-title {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.rpg-loot-list {
  text-align: left;
  margin: 12px 0;
}

.rpg-loot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(var(--frame-rgb), 0.06);
  border-top: 1px solid rgba(var(--frame-rgb), 0.3);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.3);
  font-size: 14px;
}

.rpg-loot-text { color: var(--fg); }
.rpg-loot-item--clickable:hover { background: rgba(var(--frame-rgb), 0.12); }

/* ═══════════════════════════════════════════════
   LEVEL UP OVERLAY
   ═══════════════════════════════════════════════ */

.rpg-levelup-title {
  font-size: 24px;
  color: #facc15;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.rpg-perk-card {
  position: relative;
  padding: 14px;
  margin: 8px 0;
  background: repeating-linear-gradient(45deg,rgba(var(--frame-rgb),0.04),rgba(var(--frame-rgb),0.04) 50px,rgba(0,0,0,0.02) 50px,rgba(0,0,0,0.02) 70px);
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.rpg-perk-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-top: 2px solid var(--frame-color);
  border-left: 2px solid var(--frame-color);
}

.rpg-perk-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-bottom: 2px solid var(--frame-color);
  border-right: 2px solid var(--frame-color);
}

.rpg-perk-card:hover {
  background: repeating-linear-gradient(45deg,rgba(var(--frame-rgb),0.1),rgba(var(--frame-rgb),0.1) 50px,rgba(0,0,0,0.03) 50px,rgba(0,0,0,0.03) 70px) !important;
}

.rpg-perk-card--owned {
  opacity: 0.4;
  cursor: default;
}

.rpg-perk-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rpg-perk-icon { font-size: 20px; }
.rpg-perk-name { font-size: 15px; font-weight: bold; color: var(--fg); }
.rpg-perk-desc { font-size: 12px; color: rgba(255,255,255,0.6); }

/* ═══════════════════════════════════════════════
   STAT CHECK POPUP
   ═══════════════════════════════════════════════ */

.rpg-statcheck-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  width: 90%;
  max-width: 360px;
  padding: 24px 20px;
  background: rgba(6, 5, 8, 0.95);
  border-top: 2px solid var(--frame-color);
  border-bottom: 2px solid var(--frame-color);
  text-align: center;
  animation: rpg-popup-in 0.3s ease;
}

@keyframes rpg-popup-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.rpg-statcheck-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 12px; height: 12px;
  border-top: 2px solid var(--frame-color);
  border-left: 2px solid var(--frame-color);
}

.rpg-statcheck-popup::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-bottom: 2px solid var(--frame-color);
  border-right: 2px solid var(--frame-color);
}

.rpg-statcheck-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.rpg-statcheck-roll {
  font-size: 32px;
  font-weight: bold;
  margin: 8px 0;
}

.rpg-statcheck-success { color: #4ade80; }
.rpg-statcheck-fail { color: #ef4444; }
.rpg-statcheck-crit { color: #facc15; }

.rpg-statcheck-detail {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 8px 0;
}

/* ═══════════════════════════════════════════════
   COMPANION PANEL
   ═══════════════════════════════════════════════ */

.rpg-companion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.rpg-companion-avatar {
  font-size: 36px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--frame-rgb), 0.1);
  border: 1px solid rgba(var(--frame-rgb), 0.3);
}

.rpg-companion-info { flex: 1; }

.rpg-companion-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--fg);
}

.rpg-companion-mood {
  font-size: 12px;
  color: #a78bfa;
  margin-top: 2px;
}

.rpg-companion-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.rpg-companion-skill {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(var(--frame-rgb), 0.04);
  border-top: 1px solid rgba(var(--frame-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.2);
  font-size: 12px;
}

.rpg-companion-skill-label { color: rgba(255,255,255,0.6); }
.rpg-companion-skill-value { font-weight: bold; color: var(--fg); }

/* ═══════════════════════════════════════════════
   EQUIPMENT SWAP MODAL
   ═══════════════════════════════════════════════ */

.rpg-swap-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  overflow-y: auto;
  padding: 24px 15px;
}

.rpg-swap-overlay.active { display: block; }

.rpg-swap-title {
  font-size: 16px;
  color: var(--frame-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  text-align: center;
}

.rpg-swap-current {
  padding: 12px 14px;
  background: rgba(var(--frame-rgb), 0.08);
  border: 1px solid rgba(var(--frame-rgb), 0.3);
  margin-bottom: 16px;
  text-align: left;
  font-size: 14px;
}

.rpg-swap-current-label {
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

.rpg-swap-item {
  position: relative;
  padding: 12px 14px;
  margin: 6px 0;
  background: repeating-linear-gradient(45deg,rgba(var(--frame-rgb),0.04),rgba(var(--frame-rgb),0.04) 50px,rgba(0,0,0,0.02) 50px,rgba(0,0,0,0.02) 70px);
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.rpg-swap-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 6px;
  border-top: 1px solid var(--frame-color);
  border-left: 1px solid var(--frame-color);
}

.rpg-swap-item::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 6px; height: 6px;
  border-bottom: 1px solid var(--frame-color);
  border-right: 1px solid var(--frame-color);
}

.rpg-swap-item:hover {
  background: repeating-linear-gradient(45deg,rgba(var(--frame-rgb),0.1),rgba(var(--frame-rgb),0.1) 50px,rgba(0,0,0,0.03) 50px,rgba(0,0,0,0.03) 70px) !important;
}

.rpg-swap-compare {
  font-size: 12px;
  margin-top: 4px;
}

.rpg-swap-compare-up { color: #4ade80; }
.rpg-swap-compare-down { color: #ef4444; }

/* ═══════════════════════════════════════════════
   CLOSE BUTTON (shared)
   ═══════════════════════════════════════════════ */

.rpg-close-btn {
  display: block;
  width: 100%;
  max-width: 540px;
  margin: 20px auto 0;
  padding: 14px 20px;
  background: rgba(var(--frame-rgb), 0.06);
  border: none;
  border-top: 1px solid rgba(var(--frame-rgb), 0.5);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.5);
  border-radius: 0 !important;
  font-family: "Noto Sans", sans-serif;
  font-size: 15px;
  color: rgba(185, 207, 211, 0.95);
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.rpg-close-btn:hover {
  background: rgba(var(--accent-rgb), 0.35);
}

/* ═══════════════════════════════════════════════
   CHOICE STAT-CHECK BADGE (inline in story choices)
   ═══════════════════════════════════════════════ */

.rpg-choice-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 0;
  font-family: "Noto Sans", sans-serif;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.rpg-choice-badge--pass {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.rpg-choice-badge--fail {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.rpg-choice-badge--locked {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════
   TURN INDICATOR
   ═══════════════════════════════════════════════ */

.rpg-turn-indicator {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════
   RPG SHOP SCREENS
   ═══════════════════════════════════════════════ */

.rpg-shop-screen .keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.rpg-shop-item {
  padding: 12px;
  background: repeating-linear-gradient(45deg, rgba(var(--frame-rgb), 0.04), rgba(var(--frame-rgb), 0.04) 50px, rgba(0,0,0,0.02) 50px, rgba(0,0,0,0.02) 70px);
  border-top: 1px solid rgba(var(--frame-rgb), 0.4);
  border-bottom: 1px solid rgba(var(--frame-rgb), 0.4);
  transition: background 0.2s;
}

.rpg-shop-item:hover {
  background: repeating-linear-gradient(45deg, rgba(var(--frame-rgb), 0.1), rgba(var(--frame-rgb), 0.1) 50px, rgba(0,0,0,0.03) 50px, rgba(0,0,0,0.03) 70px) !important;
}

.rpg-shop-item-stats {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.rpg-shop-owned {
  font-size: 11px;
  color: #4ade80;
  margin-top: 4px;
}

.rpg-shop-item-name {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.rpg-shop-item-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  line-height: 1.3;
}

.rpg-shop-item-stats .stat-higher { color: #4ade80; }
.rpg-shop-item-stats .stat-lower { color: #f87171; }

.rpg-shop-item-price {
  font-size: 12px;
  margin-top: 4px;
}

.rpg-shop-item-price.afford {
  color: #4ade80;
}

.rpg-shop-item-price.cant-afford {
  color: #ef4444;
}

.rpg-shop-detail-history {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin: 12px 0 24px 0;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
}

.rpg-shop-detail-stats {
  font-size: 12px;
  color: var(--frame-color);
  margin-bottom: 8px;
}

.rpg-shop-detail-price {
  font-size: 16px;
  font-weight: bold;
  color: var(--frame-color);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════
   ПРИНУДИТЕЛЬНЫЕ ШРИФТЫ ДЛЯ RPG ПАНЕЛЕЙ
   Для мобильных устройств: явное указание шрифтов с fallback
   ═══════════════════════════════════════════════ */

/* Базовые RPG экраны */
.rpg-screen,
.rpg-screen h2,
.rpg-container,
.rpg-bar-label,
.rpg-stat-name,
.rpg-stat-value,
.rpg-equip-slot,
.rpg-equip-name,
.rpg-equip-stats,
.rpg-info-label,
.rpg-info-value,
.rpg-combatant-name,
.rpg-combat-btn,
.rpg-result-title,
.rpg-loot-item,
.rpg-levelup-stat,
.rpg-levelup-btn,
.rpg-swap-label,
.rpg-shop-item,
.rpg-shop-item-name,
.rpg-shop-item-stats,
.rpg-shop-item-price,
.rpg-shop-detail-history,
.rpg-shop-detail-stats,
.rpg-shop-detail-price,
.rpg-shop-detail-btn {
  font-family: var(--font-primary) !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

/* Заголовки */
.rpg-screen h2,
.rpg-stat-value,
.rpg-result-title,
.rpg-shop-detail-price {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
}

/* Кнопки */
.rpg-combat-btn,
.rpg-levelup-btn,
.rpg-shop-detail-btn {
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
}

/* Текст */
.rpg-equip-stats,
.rpg-info-label,
.rpg-shop-item-stats,
.rpg-shop-detail-history {
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

/* HUD bar */
#rpg-hud,
.rpg-hud-hp-text,
.rpg-hud-stat-value,
.rpg-hud-companion {
  font-family: var(--font-primary) !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}
