html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #000;
  color: #fff;
}

* {
  box-sizing: border-box;
}

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/page/earth.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.2;
  z-index: 0;
}

.header {
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
  padding: 15px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3;
  box-shadow: inset 0 -3px 10px rgba(0, 170, 255, 0.6);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.header:hover {
  opacity: 1;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav-auth {
  width: min(1180px, 100%);
  align-items: center;
}

.nav-button {
  text-decoration: none;
  display: inline-block;
  background: transparent;
  border: 2px solid #444;
  padding: 10px 20px;
  color: #bbb;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-logout {
  margin-left: auto;
}

.nav-button-danger {
  border-color: #b3261e;
  color: #ffb4ab;
}

.nav-button-danger:hover,
.nav-button-danger.active {
  border-color: #ff5449;
  color: #ffdfdc;
  box-shadow: 0 0 12px rgba(255, 84, 73, 0.8);
}

.guest-headline {
  color: #e2f6ff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 8px 26px rgba(0, 170, 255, 0.18);
}

.nav-button:hover,
.nav-button.active {
  border-color: #00aaff;
  color: #00aaff;
  box-shadow: 0 0 12px #00aaff;
}

.content {
  position: relative;
  padding: 32px 20px 80px;
  max-width: 1150px;
  margin: 0 auto;
}

.login-page-shell {
  min-height: calc(100vh - 170px);
  max-width: none;
  display: grid;
  place-items: center;
}

#login-container {
  position: relative;
  width: min(620px, 96vw);
  margin: 40px auto;
  padding: 1px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(125, 211, 255, 0.3), rgba(0, 170, 255, 0.08));
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.login-panel-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 34px 30px;
  border-radius: 23px;
  background:
    radial-gradient(circle at top right, rgba(0, 170, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(3, 10, 20, 0.96), rgba(8, 18, 34, 0.94));
}

.login-panel-orbit {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.login-panel-orbit-a {
  width: 180px;
  height: 180px;
  right: -46px;
  top: -56px;
  background: radial-gradient(circle, rgba(0, 170, 255, 0.24), transparent 68%);
}

.login-panel-orbit-b {
  width: 150px;
  height: 150px;
  left: -40px;
  bottom: -34px;
  background: radial-gradient(circle, rgba(107, 207, 255, 0.16), transparent 70%);
}

.login-language-wrap {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.top-buttons {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: stretch;
}

.top-button {
  flex: 1;
  min-height: 50px;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(22, 32, 46, 0.92), rgba(10, 17, 28, 0.92));
  border: 1px solid rgba(125, 211, 255, 0.18);
  border-radius: 14px;
  color: #dcecff;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.22s ease;
}

.top-button:hover,
.top-button.active {
  background: linear-gradient(180deg, rgba(0, 54, 102, 0.92), rgba(0, 31, 61, 0.94));
  border-color: rgba(107, 207, 255, 0.72);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 170, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#loginLanguage {
  min-width: 154px;
  max-width: 182px;
  min-height: 46px;
  padding: 8px 42px 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 255, 0.42);
  background-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(12, 31, 54, 0.96), rgba(7, 17, 30, 0.96)),
    linear-gradient(45deg, transparent 50%, #a9ebff 50%),
    linear-gradient(135deg, #a9ebff 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    0 0,
    calc(100% - 22px) 19px,
    calc(100% - 15px) 19px;
  background-size:
    100% 100%,
    6px 6px,
    6px 6px;
  color: #f0f7ff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
}

#loginLanguage:hover,
#loginLanguage:focus {
  border-color: #6ad0ff;
  box-shadow: 0 0 0 2px rgba(106, 208, 255, 0.16), 0 12px 24px rgba(0, 0, 0, 0.26);
  outline: none;
}

#loginLanguage option {
  background: #0b1420;
  color: #f0f7ff;
}

.response-box {
  width: 100%;
  min-height: 54px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 255, 0.16);
  font-weight: 600;
  font-family: monospace;
  background: rgba(8, 14, 24, 0.82);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.response-box.success { color: #4dff4d; }
.response-box.error { color: #ff4d4d; }
.response-box.info { color: #ffd700; }

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 255, 0.2);
  background: rgba(9, 17, 28, 0.94);
  color: #fff;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(107, 207, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(107, 207, 255, 0.12);
  background: rgba(11, 21, 36, 0.96);
}

.inline-buttons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.inline-buttons.one {
  grid-template-columns: 1fr;
}

.inline-buttons button,
.actions-grid button {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0, 74, 140, 0.94), rgba(0, 42, 82, 0.96));
  border: 1px solid rgba(106, 208, 255, 0.68);
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.inline-buttons button:hover,
.actions-grid button:hover {
  background: linear-gradient(180deg, rgba(0, 98, 184, 0.96), rgba(0, 53, 103, 0.98));
  box-shadow: 0 12px 24px rgba(0, 170, 255, 0.18);
}

.compact-top {
  margin-top: 10px;
}

#game-container {
  display: grid;
  gap: 12px;
}

.panel {
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(0, 170, 255, 0.35);
  border-radius: 10px;
  padding: 14px;
}

.world-section {
  margin-bottom: 18px;
  border-color: rgba(125, 211, 255, 0.42);
  box-shadow: inset 0 0 18px rgba(0, 170, 255, 0.08);
}

.world-page-shell {
  max-width: 1100px;
}

.world-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.world-panel-head h2 {
  margin: 0;
}

.world-panel-tag {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 255, 0.46);
  background: linear-gradient(180deg, rgba(0, 59, 107, 0.78), rgba(0, 29, 56, 0.9));
  color: #ccf0ff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.world-intel-panel {
  background:
    radial-gradient(circle at top right, rgba(0, 170, 255, 0.17), transparent 42%),
    linear-gradient(160deg, rgba(8, 20, 38, 0.95), rgba(3, 11, 22, 0.94));
}

.world-battle-panel {
  background:
    radial-gradient(circle at top left, rgba(255, 82, 82, 0.1), transparent 40%),
    linear-gradient(165deg, rgba(10, 17, 31, 0.95), rgba(4, 9, 17, 0.95));
}

.world-travel-panel {
  background:
    radial-gradient(circle at top, rgba(255, 214, 129, 0.16), transparent 42%),
    linear-gradient(165deg, rgba(24, 17, 8, 0.95), rgba(12, 8, 3, 0.95));
  border-color: rgba(255, 203, 110, 0.5);
  box-shadow: inset 0 0 22px rgba(255, 203, 110, 0.12);
}

.travel-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.travel-energy-row {
  margin-bottom: 10px;
}

.travel-progress-row {
  margin-bottom: 10px;
}

.travel-cancel-button {
  border-color: rgba(255, 120, 110, 0.75);
  background: linear-gradient(180deg, rgba(96, 24, 18, 0.92), rgba(64, 16, 12, 0.95));
}

.travel-cancel-button:hover {
  border-color: rgba(255, 156, 148, 0.95);
  box-shadow: 0 10px 24px rgba(255, 101, 84, 0.24);
}

.battle-panel {
  border-color: rgba(244, 210, 122, 0.45);
  box-shadow: inset 0 0 20px rgba(244, 210, 122, 0.08);
}

.panel h2 {
  margin: 0 0 10px;
  color: #7dd3ff;
}

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

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

.stat-card {
  background: rgba(12, 20, 35, 0.92);
  border: 1px solid rgba(0, 170, 255, 0.25);
  border-radius: 7px;
  padding: 8px;
}

.stat-card strong {
  display: block;
  color: #9fdfff;
  font-size: 12px;
}

.profile-bars {
  display: grid;
  gap: 12px;
}

.profile-page {
  display: grid;
  gap: 14px;
}

.profile-page .panel {
  border-color: rgba(110, 198, 255, 0.35);
  background:
    radial-gradient(circle at top right, rgba(64, 151, 220, 0.16), transparent 44%),
    linear-gradient(165deg, rgba(7, 16, 30, 0.94), rgba(3, 10, 20, 0.95));
  box-shadow: inset 0 0 0 1px rgba(126, 205, 255, 0.08), 0 16px 30px rgba(0, 0, 0, 0.32);
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-hero-main {
  display: grid;
  gap: 6px;
}

.profile-hero-identity {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.profile-hero-identity-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-hero-eyebrow {
  color: #8dcdf1;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-hero-name {
  margin: 0;
  color: #f0f8ff;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.1;
}

.profile-hero-class-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(126, 206, 255, 0.62);
  background: radial-gradient(circle at top, rgba(148, 224, 255, 0.24), rgba(7, 20, 38, 0.95));
  object-fit: contain;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 10px 20px rgba(0, 0, 0, 0.28);
}

.profile-hero-class-name {
  color: #9dd5f5;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: flex-start;
  justify-content: flex-end;
  max-width: 520px;
}

.profile-hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 204, 255, 0.38);
  background: linear-gradient(180deg, rgba(9, 36, 66, 0.88), rgba(5, 22, 41, 0.92));
  color: #d7efff;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.profile-stats-panel {
  padding-top: 16px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 9px;
}

.profile-stat-card {
  border: 1px solid rgba(111, 196, 249, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.92), rgba(4, 12, 24, 0.94));
  box-shadow: inset 0 0 0 1px rgba(126, 206, 255, 0.07);
  padding: 8px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-stat-card:hover {
  transform: translateY(-1px);
  border-color: rgba(130, 216, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(136, 217, 255, 0.12), 0 10px 20px rgba(0, 0, 0, 0.28);
}

.profile-stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(125, 211, 255, 0.36);
  background: radial-gradient(circle at top, rgba(146, 220, 255, 0.2), rgba(7, 20, 38, 0.92));
  display: grid;
  place-items: center;
}

.profile-stat-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}

.profile-stat-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-stat-text strong {
  color: #9edbfc;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-stat-text span {
  color: #e4f5ff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-stat-value {
  display: block;
}

.profile-stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.profile-stat-extra {
  display: inline;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-stat-extra-crit {
  color: #ffd36a;
}

.resource-bar {
  display: grid;
  gap: 6px;
}

.resource-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #d8e9ff;
  font-size: 13px;
}

.resource-bar-head strong {
  color: #9fdfff;
}

.resource-bar-track {
  height: 26px;
  border: 1px solid rgba(183, 220, 255, 0.32);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(4, 10, 20, 0.92), rgba(8, 16, 29, 0.8));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 10px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(2, 10, 20, 0.25);
}

.resource-bar-fill {
  height: 100%;
  width: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.24), 0 0 16px rgba(160, 210, 255, 0.28);
}

.resource-hp .resource-bar-fill {
  background: linear-gradient(90deg, #5e0f19, #d43142, #ff7782);
}

.resource-endurance .resource-bar-fill {
  background: linear-gradient(90deg, #5c3b00, #d99516, #ffd36a);
}

.resource-mana .resource-bar-fill {
  background: linear-gradient(90deg, #123366, #2b80d7, #8bcaff);
}

.resource-xp .resource-bar-fill {
  background: linear-gradient(90deg, #14356e, #2e8cff, #98d7ff);
}

.area-intel-panel {
  display: grid;
  gap: 8px;
}

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

.area-intel-grid-secondary {
  margin-top: 8px;
}

.area-intel-card {
  background: linear-gradient(145deg, rgba(8, 20, 38, 0.96), rgba(3, 10, 20, 0.94));
  border: 1px solid rgba(125, 211, 255, 0.25);
  border-radius: 9px;
  padding: 7px 9px;
  display: grid;
  gap: 3px;
  box-shadow: inset 0 0 12px rgba(0, 170, 255, 0.07);
}

.area-intel-card-wide {
  grid-column: span 1;
}

.area-intel-label {
  color: #9bb9d6;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.area-intel-card strong {
  color: #e5f6ff;
  font-size: 13px;
}

.area-enemy-roster {
  margin-top: 6px;
  border: 1px solid rgba(125, 211, 255, 0.24);
  border-radius: 10px;
  background: rgba(5, 12, 24, 0.72);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.area-enemy-title {
  color: #b9e5ff;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.area-enemy-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 9px;
}

.area-enemy-empty {
  grid-column: 1 / -1;
  color: #b6d4ea;
  font-size: 13px;
}

.area-enemy-card {
  position: relative;
  border: 1px solid rgba(125, 211, 255, 0.26);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(7, 17, 32, 0.95), rgba(3, 10, 20, 0.95));
  padding: 8px;
  display: grid;
  gap: 5px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.area-enemy-icon {
  height: 42px;
  border-radius: 8px;
  border: 1px dashed rgba(125, 211, 255, 0.4);
  background: rgba(9, 22, 40, 0.7);
  display: grid;
  place-items: center;
  color: #8ecff1;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.area-enemy-name {
  color: #e4f4ff;
  font-size: 13px;
  line-height: 1.3;
}

.area-enemy-level {
  color: #8fb7cf;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.area-enemy-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(320px, 82vw);
  border: 1px solid rgba(125, 211, 255, 0.58);
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.97);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  padding: 10px;
  display: none;
  z-index: 22;
  pointer-events: auto;
}

.area-enemy-hint.is-elite {
  border-color: rgba(245, 193, 84, 0.84);
  background: linear-gradient(180deg, rgba(37, 25, 6, 0.97), rgba(20, 13, 3, 0.97));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 193, 84, 0.34);
}

.area-enemy-card:hover .area-enemy-hint,
.area-enemy-card:focus-within .area-enemy-hint {
  display: block;
}

.area-enemy-hint strong {
  display: block;
  color: #dff2ff;
  margin-bottom: 5px;
  font-size: 13px;
}

.area-enemy-hint.is-elite strong {
  color: #ffe5a8;
}

.area-enemy-hint p {
  margin: 0;
  color: #c3def0;
  font-size: 12px;
  line-height: 1.35;
}

.area-enemy-hint.is-elite p,
.area-enemy-hint.is-elite .area-enemy-hint-switch,
.area-enemy-hint.is-elite .area-enemy-hint-label {
  color: #f4d694;
}

.area-enemy-hint-label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  color: #8ecff1;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.area-enemy-hint-switch {
  display: block;
  color: #9bc4db;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.area-enemy-hint-loot {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 3px;
  color: #e3f4ff;
  font-size: 12px;
  line-height: 1.3;
}

.area-enemy-drop-row {
  display: grid;
  grid-template-columns: 6ch 1ch 1fr;
  column-gap: 6px;
  align-items: baseline;
}

.area-enemy-drop-chance {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.area-enemy-drop-separator {
  text-align: center;
  color: rgba(189, 220, 240, 0.9);
}

.area-enemy-drop-value {
  min-width: 0;
}

#itemsGrid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  align-items: start;
  overflow: visible;
}

.inventory-game-title {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ecf6ff;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.42), 0 0 18px rgba(116, 196, 255, 0.28);
  pointer-events: none;
}

#navWorld {
  border-color: rgba(80, 197, 90, 0.9);
  color: #87e890;
  box-shadow: inset 0 0 0 1px rgba(80, 197, 90, 0.16);
}

#navWorld:hover,
#navWorld.active {
  border-color: #45ca58;
  color: #c6ffd0;
  box-shadow: 0 0 14px rgba(69, 202, 88, 0.72);
}

.inventory-shell {
  max-width: 1360px;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 20px;
}

.inventory-gear-panel {
  min-height: 540px;
  background:
    radial-gradient(circle at top, rgba(209, 248, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(5, 13, 25, 0.96), rgba(2, 8, 16, 0.94));
  border-color: rgba(140, 219, 255, 0.34);
}

.inventory-gear-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 2px;
}

.inventory-gear-slot {
  width: 100%;
  border: 1px solid rgba(122, 196, 233, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 21, 40, 0.92), rgba(8, 17, 30, 0.88));
  color: #e7f8ff;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.inventory-gear-slot span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-gear-slot small {
  color: #9ec3d8;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-gear-slot-filled {
  border-color: rgba(255, 205, 111, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 205, 111, 0.12);
}

.inventory-gear-slot-selected {
  border-color: rgba(117, 225, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(117, 225, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.inventory-gear-slot-drop-active {
  border-color: rgba(255, 213, 120, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 213, 120, 0.22), 0 12px 24px rgba(0, 0, 0, 0.25);
}

.inventory-main-panel {
  min-height: 640px;
}

.inventory-currency-rail {
  position: fixed;
  right: 18px;
  top: 88px;
  z-index: 8;
  display: grid;
  gap: 10px;
}

.inventory-currency-tile {
  min-width: 180px;
  border: 1px solid rgba(129, 205, 247, 0.42);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(6, 17, 34, 0.94), rgba(10, 20, 36, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-areas:
    "icon amount"
    "icon label";
  align-items: center;
  column-gap: 10px;
}

.inventory-currency-tile img {
  grid-area: icon;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.inventory-currency-tile strong {
  grid-area: amount;
  font-size: 18px;
  color: #fff1c8;
  line-height: 1;
}

.inventory-currency-tile span {
  grid-area: label;
  color: #d0e9f7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inventory-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inventory-header-row h2 {
  margin: 0;
}

.inventory-search {
  width: min(320px, 100%);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 255, 0.38);
  background: rgba(8, 18, 32, 0.92);
  color: #e7f7ff;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.inventory-search:focus {
  border-color: #5acbff;
  box-shadow: 0 0 0 2px rgba(90, 203, 255, 0.16);
}

.inventory-slot {
  position: relative;
  min-width: 0;
  background: rgba(12, 20, 35, 0.92);
  border: 1px solid rgba(0, 170, 255, 0.25);
  border-radius: 7px;
  padding: 8px;
  display: grid;
  gap: 6px;
  justify-items: center;
  overflow: visible;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.inventory-slot-equipped {
  border-color: rgba(255, 205, 111, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 205, 111, 0.22), 0 12px 24px rgba(0, 0, 0, 0.28);
}

.inventory-slot[draggable="true"] {
  cursor: grab;
}

.inventory-slot-dragging {
  opacity: 0.35;
  transform: scale(0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.inventory-slot-swap-target {
  border-color: rgba(255, 214, 102, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 214, 102, 0.22), 0 12px 22px rgba(0, 0, 0, 0.24);
  transform: translateY(-2px);
}

.inventory-slot-match {
  border-color: rgba(109, 228, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(109, 228, 255, 0.22), 0 10px 22px rgba(0, 32, 58, 0.28);
}

.inventory-slot-dim {
  opacity: 0.32;
  filter: grayscale(0.35);
}

.inventory-slot-visual {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}

.inventory-slot-frame,
.inventory-slot-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.inventory-slot-icon {
  inset: 12%;
  width: 76%;
  height: 76%;
  z-index: 2;
}

.inventory-slot-frame {
  z-index: 1;
  pointer-events: none;
}

.inventory-slot-quantity {
  position: absolute;
  right: 2px;
  bottom: 1px;
  z-index: 3;
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.inventory-slot-missing {
  width: 52px;
  height: 52px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #ffdf9e;
  font-size: 24px;
  font-weight: 700;
}

.inventory-slot-name {
  width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.inventory-slot-name {
  color: #d8efff;
  font-size: 12px;
}

.inventory-slot-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(240px, 76vw);
  padding: 10px;
  border: 1px solid rgba(125, 211, 255, 0.55);
  border-radius: 7px;
  background: rgba(4, 9, 18, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: #d8e9ff;
  display: none;
  transform: translateX(-50%);
  text-align: left;
  pointer-events: none;
}

.inventory-slot-hint strong,
.inventory-slot-hint span,
.inventory-slot-hint p {
  display: block;
}

.inventory-slot-hint strong {
  color: #9fdfff;
  font-size: 13px;
  margin-bottom: 4px;
}

.inventory-slot-hint span {
  color: #f4d27a;
  font-size: 12px;
  margin-top: 4px;
}

.inventory-slot-hint p {
  margin: 7px 0;
  color: #d8e9ff;
  font-size: 12px;
  line-height: 1.35;
}

.inventory-slot:hover .inventory-slot-hint,
.inventory-slot:focus-within .inventory-slot-hint {
  display: block;
}

.inventory-trash-dock {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%) translateY(18px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inventory-trash-dock-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.inventory-trash-target {
  min-width: 240px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 124, 124, 0.45);
  background: linear-gradient(180deg, rgba(31, 6, 8, 0.94), rgba(84, 11, 17, 0.92));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
  color: #ffe2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transform: scale(1);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.inventory-trash-target-active {
  transform: scale(1.08);
  border-color: rgba(255, 79, 79, 0.92);
  background: linear-gradient(180deg, rgba(63, 4, 8, 0.98), rgba(154, 16, 24, 0.95));
  box-shadow: 0 0 0 2px rgba(255, 79, 79, 0.22), 0 22px 42px rgba(0, 0, 0, 0.48);
}

.inventory-trash-icon {
  font-size: 28px;
  line-height: 1;
}

.inventory-delete-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(1, 5, 11, 0.68);
}

.inventory-delete-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 24px));
  z-index: 60;
  background: linear-gradient(180deg, rgba(7, 15, 29, 0.98), rgba(3, 10, 20, 0.96));
  border: 1px solid rgba(125, 211, 255, 0.4);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 14px;
}

.inventory-delete-modal h3 {
  margin: 0;
  color: #e4f5ff;
  font-size: 18px;
  line-height: 1.35;
}

.inventory-delete-range {
  width: 100%;
  accent-color: #ff5959;
}

.inventory-delete-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cfe3f2;
}

.inventory-delete-meta strong {
  color: #fff;
  font-size: 18px;
}

.inventory-delete-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inventory-delete-actions button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 255, 0.38);
  background: rgba(0, 39, 70, 0.86);
  color: #effaff;
  font-weight: 700;
  cursor: pointer;
}

.inventory-delete-actions button:hover {
  background: rgba(0, 64, 112, 0.86);
}

.inventory-action-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 22px));
  z-index: 61;
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.98), rgba(5, 14, 24, 0.96));
  border: 1px solid rgba(125, 211, 255, 0.4);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.48);
  display: grid;
  gap: 12px;
}

.inventory-action-modal h3 {
  margin: 0;
  color: #e6f4ff;
  font-size: 18px;
}

.inventory-action-buttons {
  display: grid;
  gap: 9px;
}

.inventory-action-buttons button,
.inventory-action-close {
  min-height: 42px;
  border-radius: 9px;
  border: 1px solid rgba(125, 211, 255, 0.35);
  background: rgba(10, 39, 66, 0.86);
  color: #eff9ff;
  font-weight: 700;
  cursor: pointer;
}

.inventory-action-buttons button:hover,
.inventory-action-close:hover {
  background: rgba(9, 60, 99, 0.9);
}

.inventory-action-danger {
  border-color: rgba(255, 120, 120, 0.45) !important;
  background: rgba(90, 25, 25, 0.88) !important;
}

.inventory-action-primary {
  border-color: rgba(106, 215, 255, 0.55) !important;
}

.inventory-hover-rail {
  top: 42%;
}

.inventory-controls-panel {
  width: min(420px, calc(100vw - 26px));
}

.inventory-controls-group {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.inventory-control-label {
  color: #b6d5ea;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inventory-control-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 255, 0.35);
  background: rgba(8, 18, 32, 0.92);
  color: #e8f8ff;
}

.inventory-control-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d8ecff;
  font-size: 13px;
}

.inventory-control-check input {
  accent-color: #4bc7ff;
}

.inventory-toast {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 72;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 255, 0.5);
  background: rgba(6, 16, 30, 0.94);
  color: #ddf2ff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  font-size: 13px;
  line-height: 1.35;
}

.inventory-toast.success {
  border-color: rgba(117, 233, 156, 0.72);
  color: #d7ffe4;
}

.inventory-toast.error {
  border-color: rgba(255, 126, 126, 0.72);
  color: #ffdede;
}

.inventory-toast.info {
  border-color: rgba(125, 211, 255, 0.58);
}

@media (max-width: 1180px) {
  .inventory-shell {
    grid-template-columns: 1fr;
  }

  .inventory-currency-rail {
    position: static;
    margin: 14px 20px 0;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .inventory-page .inventory-game-title {
    position: static;
    transform: none;
    font-size: 18px;
    margin-right: 8px;
  }

  .inventory-page .header {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .inventory-page .nav-auth {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }

  .inventory-currency-rail {
    grid-template-columns: 1fr;
  }
}

.area-info,
.battle-info,
.changelog-meta {
  white-space: pre-wrap;
  line-height: 1.35;
  color: #d8e9ff;
}

.areas-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.area-chip {
  text-align: left;
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 170, 255, 0.35);
  background: rgba(12, 20, 35, 0.9);
  color: #d8e9ff;
  cursor: pointer;
}

.area-chip.selected {
  border-color: #00aaff;
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.55);
  color: #7dd3ff;
}

.settings-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.settings-form label {
  color: #b9d6ea;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-form input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 255, 0.28);
  background: rgba(9, 18, 31, 0.92);
  color: #f4fbff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.settings-form select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 255, 0.28);
  background: rgba(9, 18, 31, 0.92);
  color: #f4fbff;
  font-size: 14px;
  outline: none;
}

.settings-form input:focus,
.settings-form select:focus {
  border-color: #6bcfff;
  box-shadow: 0 0 0 2px rgba(107, 207, 255, 0.16);
}

.settings-form button,
.battle-controls button {
  padding: 9px 12px;
  background-color: #002244;
  border: 2px solid #00aaff;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.settings-form button:hover,
.battle-controls button:hover {
  background-color: #003366;
}

.soft-note {
  color: #a7bfd6;
  font-size: 13px;
  margin-top: 10px;
}

.settings-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-hero-panel {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, rgba(8, 20, 38, 0.92), rgba(3, 10, 20, 0.92));
  border-color: rgba(125, 211, 255, 0.46);
  box-shadow: inset 0 0 18px rgba(82, 187, 255, 0.08), 0 18px 34px rgba(0, 0, 0, 0.24);
}

.settings-card {
  background: linear-gradient(180deg, rgba(7, 16, 30, 0.94), rgba(3, 10, 20, 0.9));
  border-color: rgba(125, 211, 255, 0.3);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.settings-card-wide {
  grid-column: span 2;
}

.settings-panel h2 {
  margin-bottom: 14px;
}

#passwordForm {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#passwordForm #currentPassword {
  grid-column: 1 / -1;
}

#passwordForm button {
  grid-column: 1 / -1;
}

.battle-controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.battle-controls button {
  width: 100%;
  padding: 8px 6px;
  background-color: #002244;
  border: 2px solid #00aaff;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.battle-controls button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.combat-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.combat-card {
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.95), rgba(4, 11, 23, 0.95));
  border: 1px solid rgba(125, 211, 255, 0.28);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 24px rgba(0, 6, 14, 0.25);
}

.combat-player {
  position: relative;
}

.world-battle-panel {
  position: relative;
}

.combat-consumable-dock {
  position: absolute;
  left: -84px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 16;
  display: grid;
  justify-items: center;
  align-items: center;
  pointer-events: none;
}

.combat-consumable-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(124, 211, 255, 0.48);
  background: radial-gradient(circle at 32% 30%, rgba(89, 189, 255, 0.3), rgba(6, 18, 33, 0.98));
  color: #cde9ff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.combat-consumable-core.is-active {
  color: #eafff6;
  border-color: rgba(130, 244, 176, 0.62);
  box-shadow: 0 0 0 1px rgba(130, 244, 176, 0.2), 0 12px 24px rgba(0, 0, 0, 0.36);
}

.combat-consumable-flyout {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.combat-consumable-dock .combat-consumable-button {
  position: absolute;
  left: 0;
  top: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.74);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.18s ease;
  pointer-events: none;
}

.combat-consumable-dock:hover .combat-consumable-button:not(.hidden),
.combat-consumable-dock:focus-within .combat-consumable-button:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.combat-consumable-dock:hover #battleConsumable1:not(.hidden),
.combat-consumable-dock:focus-within #battleConsumable1:not(.hidden) {
  transform: translate(26px, -62px) scale(1);
}

.combat-consumable-dock:hover #battleConsumable2:not(.hidden),
.combat-consumable-dock:focus-within #battleConsumable2:not(.hidden) {
  transform: translate(26px, 12px) scale(1);
}

.combat-consumable-dock-empty .combat-consumable-core {
  opacity: 0.62;
}

.combat-consumable-dock-empty .combat-consumable-button {
  display: none;
}

.combat-consumable-button {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(124, 211, 255, 0.45);
  background: linear-gradient(180deg, rgba(9, 22, 39, 0.96), rgba(4, 13, 24, 0.94));
  cursor: pointer;
  overflow: visible;
}

.combat-consumable-button.is-empty {
  border-style: dashed;
  opacity: 0.72;
}

.combat-consumable-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.combat-consumable-slot {
  position: absolute;
  left: 6px;
  top: 5px;
  font-size: 11px;
  color: #d9efff;
  font-weight: 700;
}

.combat-consumable-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.combat-consumable-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a7c7dd;
  font-size: 20px;
  font-weight: 700;
}

.combat-consumable-amount {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 20px;
  height: 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.combat-consumable-hint {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 32;
  width: 240px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(124, 211, 255, 0.52);
  background: rgba(4, 11, 21, 0.96);
  color: #d8efff;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  display: none;
  pointer-events: none;
}

.combat-consumable-button:hover .combat-consumable-hint,
.combat-consumable-button:focus-visible .combat-consumable-hint {
  display: block;
}

.combat-card h3 {
  margin: 0;
  color: #d7eeff;
  font-size: 14px;
}

.combat-state {
  margin: 0;
  color: #a7d7ff;
  font-size: 12px;
  line-height: 1.35;
}

.combat-enemy {
  position: relative;
  overflow: hidden;
}

.combat-resource {
  display: grid;
  gap: 4px;
}

.combat-resource-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #cfe6ff;
  font-size: 12px;
}

.combat-resource-track {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 255, 0.35);
  background: linear-gradient(180deg, rgba(2, 8, 16, 0.92), rgba(7, 14, 26, 0.78));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), inset 0 -2px 6px rgba(0, 0, 0, 0.5);
}

.hp-change-pop {
  position: fixed;
  z-index: 65;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 17px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  animation: enemyDamagePop 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  pointer-events: none;
}

.hp-change-pop.damage {
  color: #ff8d8d;
}

.hp-change-pop.heal {
  color: #79f2a1;
}

.combat-resource-fill {
  height: 100%;
  width: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.3), 0 0 12px rgba(181, 219, 255, 0.2);
}

.resource-hp-fill {
  background: linear-gradient(90deg, #5e0f19, #d43142, #ff7782);
}

.resource-mana-fill {
  background: linear-gradient(90deg, #123366, #2b80d7, #8bcaff);
}

.resource-energy-fill {
  background: linear-gradient(90deg, #5c3b00, #d99516, #ffd36a);
}

.resource-enemy-fill {
  background: linear-gradient(90deg, #4d0b18, #cc2941, #ff6c7c);
}

.mmorpg-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.mmorpg-controls button {
  min-height: 40px;
}

.combat-log-wrap {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.combat-log-wrap strong {
  color: #9fdfff;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.combat-log {
  margin: 0;
  padding: 10px 12px 10px 24px;
  border: 1px solid rgba(125, 211, 255, 0.25);
  border-radius: 6px;
  background: rgba(1, 8, 18, 0.84);
  max-height: 210px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.combat-log li {
  color: #d8e9ff;
  font-size: 12px;
  line-height: 1.35;
}

.loot-feed {
  position: fixed;
  left: 12px;
  top: 110px;
  z-index: 52;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.loot-feed-tile {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 255, 0.22);
  background: linear-gradient(180deg, rgba(7, 16, 30, 0.96), rgba(2, 9, 18, 0.96));
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
  transform: translateX(calc(-100% - 26px));
  opacity: 0;
  pointer-events: auto;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.loot-feed-tile-visible {
  transform: translateX(0);
  opacity: 1;
}

.loot-feed-tile-exit {
  transform: translateX(calc(-100% - 26px));
  opacity: 0;
}

.loot-feed-icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(8, 17, 31, 0.9);
  border: 1px solid rgba(125, 211, 255, 0.2);
  overflow: hidden;
}

.loot-feed-frame,
.loot-feed-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loot-feed-icon {
  inset: 12%;
  width: 76%;
  height: 76%;
  z-index: 2;
}

.loot-feed-frame {
  z-index: 1;
}

.loot-feed-currency-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #eef9ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  z-index: 2;
}

.loot-feed-icon-gold .loot-feed-currency-badge {
  background: linear-gradient(180deg, #f3c861, #8f6416);
}

.loot-feed-icon-silver .loot-feed-currency-badge {
  background: linear-gradient(180deg, #d6e0ea, #6f7c89);
}

.loot-feed-icon-xp .loot-feed-currency-badge {
  background: linear-gradient(180deg, #6bcfff, #2458b7);
}

.loot-feed-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.loot-feed-title {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.loot-feed-meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #98b8d1;
}

.loot-feed-timer {
  position: relative;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.loot-feed-timer-bar {
  width: 100%;
  height: 100%;
  transform-origin: right center;
  background: linear-gradient(90deg, rgba(125, 211, 255, 0.95), rgba(32, 123, 255, 0.7));
}

.loot-feed-timer-bar-running {
  animation: lootTimerShrink 5.2s linear forwards;
}

.loot-feed-tile-autodelete {
  border-style: dashed;
  opacity: 0.88;
}

.loot-feed-tile.rarity-common .loot-feed-title {
  color: #b4b7bd;
}

.loot-feed-tile.rarity-uncommon .loot-feed-title {
  color: #53d16d;
}

.loot-feed-tile.rarity-rare .loot-feed-title {
  color: #58a8ff;
}

.loot-feed-tile.rarity-epic .loot-feed-title {
  color: #b26cff;
}

.loot-feed-tile.rarity-legendary .loot-feed-title {
  color: #f3c861;
}

.loot-feed-tile.rarity-mythical .loot-feed-title {
  color: #d22f5a;
}

@keyframes lootTimerShrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@keyframes enemyDamagePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -42px) scale(0.95);
  }
}

.map-hover-rail {
  position: fixed;
  right: -150px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 188px;
  display: grid;
  grid-template-columns: 38px 1fr;
  border: 1px solid rgba(125, 211, 255, 0.38);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  background: rgba(4, 11, 24, 0.95);
  transition: right 0.3s ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.map-hover-rail:hover,
.map-hover-rail.panel-open {
  right: 0;
}

.map-hover-handle {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  color: #9fdfff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(0, 99, 168, 0.65), rgba(0, 35, 70, 0.92));
  padding: 10px 0;
}

.map-hover-option {
  border: 0;
  background: transparent;
  color: #e0f4ff;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.map-hover-option:hover {
  background: rgba(36, 129, 210, 0.18);
}

.area-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(2, 7, 14, 0.62);
}

.area-picker-panel {
  position: fixed;
  top: 72px;
  right: 22px;
  width: min(380px, calc(100vw - 26px));
  max-height: calc(100vh - 130px);
  overflow: auto;
  z-index: 50;
  background: linear-gradient(180deg, rgba(7, 16, 30, 0.98), rgba(4, 9, 18, 0.96));
  border: 1px solid rgba(125, 211, 255, 0.44);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.5);
}

.area-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.area-picker-header h3 {
  margin: 0;
  color: #d8efff;
  font-size: 16px;
}

.area-picker-close {
  border: 1px solid rgba(125, 211, 255, 0.55);
  border-radius: 6px;
  padding: 6px 10px;
  background: rgba(0, 47, 84, 0.72);
  color: #d8efff;
  cursor: pointer;
  font-weight: 600;
}

.area-picker-close:hover {
  background: rgba(0, 67, 120, 0.75);
}

.changelog-list {
  margin: 10px 0 0;
  padding-left: 0;
  display: grid;
  gap: 12px;
  list-style: none;
}

.changelog-page {
  max-width: 980px;
}

.changelog-panel {
  background:
    radial-gradient(circle at top right, rgba(0, 170, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(8, 18, 34, 0.96), rgba(4, 10, 20, 0.92));
  border-color: rgba(125, 211, 255, 0.42);
  box-shadow: inset 0 0 22px rgba(0, 170, 255, 0.08), 0 20px 36px rgba(0, 0, 0, 0.24);
}

.changelog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.changelog-hero-copy {
  display: grid;
  gap: 10px;
}

.changelog-hero-copy h2 {
  margin-bottom: 0;
}

.changelog-version-pill {
  align-self: start;
  justify-self: end;
  min-height: 36px;
  min-width: 140px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 255, 0.42);
  background: linear-gradient(180deg, rgba(0, 58, 108, 0.82), rgba(0, 30, 60, 0.9));
  color: #d8efff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.changelog-connection-status {
  min-height: 24px;
  color: #f4d27a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.changelog-connection-status.error {
  color: #ff6b6b;
}

.changelog-timeline {
  position: relative;
}

.changelog-entry-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 255, 0.2);
  background: linear-gradient(180deg, rgba(6, 15, 28, 0.92), rgba(2, 9, 18, 0.9));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.changelog-entry-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 255, 0.35);
  background: linear-gradient(180deg, rgba(0, 55, 102, 0.9), rgba(0, 29, 56, 0.92));
  color: #9fe3ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.changelog-entry-body {
  color: #dcecff;
  font-size: 14px;
  line-height: 1.55;
}

.changelog-entry-empty {
  grid-template-columns: 1fr;
  color: #dcecff;
}

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

.footer {
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
  padding: 8px 15px;
  font-size: 14px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 3;
  box-shadow: inset 0 3px 10px rgba(0, 170, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-xp-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 35px;
  height: 9px;
  z-index: 4;
  background: rgba(0, 0, 0, 0.72);
  border-top: 1px solid rgba(125, 211, 255, 0.35);
  border-bottom: 1px solid rgba(125, 211, 255, 0.25);
  overflow: hidden;
}

.footer-xp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0d3267, #2b8cff, #a7ddff);
  box-shadow: 0 0 14px rgba(43, 140, 255, 0.8);
  transition: width 0.35s ease;
}

.footer-xp-text {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  color: #bfe8ff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

.footer-user {
  color: #9fdfff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-footer-xp {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #bfe8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.footer-copy {
  color: #d8e9ff;
  text-align: right;
  white-space: nowrap;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.footer-cache-button {
  padding: 4px 8px;
  border: 1px solid rgba(125, 211, 255, 0.55);
  border-radius: 5px;
  background: rgba(0, 34, 68, 0.9);
  color: #d8e9ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.footer-cache-button:hover {
  border-color: #00aaff;
  color: #fff;
}

.footer-cache-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .header {
    flex-direction: column;
    gap: 10px;
  }

  .login-language-wrap {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
  }

  .nav {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-logout {
    margin-left: 0;
    width: 100%;
  }

  .top-buttons {
    flex-direction: column;
  }

  #loginLanguage {
    max-width: none;
    width: 100%;
  }

  .split,
  .actions-grid,
  .inline-buttons,
  .battle-controls {
    grid-template-columns: 1fr;
  }

  .changelog-hero {
    grid-template-columns: 1fr;
  }

  .changelog-version-pill {
    justify-self: start;
    min-width: 0;
  }

  .changelog-entry-card {
    grid-template-columns: 1fr;
  }

  .settings-dashboard {
    grid-template-columns: 1fr;
  }

  .settings-card-wide {
    grid-column: auto;
  }

  #passwordForm {
    grid-template-columns: 1fr;
  }

  #passwordForm #currentPassword,
  #passwordForm button {
    grid-column: auto;
  }

  .inventory-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-delete-actions {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    flex-direction: column;
  }

  .profile-hero-identity {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .profile-hero-class-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    padding: 7px;
  }

  .profile-hero-chips {
    justify-content: flex-start;
    max-width: none;
  }

  .profile-footer-xp {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    text-align: center;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  .area-intel-grid {
    grid-template-columns: 1fr;
  }

  .travel-info-grid {
    grid-template-columns: 1fr;
  }

  .world-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .combat-stage {
    grid-template-columns: 1fr;
  }

  .combat-player {
    padding-left: 10px;
  }

  .combat-consumable-dock {
    position: static;
    transform: none;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    margin-bottom: 8px;
    pointer-events: auto;
  }

  .combat-consumable-flyout {
    position: static;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, 58px);
    gap: 8px;
    margin-top: 8px;
  }

  .combat-consumable-dock .combat-consumable-button {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .combat-consumable-dock-empty .combat-consumable-flyout {
    display: none;
  }

  .combat-consumable-hint {
    left: 0;
    top: calc(100% + 8px);
    transform: none;
    width: min(250px, calc(100vw - 48px));
  }

  .map-hover-rail {
    top: auto;
    bottom: 92px;
    transform: none;
  }

  .area-picker-panel {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 92px;
    width: auto;
    max-height: 60vh;
  }
}
