:root {
  color-scheme: dark;
  --obsidian: #0b0d12;
  --slate: #242a35;
  --bone: #d7d0c2;
  --ether: #62d7e8;
  --indigo: #4d568d;
  --danger: #a92d3d;
  --warning: #c58a45;
  --health: #42c775;
  --panel: rgba(7, 10, 15, 0.9);
  --line: rgba(175, 198, 211, 0.38);
  --rarity-common: #aeb8bd;
  --rarity-uncommon: #65d596;
  --rarity-rare: #65b9ec;
  --rarity-epic: #ad82eb;
  --rarity-legendary: #e3ae5e;
}

@property --item-outline-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #05070a;
  color: var(--bone);
  font-family: Inter, Manrope, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(98, 215, 232, 0.1), transparent 42%),
    #05070a;
}

.game {
  position: relative;
  width: min(100%, 460px);
  height: min(100dvh, 818px);
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: var(--obsidian);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.8);
  user-select: none;
}

.scene,
.scene-vignette {
  position: absolute;
  inset: 0;
}

.scene {
  z-index: -3;
  background-image: url("assets/battle-catacombs.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #080c12;
  filter: brightness(0.72) saturate(0.82) contrast(1.08);
  transform: scale(1.015);
}

.game[data-region="ashen_mire"] .scene {
  background-image: url("assets/battle-ashen-mire.png");
  filter: brightness(0.68) saturate(0.76) contrast(1.1);
}

.battle-stage {
  position: absolute;
  z-index: 0;
  inset: 18% 0 22%;
  overflow: hidden;
  pointer-events: none;
}

.battle-ground-shadow {
  position: absolute;
  left: 5%;
  right: 3%;
  bottom: 4%;
  height: 20%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.72), transparent 70%);
  filter: blur(6px);
}

.combatant-sprite {
  position: absolute;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 92%;
  will-change: transform, filter, opacity;
}

.player-actor {
  position: absolute;
  z-index: 2;
  left: -6%;
  bottom: 0;
  width: 57%;
  aspect-ratio: 1;
  transform-origin: 50% 92%;
  will-change: transform, filter, opacity;
  animation: seekerIdle 2.8s ease-in-out infinite alternate;
}

.player-body-sprite,
.player-weapon-sprite,
.player-hand-sprite {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.player-body-sprite {
  z-index: 1;
}

.player-weapon-sprite {
  z-index: 2;
  --weapon-hand-x: 71.4%;
  --weapon-hand-y: 50.7%;
  --weapon-grip-x: 50%;
  --weapon-grip-y: 50%;
  --weapon-rotation: 0deg;
  --weapon-scale: 1;
  transform-origin: var(--weapon-grip-x) var(--weapon-grip-y);
  transform:
    translate(
      calc(var(--weapon-hand-x) - var(--weapon-grip-x)),
      calc(var(--weapon-hand-y) - var(--weapon-grip-y))
    )
    rotate(var(--weapon-rotation))
    scale(var(--weapon-scale));
  filter: drop-shadow(0 0 6px rgba(98, 215, 232, 0.2));
}

.player-hand-sprite {
  z-index: 3;
  clip-path: polygon(65% 42%, 77% 42%, 77% 57%, 65% 57%);
}

.player-weapon-sprite[data-weapon="drowned_blade"] {
  --weapon-hand-y: 51.5%;
  --weapon-grip-x: 24.5%;
  --weapon-grip-y: 19%;
  --weapon-rotation: -31deg;
  --weapon-scale: 0.5;
}

.player-weapon-sprite[data-weapon="veil_fang"] {
  --weapon-hand-y: 46.4%;
  --weapon-grip-x: 29.5%;
  --weapon-grip-y: 21.5%;
  --weapon-rotation: -31deg;
  --weapon-scale: 0.52;
}

.player-weapon-sprite[data-weapon="revenant_falchion"] {
  --weapon-grip-x: 26%;
  --weapon-grip-y: 19.5%;
  --weapon-rotation: -32deg;
  --weapon-scale: 0.49;
}

.player-weapon-sprite[data-weapon="acolyte_sickle"] {
  --weapon-grip-x: 60.5%;
  --weapon-grip-y: 43%;
  --weapon-rotation: -15deg;
  --weapon-scale: 0.74;
}

.player-weapon-sprite[data-weapon="warden_halberd"] {
  --weapon-hand-y: 46.7%;
  --weapon-grip-x: 62.5%;
  --weapon-grip-y: 65.5%;
  --weapon-rotation: 148deg;
  --weapon-scale: 0.67;
}

.player-weapon-sprite[data-weapon="broken_falchion"] {
  --weapon-hand-y: 47%;
  --weapon-grip-x: 58.5%;
  --weapon-grip-y: 44%;
  --weapon-rotation: -33deg;
  --weapon-scale: 0.8;
}

.player-weapon-sprite[hidden] {
  display: none;
}

.enemy-sprite {
  z-index: 1;
  right: -6%;
  bottom: 12%;
  width: 63%;
  max-height: 72%;
  animation: enemyIdle 3.2s ease-in-out infinite alternate;
}

.enemy-sprite[data-enemy="veil_hounds"] {
  right: -13%;
  bottom: 17%;
  width: 78%;
  max-height: 55%;
}

.enemy-sprite[data-enemy="nameless_acolyte"] {
  right: -1%;
  width: 52%;
}

.enemy-sprite[data-enemy="catacomb_warden"] {
  right: -10%;
  width: 68%;
}

.enemy-sprite[data-enemy="bog_wraith"] {
  right: 1%;
  bottom: 10%;
  width: 48%;
  max-height: 74%;
}

.enemy-sprite[data-enemy="spore_stalker"] {
  right: -10%;
  bottom: 14%;
  width: 70%;
  max-height: 58%;
}

.enemy-sprite[data-enemy="ash_matron"] {
  right: -2%;
  bottom: 7%;
  width: 59%;
  max-height: 82%;
}

.player-actor.strike {
  animation: seekerStrike 320ms ease-out;
}

.player-actor.guard {
  animation: seekerGuard 420ms ease-out;
  filter: drop-shadow(0 0 18px rgba(98, 215, 232, 0.9));
}

.player-actor.hit {
  animation: playerSpriteHit 260ms ease-out;
  filter: brightness(1.45) drop-shadow(0 0 12px rgba(213, 63, 77, 0.65));
}

.enemy-sprite.attack {
  animation: enemyAttack 360ms ease-in-out;
}

.enemy-sprite.hit {
  animation: enemyHit 280ms ease-out;
  filter: brightness(1.7) drop-shadow(0 0 14px rgba(98, 215, 232, 0.65));
}

.enemy-sprite.defeated {
  opacity: 0.24;
  filter: grayscale(0.8) brightness(0.45);
  transform: translateY(18px) rotate(4deg);
  transition: opacity 650ms ease, filter 650ms ease, transform 650ms ease;
}

.player-actor.defeated {
  opacity: 0.36;
  filter: grayscale(0.9) brightness(0.42);
  transform: translateY(22px) rotate(-4deg);
  transition: opacity 650ms ease, filter 650ms ease, transform 650ms ease;
}

.effect-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.combat-effect {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  will-change: opacity, transform;
}

.combat-effect.slash {
  right: -1%;
  top: 22%;
  width: 64%;
  animation: slashSpriteEffect 460ms ease-out forwards;
}

.combat-effect.interrupt {
  right: 2%;
  top: 20%;
  width: 58%;
  animation: interruptSpriteEffect 520ms ease-out forwards;
}

.combat-effect.ultimate {
  right: -2%;
  top: 7%;
  width: 65%;
  height: 72%;
  animation: ultimateSpriteEffect 720ms ease-out forwards;
}

.combat-effect.guard {
  left: -6%;
  bottom: -2%;
  width: 63%;
  animation: guardSpriteEffect 620ms ease-out forwards;
}

.scene-vignette {
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(5, 8, 12, 0.95) 0%, rgba(5, 8, 12, 0.46) 18%, transparent 35%),
    linear-gradient(to top, rgba(5, 8, 12, 0.98) 0%, rgba(5, 8, 12, 0.74) 24%, transparent 43%),
    radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.32) 100%);
}

.top-panel {
  position: absolute;
  z-index: 4;
  inset: 0 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(6, 9, 14, 0.96);
  box-shadow: 0 14px 26px rgba(6, 9, 14, 0.72);
}

.location-row,
.name-row,
.energy-row,
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-actions,
.profile-chip {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 8px;
}

.city-header-actions,
.panel-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.profile-chip {
  max-width: 150px;
  min-height: 38px;
  gap: 7px;
  padding: 4px 8px 4px 5px;
  border: 1px solid rgba(160, 186, 199, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.profile-chip img,
.profile-initial {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
}

.profile-chip img {
  object-fit: cover;
}

.profile-initial {
  display: grid;
  place-items: center;
  border: 1px solid rgba(98, 215, 232, 0.44);
  background: rgba(98, 215, 232, 0.12);
  color: #baf5fb;
  font-family: Georgia, serif;
  font-size: 13px;
}

.profile-copy {
  min-width: 0;
  display: grid;
  text-align: left;
}

.profile-copy strong,
.profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  max-width: 82px;
  font-size: 11px;
  font-weight: 600;
}

.profile-copy small {
  color: rgba(215, 208, 194, 0.58);
  font-size: 11px;
}

.eyebrow,
.room,
.name-row,
.energy-row {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.eyebrow {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  color: #f0e9dc;
}

.room {
  margin-top: 3px;
  color: rgba(215, 208, 194, 0.62);
  font-size: 11px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.7);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 20px;
  transition: border-color 150ms ease, transform 150ms ease;
}

.icon-button:active {
  transform: scale(0.94);
}

.audio-toggle-button {
  position: relative;
  flex: 0 0 40px;
  color: rgba(215, 208, 194, 0.48);
  font-size: 18px;
}

.audio-toggle-button::after {
  position: absolute;
  content: "";
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(215, 208, 194, 0.28);
  box-shadow: 0 0 0 transparent;
}

.audio-toggle-button[aria-pressed="true"] {
  border-color: rgba(98, 215, 232, 0.62);
  color: #bdf5f8;
  text-shadow: 0 0 10px rgba(98, 215, 232, 0.7);
}

.audio-toggle-button[aria-pressed="true"]::after {
  background: var(--ether);
  box-shadow: 0 0 8px rgba(98, 215, 232, 0.9);
}

.audio-toggle-button.audio-active span {
  display: inline-block;
  animation: audioPulse 1.4s ease-in-out infinite alternate;
}

.boss-hud {
  margin-top: 12px;
}

.name-row {
  margin-bottom: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  color: #eee8dc;
}

.bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(214, 223, 227, 0.42);
  background: rgba(0, 0, 0, 0.72);
  transform: skewX(-9deg);
}

.bar-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transition: width 180ms ease;
}

.boss-bar {
  height: 13px;
  box-shadow: 0 0 14px rgba(169, 45, 61, 0.32);
}

.boss-bar .bar-fill {
  background: linear-gradient(90deg, #7e1726, #d53f4d);
}

.telegraph-mask,
.telegraph {
  position: absolute;
  top: 18.5%;
  left: 9%;
  right: 9%;
}

.telegraph-mask {
  z-index: 4;
  top: 12.5%;
  left: 4%;
  right: 4%;
  height: 82px;
  background: linear-gradient(90deg, rgba(6, 9, 14, 0.44), rgba(6, 9, 14, 0.92), rgba(6, 9, 14, 0.44));
  filter: blur(1px);
  pointer-events: none;
}

.telegraph {
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 9px;
  border: 1px solid rgba(221, 152, 68, 0.75);
  background: linear-gradient(90deg, rgba(38, 21, 12, 0.72), rgba(12, 12, 14, 0.93), rgba(38, 21, 12, 0.72));
  box-shadow: 0 0 24px rgba(197, 138, 69, 0.28);
  color: #ffd7a0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.telegraph.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: dangerPulse 700ms ease-in-out infinite alternate;
}

.telegraph span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 3.6vw, 16px);
}

.telegraph strong {
  font-size: 22px;
  font-weight: 500;
}

.telegraph-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 205, 139, 0.16);
}

.telegraph-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--warning);
  transform-origin: left center;
}

.bottom-panel {
  position: absolute;
  z-index: 4;
  inset: auto 0 0;
  padding: 28px 14px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 8, 12, 0.99) 0%, rgba(5, 8, 12, 0.92) 74%, transparent 100%);
}

.player-row {
  align-items: flex-end;
  margin-bottom: 13px;
}

.player-bars {
  flex: 1;
}

.player-bars .name-row {
  font-size: 11px;
}

.player-bar {
  height: 11px;
}

.player-bar .bar-fill {
  background: linear-gradient(90deg, #1c924d, #61dd90);
  box-shadow: 0 0 12px rgba(66, 199, 117, 0.34);
}

.energy-row {
  margin: 6px 0 3px;
  font-size: 11px;
  color: rgba(215, 208, 194, 0.7);
}

.energy-bar {
  height: 7px;
}

.energy-bar .bar-fill {
  width: 35%;
  background: linear-gradient(90deg, #238a9d, #70e6f2);
  box-shadow: 0 0 12px rgba(98, 215, 232, 0.35);
}

.reward {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: #ffc477;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-shadow: 0 0 12px rgba(197, 138, 69, 0.45);
}

.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.skill {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(189, 208, 218, 0.44);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(101, 127, 143, 0.22), transparent 48%),
    rgba(12, 17, 24, 0.92);
  box-shadow: inset 0 0 0 3px rgba(4, 7, 11, 0.72), 0 5px 20px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 90ms ease, border-color 150ms ease, filter 150ms ease;
}

.skill:active:not(:disabled),
.skill.activated {
  transform: scale(0.91);
  border-color: var(--ether);
  filter: brightness(1.28);
}

.skill:disabled {
  cursor: not-allowed;
  filter: saturate(0.35) brightness(0.68);
}

.skill-icon {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
}

.skill-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.skill-name {
  position: absolute;
  inset: auto 4px 11%;
  color: rgba(225, 228, 225, 0.76);
  font-size: clamp(8px, 2.4vw, 10px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 4px #000, 0 0 8px #000;
  z-index: 2;
}

.cooldown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 10, 0.72);
  color: white;
  font-size: clamp(21px, 6vw, 28px);
  opacity: 0;
  z-index: 3;
}

.skill.cooling .cooldown {
  opacity: 1;
}

.ultimate {
  border-color: rgba(98, 215, 232, 0.62);
}

.ultimate.ready {
  border-color: #91eff8;
  animation: readyPulse 900ms ease-in-out infinite alternate;
}

.charge-ring {
  position: absolute;
  inset: 4px;
  border: 3px solid transparent;
  border-top-color: var(--ether);
  border-right-color: var(--ether);
  border-radius: 50%;
  z-index: 2;
  opacity: 0.8;
  pointer-events: none;
  transform: rotate(-45deg);
}

.combat-toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 27%;
  max-width: 80%;
  padding: 7px 14px;
  border: 1px solid rgba(98, 215, 232, 0.42);
  background: rgba(6, 10, 15, 0.86);
  color: #dffbff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
  white-space: nowrap;
}

.combat-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.damage-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}

.damage-number {
  position: absolute;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #f0e8d8;
  text-shadow: 0 2px 5px black, 0 0 10px rgba(255, 255, 255, 0.3);
  animation: floatDamage 750ms ease-out forwards;
}

.damage-number.player {
  left: 23%;
  top: 60%;
  color: #ff8190;
}

.damage-number.boss {
  left: 67%;
  top: 43%;
}

.damage-number.critical {
  color: #ffd08b;
  font-size: 29px;
}

.overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 8, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease, content-visibility 180ms allow-discrete;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* A closed screen is not rendered at all, so its hall background and art are
   downloaded when the screen first opens instead of all at launch. */
.overlay:not(.active) {
  content-visibility: hidden;
}

.rift-overlay {
  z-index: 19;
  padding: 0;
  background: #05080c;
  backdrop-filter: none;
}

.continent-overlay {
  z-index: 20;
  padding: 0;
  background: #030609;
  backdrop-filter: none;
}

.continent-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 9%, rgba(98, 215, 232, 0.1), transparent 30%),
    linear-gradient(to bottom, rgba(3, 6, 9, 0.28), rgba(3, 6, 9, 0.98) 70%),
    #030609;
}

.continent-header {
  margin: 0 -12px;
  padding-bottom: 15px;
}

.continent-intro {
  max-width: 410px;
  margin: 0 auto 11px;
  color: rgba(215, 208, 194, 0.68);
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.continent-map {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.38);
  background: #05080d;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.68), 0 12px 32px rgba(0, 0, 0, 0.28);
}

.continent-map::after {
  position: absolute;
  z-index: 1;
  content: "";
  inset: 0;
  background: radial-gradient(circle at 51% 43%, transparent 22%, rgba(2, 5, 9, 0.12) 58%, rgba(2, 4, 7, 0.62) 100%);
  pointer-events: none;
}

.continent-map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continent-city-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.continent-city-marker {
  position: absolute;
  left: var(--city-x, 50%);
  top: var(--city-y, 50%);
  display: grid;
  min-width: 30px;
  justify-items: center;
  gap: 2px;
  padding: 3px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.continent-city-marker span {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(98, 215, 232, 0.82);
  border-radius: 50%;
  background: radial-gradient(circle, #e9feff 0 11%, #62d7e8 13% 25%, rgba(4, 10, 16, 0.92) 29% 100%);
  box-shadow: 0 0 7px #62d7e8, 0 0 17px rgba(98, 215, 232, 0.58);
}

.continent-city-marker strong {
  max-width: 82px;
  padding: 2px 4px;
  color: #e9f9fb;
  background: rgba(2, 5, 9, 0.84);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.continent-city-marker.locked span {
  border-color: rgba(174, 180, 188, 0.64);
  background: radial-gradient(circle, #a8afb7 0 9%, #545c66 12% 24%, rgba(5, 8, 12, 0.94) 28% 100%);
  box-shadow: 0 0 8px rgba(160, 172, 184, 0.38);
  filter: grayscale(0.75);
}

.continent-city-marker.locked strong {
  color: rgba(222, 217, 207, 0.64);
}

.continent-city-marker[data-tone="ash"] span {
  border-color: rgba(229, 99, 67, 0.72);
  box-shadow: 0 0 10px rgba(220, 71, 47, 0.52);
}

.continent-city-marker[data-tone="zero"] span {
  border-color: rgba(182, 129, 235, 0.74);
  box-shadow: 0 0 11px rgba(181, 112, 230, 0.55);
}

.continent-city-marker.selected {
  transform: translate(-50%, -50%) scale(1.14);
}

.continent-city-marker.selected span {
  border-color: #f4ffff;
  box-shadow: 0 0 8px #c7faff, 0 0 23px rgba(98, 215, 232, 0.92);
}

.continent-city-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(138px, 43%);
  gap: 7px;
  margin: 9px 0;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(98, 215, 232, 0.32) transparent;
}

.continent-city-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 4px;
  min-height: 78px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(161, 190, 202, 0.28);
  background:
    radial-gradient(circle at 85% 20%, rgba(98, 215, 232, 0.14), transparent 38%),
    linear-gradient(145deg, #111a22, #060a0f 72%);
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
}

.continent-city-card[data-tone="ash"] {
  background: radial-gradient(circle at 85% 20%, rgba(207, 72, 43, 0.2), transparent 40%), linear-gradient(145deg, #1b1312, #08090b 72%);
}

.continent-city-card[data-tone="frost"] {
  background: radial-gradient(circle at 85% 20%, rgba(205, 235, 245, 0.18), transparent 40%), linear-gradient(145deg, #111b24, #06090c 72%);
}

.continent-city-card[data-tone="glass"],
.continent-city-card[data-tone="zero"] {
  background: radial-gradient(circle at 85% 20%, rgba(181, 112, 230, 0.18), transparent 40%), linear-gradient(145deg, #171322, #07080d 72%);
}

.continent-city-card.selected {
  border-color: rgba(98, 215, 232, 0.82);
  box-shadow: inset 0 0 0 1px rgba(98, 215, 232, 0.13), 0 0 16px rgba(98, 215, 232, 0.11);
}

.continent-city-card.locked {
  filter: saturate(0.58) brightness(0.72);
}

.continent-city-card small,
.continent-city-card span {
  color: rgba(215, 208, 194, 0.56);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.continent-city-card strong {
  color: #eee4d6;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.08;
  text-transform: uppercase;
}

.continent-city-card span {
  color: #9ce8f2;
}

.continent-city-brief {
  padding: 13px;
  border: 1px solid rgba(98, 215, 232, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 215, 232, 0.09), transparent 42%),
    rgba(5, 9, 14, 0.96);
}

.continent-city-heading,
.continent-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.continent-city-heading span,
.continent-city-heading small,
.continent-route span,
.continent-route strong {
  color: #9ce8f2;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.continent-city-heading small,
.continent-route span {
  color: rgba(215, 208, 194, 0.52);
}

.continent-city-brief h2 {
  margin: 7px 0 5px;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  text-transform: uppercase;
}

.continent-city-brief > p {
  min-height: 31px;
  margin: 0 0 9px;
  color: rgba(215, 208, 194, 0.68);
  font-size: 11px;
  line-height: 1.4;
}

.continent-route {
  margin-bottom: 10px;
  padding: 7px 0;
  border-block: 1px solid rgba(161, 190, 202, 0.14);
}

.continent-route strong {
  max-width: 70%;
  color: #d9f7fa;
  text-align: right;
}

.continent-city-brief .primary-button {
  margin-top: 0;
}

.rift-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 15%, rgba(98, 215, 232, 0.14), transparent 29%),
    linear-gradient(to bottom, rgba(4, 7, 11, 0.12), rgba(4, 7, 11, 0.98) 58%),
    url("assets/city-hub.png") center top / cover no-repeat;
}

.rift-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px;
  padding: max(18px, env(safe-area-inset-top)) 16px 20px;
  background: linear-gradient(to bottom, rgba(4, 7, 11, 0.98), rgba(4, 7, 11, 0.76), transparent);
}

.rift-header h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rift-intro {
  max-width: 360px;
  margin: 3px auto 12px;
  color: rgba(215, 208, 194, 0.7);
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.world-map {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 310px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.35);
  background: #05080d;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.74), 0 12px 34px rgba(0, 0, 0, 0.24);
}

.world-map::after {
  position: absolute;
  content: "";
  inset: 0;
  background: radial-gradient(circle at 50% 45%, transparent 18%, rgba(2, 5, 9, 0.14) 58%, rgba(2, 4, 7, 0.66) 100%);
  pointer-events: none;
}

.world-map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.world-gate-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.world-map-city,
.world-gate {
  position: absolute;
  left: var(--gate-x, 50%);
  top: var(--gate-y, 50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
}

.world-map-city {
  z-index: 2;
  left: 50%;
  top: 47%;
  color: rgba(238, 228, 214, 0.84);
  pointer-events: none;
}

.world-map-city span,
.world-gate span {
  width: 19px;
  height: 19px;
  border: 1px solid rgba(98, 215, 232, 0.82);
  border-radius: 50%;
  background: radial-gradient(circle, #d9fbff 0 10%, #62d7e8 12% 23%, rgba(4, 10, 16, 0.9) 27% 100%);
  box-shadow: 0 0 6px #62d7e8, 0 0 15px rgba(98, 215, 232, 0.65);
}

.world-map-city strong,
.world-gate strong {
  padding: 2px 4px;
  color: #e9f9fb;
  background: rgba(2, 5, 9, 0.82);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.world-gate {
  z-index: 3;
  min-width: 28px;
  padding: 3px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.world-gate.locked span {
  border-color: rgba(173, 177, 184, 0.62);
  background: radial-gradient(circle, #b5bac1 0 8%, #5b626d 12% 23%, rgba(5, 8, 12, 0.94) 27% 100%);
  box-shadow: 0 0 7px rgba(155, 165, 177, 0.38);
  filter: grayscale(1);
}

.world-gate.locked strong {
  color: rgba(215, 208, 194, 0.58);
}

.world-gate.selected {
  transform: translate(-50%, -50%) scale(1.12);
}

.world-gate.selected span {
  border-color: #f0ffff;
  box-shadow: 0 0 8px #bdf8ff, 0 0 21px rgba(98, 215, 232, 0.9);
}

.world-gate:focus-visible {
  outline: 1px solid #bdf8ff;
  outline-offset: 2px;
}

.region-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(128px, 42%);
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(98, 215, 232, 0.32) transparent;
}

.region-card {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(161, 190, 202, 0.3);
  background: #080d12;
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
}

.region-card::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(to bottom, rgba(3, 5, 8, 0.08) 18%, rgba(3, 5, 8, 0.96) 82%);
  pointer-events: none;
}

.region-card.selected {
  border-color: rgba(98, 215, 232, 0.78);
  box-shadow: inset 0 0 0 1px rgba(98, 215, 232, 0.15), 0 0 18px rgba(98, 215, 232, 0.12);
}

.region-card.locked {
  cursor: pointer;
  filter: grayscale(0.82) brightness(0.56);
}

.region-card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.region-card-copy {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 4px;
  padding: 28px 9px 10px;
}

.region-card-copy small {
  color: rgba(215, 208, 194, 0.56);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.region-card-copy strong {
  color: #eee4d6;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
}

.region-card-copy span {
  color: #a9eef5;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.region-brief {
  padding: 13px;
  border: 1px solid rgba(98, 215, 232, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 215, 232, 0.09), transparent 42%),
    rgba(5, 9, 14, 0.94);
}

.region-brief-heading,
.region-route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.region-brief-heading span,
.region-brief-heading small {
  color: #9ce8f2;
  font-size: 11px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.region-brief-heading small {
  color: rgba(215, 208, 194, 0.52);
}

.region-brief h2 {
  margin: 7px 0 5px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  text-transform: uppercase;
}

.region-brief > p {
  min-height: 34px;
  margin: 0 0 10px;
  color: rgba(215, 208, 194, 0.68);
  font-size: 11px;
  line-height: 1.45;
}

.region-route-meta {
  margin-bottom: 11px;
  padding: 7px 0;
  border-block: 1px solid rgba(161, 190, 202, 0.14);
  color: rgba(215, 208, 194, 0.56);
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.region-route-meta strong {
  color: #d9f7fa;
}

.region-brief .primary-button,
.region-brief .secondary-button {
  margin-top: 7px;
}

.city-overlay {
  z-index: 18;
  padding: 0;
  background: #070b10;
  backdrop-filter: none;
}

.city-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(5, 8, 12, 0.4), transparent 34%, rgba(4, 7, 10, 0.94) 78%),
    url("assets/city-hub.png") center / cover no-repeat;
}

.city-shell::after {
  position: absolute;
  content: "";
  inset: 0;
  background: radial-gradient(circle at 50% 34%, transparent 22%, rgba(2, 4, 7, 0.34) 100%);
  pointer-events: none;
}

.city-header,
.city-navigation {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
}

.city-header {
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 16px 28px;
  background: linear-gradient(to bottom, rgba(4, 7, 11, 0.94), rgba(4, 7, 11, 0.52), transparent);
}

.city-header h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.city-resources {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid rgba(98, 215, 232, 0.28);
  background: rgba(4, 8, 12, 0.72);
}

.city-resources span {
  color: #d9a8f2;
  font-family: Georgia, serif;
  font-size: 15px;
}

.city-resources small {
  color: rgba(215, 208, 194, 0.58);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.city-atmosphere {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(98, 215, 232, 0.07) 52%, transparent 70%);
  mix-blend-mode: screen;
  animation: cityVeil 6s ease-in-out infinite alternate;
}

.city-navigation {
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 46px 12px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(4, 7, 11, 0.99) 0%, rgba(4, 7, 11, 0.94) 76%, transparent 100%);
}

.city-intro {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: rgba(215, 208, 194, 0.68);
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.035em;
  text-align: left;
}

.city-primary-actions,
.city-secondary-actions {
  display: contents;
}

.city-location {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 64px;
  padding: 7px;
  border: 1px solid rgba(161, 190, 202, 0.28);
  border-radius: 2px;
  background:
    linear-gradient(145deg, rgba(15, 22, 30, 0.92), rgba(6, 10, 15, 0.96)),
    rgba(9, 14, 20, 0.92);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  transition: transform 100ms ease, border-color 140ms ease, background 140ms ease;
}

.city-location:active {
  transform: scale(0.975);
}

.city-location-primary {
  border-color: rgba(98, 215, 232, 0.58);
  background: linear-gradient(145deg, rgba(24, 57, 65, 0.9), rgba(7, 13, 18, 0.96));
}

.city-location-world {
  border-color: rgba(217, 171, 93, 0.54);
  background: linear-gradient(145deg, rgba(57, 46, 29, 0.9), rgba(8, 12, 16, 0.96));
}

.city-location-world .city-location-icon {
  filter: drop-shadow(0 0 5px rgba(217, 171, 93, 0.3));
}

.city-location-character {
  border-color: rgba(192, 129, 235, 0.42);
  background: linear-gradient(145deg, rgba(45, 31, 57, 0.9), rgba(8, 11, 17, 0.96));
}

.city-location-icon {
  width: 34px;
  height: 34px;
  align-self: center;
  background-image: url("assets/ui/city-menu-icons.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
  filter: drop-shadow(0 0 5px rgba(98, 215, 232, 0.22));
}

.city-location-icon[data-city-icon="world"] { background-position: 0 0; }
.city-location-icon[data-city-icon="gates"] { background-position: 50% 0; }
.city-location-icon[data-city-icon="hall"] { background-position: 100% 0; }
.city-location-icon[data-city-icon="forge"] { background-position: 0 50%; }
.city-location-icon[data-city-icon="storage"] { background-position: 50% 50%; }
.city-location-icon[data-city-icon="story"] { background-position: 100% 50%; }
.city-location-icon[data-city-icon="tavern"] { background-position: 0 100%; }
.city-location-icon[data-city-icon="archive"] { background-position: 50% 100%; }
.city-location-icon[data-city-icon="chronicle"] { background-position: 100% 100%; }
.city-location-icon[data-city-icon="guild"] {
  display: grid;
  place-items: center;
  border: 1px solid rgba(227, 174, 94, 0.38);
  background: radial-gradient(circle, rgba(227, 174, 94, 0.2), rgba(8, 12, 16, 0.8));
  color: #efc58d;
  font-family: Georgia, serif;
  font-size: 19px;
}

.city-location-icon[data-city-icon="guild"]::before { content: "⚜"; }

.city-location:hover {
  border-color: rgba(98, 215, 232, 0.58);
  background-color: rgba(98, 215, 232, 0.06);
}

.city-location > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.city-location strong {
  color: #e8e0d4;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.08;
  text-transform: uppercase;
}

.city-location small {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.city-secondary-actions {
  margin: 0;
}

.city-location-chronicle {
  border-color: rgba(192, 129, 235, 0.4);
  background: linear-gradient(145deg, rgba(39, 31, 54, 0.9), rgba(7, 11, 17, 0.96));
}

.city-location-story {
  border-color: rgba(98, 215, 232, 0.58);
  background: linear-gradient(145deg, rgba(31, 51, 61, 0.92), rgba(24, 17, 35, 0.94));
  box-shadow: inset 0 0 18px rgba(98, 215, 232, 0.045);
}

.city-location-story .city-location-icon {
  filter: drop-shadow(0 0 6px rgba(192, 129, 235, 0.48));
}

.city-location-guild {
  border-color: rgba(227, 174, 94, 0.38);
  background: linear-gradient(145deg, rgba(52, 37, 20, 0.88), rgba(7, 11, 17, 0.96));
}

.guild-badge {
  border-color: rgba(227, 174, 94, 0.72);
  background: #d89c50;
  color: #100b06;
}

.city-location-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(224, 186, 243, 0.64);
  border-radius: 50%;
  background: #281832;
  color: #f0d6ff;
  font-size: 11px;
  box-shadow: 0 0 12px rgba(192, 129, 235, 0.35);
}

.city-location-badge[hidden] {
  display: none !important;
}

.story-badge {
  border-color: rgba(98, 215, 232, 0.72);
  background: #102a31;
  color: #c7f6fa;
  animation: audioPulse 1.2s ease-in-out infinite alternate;
}

.city-location.locked {
  opacity: 0.5;
  cursor: default;
}

.story-overlay,
.cutscene-overlay {
  z-index: 27;
  padding: 0;
  background: #030508;
  backdrop-filter: none;
}

.story-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05080c;
}

.story-header {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: max(17px, env(safe-area-inset-top)) 14px 28px;
  background: linear-gradient(to bottom, rgba(3, 5, 8, 0.99) 25%, rgba(3, 5, 8, 0.78) 72%, transparent);
}

.story-header h1 {
  max-width: 270px;
  margin: 4px 0 0;
  color: #eee6d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.05;
  text-transform: uppercase;
}

.story-quest-strip {
  position: absolute;
  z-index: 6;
  top: 88px;
  right: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(98, 215, 232, 0.28);
  background: rgba(4, 8, 12, 0.82);
  color: rgba(215, 208, 194, 0.56);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-quest-strip strong {
  max-width: 152px;
  overflow: hidden;
  color: #b9edf3;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-progress {
  height: 3px;
  overflow: hidden;
  background: rgba(215, 208, 194, 0.12);
}

.story-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4aa6b5, #62d7e8, #c081eb);
  box-shadow: 0 0 8px rgba(98, 215, 232, 0.55);
  transition: width 300ms ease;
}

.story-dialogue-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.story-backdrop {
  --story-background: url("assets/city-hub.png");
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(3, 5, 8, 0.18), rgba(3, 5, 8, 0.36) 46%, rgba(3, 5, 8, 0.98) 82%),
    var(--story-background) center / cover no-repeat;
  filter: saturate(0.74) brightness(0.68);
  transform: scale(1.02);
}

.story-backdrop[data-location="tavern"] {
  background:
    linear-gradient(to bottom, rgba(3, 5, 8, 0.12), rgba(3, 5, 8, 0.42) 50%, rgba(3, 5, 8, 0.99) 84%),
    var(--story-background, url("assets/tavern-hall.png")) center / cover no-repeat;
}

.story-backdrop[data-location="chronicle"] {
  background:
    linear-gradient(to bottom, rgba(3, 5, 8, 0.1), rgba(3, 5, 8, 0.43) 48%, rgba(3, 5, 8, 0.99) 84%),
    var(--story-background, url("assets/chronicle-hall.png")) center / cover no-repeat;
}

.story-backdrop[data-location="map"] {
  background:
    linear-gradient(to bottom, rgba(3, 5, 8, 0.14), rgba(3, 5, 8, 0.5) 52%, rgba(3, 5, 8, 0.99) 86%),
    var(--story-background, url("assets/world-map.png")) center / cover no-repeat;
}

.story-npc-sprite {
  position: absolute;
  z-index: 2;
  top: 122px;
  left: 50%;
  width: min(98%, 425px);
  height: calc(100% - 316px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.75));
  transform: translateX(-50%);
  transition: opacity 180ms ease, filter 180ms ease;
}

.story-npc-sprite[data-speaker="seeker"] {
  left: 44%;
  width: min(82%, 350px);
}

.story-npc-sprite[hidden] {
  display: none;
}

.story-item-prop {
  position: absolute;
  z-index: 3;
  right: 4%;
  bottom: 245px;
  width: min(31vw, 138px);
  max-height: 31%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.86)) drop-shadow(0 0 12px rgba(98, 215, 232, 0.2));
  transform: rotate(3deg);
}

.story-npc-sprite[hidden] + .story-item-prop {
  right: auto;
  left: 50%;
  bottom: 232px;
  width: min(48vw, 205px);
  max-height: 42%;
  transform: translateX(-50%);
}

.story-item-prop[data-kind="map"],
.story-npc-sprite[hidden] + .story-item-prop[data-kind="map"] {
  right: auto;
  left: 50%;
  bottom: 230px;
  width: min(86vw, 390px);
  max-height: 34%;
  border: 1px solid rgba(88, 199, 216, 0.44);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.78), 0 0 22px rgba(57, 175, 196, 0.16);
  object-fit: cover;
  transform: translateX(-50%) rotate(-1deg);
}

.story-item-prop[hidden],
.cutscene-item-prop[hidden] {
  display: none;
}

.story-dialogue-panel {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  min-height: 188px;
  padding: 12px;
  border: 1px solid rgba(98, 215, 232, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(192, 129, 235, 0.12), transparent 34%),
    rgba(4, 8, 13, 0.95);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.46), inset 0 0 26px rgba(98, 215, 232, 0.035);
}

.story-npc-role {
  margin: 7px 0 2px;
  color: #8bd7e2;
  font-size: 11px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.story-dialogue-panel h2 {
  margin: 0 0 7px;
  color: #eee4d5;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  text-transform: uppercase;
}

.story-dialogue-text {
  min-height: 52px;
  margin: 0 0 10px;
  color: rgba(230, 222, 208, 0.82);
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.48;
}

.story-choices {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.story-choices[hidden] {
  display: none;
}

.story-choice {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(192, 129, 235, 0.4);
  background: rgba(192, 129, 235, 0.08);
  color: #e2c2f0;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 11px;
  text-align: left;
}

.story-choice.story-action-step {
  position: relative;
  padding-left: 36px;
  border-color: rgba(98, 215, 232, 0.42);
  background: rgba(20, 78, 88, 0.16);
  color: #c9f4f7;
}

.story-choice.story-action-step::before {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(98, 215, 232, 0.65);
  color: #8cecf4;
  content: "";
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  transform: translateY(-50%) rotate(45deg);
}

.story-choice.story-action-step.done {
  border-color: rgba(131, 219, 178, 0.34);
  background: rgba(72, 145, 111, 0.1);
  color: rgba(199, 238, 218, 0.62);
}

.story-choice.story-action-step.done::before {
  border-color: rgba(131, 219, 178, 0.72);
  content: "✓";
  line-height: 13px;
  transform: translateY(-50%);
}

.story-continue-button,
.story-objective-button {
  margin-top: 4px;
}

.cutscene-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020407;
}

.cutscene-backdrop,
.cutscene-shade,
.cutscene-portrait {
  position: absolute;
  inset: 0;
}

.cutscene-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.82) contrast(1.05);
  animation: cutsceneDrift 9s ease-in-out infinite alternate;
}

.cutscene-shade {
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(2, 4, 7, 0.82), transparent 25%, rgba(2, 4, 7, 0.2) 52%, rgba(2, 4, 7, 0.98) 84%),
    radial-gradient(circle at 50% 42%, transparent 18%, rgba(2, 4, 7, 0.38) 100%);
}

.cutscene-portrait {
  z-index: 2;
  top: 86px;
  left: 50%;
  width: min(104%, 455px);
  height: 62%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.82));
  transform: translateX(-50%);
}

.cutscene-portrait[data-speaker="seeker"] {
  width: min(86%, 370px);
}

.cutscene-item-prop {
  position: absolute;
  z-index: 3;
  right: 5%;
  bottom: 27%;
  width: min(34vw, 155px);
  max-height: 32%;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 13px rgba(98, 215, 232, 0.24));
  transform: rotate(4deg);
}

.cutscene-portrait[hidden] + .cutscene-item-prop {
  right: auto;
  left: 50%;
  bottom: 28%;
  width: min(46vw, 205px);
  transform: translateX(-50%);
}

.cutscene-header {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 14px 32px;
  background: linear-gradient(to bottom, rgba(2, 4, 7, 0.96), transparent);
}

.cutscene-header h1 {
  margin: 4px 0 0;
  color: #eee6d9;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cutscene-caption {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  min-height: 178px;
  padding: 13px;
  border: 1px solid rgba(98, 215, 232, 0.42);
  background: rgba(3, 6, 10, 0.94);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.52);
}

.cutscene-portrait[hidden] {
  display: none;
}

.cutscene-frame-counter {
  float: right;
  color: rgba(215, 208, 194, 0.45);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.cutscene-speaker {
  margin: 0 0 7px;
  color: #a9eef5;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cutscene-text {
  min-height: 67px;
  margin: 0 0 12px;
  color: rgba(236, 228, 214, 0.86);
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.52;
}

@keyframes cutsceneDrift {
  from { transform: scale(1.04) translateX(-1%); }
  to { transform: scale(1.1) translateX(1%); }
}

.character-overlay {
  z-index: 19;
  padding: 0;
  background: #05080c;
  backdrop-filter: none;
}

.character-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px max(20px, env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom, rgba(4, 7, 11, 0.1) 0%, rgba(4, 7, 11, 0.7) 31%, rgba(4, 7, 11, 0.98) 76%),
    url("assets/seeker-hall.png") center top / cover no-repeat;
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 215, 232, 0.35) transparent;
}

.character-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px;
  padding: max(17px, env(safe-area-inset-top)) 14px 30px;
  background: linear-gradient(to bottom, rgba(4, 7, 11, 0.99) 30%, rgba(4, 7, 11, 0.82) 70%, transparent);
}

.character-header h1 {
  margin: 4px 0 0;
  color: #eee6d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-status {
  position: relative;
  z-index: 2;
  margin: 40px 0;
  color: rgba(215, 208, 194, 0.62);
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.character-status[hidden],
.character-content[hidden] {
  display: none;
}

.character-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}

.character-identity {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 13px;
  min-height: 196px;
  padding: 10px;
  border: 1px solid rgba(98, 215, 232, 0.3);
  background:
    linear-gradient(125deg, rgba(98, 215, 232, 0.08), transparent 50%),
    rgba(5, 9, 13, 0.88);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.character-figure {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.22);
  background:
    radial-gradient(circle at 50% 55%, rgba(98, 215, 232, 0.15), transparent 54%),
    rgba(2, 5, 8, 0.88);
}

.character-figure::after {
  position: absolute;
  content: "";
  inset: 0;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.character-body-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.36);
}

.character-profile-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
}

.rank-badge {
  position: relative;
  width: 62px;
  height: 62px;
  margin-bottom: 1px;
}

.rank-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rank-badge strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
  color: #d7fbff;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(98, 215, 232, 0.72);
}

.character-rank-label {
  margin: 0 0 5px;
  color: #89dce7;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.character-profile-copy h2 {
  margin: 0;
  color: #eee3d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.05;
  text-transform: uppercase;
}

.character-profile-copy > p:not(.character-rank-label) {
  margin: 5px 0 7px;
  color: rgba(215, 208, 194, 0.62);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.character-xp {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: rgba(215, 208, 194, 0.1);
}

.character-xp span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #447f8b, #62d7e8, #c081eb);
  box-shadow: 0 0 10px rgba(98, 215, 232, 0.52);
}

.character-profile-copy small {
  margin-top: 5px;
  color: rgba(215, 208, 194, 0.48);
  font-size: 11px;
}

.character-equipped-weapon {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 6px 7px;
  border: 1px solid rgba(98, 215, 232, 0.25);
  background:
    linear-gradient(100deg, rgba(98, 215, 232, 0.09), transparent 74%),
    rgba(2, 7, 11, 0.76);
  box-shadow: inset 2px 0 rgba(98, 215, 232, 0.42);
}

.character-equipped-weapon[hidden] {
  display: none;
}

.character-equipped-weapon > img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid rgba(98, 215, 232, 0.26);
  background: #05080c;
}

.character-equipped-weapon > span {
  display: grid;
  min-width: 0;
}

.character-equipped-weapon > span > small {
  margin: 0 0 2px;
  color: rgba(98, 215, 232, 0.68);
  font-size: 11px;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.character-equipped-weapon > span > strong {
  overflow: hidden;
  color: #e8e0d4;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-section-heading {
  margin: 1px 1px 8px;
}

.character-section-heading h2 {
  margin: 3px 0 0;
  color: #e9dfd1;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.character-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.character-stat {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  padding: 6px 8px 6px 5px;
  border: 1px solid rgba(145, 177, 191, 0.21);
  background: rgba(5, 9, 13, 0.88);
}

.character-stat img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.character-stat-copy {
  min-width: 0;
}

.character-stat-copy strong {
  display: block;
  color: #d9d0c3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.character-stat-copy small {
  display: block;
  margin-top: 3px;
  color: rgba(215, 208, 194, 0.43);
  font-size: 11px;
  line-height: 1.2;
}

.character-stat-value {
  color: #bdeff4;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.character-stat-value small {
  display: block;
  margin-top: 2px;
  color: #b98bd2;
  font-family: sans-serif;
  font-size: 11px;
  text-align: right;
}

.archetype-card {
  padding: 13px;
  border: 1px solid rgba(192, 129, 235, 0.28);
  background:
    radial-gradient(circle at 86% 50%, rgba(192, 129, 235, 0.12), transparent 32%),
    rgba(7, 8, 12, 0.9);
}

.archetype-card h2 {
  margin: 4px 0 5px;
  color: #d9c3e6;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  text-transform: uppercase;
}

.archetype-card p:not(.eyebrow) {
  margin: 0 0 8px;
  color: rgba(215, 208, 194, 0.58);
  font-size: 11px;
  line-height: 1.4;
}

.archetype-card span {
  color: #c99ce1;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tavern-overlay {
  z-index: 19;
  padding: 0;
  background: #070706;
  backdrop-filter: none;
}

.tavern-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom, rgba(5, 6, 7, 0.12) 0%, rgba(5, 7, 9, 0.72) 30%, rgba(4, 6, 8, 0.98) 76%),
    url("assets/tavern-hall.png") center top / cover no-repeat;
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 146, 69, 0.42) transparent;
}

.tavern-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px;
  padding: max(17px, env(safe-area-inset-top)) 14px 28px;
  background: linear-gradient(to bottom, rgba(5, 7, 9, 0.99) 30%, rgba(5, 7, 9, 0.84) 70%, transparent);
}

.tavern-header h1 {
  margin: 4px 0 0;
  color: #f0e1cd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.tavern-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 6px;
  margin: 2px 0 8px;
}

.tavern-summary span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(220, 146, 69, 0.3);
  background: rgba(11, 10, 9, 0.84);
  color: rgba(221, 209, 191, 0.52);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tavern-summary strong {
  overflow: hidden;
  color: #efc58d;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tavern-note,
.tavern-status {
  position: relative;
  z-index: 2;
  color: rgba(221, 209, 191, 0.62);
  font-size: 11px;
  line-height: 1.4;
}

.tavern-note {
  margin: 0 2px 10px;
}

.tavern-status {
  margin: 40px 0;
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.tavern-status[hidden] {
  display: none;
}

.contract-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
}

.contract-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(190, 145, 91, 0.28);
  background:
    linear-gradient(110deg, rgba(220, 146, 69, 0.08), transparent 56%),
    rgba(8, 9, 10, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
}

.contract-card.contract-active,
.contract-card.contract-ready {
  border-color: rgba(98, 215, 232, 0.48);
  background:
    linear-gradient(110deg, rgba(98, 215, 232, 0.1), transparent 58%),
    rgba(7, 10, 13, 0.94);
}

.contract-card.contract-claimed {
  opacity: 0.68;
}

.contract-portrait {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid rgba(220, 146, 69, 0.24);
  background:
    radial-gradient(circle at 50% 42%, rgba(220, 146, 69, 0.15), transparent 60%),
    rgba(3, 5, 7, 0.94);
}

.contract-portrait::after {
  position: absolute;
  content: "";
  inset: 0;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.contract-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 146px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.16);
}

.contract-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.contract-patron {
  margin: 0;
  color: #d99b59;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contract-copy h2 {
  margin: 0;
  color: #eee1ce;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
}

.contract-brief {
  margin: 0;
  color: rgba(221, 209, 191, 0.62);
  font-size: 11px;
  line-height: 1.35;
}

.contract-objective {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  margin-top: 2px;
  color: rgba(221, 209, 191, 0.55);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.contract-objective strong {
  color: #bdeff4;
  font-weight: 500;
}

.contract-progress {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: rgba(221, 209, 191, 0.11);
}

.contract-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a45f2d, #e2a35f, #62d7e8);
  box-shadow: 0 0 9px rgba(220, 146, 69, 0.45);
}

.contract-action {
  min-height: 32px;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(220, 146, 69, 0.55);
  background: rgba(172, 94, 42, 0.14);
  color: #efc58d;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.contract-reward {
  margin: 0;
  color: rgba(239, 197, 141, 0.78);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contract-ready .contract-action {
  border-color: rgba(98, 215, 232, 0.58);
  background: rgba(98, 215, 232, 0.12);
  color: #bdeff4;
}

.contract-action:disabled {
  cursor: default;
  opacity: 0.5;
}

.archive-overlay {
  z-index: 19;
  padding: 0;
  background: #05080c;
  backdrop-filter: none;
}

.archive-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom, rgba(4, 7, 11, 0.16) 0%, rgba(4, 7, 11, 0.72) 28%, rgba(4, 7, 11, 0.97) 72%),
    url("assets/archive-hall.png") center top / cover no-repeat;
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 215, 232, 0.35) transparent;
}

.archive-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px;
  padding: max(17px, env(safe-area-inset-top)) 14px 28px;
  background: linear-gradient(to bottom, rgba(4, 7, 11, 0.99) 30%, rgba(4, 7, 11, 0.84) 70%, transparent);
}

.archive-header h1 {
  margin: 4px 0 0;
  color: #eee6d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 2px 0 10px;
}

.archive-summary span {
  display: grid;
  gap: 3px;
  padding: 8px 5px;
  border: 1px solid rgba(98, 215, 232, 0.23);
  background: rgba(5, 10, 15, 0.82);
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.archive-summary strong {
  color: #bdeff4;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
}

.archive-status {
  position: relative;
  z-index: 2;
  margin: 40px 0;
  color: rgba(215, 208, 194, 0.62);
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.archive-status[hidden] {
  display: none;
}

.archive-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
}

.archive-entry {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(153, 182, 196, 0.24);
  background:
    linear-gradient(110deg, rgba(98, 215, 232, 0.07), transparent 54%),
    rgba(6, 10, 15, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.archive-entry.mastered {
  border-color: rgba(192, 129, 235, 0.55);
  background:
    linear-gradient(110deg, rgba(192, 129, 235, 0.11), transparent 58%),
    rgba(6, 10, 15, 0.93);
}

.archive-portrait {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.24);
  background:
    radial-gradient(circle at 50% 42%, rgba(98, 215, 232, 0.16), transparent 58%),
    rgba(2, 5, 8, 0.92);
}

.archive-portrait::after {
  position: absolute;
  content: "";
  inset: 0;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.66);
  pointer-events: none;
}

.archive-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 128px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(1.2);
}

.archive-entry.unknown .archive-portrait img {
  filter: brightness(0) drop-shadow(0 0 8px rgba(98, 215, 232, 0.25));
  opacity: 0.48;
}

.archive-entry-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.archive-classification {
  margin: 0;
  color: #8fd9e4;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.archive-entry h2 {
  margin: 0;
  color: #ebe2d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
}

.archive-lore,
.archive-field-note {
  margin: 0;
  color: rgba(215, 208, 194, 0.62);
  font-size: 11px;
  line-height: 1.35;
}

.archive-field-note {
  padding-top: 5px;
  border-top: 1px solid rgba(215, 208, 194, 0.1);
  color: rgba(189, 239, 244, 0.66);
}

.archive-research {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  margin-top: 2px;
  color: rgba(215, 208, 194, 0.52);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-research > span:nth-child(2) {
  color: #d9a8f2;
}

.archive-progress {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: rgba(215, 208, 194, 0.1);
}

.archive-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #447f8b, #62d7e8, #c081eb);
  box-shadow: 0 0 9px rgba(98, 215, 232, 0.42);
}

.archive-claim-button {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(192, 129, 235, 0.52);
  background: rgba(192, 129, 235, 0.1);
  color: #e0baf3;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-claim-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.chronicle-overlay {
  z-index: 19;
  padding: 0;
  background: #05080c;
  backdrop-filter: none;
}

.chronicle-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 14px max(22px, env(safe-area-inset-bottom));
  background:
    linear-gradient(to bottom, rgba(4, 7, 11, 0.08) 0%, rgba(4, 7, 11, 0.74) 30%, rgba(4, 7, 11, 0.98) 72%),
    url("assets/chronicle-hall.png") center top / cover no-repeat;
  scrollbar-width: thin;
  scrollbar-color: rgba(192, 129, 235, 0.38) transparent;
}

.chronicle-header {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px;
  padding: max(17px, env(safe-area-inset-top)) 14px 28px;
  background: linear-gradient(to bottom, rgba(4, 7, 11, 0.99) 30%, rgba(4, 7, 11, 0.84) 70%, transparent);
}

.chronicle-header h1 {
  margin: 4px 0 0;
  color: #eee6d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chronicle-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 2px 0 8px;
}

.chronicle-summary span {
  display: grid;
  gap: 3px;
  padding: 8px 5px;
  border: 1px solid rgba(192, 129, 235, 0.24);
  background: rgba(7, 8, 13, 0.84);
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.chronicle-summary strong {
  color: #dfc4ed;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
}

.chronicle-world-event {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid rgba(98, 215, 232, 0.34);
  background:
    radial-gradient(circle at 90% 16%, rgba(98, 215, 232, 0.13), transparent 34%),
    rgba(5, 9, 14, 0.91);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.chronicle-world-event h2 {
  margin: 3px 0 0;
  color: #e7dfd3;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
}

.chronicle-world-event > strong {
  align-self: start;
  padding: 4px 6px;
  border: 1px solid rgba(98, 215, 232, 0.32);
  color: #a9e7ef;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chronicle-world-event > p:last-child {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: rgba(215, 208, 194, 0.6);
  font-size: 11px;
  line-height: 1.4;
}

.chronicle-status {
  position: relative;
  z-index: 2;
  margin: 40px 0;
  color: rgba(215, 208, 194, 0.62);
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.chronicle-status[hidden] {
  display: none;
}

.chronicle-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
}

.chronicle-entry {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(153, 182, 196, 0.24);
  background:
    linear-gradient(110deg, rgba(98, 215, 232, 0.06), transparent 54%),
    rgba(6, 9, 14, 0.93);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.chronicle-entry.unread {
  border-color: rgba(192, 129, 235, 0.56);
  background:
    linear-gradient(110deg, rgba(192, 129, 235, 0.13), transparent 56%),
    rgba(7, 9, 15, 0.95);
}

.chronicle-entry.locked {
  opacity: 0.68;
}

.chronicle-fragment-art {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.22);
  background:
    radial-gradient(circle at 50% 45%, rgba(98, 215, 232, 0.12), transparent 55%),
    rgba(2, 5, 8, 0.94);
}

.chronicle-fragment-art::after {
  position: absolute;
  content: "";
  inset: 0;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.chronicle-fragment-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 128px;
  object-fit: cover;
}

.chronicle-fragment-seal {
  display: grid;
  place-items: center;
  min-height: 128px;
  color: rgba(98, 215, 232, 0.32);
  font-family: Georgia, serif;
  font-size: 36px;
  text-shadow: 0 0 14px rgba(98, 215, 232, 0.26);
}

.chronicle-entry-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.chronicle-entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 7px;
  color: #8fd9e4;
  font-size: 11px;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.chronicle-entry-meta .new-record {
  color: #d9a8f2;
}

.chronicle-entry h2 {
  margin: 0;
  color: #ebe2d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: uppercase;
}

.chronicle-entry-summary,
.chronicle-entry-body {
  margin: 0;
  color: rgba(215, 208, 194, 0.62);
  font-size: 11px;
  line-height: 1.38;
}

.chronicle-entry-body {
  padding-top: 6px;
  border-top: 1px solid rgba(215, 208, 194, 0.11);
  color: rgba(226, 218, 204, 0.77);
  white-space: pre-line;
}

.chronicle-read-button {
  min-height: 30px;
  margin-top: 3px;
  padding: 6px 8px;
  border: 1px solid rgba(192, 129, 235, 0.54);
  background: rgba(192, 129, 235, 0.11);
  color: #e0baf3;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chronicle-read-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.chronicle-audio-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(98, 215, 232, 0.38);
  background: rgba(98, 215, 232, 0.07);
  color: #bdeff4;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chronicle-audio-button::before {
  content: "▶";
  font-size: 11px;
}

.chronicle-audio-button.playing {
  border-color: rgba(192, 129, 235, 0.62);
  background: rgba(192, 129, 235, 0.12);
  color: #e4bcf5;
}

.chronicle-audio-button.playing::before {
  content: "Ⅱ";
}

.chronicle-memory-mark {
  color: rgba(98, 215, 232, 0.55);
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.text-button {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: rgba(215, 208, 194, 0.58);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.forge-modal {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.forge-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  text-align: left;
}

.forge-heading > img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(98, 215, 232, 0.28));
}

.forge-heading .eyebrow,
.forge-heading h2 {
  margin: 0;
}

.forge-heading h2 {
  margin-top: 3px;
}

.modal .forge-note {
  margin-bottom: 13px;
  font-size: 11px;
}

.forge-item-list {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  text-align: left;
}

.forge-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 46%, transparent);
  background: color-mix(in srgb, var(--item-rarity) 7%, rgba(8, 12, 17, 0.92));
}

.forge-item-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 54%, transparent);
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 23px;
  text-align: center;
}

.item-art {
  display: block;
  object-fit: cover;
  object-position: center;
  background: #05080c;
  border-radius: 2px;
}

.forge-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.forge-item-copy strong {
  overflow: hidden;
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-item-copy small {
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
}

.forge-item .upgrade-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 76px;
  min-height: 34px;
  padding: 6px;
  font-size: 11px;
}

.forge-item .upgrade-button img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.modal {
  width: min(100%, 342px);
  padding: 28px 24px 24px;
  border: 1px solid rgba(160, 186, 199, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(98, 215, 232, 0.08), transparent 40%),
    rgba(9, 13, 19, 0.96);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.64), inset 0 0 0 3px rgba(255, 255, 255, 0.018);
  text-align: center;
}

.modal.compact {
  width: min(100%, 300px);
}

.reward-modal {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.modal h1,
.modal h2 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal h1 {
  font-size: clamp(28px, 8vw, 38px);
}

.modal h2 {
  font-size: 32px;
}

.modal p:not(.eyebrow) {
  margin: 0 0 22px;
  color: rgba(215, 208, 194, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.loader {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border: 2px solid rgba(98, 215, 232, 0.18);
  border-top-color: var(--ether);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.result-progress {
  margin: -10px 0 14px !important;
  color: #a9eef5 !important;
  font-family: Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.primary-button {
  border: 1px solid rgba(98, 215, 232, 0.76);
  background: linear-gradient(180deg, rgba(44, 114, 127, 0.85), rgba(22, 58, 69, 0.94));
  box-shadow: 0 0 22px rgba(98, 215, 232, 0.13);
}

.primary-button:disabled {
  border-color: rgba(161, 190, 202, 0.2);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  color: rgba(215, 208, 194, 0.46);
  cursor: default;
}

.secondary-button {
  margin-top: 10px;
  border: 1px solid rgba(215, 208, 194, 0.22);
  background: rgba(255, 255, 255, 0.035);
}

.reward-choices {
  display: grid;
  gap: 9px;
}

.reward-choice {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(98, 215, 232, 0.32);
  background:
    linear-gradient(100deg, rgba(98, 215, 232, 0.09), transparent 55%),
    rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 100ms ease, background 140ms ease;
}

.reward-choice:active:not(:disabled) {
  transform: scale(0.98);
}

.reward-choice:hover:not(:disabled),
.reward-choice:focus-visible {
  border-color: rgba(98, 215, 232, 0.72);
  background-color: rgba(98, 215, 232, 0.07);
}

.reward-choice:disabled {
  cursor: wait;
  opacity: 0.52;
}

.reward-choice strong {
  color: #f0e9dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reward-choice span {
  color: #a9eef5;
  font-size: 12px;
}

.reward-choice small {
  color: rgba(215, 208, 194, 0.58);
  font-size: 11px;
}

.drop-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: -8px 0 16px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--item-rarity, var(--ether)) 62%, transparent);
  background: color-mix(in srgb, var(--item-rarity, var(--ether)) 9%, rgba(7, 10, 15, 0.94));
  text-align: left;
}

.drop-notice[hidden] {
  display: none;
}

.drop-notice .item-glyph {
  grid-row: 1 / 4;
  align-self: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity, var(--ether)) 58%, transparent);
  color: var(--item-rarity, var(--ether));
  font-family: Georgia, serif;
  font-size: 30px;
}

.drop-notice strong,
.drop-notice span,
.drop-notice small {
  min-width: 0;
}

.drop-notice strong {
  color: var(--item-rarity, var(--bone));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

.drop-notice span {
  color: #dfe9ed;
  font-size: 12px;
}

.drop-notice small {
  color: rgba(215, 208, 194, 0.56);
  font-size: 11px;
}

.inventory-modal {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding-inline: 18px;
}

.inventory-wallet {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: -4px auto 13px;
  padding: 6px 10px;
  border: 1px solid rgba(192, 129, 235, 0.28);
  background: rgba(192, 129, 235, 0.06);
  color: #d9a8f2;
}

.inventory-wallet span {
  font-size: 18px;
}

.inventory-wallet strong {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
}

.inventory-wallet small {
  color: rgba(224, 196, 237, 0.62);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.equipment-bonuses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 12px;
}

.equipment-bonuses span {
  display: grid;
  gap: 2px;
  padding: 8px 3px;
  border: 1px solid rgba(98, 215, 232, 0.18);
  background: rgba(98, 215, 232, 0.04);
  color: rgba(215, 208, 194, 0.55);
  font-size: 11px;
  text-transform: uppercase;
}

.equipment-bonuses strong {
  color: #a9eef5;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 500;
}

.modal .inventory-note,
.modal .inventory-empty {
  margin-bottom: 12px !important;
  font-size: 11px !important;
}

.inventory-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-dismantle-toggle {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 9px 4px 5px;
  border: 1px solid rgba(215, 208, 194, 0.16);
  background:
    linear-gradient(100deg, rgba(98, 215, 232, 0.055), transparent 70%),
    rgba(255, 255, 255, 0.018);
  color: rgba(215, 208, 194, 0.64);
  cursor: pointer;
  text-align: left;
}

.quick-dismantle-toggle > img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(0.42) opacity(0.72);
}

.quick-dismantle-toggle > span {
  display: grid;
  gap: 2px;
}

.quick-dismantle-toggle strong {
  color: #dce7e8;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.quick-dismantle-toggle small {
  color: rgba(215, 208, 194, 0.45);
  font-size: 11px;
}

.quick-dismantle-toggle.active {
  border-color: rgba(98, 215, 232, 0.58);
  background:
    linear-gradient(100deg, rgba(98, 215, 232, 0.16), transparent 72%),
    rgba(98, 215, 232, 0.035);
  box-shadow: inset 3px 0 rgba(98, 215, 232, 0.65), 0 0 18px rgba(98, 215, 232, 0.07);
}

.quick-dismantle-toggle.active > img {
  filter: drop-shadow(0 0 7px rgba(98, 215, 232, 0.62));
}

.quick-dismantle-toggle.active strong {
  color: #a9eef5;
}

.quick-dismantle-toggle:disabled {
  cursor: wait;
  opacity: 0.52;
}

.inventory-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.inventory-filters::-webkit-scrollbar {
  display: none;
}

.inventory-filter {
  flex: 1 0 auto;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(215, 208, 194, 0.16);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(215, 208, 194, 0.58);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inventory-filter.active {
  border-color: rgba(98, 215, 232, 0.58);
  background: rgba(98, 215, 232, 0.09);
  color: #bdeff4;
}

.inventory-list-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  color: rgba(215, 208, 194, 0.48);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.inventory-list-options label {
  color: rgba(215, 208, 194, 0.38);
}

.inventory-list-options select {
  min-height: 30px;
  padding: 4px 22px 4px 8px;
  border: 1px solid rgba(98, 215, 232, 0.2);
  border-radius: 0;
  background: #0d141b;
  color: #bdeff4;
  font: inherit;
  text-transform: uppercase;
}

.inventory-empty[hidden] {
  display: none;
}

.inventory-list {
  display: grid;
  gap: 8px;
  text-align: left;
}

.inventory-item {
  --item-rarity: var(--rarity-common);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 55%, transparent);
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--item-rarity) 11%, transparent), transparent 48%),
    rgba(255, 255, 255, 0.018);
}

.inventory-item.equipped {
  box-shadow: inset 3px 0 0 var(--item-rarity);
}

.inventory-item.locked {
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--item-rarity) 14%, transparent), transparent 48%),
    rgba(192, 129, 235, 0.025);
}

.inventory-item.quick-ready {
  box-shadow: inset 3px 0 0 rgba(98, 215, 232, 0.72);
}

.item-rarity-common { --item-rarity: var(--rarity-common); }
.item-rarity-uncommon { --item-rarity: var(--rarity-uncommon); }
.item-rarity-rare { --item-rarity: var(--rarity-rare); }
.item-rarity-epic { --item-rarity: var(--rarity-epic); }
.item-rarity-legendary { --item-rarity: var(--rarity-legendary); }

.inventory-item .item-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 60%, transparent);
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 25px;
}

.inventory-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.inventory-item-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inventory-item-heading strong {
  flex: 1;
  min-width: 0;
}

.favorite-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(215, 208, 194, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(215, 208, 194, 0.46);
  cursor: pointer;
  font-size: 14px;
}

.favorite-button.active {
  border-color: rgba(192, 129, 235, 0.42);
  background: rgba(192, 129, 235, 0.09);
  color: #ddaef3;
}

.favorite-button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.item-power {
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 36%, transparent);
  color: var(--item-rarity) !important;
  font-family: Georgia, serif;
  font-size: 11px !important;
  letter-spacing: 0.04em;
}

.inventory-item-copy strong,
.inventory-item-copy span,
.inventory-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-copy strong {
  color: var(--item-rarity);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 500;
}

.inventory-item-copy span {
  color: #dfe9ed;
  font-size: 11px;
}

.inventory-item-copy .item-stat-line {
  overflow: visible;
  white-space: normal;
}

.inventory-item-copy small {
  color: rgba(215, 208, 194, 0.48);
  font-size: 11px;
}

.inventory-item-copy .item-affixes {
  color: color-mix(in srgb, var(--item-rarity) 72%, #d9d4c9);
  white-space: normal;
}

.inventory-item-copy .item-comparison {
  overflow: visible;
  color: rgba(215, 208, 194, 0.6);
  text-overflow: initial;
  white-space: normal;
}

.item-comparison.upgrade {
  color: #7ee0b3;
}

.item-comparison.downgrade {
  color: #d6a6a0;
}

.item-comparison.equipped {
  color: #a9eef5;
}

.equip-button {
  min-width: 70px;
  padding: 8px 7px;
  border: 1px solid rgba(98, 215, 232, 0.38);
  background: rgba(98, 215, 232, 0.07);
  color: #bdeff4;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-actions {
  display: grid;
  gap: 5px;
  width: 78px;
}

.item-actions button {
  width: 100%;
  min-height: 28px;
  padding: 6px 4px;
  font-size: 11px;
  line-height: 1.15;
}

.details-button,
.reroll-button {
  border: 1px solid rgba(98, 215, 232, 0.32);
  background: rgba(98, 215, 232, 0.055);
  color: #bdeff4;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-overlay {
  z-index: 24;
}

.item-details-modal {
  --item-rarity: var(--rarity-common);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  text-align: left;
}

/* Rarity owns the inspection frame. Keep these selectors more specific than
   the modal's common fallback so non-common items cannot be reset to gray. */
.item-details-modal.item-rarity-common { --item-rarity: var(--rarity-common); }
.item-details-modal.item-rarity-uncommon { --item-rarity: var(--rarity-uncommon); }
.item-details-modal.item-rarity-rare { --item-rarity: var(--rarity-rare); }
.item-details-modal.item-rarity-epic { --item-rarity: var(--rarity-epic); }
.item-details-modal.item-rarity-legendary { --item-rarity: var(--rarity-legendary); }

.item-details-modal::after {
  position: absolute;
  z-index: 7;
  inset: 0 18px auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--item-rarity) 18%, #fff2c8 50%, var(--item-rarity) 82%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--item-rarity) 72%, transparent);
  content: "";
  pointer-events: none;
}

.item-details-modal .eyebrow,
.item-details-modal h2 {
  color: var(--item-rarity);
  text-align: center;
}

.item-details-hero {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 46%, transparent);
  background: color-mix(in srgb, var(--item-rarity) 8%, transparent);
}

.item-details-hero .item-glyph {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 60%, transparent);
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 34px;
}

.item-details-hero-copy {
  display: grid;
  gap: 4px;
}

.item-details-hero-copy strong {
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
}

.item-details-hero-copy span {
  color: rgba(215, 208, 194, 0.62);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.item-details-section {
  margin-bottom: 13px;
}

.item-details-section h3 {
  margin: 0 0 7px;
  color: rgba(215, 208, 194, 0.48);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.item-details-list {
  display: grid;
  gap: 5px;
}

.item-details-list span {
  padding: 7px 9px;
  border: 1px solid rgba(215, 208, 194, 0.12);
  background: rgba(255, 255, 255, 0.018);
  color: #dfe9ed;
  font-size: 11px;
}

.item-details-list .affix-row {
  border-color: color-mix(in srgb, var(--item-rarity) 35%, transparent);
  color: color-mix(in srgb, var(--item-rarity) 76%, #e8e1d5);
}

.item-provenance {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
}

.item-provenance div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  font-size: 11px;
}

.item-provenance dt {
  color: rgba(215, 208, 194, 0.42);
  text-transform: uppercase;
}

.item-provenance dd {
  margin: 0;
  color: rgba(215, 208, 194, 0.76);
}

.reroll-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
}

.reroll-button:disabled {
  border-color: rgba(215, 208, 194, 0.13);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(215, 208, 194, 0.36);
  cursor: default;
}

.modal .item-details-note {
  min-height: 17px;
  margin: 7px 0 10px !important;
  color: rgba(215, 208, 194, 0.5) !important;
  font-size: 11px !important;
  text-align: center;
}

.upgrade-button,
.dismantle-button,
.danger-button {
  border: 1px solid rgba(192, 129, 235, 0.34);
  background: rgba(192, 129, 235, 0.07);
  color: #ddaef3;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upgrade-button:disabled {
  border-color: rgba(215, 208, 194, 0.13);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(215, 208, 194, 0.36);
  cursor: default;
}

.dismantle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-color: rgba(215, 208, 194, 0.16);
  background: transparent;
  color: rgba(215, 208, 194, 0.55);
}

.dismantle-button img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: grayscale(0.52) opacity(0.72);
}

.quick-dismantle-button {
  border-color: rgba(98, 215, 232, 0.45);
  background: rgba(98, 215, 232, 0.08);
  color: #a9eef5;
}

.quick-dismantle-button img {
  filter: drop-shadow(0 0 4px rgba(98, 215, 232, 0.55));
}

.danger-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-color: rgba(224, 102, 102, 0.55);
  background: rgba(125, 38, 38, 0.24);
  color: #f0b0aa;
}

.confirmation-item-name {
  display: block;
  margin: 0 0 8px;
  color: #e8d9c7;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
}

.confirmation-modal p:not(.eyebrow) {
  margin-bottom: 18px;
}

.equip-button:disabled {
  border-color: rgba(215, 208, 194, 0.16);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(215, 208, 194, 0.45);
  cursor: default;
}

.inventory-filter:focus-visible,
.inventory-list-options select:focus-visible,
.quick-dismantle-toggle:focus-visible,
.equip-button:focus-visible,
.details-button:focus-visible,
.reroll-button:focus-visible,
.upgrade-button:focus-visible,
.dismantle-button:focus-visible,
.favorite-button:focus-visible,
.danger-button:focus-visible {
  outline: 2px solid var(--ether);
  outline-offset: 2px;
}

.city-location:focus-visible,
.continent-city-marker:focus-visible,
.continent-city-card:focus-visible,
.region-card:focus-visible,
.audio-toggle-button:focus-visible,
.chronicle-audio-button:focus-visible,
.character-header .icon-button:focus-visible,
.contract-action:focus-visible,
.archive-claim-button:focus-visible,
.story-choice:focus-visible,
.story-continue-button:focus-visible,
.story-objective-button:focus-visible,
.cutscene-caption .primary-button:focus-visible,
.text-button:focus-visible {
  outline: 2px solid var(--ether);
  outline-offset: 2px;
}

/* Inventory — compact loadout and backpack */
.inventory-overlay {
  padding: 0;
  background: #04070b;
  backdrop-filter: none;
}

.inventory-modal {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #080c12;
  box-shadow: none;
  text-align: left;
}

.inventory-modal::before,
.inventory-modal::after {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
}

.inventory-modal::before {
  background: url("assets/inventory-vault.png") center 42% / cover no-repeat;
  filter: saturate(0.78) contrast(1.04);
  opacity: 0.5;
}

.inventory-modal::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 6, 10, 0.46) 0%, rgba(4, 8, 13, 0.76) 30%, rgba(5, 8, 13, 0.88) 100%),
    radial-gradient(circle at 86% 4%, rgba(98, 215, 232, 0.12), transparent 28%);
}

.inventory-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: max(10px, env(safe-area-inset-top)) 14px 9px;
  border-bottom: 1px solid rgba(98, 215, 232, 0.2);
  background: linear-gradient(180deg, rgba(4, 8, 13, 0.94), rgba(5, 10, 15, 0.78));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.inventory-header .eyebrow {
  margin-bottom: 2px;
  color: rgba(169, 238, 245, 0.66);
  font-size: 11px;
  letter-spacing: 0.15em;
}

.inventory-modal .inventory-header h2 {
  margin: 0;
  color: #eee6da;
  font-size: 27px;
  line-height: 0.96;
  letter-spacing: 0.045em;
}

.inventory-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: #d9e7e9;
  font-size: 24px;
}

.inventory-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 13px max(20px, env(safe-area-inset-bottom));
  scrollbar-color: rgba(98, 215, 232, 0.36) rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
}

.inventory-summary {
  display: grid;
  grid-template-columns: minmax(116px, 0.78fr) minmax(0, 1.4fr);
  align-items: stretch;
  gap: 7px;
  margin-bottom: 14px;
  padding: 7px;
  border: 1px solid rgba(98, 215, 232, 0.18);
  background: rgba(4, 8, 13, 0.72);
  box-shadow: inset 0 0 26px rgba(98, 215, 232, 0.025);
}

.inventory-modal .inventory-wallet {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 0 7px;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid rgba(192, 129, 235, 0.3);
  background: linear-gradient(145deg, rgba(192, 129, 235, 0.1), rgba(8, 10, 17, 0.72));
}

.inventory-modal .inventory-wallet span {
  grid-row: 1 / 3;
  color: #ddb3f4;
  font-size: 24px;
  text-shadow: 0 0 12px rgba(192, 129, 235, 0.54);
}

.inventory-modal .inventory-wallet strong {
  align-self: end;
  color: #f0d6fc;
  font-size: 17px;
  line-height: 1;
}

.inventory-modal .inventory-wallet small {
  align-self: start;
  overflow: hidden;
  color: rgba(224, 196, 237, 0.56);
  font-size: 11px;
  letter-spacing: 0.075em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inventory-modal .equipment-bonuses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.inventory-modal .equipment-bonuses span {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 2px;
  border: 1px solid rgba(98, 215, 232, 0.15);
  background: rgba(98, 215, 232, 0.035);
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
}

.inventory-modal .equipment-bonuses strong {
  color: #a9eef5;
  font-size: 13px;
  text-shadow: 0 0 9px rgba(98, 215, 232, 0.3);
}

.inventory-loadout,
.inventory-backpack {
  margin-bottom: 16px;
}

.inventory-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  padding-inline: 1px;
}

.inventory-section-heading .eyebrow {
  margin: 0 0 1px;
  color: rgba(98, 215, 232, 0.58);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.inventory-section-heading h3 {
  margin: 0;
  color: #e9e1d5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.inventory-section-heading > small,
.inventory-backpack-heading > span {
  color: rgba(215, 208, 194, 0.42);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.inventory-equipped {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.loadout-slot {
  --item-rarity: rgba(143, 160, 169, 0.7);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 53px minmax(22px, auto) auto;
  justify-items: center;
  min-width: 0;
  min-height: 112px;
  padding: 6px 5px 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 52%, transparent);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--item-rarity) 15%, transparent), transparent 48%),
    rgba(5, 9, 14, 0.82);
  color: #dfe9ed;
  cursor: pointer;
}

.loadout-slot::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 4%, var(--item-rarity) 50%, transparent 96%);
  content: "";
  opacity: 0.2;
}

.loadout-slot > * {
  position: relative;
  z-index: 1;
}

.loadout-slot.item-rarity-uncommon {
  border-color: color-mix(in srgb, var(--rarity-uncommon) 64%, transparent);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rarity-uncommon) 20%, transparent), transparent 50%),
    rgba(5, 11, 12, 0.85);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--rarity-uncommon) 7%, transparent);
}

.loadout-slot.item-rarity-uncommon::before { opacity: 0.48; }

.loadout-slot.item-rarity-rare {
  border-color: color-mix(in srgb, var(--rarity-rare) 76%, transparent);
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--rarity-rare) 26%, transparent), transparent 52%),
    linear-gradient(145deg, rgba(37, 93, 125, 0.13), rgba(5, 9, 15, 0.87));
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--rarity-rare) 11%, transparent), 0 0 9px rgba(101, 185, 236, 0.07);
}

.loadout-slot.item-rarity-rare::before { height: 2px; opacity: 0.72; }

.loadout-slot.item-rarity-epic {
  border-color: color-mix(in srgb, var(--rarity-epic) 86%, transparent);
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(173, 130, 235, 0.035) 12px 13px),
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rarity-epic) 31%, transparent), transparent 54%),
    rgba(10, 7, 16, 0.89);
  box-shadow: inset 0 0 0 1px rgba(173, 130, 235, 0.12), inset 0 0 22px rgba(173, 130, 235, 0.1), 0 0 12px rgba(173, 130, 235, 0.1);
}

.loadout-slot.item-rarity-epic::before { height: 3px; opacity: 0.88; }
.loadout-slot.item-rarity-epic::after { height: 2px; opacity: 0.86; }

.loadout-slot.item-rarity-legendary {
  border-color: color-mix(in srgb, var(--rarity-legendary) 94%, transparent);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(227, 174, 94, 0.055) 10px 11px),
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--rarity-legendary) 38%, transparent), transparent 56%),
    linear-gradient(160deg, rgba(58, 39, 15, 0.4), rgba(7, 8, 11, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 151, 0.19), inset 0 0 24px rgba(227, 174, 94, 0.13), 0 0 15px rgba(227, 174, 94, 0.14);
}

.loadout-slot.item-rarity-legendary::before {
  height: 3px;
  background: linear-gradient(90deg, transparent 2%, #8b5d22 18%, #ffe0a0 50%, #8b5d22 82%, transparent 98%);
  opacity: 1;
}

.loadout-slot.item-rarity-legendary::after { height: 2px; opacity: 1; }

.loadout-slot::after {
  position: absolute;
  inset: auto 12% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--item-rarity), transparent);
  content: "";
  opacity: 0.72;
}

.loadout-slot-label {
  width: 100%;
  color: rgba(215, 208, 194, 0.44);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.loadout-slot-art {
  align-self: center;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 58%, transparent);
  background: rgba(3, 6, 10, 0.74);
  box-shadow: 0 0 13px color-mix(in srgb, var(--item-rarity) 12%, transparent);
}

.loadout-empty-glyph {
  color: rgba(154, 176, 184, 0.35);
  font-family: Georgia, serif;
  font-size: 25px;
}

.loadout-slot strong,
.loadout-slot small {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-slot strong {
  align-self: end;
  color: var(--item-rarity);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 500;
}

.loadout-slot small {
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
}

.loadout-slot.empty {
  border-style: dashed;
  opacity: 0.62;
  cursor: default;
}

.loadout-slot:not(:disabled):active {
  transform: translateY(1px);
}

.inventory-toolbar {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.inventory-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  overflow: visible;
  padding: 0;
}

.inventory-filter {
  min-width: 0;
  min-height: 31px;
  padding: 5px 3px;
  overflow: hidden;
  border: 1px solid rgba(215, 208, 194, 0.14);
  background: rgba(5, 9, 14, 0.76);
  color: rgba(215, 208, 194, 0.5);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-filter.active {
  border-color: rgba(98, 215, 232, 0.54);
  background: linear-gradient(180deg, rgba(98, 215, 232, 0.13), rgba(98, 215, 232, 0.045));
  color: #c4f1f4;
  box-shadow: inset 0 -2px rgba(98, 215, 232, 0.48), 0 0 12px rgba(98, 215, 232, 0.055);
}

.inventory-utility-row {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 6px;
}

.inventory-sort-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 41px;
  padding: 5px 6px;
  border: 1px solid rgba(98, 215, 232, 0.16);
  background: rgba(5, 9, 14, 0.76);
}

.inventory-sort-control > span {
  color: rgba(215, 208, 194, 0.36);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inventory-sort-control select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 3px;
  border: 0;
  border-bottom: 1px solid rgba(98, 215, 232, 0.26);
  border-radius: 0;
  background: #0a1118;
  color: #bdeff4;
  font-size: 11px;
  text-transform: uppercase;
}

.quick-dismantle-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 41px;
  padding: 4px 6px 4px 4px;
  border: 1px solid rgba(215, 208, 194, 0.14);
  background: rgba(5, 9, 14, 0.76);
}

.quick-dismantle-toggle > img {
  width: 29px;
  height: 29px;
}

.quick-dismantle-toggle > span {
  min-width: 0;
}

.quick-dismantle-toggle strong,
.quick-dismantle-toggle small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-dismantle-toggle strong {
  font-size: 11px;
}

.quick-dismantle-toggle small {
  font-size: 11px;
}

.quick-dismantle-toggle > i {
  position: relative;
  width: 25px;
  height: 14px;
  border: 1px solid rgba(215, 208, 194, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.quick-dismantle-toggle > i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(215, 208, 194, 0.46);
  content: "";
  transition: left 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.quick-dismantle-toggle.active {
  border-color: rgba(98, 215, 232, 0.52);
  background: rgba(23, 65, 72, 0.34);
  box-shadow: inset 2px 0 rgba(98, 215, 232, 0.55);
}

.quick-dismantle-toggle.active > i {
  border-color: rgba(98, 215, 232, 0.62);
  background: rgba(98, 215, 232, 0.12);
}

.quick-dismantle-toggle.active > i::after {
  left: 13px;
  background: #9eebf2;
  box-shadow: 0 0 7px rgba(98, 215, 232, 0.65);
}

.inventory-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
}

.inventory-insights > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(215, 208, 194, 0.11);
  background: rgba(5, 9, 14, 0.68);
}

.inventory-insights b {
  color: rgba(215, 208, 194, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 500;
}

.inventory-insights small {
  min-width: 0;
  overflow: hidden;
  color: rgba(215, 208, 194, 0.36);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inventory-insights .upgrade.active {
  border-color: rgba(101, 213, 150, 0.3);
  background: rgba(34, 92, 63, 0.15);
}

.inventory-insights .upgrade.active b { color: #83dfae; }
.inventory-insights .locked.active b { color: #c9a2f2; }
.inventory-insights .salvage.active b { color: #e5bb78; }

.modal .inventory-empty {
  margin: 8px 0 0 !important;
  padding: 16px 12px;
  border: 1px dashed rgba(98, 215, 232, 0.2);
  background: rgba(5, 9, 14, 0.66);
  color: rgba(215, 208, 194, 0.55) !important;
  font-size: 11px !important;
  text-align: center;
}

.inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
}

.inventory-item {
  --item-rarity: var(--rarity-common);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 46%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--item-rarity) 10%, transparent), transparent 58%),
    rgba(5, 9, 14, 0.86);
  box-shadow: inset 0 -1px color-mix(in srgb, var(--item-rarity) 18%, transparent);
}

.inventory-item::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 3%, var(--item-rarity) 50%, transparent 97%);
  content: "";
  opacity: 0.12;
}

.inventory-item::after {
  position: absolute;
  z-index: 0;
  inset: 3px;
  border: 1px solid var(--item-rarity);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.inventory-item > * {
  position: relative;
  z-index: 1;
}

.inventory-item.item-rarity-common {
  border-color: rgba(174, 184, 189, 0.33);
  background: linear-gradient(145deg, rgba(174, 184, 189, 0.045), transparent 58%), rgba(5, 9, 14, 0.88);
  box-shadow: inset 0 -1px rgba(174, 184, 189, 0.12);
}

.inventory-item.item-rarity-uncommon {
  border-color: color-mix(in srgb, var(--rarity-uncommon) 58%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--rarity-uncommon) 15%, transparent), transparent 62%),
    rgba(4, 12, 12, 0.88);
  box-shadow: inset 2px 0 rgba(101, 213, 150, 0.5), inset 0 -1px rgba(101, 213, 150, 0.2);
}

.inventory-item.item-rarity-uncommon::before { opacity: 0.42; }
.inventory-item.item-rarity-uncommon::after { opacity: 0.07; }

.inventory-item.item-rarity-rare {
  border-color: color-mix(in srgb, var(--rarity-rare) 72%, transparent);
  background:
    radial-gradient(circle at 9% 12%, rgba(101, 185, 236, 0.16), transparent 36%),
    linear-gradient(145deg, rgba(45, 108, 145, 0.13), transparent 65%),
    rgba(4, 9, 15, 0.89);
  box-shadow: inset 2px 0 rgba(101, 185, 236, 0.74), inset 0 0 18px rgba(101, 185, 236, 0.06), 0 0 8px rgba(101, 185, 236, 0.06);
}

.inventory-item.item-rarity-rare::before { opacity: 0.68; }
.inventory-item.item-rarity-rare::after { opacity: 0.12; }

.inventory-item.item-rarity-epic {
  border-color: color-mix(in srgb, var(--rarity-epic) 84%, transparent);
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(173, 130, 235, 0.035) 13px 14px),
    radial-gradient(circle at 10% 10%, rgba(173, 130, 235, 0.22), transparent 39%),
    linear-gradient(145deg, rgba(77, 43, 116, 0.15), transparent 68%),
    rgba(9, 6, 15, 0.9);
  box-shadow: inset 3px 0 rgba(173, 130, 235, 0.82), inset 0 0 22px rgba(173, 130, 235, 0.09), 0 0 11px rgba(173, 130, 235, 0.1);
}

.inventory-item.item-rarity-epic::before { height: 3px; opacity: 0.9; }
.inventory-item.item-rarity-epic::after { opacity: 0.22; }

.inventory-item.item-rarity-legendary {
  border-color: color-mix(in srgb, var(--rarity-legendary) 96%, transparent);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(227, 174, 94, 0.052) 10px 11px),
    radial-gradient(circle at 11% 10%, rgba(255, 202, 111, 0.27), transparent 42%),
    linear-gradient(145deg, rgba(104, 67, 20, 0.22), transparent 67%),
    rgba(12, 9, 5, 0.92);
  box-shadow: inset 3px 0 rgba(255, 205, 120, 0.96), inset 0 0 0 1px rgba(255, 227, 174, 0.13), inset 0 0 25px rgba(227, 174, 94, 0.13), 0 0 15px rgba(227, 174, 94, 0.16);
}

.inventory-item.item-rarity-legendary::before {
  height: 3px;
  background: linear-gradient(90deg, transparent 2%, #8b5d22 15%, #ffe0a0 50%, #8b5d22 85%, transparent 98%);
  opacity: 1;
}

.inventory-item.item-rarity-legendary::after { opacity: 0.38; }

.inventory-item.locked {
  outline: 1px solid rgba(192, 129, 235, 0.36);
  outline-offset: -4px;
}

.inventory-item.quick-ready {
  outline: 1px solid rgba(98, 215, 232, 0.62);
  outline-offset: -4px;
}

.inventory-card-top {
  display: grid;
  grid-template-columns: 57px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-width: 0;
}

.inventory-card-art {
  display: block;
  width: 49px;
  height: 49px;
  object-fit: cover;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 58%, transparent);
  background: #05080c;
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 26px;
  text-align: center;
}

.inventory-item.item-rarity-common .inventory-card-art {
  filter: grayscale(0.28) saturate(0.72);
}

.inventory-item.item-rarity-uncommon .inventory-card-art {
  box-shadow: 0 0 8px rgba(101, 213, 150, 0.12);
}

.inventory-item.item-rarity-rare .inventory-card-art {
  box-shadow: 0 0 10px rgba(101, 185, 236, 0.22);
}

.inventory-item.item-rarity-epic .inventory-card-art {
  box-shadow: 0 0 12px rgba(173, 130, 235, 0.3);
}

.inventory-item.item-rarity-legendary .inventory-card-art {
  box-shadow: 0 0 14px rgba(227, 174, 94, 0.38);
}

.inventory-item-copy {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.inventory-item-heading {
  align-items: start;
  gap: 3px;
}

.inventory-item-heading strong {
  display: -webkit-box;
  min-width: 0;
  min-height: 22px;
  overflow: hidden;
  color: var(--item-rarity);
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-button {
  width: 21px;
  height: 21px;
  font-size: 12px;
}

.inventory-item-copy .item-stat-line {
  display: -webkit-box;
  min-height: 20px;
  overflow: hidden;
  color: rgba(227, 235, 236, 0.82);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inventory-item-metrics {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.inventory-item .item-power,
.inventory-item-copy .inventory-rarity-badge {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 3px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 28%, transparent);
  color: var(--item-rarity) !important;
  font-family: inherit;
  font-size: 11px !important;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-copy .inventory-rarity-badge {
  border-color: color-mix(in srgb, var(--item-rarity) 55%, transparent);
  background: color-mix(in srgb, var(--item-rarity) 9%, transparent);
  font-weight: 700;
  text-transform: uppercase;
}

.inventory-item-comparison {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 5px;
  border: 1px solid rgba(215, 208, 194, 0.1);
  background: rgba(255, 255, 255, 0.018);
  color: rgba(215, 208, 194, 0.58);
}

.inventory-item-comparison i {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: normal;
}

.inventory-item-comparison span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inventory-item-comparison.upgrade {
  border-color: rgba(86, 207, 145, 0.28);
  background: linear-gradient(90deg, rgba(49, 133, 91, 0.14), transparent);
  color: #79d9aa;
}

.inventory-item-comparison.downgrade {
  border-color: rgba(212, 125, 116, 0.24);
  background: linear-gradient(90deg, rgba(122, 53, 48, 0.11), transparent);
  color: #cf9690;
}

.inventory-item-comparison.equal {
  border-color: rgba(98, 215, 232, 0.2);
  color: rgba(169, 238, 245, 0.7);
}

.inventory-item.comparison-upgrade .equip-button {
  border-color: rgba(86, 207, 145, 0.5);
  background: linear-gradient(180deg, rgba(44, 132, 88, 0.32), rgba(21, 66, 47, 0.3));
  color: #a2e8bf;
  box-shadow: inset 0 -2px rgba(86, 207, 145, 0.24);
}

.inventory-item-meta {
  overflow: hidden;
  color: color-mix(in srgb, var(--item-rarity) 72%, rgba(215, 208, 194, 0.45));
  font-size: 11px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.item-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 4px;
  width: auto;
  min-width: 0;
}

.item-actions button {
  width: auto;
  min-width: 0;
  min-height: 29px;
  padding: 5px 3px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item .equip-button,
.inventory-item .details-button {
  min-width: 0;
}

.inventory-item .dismantle-button {
  display: inline-flex;
  width: 43px;
  padding-inline: 2px;
  gap: 2px;
}

.inventory-item .dismantle-button img {
  width: 13px;
  height: 13px;
}

.inventory-item .dismantle-button span {
  font-size: 11px;
}

.loadout-slot:focus-visible,
.inventory-close:focus-visible,
.inventory-sort-control select:focus-visible {
  outline: 2px solid var(--ether);
  outline-offset: 2px;
}

/* Forge 2.0 — risk, protection and awakening */
.forge-overlay {
  z-index: 22;
  padding: 0;
  background: #04070a;
  backdrop-filter: none;
}

.forge-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #dfe9ed;
}

.forge-shell::before,
.forge-shell::after {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
}

.forge-shell::before {
  background: url("assets/forge-sanctum.png") center 54% / cover no-repeat;
  filter: saturate(0.82) contrast(1.05);
  opacity: 0.58;
}

.forge-shell::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 6, 9, 0.48), rgba(4, 8, 12, 0.84) 24%, rgba(4, 7, 11, 0.93) 100%),
    radial-gradient(circle at 82% 18%, rgba(207, 116, 48, 0.1), transparent 28%);
}

.forge-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 70px;
  padding: max(9px, env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid rgba(98, 215, 232, 0.2);
  background: linear-gradient(180deg, rgba(4, 7, 10, 0.94), rgba(5, 9, 13, 0.76));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

.forge-heading {
  justify-content: flex-start;
  min-width: 0;
  margin: 0;
}

.forge-heading > img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(98, 215, 232, 0.38));
}

.forge-heading .eyebrow {
  color: rgba(169, 238, 245, 0.62);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.forge-heading h2 {
  margin: 2px 0 0;
  overflow: hidden;
  color: #eee5d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.forge-header .icon-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: #d9e7e9;
  font-size: 24px;
}

.forge-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 13px max(20px, env(safe-area-inset-bottom));
  scrollbar-color: rgba(98, 215, 232, 0.36) rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
}

.forge-summary,
.forge-milestones,
.forge-protection,
.forge-risk-table,
.forge-equipment {
  margin-bottom: 13px;
}

.forge-summary {
  display: grid;
  grid-template-columns: minmax(122px, 0.75fr) minmax(0, 1.25fr);
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(98, 215, 232, 0.17);
  background: rgba(4, 8, 12, 0.76);
}

.forge-summary .inventory-wallet {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 0 7px;
  width: auto;
  margin: 0;
  padding: 7px 8px;
  border-color: rgba(192, 129, 235, 0.32);
  background: rgba(32, 17, 42, 0.58);
}

.forge-summary .inventory-wallet > span {
  grid-row: 1 / 3;
  font-size: 23px;
}

.forge-summary .inventory-wallet strong {
  font-size: 17px;
}

.forge-summary .inventory-wallet small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-shell .forge-note {
  display: grid;
  align-content: center;
  margin: 0 !important;
  padding: 7px 9px;
  border-left: 2px solid rgba(224, 139, 62, 0.55);
  background: rgba(60, 32, 14, 0.24);
  color: rgba(230, 220, 203, 0.68) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.forge-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  padding-inline: 1px;
}

.forge-section-heading .eyebrow {
  margin: 0 0 1px;
  color: rgba(98, 215, 232, 0.58);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.forge-section-heading h3 {
  margin: 0;
  color: #e9e1d5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.forge-section-heading > small {
  max-width: 46%;
  color: rgba(215, 208, 194, 0.42);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-align: right;
  text-transform: uppercase;
}

.forge-milestone-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.forge-milestone {
  display: grid;
  grid-template-rows: 43px auto auto;
  justify-items: center;
  min-width: 0;
  padding: 4px 3px 6px;
  border: 1px solid rgba(215, 208, 194, 0.13);
  background: rgba(5, 8, 12, 0.78);
  text-align: center;
}

.forge-milestone i,
.forge-aura,
.item-enhancement-aura,
.forge-result-aura,
.player-weapon-aura {
  background-image: url("assets/ui/forge-enhancement-auras.png");
  background-position: var(--aura-position, 0 0);
  background-repeat: no-repeat;
  background-size: 200% 200%;
}

.aura-tier-1,
.forge-milestone.tier-1 { --aura-position: 0% 0%; --aura-color: #79e9f2; }
.aura-tier-2,
.forge-milestone.tier-2 { --aura-position: 100% 0%; --aura-color: #9d8cff; }
.aura-tier-3,
.forge-milestone.tier-3 { --aura-position: 0% 100%; --aura-color: #82cfff; }
.aura-tier-4,
.forge-milestone.tier-4 { --aura-position: 100% 100%; --aura-color: #ffd992; }

.forge-milestone i {
  display: block;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--aura-color) 42%, transparent));
  animation: forgeAuraPulse 2.6s ease-in-out infinite alternate;
}

.forge-milestone strong {
  color: var(--aura-color);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 500;
}

.forge-milestone small {
  width: 100%;
  overflow: hidden;
  color: rgba(215, 208, 194, 0.44);
  font-size: 11px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.forge-protection-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.forge-protection-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 48px;
  padding: 5px;
  border: 1px solid rgba(215, 208, 194, 0.14);
  background: rgba(5, 9, 13, 0.8);
  color: rgba(215, 208, 194, 0.6);
  cursor: pointer;
  text-align: left;
}

.forge-protection-option.active {
  border-color: rgba(98, 215, 232, 0.58);
  background: linear-gradient(145deg, rgba(98, 215, 232, 0.13), rgba(5, 9, 13, 0.84));
  box-shadow: inset 0 -2px rgba(98, 215, 232, 0.44);
}

.forge-protection-option[data-forge-protection="perfect"].active {
  border-color: rgba(227, 174, 94, 0.68);
  background: linear-gradient(145deg, rgba(227, 174, 94, 0.14), rgba(9, 8, 6, 0.86));
  box-shadow: inset 0 -2px rgba(227, 174, 94, 0.52);
}

.forge-protection-option:disabled {
  cursor: default;
  filter: grayscale(0.55);
  opacity: 0.42;
}

.forge-protection-option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.forge-protection-option strong,
.forge-protection-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-protection-option strong {
  color: #dce7e8;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.forge-protection-option small {
  color: rgba(215, 208, 194, 0.43);
  font-size: 11px;
}

.protection-glyph {
  position: relative;
  display: block;
  width: 22px;
  height: 28px;
  border: 1px solid rgba(161, 190, 202, 0.32);
  border-radius: 8px 2px 8px 2px;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(98, 215, 232, 0.25) 43% 48%, transparent 49%),
    rgba(8, 15, 19, 0.9);
  box-shadow: inset 0 0 8px rgba(98, 215, 232, 0.08);
}

.protection-glyph::after {
  position: absolute;
  inset: 7px 5px;
  border: 1px solid rgba(98, 215, 232, 0.45);
  border-radius: 50% 50% 45% 45%;
  content: "";
}

.protection-glyph.none {
  border-style: dashed;
  opacity: 0.45;
}

.protection-glyph.none::after {
  border: 0;
  background: linear-gradient(135deg, transparent 43%, rgba(215, 208, 194, 0.62) 45% 55%, transparent 57%);
}

.protection-glyph.perfect {
  border-color: rgba(227, 174, 94, 0.62);
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(227, 174, 94, 0.35) 43% 48%, transparent 49%),
    rgba(20, 14, 7, 0.92);
  box-shadow: inset 0 0 9px rgba(227, 174, 94, 0.16), 0 0 7px rgba(227, 174, 94, 0.08);
}

.protection-glyph.perfect::after {
  border-color: rgba(255, 217, 143, 0.68);
}

.protection-scroll-art {
  display: block;
  width: 36px;
  height: 36px;
  background-image: url("assets/ui/forge-protection-scrolls.png");
  background-position: 0 50%;
  background-repeat: no-repeat;
  background-size: 200% 100%;
  filter: drop-shadow(0 0 5px rgba(98, 215, 232, 0.34));
  transition: filter 160ms ease, transform 160ms ease;
}

.protection-scroll-art.perfect {
  background-position: 100% 50%;
  filter: drop-shadow(0 0 5px rgba(227, 174, 94, 0.4));
}

.forge-protection-option.active .protection-scroll-art {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(98, 215, 232, 0.72));
  transform: scale(1.08);
}

.forge-protection-option.active .protection-scroll-art.perfect {
  filter: brightness(1.15) drop-shadow(0 0 9px rgba(227, 174, 94, 0.76));
}

.forge-shell .forge-protection-description {
  margin: 6px 0 0 !important;
  min-height: 24px;
  padding: 6px 8px;
  border-left: 2px solid rgba(98, 215, 232, 0.4);
  background: rgba(5, 9, 13, 0.58);
  color: rgba(215, 208, 194, 0.58) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.forge-protection-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}

.forge-protection-sources > span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0 5px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(98, 215, 232, 0.16);
  background: rgba(4, 8, 12, 0.5);
}

.forge-protection-sources > span:last-child {
  border-color: rgba(227, 174, 94, 0.2);
}

.forge-protection-sources .protection-scroll-art {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
}

.forge-protection-sources b {
  color: #bdeff4;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.forge-protection-sources > span:last-child b {
  color: #efc58d;
}

.forge-protection-sources small {
  color: rgba(215, 208, 194, 0.43);
  font-size: 11px;
  line-height: 1.25;
}

.forge-risk-table {
  padding: 8px;
  border: 1px solid rgba(224, 139, 62, 0.2);
  background: rgba(7, 8, 10, 0.76);
}

.forge-risk-scale {
  display: grid;
  gap: 2px;
}

.forge-risk-scale-row {
  display: grid;
  grid-template-columns: 0.7fr repeat(3, 1fr);
  align-items: center;
  min-height: 25px;
  border-left: 2px solid rgba(224, 139, 62, 0.34);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(224, 213, 197, 0.62);
  font-size: 11px;
  text-align: center;
}

.forge-risk-scale-row > * {
  padding: 4px 3px;
  border-right: 1px solid rgba(255, 255, 255, 0.045);
}

.forge-risk-scale-row.header {
  min-height: 21px;
  border-left-color: transparent;
  background: rgba(98, 215, 232, 0.055);
  color: rgba(172, 224, 230, 0.48);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.forge-risk-scale-row strong {
  color: #eee3d4;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
}

.forge-risk-scale-row span:nth-child(2) { color: #8be5cf; }
.forge-risk-scale-row span:nth-child(3) { color: #e4b16f; }
.forge-risk-scale-row span:nth-child(4) { color: #ec7f7f; }
.forge-risk-scale-row.safe { border-left-color: rgba(104, 220, 196, 0.48); }
.forge-risk-scale-row.danger {
  border-left-color: rgba(234, 98, 98, 0.74);
  background: linear-gradient(90deg, rgba(143, 37, 37, 0.14), rgba(255, 255, 255, 0.022));
}

.forge-risk-table-note {
  margin: 6px 0 0 !important;
  color: rgba(215, 208, 194, 0.46) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.forge-item-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.forge-item {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas:
    "visual copy"
    "risk risk"
    "upgrade upgrade";
  align-items: center;
  gap: 7px 9px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 56%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--item-rarity) 12%, transparent), transparent 60%),
    rgba(5, 8, 12, 0.88);
  box-shadow: inset 2px 0 color-mix(in srgb, var(--item-rarity) 58%, transparent);
}

.forge-item-visual {
  position: relative;
  grid-area: visual;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: visible;
}

.forge-item.forge-tier-1 { --forge-awaken-color: #79e9f2; }
.forge-item.forge-tier-2 { --forge-awaken-color: #9d8cff; }
.forge-item.forge-tier-3 { --forge-awaken-color: #82cfff; }
.forge-item.forge-tier-4 { --forge-awaken-color: #ffd992; }

.forge-item-glyph {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 50px;
  border-color: color-mix(in srgb, var(--item-rarity) 68%, transparent);
  font-size: 28px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--item-rarity) 15%, transparent);
}

.forge-aura {
  position: absolute;
  z-index: 3;
  inset: -9px;
  opacity: 0.95;
  filter: brightness(1.35) saturate(1.35) drop-shadow(0 0 8px var(--aura-color));
  mix-blend-mode: screen;
  pointer-events: none;
  animation: forgeAuraSpin 5.5s linear infinite, forgeAuraPulse 1.25s ease-in-out infinite alternate;
}

.forge-aura::after {
  position: absolute;
  inset: 8px;
  background: inherit;
  content: "";
  opacity: 0.72;
  animation: forgeAuraCounterSpin 3.8s linear infinite;
}

/* One enhancement-outline component follows equipment across every UI view. */
.inventory-card-visual,
.loadout-slot-visual,
.forge-item-visual,
.forge-result-item-visual,
.item-details-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: visible;
}

.inventory-card-visual {
  width: 57px;
  height: 57px;
  --item-outline-inset: 2px;
  --item-outline-corner: 10px;
}

.loadout-slot-visual {
  align-self: center;
  width: 51px;
  height: 51px;
  --item-outline-inset: 2px;
  --item-outline-corner: 9px;
}

.forge-item-visual {
  --item-outline-inset: 7px;
  --item-outline-corner: 10px;
}

.forge-result-item-visual {
  width: 118px;
  height: 118px;
  --item-outline-inset: 4px;
  --item-outline-corner: 18px;
}

.item-details-visual {
  width: 106px;
  height: 106px;
  --item-outline-inset: -4px;
  --item-outline-corner: 15px;
}

.inventory-card-visual > .item-art,
.loadout-slot-visual > .item-art,
.item-details-visual > .item-art,
.forge-result-item-visual > .item-art,
.forge-item-visual > .item-art {
  position: relative;
  z-index: 2;
}

.item-enhancement-aura {
  display: none;
}

.inventory-card-visual:not(.upgrade-tier-0)::before,
.loadout-slot-visual:not(.upgrade-tier-0)::before,
.forge-item-visual:not(.upgrade-tier-0)::before,
.forge-result-item-visual:not(.upgrade-tier-0)::before,
.item-details-visual:not(.upgrade-tier-0)::before {
  position: absolute;
  z-index: 3;
  inset: var(--item-outline-inset, -2px);
  padding: var(--item-outline-width, 1px);
  border: 0;
  border-radius: 3px;
  background: conic-gradient(
    from var(--item-outline-angle),
    transparent 0deg 30deg,
    color-mix(in srgb, var(--enhanced-card-color) 68%, transparent) 47deg,
    var(--item-outline-highlight, #effdff) 63deg,
    var(--enhanced-card-color) 81deg,
    transparent 105deg 192deg,
    color-mix(in srgb, var(--enhanced-card-color) 52%, transparent) 216deg,
    var(--enhanced-card-color) 240deg,
    transparent 267deg 360deg
  );
  box-shadow:
    var(--item-outline-shadow, 0 0 5px color-mix(in srgb, var(--enhanced-card-color) 48%, transparent));
  content: "";
  opacity: var(--item-outline-opacity-high, 0.72);
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation:
    itemOutlineTravel var(--item-outline-speed, 4.6s) linear infinite,
    itemOutlineGlow var(--item-outline-pulse, 1.8s) ease-in-out infinite alternate;
}

.inventory-card-visual:not(.upgrade-tier-0)::after,
.loadout-slot-visual:not(.upgrade-tier-0)::after,
.forge-item-visual:not(.upgrade-tier-0)::after,
.forge-result-item-visual:not(.upgrade-tier-0)::after,
.item-details-visual:not(.upgrade-tier-0)::after {
  position: absolute;
  z-index: 4;
  inset: var(--item-outline-inset, -2px);
  background:
    linear-gradient(90deg, var(--enhanced-card-color), transparent) left top / var(--item-outline-corner) 1px no-repeat,
    linear-gradient(180deg, var(--enhanced-card-color), transparent) left top / 1px var(--item-outline-corner) no-repeat,
    linear-gradient(270deg, var(--enhanced-card-color), transparent) right top / var(--item-outline-corner) 1px no-repeat,
    linear-gradient(180deg, var(--enhanced-card-color), transparent) right top / 1px var(--item-outline-corner) no-repeat,
    linear-gradient(90deg, var(--enhanced-card-color), transparent) left bottom / var(--item-outline-corner) 1px no-repeat,
    linear-gradient(0deg, var(--enhanced-card-color), transparent) left bottom / 1px var(--item-outline-corner) no-repeat,
    linear-gradient(270deg, var(--enhanced-card-color), transparent) right bottom / var(--item-outline-corner) 1px no-repeat,
    linear-gradient(0deg, var(--enhanced-card-color), transparent) right bottom / 1px var(--item-outline-corner) no-repeat;
  content: "";
  filter: drop-shadow(0 0 var(--item-corner-glow, 3px) var(--enhanced-card-color));
  opacity: var(--item-corner-opacity-high, 0.58);
  pointer-events: none;
  animation: itemOutlineCorners var(--item-outline-pulse, 1.8s) ease-in-out infinite alternate;
}

.inventory-card-visual:not(.upgrade-tier-0) > .item-art,
.loadout-slot-visual:not(.upgrade-tier-0) > .item-art,
.forge-item-visual:not(.upgrade-tier-0) > .item-art,
.forge-result-item-visual:not(.upgrade-tier-0) > .item-art,
.item-details-visual:not(.upgrade-tier-0) > .item-art {
  border-color: color-mix(in srgb, var(--enhanced-card-color) 78%, var(--item-rarity));
  box-shadow: var(--item-art-shadow-low);
  transform-origin: center;
  will-change: filter, transform, box-shadow;
  animation: enhancedItemArtPulse var(--item-outline-pulse, 1.8s) ease-in-out infinite alternate;
}

.item-enhancement-level {
  position: absolute;
  z-index: 6;
  right: -4px;
  bottom: -3px;
  min-width: 24px;
  padding: 2px 4px;
  border: 1px solid var(--enhanced-card-color, var(--item-rarity));
  background: rgba(3, 6, 10, 0.94);
  color: var(--enhanced-card-color, var(--item-rarity));
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 0 7px color-mix(in srgb, var(--enhanced-card-color, var(--item-rarity)) 42%, transparent);
}

.forge-item-visual .item-enhancement-level {
  right: 0;
  bottom: 0;
  min-width: 25px;
  padding: 3px 4px;
  font-size: 11px;
}

.item-details-visual .item-enhancement-level {
  right: 1px;
  bottom: 1px;
  min-width: 34px;
  padding: 4px 6px;
  font-size: 11px;
}

.forge-level-badge {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  min-width: 25px;
  padding: 3px 4px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 58%, transparent);
  background: rgba(4, 7, 10, 0.9);
  color: var(--item-rarity);
  font-family: Georgia, serif;
  font-size: 11px;
  text-align: center;
}

.forge-item-copy {
  grid-area: copy;
  gap: 4px;
}

.forge-item-copy strong {
  color: var(--item-rarity);
  font-size: 13px;
  white-space: normal;
}

.forge-item-copy small {
  color: rgba(215, 208, 194, 0.54);
  font-size: 11px;
  line-height: 1.25;
}

.forge-level-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(98, 215, 232, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.forge-level-progress::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 27%, rgba(255,255,255,.2) 28% 29%, transparent 30% 46%, rgba(255,255,255,.2) 47% 48%, transparent 49% 70%, rgba(255,255,255,.2) 71% 72%, transparent 73% 99%, rgba(255,255,255,.24) 100%);
  content: "";
}

.forge-level-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #287e8d, #78e2eb, var(--item-rarity));
  box-shadow: 0 0 7px color-mix(in srgb, var(--item-rarity) 42%, transparent);
}

.forge-next-milestone {
  color: color-mix(in srgb, var(--item-rarity) 68%, rgba(215, 208, 194, 0.45)) !important;
  text-transform: uppercase;
}

.forge-risk {
  grid-area: risk;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(215, 208, 194, 0.11);
  background: rgba(2, 5, 8, 0.53);
}

.forge-risk-title,
.forge-risk-note {
  color: rgba(215, 208, 194, 0.48);
  font-size: 11px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.forge-risk-note {
  color: rgba(215, 208, 194, 0.4);
  letter-spacing: 0.025em;
  text-align: center;
  text-transform: none;
}

.forge-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.forge-chance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.018);
}

.forge-chance small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.forge-chance strong {
  flex: 0 0 auto;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
}

.forge-chance.success { color: #77ddb0; }
.forge-chance.downgrade { color: #d5a267; }
.forge-chance.break { color: #d87373; }
.forge-chance.protected { color: #9fdfe8; }

.forge-item .forge-upgrade-button {
  grid-area: upgrade;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 5px 9px;
  border-color: rgba(98, 215, 232, 0.42);
  background: linear-gradient(100deg, rgba(98, 215, 232, 0.13), rgba(192, 129, 235, 0.07));
  color: #c1f0f3;
  text-align: left;
}

.forge-item .forge-upgrade-button > img {
  width: 29px;
  height: 29px;
}

.forge-upgrade-button > span {
  display: grid;
  gap: 2px;
}

.forge-upgrade-button strong {
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.forge-upgrade-button small {
  color: rgba(221, 174, 243, 0.74);
  font-size: 11px;
}

.forge-inventory-button {
  min-height: 42px;
}

.forge-result-fx {
  --forge-result-color: var(--aura-color, #79e9f2);
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 5, 8, 0.86), rgba(3, 6, 9, 0.94)),
    repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in srgb, var(--forge-result-color) 5%, transparent) 18px 19px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  visibility: hidden;
}

.forge-result-fx::before,
.forge-result-fx::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.forge-result-fx::before {
  inset: 12% -30%;
  background: linear-gradient(90deg, transparent 18%, color-mix(in srgb, var(--forge-result-color) 34%, transparent) 49%, transparent 82%);
  filter: blur(18px);
  transform: rotate(-9deg);
  animation: forgeResultSweep var(--forge-result-duration, 2200ms) ease-in-out both;
}

.forge-result-fx::after {
  inset: 14px;
  border: 1px solid color-mix(in srgb, var(--forge-result-color) 42%, transparent);
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--forge-result-color) 9%, transparent);
  opacity: 0.7;
}

.forge-result-fx.active {
  opacity: 1;
  visibility: visible;
  animation: forgeResultVeil var(--forge-result-duration, 2200ms) ease both;
}

.forge-result-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 136px;
  isolation: isolate;
}

.forge-result-flare {
  position: absolute;
  z-index: 0;
  inset: 7px -4px;
  border: 1px solid color-mix(in srgb, var(--forge-result-color) 62%, transparent);
  background:
    linear-gradient(115deg, transparent 16%, color-mix(in srgb, var(--forge-result-color) 32%, transparent) 18%, transparent 21% 77%, color-mix(in srgb, var(--forge-result-color) 28%, transparent) 80%, transparent 83%),
    linear-gradient(25deg, transparent 35%, color-mix(in srgb, var(--forge-result-color) 16%, transparent) 48%, transparent 61%);
  box-shadow:
    inset 0 0 24px color-mix(in srgb, var(--forge-result-color) 18%, transparent),
    0 0 18px color-mix(in srgb, var(--forge-result-color) 34%, transparent);
  clip-path: polygon(8% 0, 92% 0, 100% 12%, 100% 88%, 92% 100%, 8% 100%, 0 88%, 0 12%);
  animation: forgeResultFlare var(--forge-result-duration, 2200ms) cubic-bezier(.18,.75,.2,1) both;
}

.forge-result-item {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  animation: forgeResultItemArrive var(--forge-result-duration, 2200ms) cubic-bezier(.2,.78,.2,1) both;
}

.forge-result-item-art {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--forge-result-color) 58%, transparent);
  background: rgba(2, 5, 8, 0.86);
}

.forge-result-levels {
  display: grid;
  grid-template-columns: minmax(38px, auto) 20px minmax(38px, auto);
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--forge-result-color) 48%, transparent);
  background: color-mix(in srgb, var(--forge-result-color) 8%, rgba(2, 5, 8, 0.88));
  color: rgba(215, 208, 194, 0.54);
  font-family: Georgia, "Times New Roman", serif;
  animation: forgeResultLevels var(--forge-result-duration, 2200ms) ease both;
}

.forge-result-levels i {
  color: var(--forge-result-color);
  font-style: normal;
  text-shadow: 0 0 8px currentColor;
}

.forge-result-levels strong {
  color: color-mix(in srgb, var(--forge-result-color) 86%, white);
  font-size: 15px;
  font-weight: 500;
}

.forge-result-fx > strong {
  color: var(--forge-result-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-shadow: 0 0 16px currentColor;
}

.forge-result-fx > small {
  color: rgba(236, 229, 218, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forge-result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: min(100%, 330px);
  margin-top: 5px;
}

.forge-result-meta > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px 5px;
  border: 1px solid color-mix(in srgb, var(--forge-result-color) 26%, transparent);
  background: rgba(2, 5, 8, 0.68);
}

.forge-result-meta small {
  color: rgba(215, 208, 194, 0.4);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forge-result-meta b {
  overflow: hidden;
  color: color-mix(in srgb, var(--forge-result-color) 76%, #eee7dc);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-result-fx.result-broken {
  --forge-result-color: #e16b68;
  background: linear-gradient(180deg, rgba(32, 6, 9, 0.91), rgba(4, 5, 8, 0.97));
}

.forge-result-fx.result-broken .forge-result-item-visual {
  --enhanced-card-color: #e16b68;
}

.forge-result-fx.result-broken .forge-result-item {
  animation: forgeBrokenItem var(--forge-result-duration, 2800ms) ease-out both;
}

.forge-result-fx.result-broken .forge-result-item-art {
  animation: none;
  filter: grayscale(0.55) contrast(1.18);
}

.forge-result-fx.result-downgrade { --forge-result-color: #d5a267; }
.forge-result-fx.result-downgrade .forge-result-item-visual { --enhanced-card-color: #d5a267; }
.forge-result-fx.result-protected { --forge-result-color: #9fdfe8; }
.forge-result-fx.result-protected .forge-result-item-visual { --enhanced-card-color: #9fdfe8; }

.player-weapon-aura {
  display: none;
}

.player-weapon-aura::after {
  position: absolute;
  inset: 13%;
  background: inherit;
  content: "";
  opacity: 0.5;
  animation: forgeAuraCounterSpin 4.5s linear infinite;
}

.player-weapon-aura.aura-tier-2 { opacity: 0.65; }
.player-weapon-aura.aura-tier-3 { opacity: 0.76; }
.player-weapon-aura.aura-tier-4 { opacity: 0.9; }
.player-weapon-aura[hidden] { display: none; }

.player-actor[data-upgrade-tier="1"] {
  --aura-color: #79e9f2;
  --weapon-glow-min: 2px;
  --weapon-glow-max: 7px;
  --weapon-glow-outer: 10px;
  --weapon-glow-speed: 1.9s;
  --weapon-glow-brightness: 1.08;
}

.player-actor[data-upgrade-tier="2"] {
  --aura-color: #9d8cff;
  --weapon-glow-min: 4px;
  --weapon-glow-max: 10px;
  --weapon-glow-outer: 16px;
  --weapon-glow-speed: 1.5s;
  --weapon-glow-brightness: 1.15;
}

.player-actor[data-upgrade-tier="3"] {
  --aura-color: #82cfff;
  --weapon-glow-min: 5px;
  --weapon-glow-max: 14px;
  --weapon-glow-outer: 22px;
  --weapon-glow-speed: 1.15s;
  --weapon-glow-brightness: 1.22;
}

.player-actor[data-upgrade-tier="4"] {
  --aura-color: #ffd992;
  --weapon-glow-min: 7px;
  --weapon-glow-max: 18px;
  --weapon-glow-outer: 30px;
  --weapon-glow-speed: 0.85s;
  --weapon-glow-brightness: 1.32;
}

.player-actor[data-upgrade-tier="1"] .player-weapon-sprite,
.player-actor[data-upgrade-tier="2"] .player-weapon-sprite,
.player-actor[data-upgrade-tier="3"] .player-weapon-sprite,
.player-actor[data-upgrade-tier="4"] .player-weapon-sprite {
  animation: enhancedWeaponGlow var(--weapon-glow-speed, 1.55s) ease-in-out infinite alternate;
}

.loadout-slot.upgrade-tier-1,
.inventory-item.upgrade-tier-1 { box-shadow: inset 0 0 12px rgba(121, 233, 242, 0.12), 0 0 8px rgba(121, 233, 242, 0.08); }
.loadout-slot.upgrade-tier-2,
.inventory-item.upgrade-tier-2 { box-shadow: inset 0 0 16px rgba(157, 140, 255, 0.17), 0 0 10px rgba(157, 140, 255, 0.12); }
.loadout-slot.upgrade-tier-3,
.inventory-item.upgrade-tier-3 { box-shadow: inset 0 0 18px rgba(130, 207, 255, 0.2), 0 0 12px rgba(130, 207, 255, 0.15); }
.loadout-slot.upgrade-tier-4,
.inventory-item.upgrade-tier-4 { box-shadow: inset 0 0 22px rgba(255, 217, 146, 0.24), 0 0 15px rgba(255, 217, 146, 0.2); }

.loadout-slot.upgrade-tier-1,
.inventory-item.upgrade-tier-1 { --enhanced-card-color: #79e9f2; }
.loadout-slot.upgrade-tier-2,
.inventory-item.upgrade-tier-2 { --enhanced-card-color: #9d8cff; }
.loadout-slot.upgrade-tier-3,
.inventory-item.upgrade-tier-3 { --enhanced-card-color: #82cfff; }
.loadout-slot.upgrade-tier-4,
.inventory-item.upgrade-tier-4 { --enhanced-card-color: #ffd992; }

.upgrade-tier-1 {
  --enhanced-card-color: #79e9f2;
  --item-outline-highlight: #ddfcff;
  --item-outline-speed: 4.8s;
  --item-outline-pulse: 2.2s;
  --item-outline-width: 1px;
  --item-outline-opacity-low: 0.3;
  --item-outline-opacity-high: 0.65;
  --item-corner-opacity-low: 0.16;
  --item-corner-opacity-high: 0.42;
  --item-corner-glow: 2px;
  --item-outline-shadow: 0 0 4px rgba(121, 233, 242, 0.48);
  --item-art-scale-low: 0.995;
  --item-art-scale-high: 1.015;
  --item-art-brightness: 1.08;
  --item-art-shadow-low: inset 0 0 6px rgba(121, 233, 242, 0.1), 0 0 4px rgba(121, 233, 242, 0.32);
  --item-art-shadow-high: inset 0 0 10px rgba(121, 233, 242, 0.18), 0 0 9px rgba(121, 233, 242, 0.62);
}

.upgrade-tier-2 {
  --enhanced-card-color: #9d8cff;
  --item-outline-highlight: #f0eaff;
  --item-outline-speed: 3.5s;
  --item-outline-pulse: 1.65s;
  --item-outline-width: 2px;
  --item-outline-opacity-low: 0.46;
  --item-outline-opacity-high: 0.84;
  --item-corner-opacity-low: 0.28;
  --item-corner-opacity-high: 0.68;
  --item-corner-glow: 3px;
  --item-outline-shadow: 0 0 5px rgba(157, 140, 255, 0.72), 0 0 11px rgba(157, 140, 255, 0.3);
  --item-art-scale-low: 0.99;
  --item-art-scale-high: 1.025;
  --item-art-brightness: 1.15;
  --item-art-shadow-low: inset 0 0 8px rgba(157, 140, 255, 0.14), 0 0 6px rgba(157, 140, 255, 0.46);
  --item-art-shadow-high: inset 0 0 13px rgba(157, 140, 255, 0.25), 0 0 12px rgba(157, 140, 255, 0.85), 0 0 20px rgba(157, 140, 255, 0.28);
}

.upgrade-tier-3 {
  --enhanced-card-color: #82cfff;
  --item-outline-highlight: #f1fbff;
  --item-outline-speed: 2.55s;
  --item-outline-pulse: 1.25s;
  --item-outline-width: 2px;
  --item-outline-opacity-low: 0.58;
  --item-outline-opacity-high: 1;
  --item-corner-opacity-low: 0.42;
  --item-corner-opacity-high: 0.9;
  --item-corner-glow: 5px;
  --item-outline-shadow: 0 0 6px rgba(130, 207, 255, 0.9), 0 0 15px rgba(130, 207, 255, 0.5);
  --item-art-scale-low: 0.985;
  --item-art-scale-high: 1.035;
  --item-art-brightness: 1.22;
  --item-art-shadow-low: inset 0 0 10px rgba(130, 207, 255, 0.2), 0 0 8px rgba(130, 207, 255, 0.58);
  --item-art-shadow-high: inset 0 0 15px rgba(130, 207, 255, 0.34), 0 0 15px rgba(130, 207, 255, 0.95), 0 0 25px rgba(130, 207, 255, 0.46);
}

.upgrade-tier-4 {
  --enhanced-card-color: #ffd992;
  --item-outline-highlight: #fff9dc;
  --item-outline-speed: 1.75s;
  --item-outline-pulse: 0.9s;
  --item-outline-width: 3px;
  --item-outline-opacity-low: 0.72;
  --item-outline-opacity-high: 1;
  --item-corner-opacity-low: 0.58;
  --item-corner-opacity-high: 1;
  --item-corner-glow: 7px;
  --item-outline-shadow: 0 0 7px rgba(255, 217, 146, 1), 0 0 18px rgba(255, 190, 74, 0.68), 0 0 28px rgba(255, 217, 146, 0.28);
  --item-art-scale-low: 0.98;
  --item-art-scale-high: 1.045;
  --item-art-brightness: 1.3;
  --item-art-shadow-low: inset 0 0 12px rgba(255, 217, 146, 0.25), 0 0 10px rgba(255, 190, 74, 0.72);
  --item-art-shadow-high: inset 0 0 18px rgba(255, 242, 199, 0.4), 0 0 18px rgba(255, 217, 146, 1), 0 0 32px rgba(255, 174, 47, 0.62);
}

.loadout-slot[class*="upgrade-tier-"]:not(.upgrade-tier-0),
.inventory-item[class*="upgrade-tier-"]:not(.upgrade-tier-0) {
  animation: enhancedCardAura 1.8s ease-in-out infinite alternate;
}

/* Equipment inspection — compact, readable and aura-aware. */
.detail-overlay {
  align-items: center;
  padding: 10px;
  background: rgba(2, 5, 8, 0.88);
}

.item-details-modal {
  position: relative;
  isolation: isolate;
  width: min(100%, 460px);
  max-height: calc(100dvh - 20px);
  padding: 0 12px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 58%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--item-rarity) 10%, rgba(5, 9, 14, 0.97)), rgba(4, 8, 13, 0.985) 35%),
    #05090e;
  box-shadow:
    inset 0 0 34px color-mix(in srgb, var(--item-rarity) 8%, transparent),
    0 18px 55px rgba(0, 0, 0, 0.58);
  text-align: left;
}

.item-details-modal::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 18% 19%, color-mix(in srgb, var(--enhanced-card-color, var(--item-rarity)) 18%, transparent), transparent 27%),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.012) 18px 19px);
  content: "";
  pointer-events: none;
}

.item-details-header {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -12px 10px;
  padding: 11px 12px 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--item-rarity) 62%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--item-rarity) 16%, rgba(4, 8, 13, 0.96)), rgba(4, 8, 13, 0.96) 62%),
    rgba(4, 8, 13, 0.96);
  backdrop-filter: blur(10px);
}

.item-details-header > div {
  min-width: 0;
}

.item-details-modal .item-details-header .eyebrow,
.item-details-modal .item-details-header h2 {
  margin: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-details-modal .item-details-header .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin-bottom: 5px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 88%, transparent);
  background: color-mix(in srgb, var(--item-rarity) 20%, rgba(3, 6, 10, 0.88));
  box-shadow: inset 3px 0 var(--item-rarity), 0 0 12px color-mix(in srgb, var(--item-rarity) 34%, transparent);
  color: color-mix(in srgb, var(--item-rarity) 86%, white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.item-details-modal .item-details-header .eyebrow::before {
  color: var(--item-rarity);
  content: "◆";
  font-size: 11px;
  filter: drop-shadow(0 0 4px var(--item-rarity));
}

.item-details-modal .item-details-header h2 {
  color: color-mix(in srgb, var(--item-rarity) 80%, #f3eee3);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.05;
  text-shadow: 0 0 12px color-mix(in srgb, var(--item-rarity) 28%, transparent);
}

.item-details-header .icon-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.item-details-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 122px;
  margin: 0 0 8px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 82%, transparent);
  background:
    radial-gradient(circle at 15% 48%, color-mix(in srgb, var(--item-rarity) 24%, transparent), transparent 38%),
    linear-gradient(115deg, color-mix(in srgb, var(--item-rarity) 8%, transparent), transparent 58%),
    rgba(2, 6, 10, 0.76);
  box-shadow:
    inset 3px 0 var(--item-rarity),
    inset 0 0 22px color-mix(in srgb, var(--item-rarity) 10%, transparent),
    0 0 10px color-mix(in srgb, var(--item-rarity) 16%, transparent);
}

.item-details-art {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.72));
}

.item-details-visual {
  border: 1px solid color-mix(in srgb, var(--item-rarity) 58%, transparent);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--enhanced-card-color, var(--item-rarity)) 22%, transparent), transparent 64%),
    rgba(1, 4, 8, 0.54);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--item-rarity) 13%, transparent);
}

.item-details-visual > .item-art {
  z-index: 2;
}

.item-details-visual .item-enhancement-level {
  z-index: 6;
}

.item-details-hero-copy {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.item-details-hero-copy strong {
  color: color-mix(in srgb, var(--item-rarity) 82%, #f4efe4);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.item-details-hero-copy span,
.item-details-hero-copy small {
  color: rgba(224, 217, 205, 0.62);
  font-size: 11px;
  letter-spacing: 0.055em;
  line-height: 1.35;
  text-transform: uppercase;
}

.item-details-hero-copy .item-details-rarity-mark {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--item-rarity) 68%, transparent);
  background: color-mix(in srgb, var(--item-rarity) 15%, transparent);
  color: color-mix(in srgb, var(--item-rarity) 88%, white);
  font-weight: 700;
  letter-spacing: 0.11em;
}

.item-details-enhancement {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--enhanced-card-color, var(--item-rarity)) 34%, transparent);
  background: rgba(4, 8, 12, 0.72);
}

.item-details-enhancement > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.item-details-enhancement span,
.item-details-enhancement small {
  color: rgba(215, 208, 194, 0.45);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.item-details-enhancement strong {
  color: var(--enhanced-card-color, var(--item-rarity));
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
}

.item-details-enhancement-track {
  height: 6px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--enhanced-card-color, var(--item-rarity)) 24%, transparent);
  background: rgba(255, 255, 255, 0.03);
}

.item-details-enhancement-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #286e7c, var(--enhanced-card-color, var(--item-rarity)), #f2dfb5);
  box-shadow: 0 0 9px var(--enhanced-card-color, var(--item-rarity));
}

.item-details-comparison {
  margin: 0 0 8px !important;
  padding: 7px 9px;
  border-left: 2px solid rgba(215, 208, 194, 0.34);
  background: rgba(255, 255, 255, 0.022);
  color: rgba(215, 208, 194, 0.64) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.item-details-comparison.upgrade { border-left-color: #6dd3a2; color: #8ee6b8 !important; }
.item-details-comparison.downgrade { border-left-color: #d27671; color: #dda29e !important; }
.item-details-comparison.equipped { border-left-color: #70dbe5; color: #a9eef5 !important; }

.item-details-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.item-details-actions button {
  min-height: 38px;
  padding: 7px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.item-details-actions button:only-child {
  grid-column: 1 / -1;
}

.item-details-lock-button {
  border: 1px solid rgba(215, 208, 194, 0.18);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(215, 208, 194, 0.62);
}

.item-details-lock-button.active {
  border-color: rgba(227, 174, 94, 0.52);
  background: rgba(227, 174, 94, 0.08);
  color: #edc480;
}

.item-details-modal .item-details-section {
  margin-bottom: 9px;
}

.item-details-modal .item-details-section h3 {
  margin-bottom: 5px;
  font-size: 11px;
}

.item-details-modal .item-details-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.item-details-modal .item-details-list span {
  min-height: 34px;
  padding: 7px;
  font-size: 11px;
  line-height: 1.25;
}

.item-details-modal .item-provenance {
  gap: 4px;
  margin-bottom: 9px;
  padding: 7px;
  border: 1px solid rgba(215, 208, 194, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.item-details-modal .item-provenance div {
  grid-template-columns: 58px minmax(0, 1fr);
  font-size: 11px;
}

.item-details-modal .reroll-button {
  min-height: 39px;
  padding: 8px;
  font-size: 11px;
}

.item-details-modal .item-details-note {
  margin-bottom: 0 !important;
  font-size: 11px !important;
}

.forge-protection-option:focus-visible,
.forge-header .icon-button:focus-visible,
.item-details-header .icon-button:focus-visible,
.item-details-lock-button:focus-visible {
  outline: 2px solid var(--ether);
  outline-offset: 2px;
}

@keyframes forgeAuraSpin {
  from { transform: rotate(0deg) scale(0.96); }
  to { transform: rotate(360deg) scale(0.96); }
}

@keyframes forgeAwakeningRing {
  from { transform: rotate(0deg) scale(0.94); opacity: 0.72; }
  50% { opacity: 1; }
  to { transform: rotate(360deg) scale(0.94); opacity: 0.72; }
}

@keyframes itemAuraOrbit {
  from { transform: rotate(0deg) scale(0.94); }
  to { transform: rotate(360deg) scale(0.94); }
}

@keyframes itemAuraPulse {
  from { opacity: 0.58; filter: brightness(1.08) saturate(1.1) drop-shadow(0 0 4px var(--aura-color)); }
  to { opacity: 1; filter: brightness(1.55) saturate(1.5) drop-shadow(0 0 10px var(--aura-color)); }
}

@keyframes itemAuraPulseSoft {
  from { opacity: 0.22; filter: blur(0.4px) brightness(0.96) saturate(0.9) drop-shadow(0 0 3px var(--aura-color)); }
  to { opacity: 0.38; filter: blur(0) brightness(1.12) saturate(1.02) drop-shadow(0 0 5px var(--aura-color)); }
}

@keyframes itemOutlineTravel {
  to { --item-outline-angle: 360deg; }
}

@keyframes itemOutlineGlow {
  from { opacity: var(--item-outline-opacity-low, 0.3); filter: brightness(0.9); }
  to { opacity: var(--item-outline-opacity-high, 0.72); filter: brightness(1.55); }
}

@keyframes itemOutlineCorners {
  from { opacity: var(--item-corner-opacity-low, 0.2); }
  to { opacity: var(--item-corner-opacity-high, 0.58); }
}

@keyframes enhancedItemArtPulse {
  from {
    filter: brightness(0.98);
    box-shadow: var(--item-art-shadow-low);
    transform: scale(var(--item-art-scale-low, 0.995));
  }
  to {
    filter: brightness(var(--item-art-brightness, 1.12));
    box-shadow: var(--item-art-shadow-high);
    transform: scale(var(--item-art-scale-high, 1.02));
  }
}

@keyframes itemAuraRuneOrbit {
  0% { transform: rotate(0deg) scale(0.94); opacity: 0.48; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg) scale(0.94); opacity: 0.48; }
}

@keyframes itemAuraOrbit {
  from { transform: rotate(0deg) scale(0.94); }
  to { transform: rotate(360deg) scale(0.94); }
}

@keyframes itemAuraPulse {
  from { opacity: 0.58; filter: brightness(1.08) saturate(1.1) drop-shadow(0 0 4px var(--aura-color)); }
  to { opacity: 1; filter: brightness(1.55) saturate(1.5) drop-shadow(0 0 10px var(--aura-color)); }
}

@keyframes itemAuraRuneOrbit {
  0% { transform: rotate(0deg) scale(0.94); opacity: 0.48; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg) scale(0.94); opacity: 0.48; }
}

@keyframes forgeAwakeningSparks {
  from { transform: rotate(-7deg) scale(0.78); opacity: 0.45; }
  to { transform: rotate(11deg) scale(1.18); opacity: 1; }
}

@keyframes forgeWeaponPulse {
  from { filter: brightness(0.96); transform: scale(0.98); }
  to { filter: brightness(1.25); transform: scale(1.04); }
}

@keyframes enhancedCardAura {
  from { filter: brightness(0.96); }
  to { filter: brightness(1.12) drop-shadow(0 0 5px color-mix(in srgb, var(--enhanced-card-color) 58%, transparent)); }
}

@keyframes forgeAuraCounterSpin {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes forgeAuraPulse {
  from { opacity: 0.48; filter: brightness(0.86) saturate(0.9); }
  to { opacity: 0.92; filter: brightness(1.2) saturate(1.16); }
}

@keyframes forgeResultVeil {
  0% { opacity: 0; }
  14%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes forgeResultSweep {
  0% { opacity: 0; transform: translateX(-28%) rotate(-9deg); }
  28% { opacity: 1; }
  72% { opacity: 0.72; }
  100% { opacity: 0; transform: translateX(28%) rotate(-9deg); }
}

@keyframes forgeResultFlare {
  0% { opacity: 0; transform: scaleX(0.45) scaleY(0.78); }
  24% { opacity: 1; transform: scaleX(1.06) scaleY(1.02); }
  70% { opacity: 0.84; transform: scale(1); }
  100% { opacity: 0; transform: scaleX(1.18) scaleY(1.08); }
}

@keyframes forgeResultItemArrive {
  0% { opacity: 0; transform: translateY(18px) scale(0.72); filter: brightness(2); }
  28% { opacity: 1; transform: translateY(-3px) scale(1.05); filter: brightness(1.35); }
  48%, 78% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
  100% { opacity: 0; transform: translateY(-5px) scale(1.04); }
}

@keyframes forgeResultLevels {
  0%, 18% { opacity: 0; transform: translateY(8px); }
  36%, 82% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes forgeBrokenItem {
  0% { opacity: 0; transform: scale(0.78); filter: brightness(1.8); }
  22% { opacity: 1; transform: scale(1.04) rotate(0deg); filter: brightness(1.15); }
  30% { transform: translateX(-4px) rotate(-2deg); }
  37% { transform: translateX(5px) rotate(2deg); }
  44% { transform: translateX(-3px) rotate(-1deg); }
  54%, 72% { opacity: 1; transform: translateX(0) scale(0.98); filter: grayscale(0.35); }
  100% { opacity: 0; transform: translateY(14px) scale(0.84); filter: grayscale(1) blur(2px); }
}

@keyframes weaponAuraOrbit {
  from { transform: rotate(0deg) scale(0.94); }
  to { transform: rotate(360deg) scale(0.94); }
}

@keyframes enhancedWeaponGlow {
  from {
    filter:
      drop-shadow(0 0 var(--weapon-glow-min, 3px) var(--aura-color, rgba(98, 215, 232, 0.42)))
      brightness(1);
  }
  to {
    filter:
      drop-shadow(0 0 var(--weapon-glow-max, 9px) var(--aura-color, rgba(98, 215, 232, 0.8)))
      drop-shadow(0 0 var(--weapon-glow-outer, 15px) var(--aura-color, rgba(98, 215, 232, 0.4)))
      brightness(var(--weapon-glow-brightness, 1.14));
  }
}

.loot-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.loot-row[hidden] {
  display: none;
}

.loot-row span {
  padding: 9px 4px;
  border: 1px solid rgba(150, 122, 73, 0.44);
  background: rgba(150, 122, 73, 0.08);
  color: #d9bb86;
  font-size: 12px;
}

.desktop-hint {
  display: none;
  margin: 12px 0 0;
  color: rgba(215, 208, 194, 0.4);
  font-size: 11px;
}

.game.guard-active::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: -4%;
  bottom: 22%;
  width: 62%;
  height: 55%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 56%, rgba(98, 215, 232, 0.36) 59%, transparent 64%);
  animation: shieldFlash 700ms ease-out forwards;
  pointer-events: none;
}

.game.hit {
  animation: hitShake 180ms ease-out;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes floatDamage {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  18% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -48px) scale(1.08); }
}

@keyframes dangerPulse {
  from { box-shadow: 0 0 12px rgba(197, 138, 69, 0.2); }
  to { box-shadow: 0 0 32px rgba(197, 138, 69, 0.46); }
}

@keyframes readyPulse {
  from { box-shadow: inset 0 0 0 3px rgba(4, 7, 11, 0.72), 0 0 9px rgba(98, 215, 232, 0.16); }
  to { box-shadow: inset 0 0 0 3px rgba(4, 7, 11, 0.72), 0 0 24px rgba(98, 215, 232, 0.45); }
}

@keyframes shieldFlash {
  from { opacity: 0; transform: scale(0.75); }
  30% { opacity: 1; }
  to { opacity: 0; transform: scale(1.08); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
}

@keyframes seekerIdle {
  from { transform: translateY(0) rotate(-0.4deg); }
  to { transform: translateY(-4px) rotate(0.4deg); }
}

@keyframes enemyIdle {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-5px) scale(1.008); }
}

@keyframes seekerStrike {
  0%, 100% { transform: translateX(0) rotate(0); }
  44% { transform: translateX(34px) rotate(2deg); }
}

@keyframes seekerGuard {
  0%, 100% { transform: translateX(0) scale(1); }
  45% { transform: translateX(-8px) scale(0.98); }
}

@keyframes enemyAttack {
  0%, 100% { transform: translateX(0) scale(1); }
  48% { transform: translateX(-30px) scale(1.025); }
}

@keyframes enemyHit {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(9px) rotate(1deg); }
  62% { transform: translateX(-5px) rotate(-0.5deg); }
}

@keyframes playerSpriteHit {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-10px) rotate(-1deg); }
  68% { transform: translateX(4px); }
}

@keyframes slashSpriteEffect {
  0% { opacity: 0; transform: translate(-18px, 18px) rotate(-6deg) scale(0.56); }
  34% { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -12px) rotate(3deg) scale(1.08); }
}

@keyframes guardSpriteEffect {
  0% { opacity: 0; transform: scale(0.62); }
  32% { opacity: 1; transform: scale(0.92); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes interruptSpriteEffect {
  0% { opacity: 0; transform: rotate(-12deg) scale(0.54); }
  30% { opacity: 1; transform: rotate(0) scale(0.94); }
  100% { opacity: 0; transform: rotate(8deg) scale(1.14); }
}

@keyframes ultimateSpriteEffect {
  0% { opacity: 0; transform: translateY(-24px) scaleY(0.42); }
  24% { opacity: 1; transform: translateY(0) scaleY(1); }
  72% { opacity: 0.92; }
  100% { opacity: 0; transform: translateY(8px) scale(1.08); }
}

@keyframes cityVeil {
  from { opacity: 0.45; transform: translateX(-2%); }
  to { opacity: 0.82; transform: translateX(2%); }
}

@keyframes audioPulse {
  from { opacity: 0.62; transform: translateY(1px) scale(0.94); }
  to { opacity: 1; transform: translateY(-1px) scale(1.06); }
}

@media (min-width: 700px) {
  .page-shell {
    padding: 12px;
  }

  .game {
    height: min(calc(100dvh - 58px), 818px);
    border: 1px solid rgba(160, 186, 199, 0.24);
    border-radius: 18px;
  }

  .desktop-hint {
    display: block;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 370px) {
  .city-navigation {
    gap: 5px;
    padding-inline: 9px;
  }

  .city-location {
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 4px;
    min-height: 60px;
    padding: 6px;
  }

  .city-location-icon {
    width: 29px;
    height: 29px;
  }

  .city-location strong {
    font-size: 11px;
  }

  .city-location small {
    font-size: 11px;
  }

  .profile-chip {
    max-width: 42px;
    padding-right: 5px;
  }

  .profile-copy {
    display: none;
  }
}

@media (max-height: 700px) {
  .city-navigation {
    gap: 5px;
    padding-top: 38px;
  }

  .city-intro {
    display: none;
  }

  .city-location {
    min-height: 58px;
  }
}
