﻿:root {
  --bg: #111316;
  --panel: #191d24;
  --panel-2: #202632;
  --ink: #f1efe6;
  --muted: #a8acb8;
  --line: #343b48;
  --gold: #f7b733;
  --teal: #48d1b5;
  --red: #ee5b5b;
  --green: #69d27b;
  --violet: #9b7cf0;
  --blue: #6ab7ff;
  --shadow: rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 16%, rgba(72, 209, 181, 0.13), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(247, 183, 51, 0.11), transparent 28%),
    var(--bg);
  background-size: 8px 8px, 8px 8px, auto, auto, auto;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: #0d121a;
  font: inherit;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(72, 209, 181, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
}

.entry-screen {
  min-height: calc(100vh - 28px);
  display: grid;
  align-content: center;
  gap: 16px;
}

.entry-brand {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.entry-brand h1 {
  font-size: clamp(34px, 6vw, 64px);
}

.entry-brand p,
.character-header p,
.class-card p {
  color: var(--muted);
}

.crest.large {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

.auth-layout {
  width: min(880px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-card,
.creator-card,
.saved-characters {
  padding: 14px;
}

.auth-card {
  display: grid;
  gap: 12px;
}

.character-header {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.character-header h1 {
  font-size: 28px;
}

.saved-characters,
.creator-card {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.saved-character-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 82px 1fr;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.saved-character-card .sprite-asset {
  width: 78px;
  height: 78px;
  object-fit: contain;
  image-rendering: pixelated;
}

.saved-character-card button {
  grid-column: 1 / -1;
}

.creator-top {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.gender-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.gender-option {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #111722;
  cursor: pointer;
  font-weight: 800;
}

.gender-option.active {
  color: #06110f;
  background: var(--teal);
  border-color: #0b0d10;
}

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

.class-card {
  position: relative;
  min-height: 520px;
  display: grid;
  grid-template-rows: 174px 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #121822;
  cursor: pointer;
}

.class-card.active,
.class-card:hover {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(247, 183, 51, 0.22);
}

.class-card .sprite-asset {
  align-self: end;
  justify-self: center;
  width: 164px;
  height: 164px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 7px 0 rgba(0, 0, 0, 0.28));
}

.class-select-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.class-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
}

.class-body h3 {
  font-size: 17px;
}

.class-body p {
  min-height: 58px;
  font-size: 12px;
  line-height: 1.35;
}

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

.class-stats span,
.pros-cons span {
  display: block;
  min-height: 26px;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d121a;
  color: var(--muted);
  font-size: 11px;
}

.pros-cons {
  display: grid;
  gap: 8px;
}

.pros-cons div {
  display: grid;
  gap: 5px;
}

.pros-cons strong {
  color: var(--ink);
  font-size: 12px;
}

.create-character-btn {
  width: min(360px, 100%);
  margin-top: 14px;
}

.compact-btn {
  min-width: 92px;
  padding-inline: 12px;
}

.strong-empty {
  font-weight: 700;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(25, 29, 36, 0.92);
  box-shadow: 0 12px 28px var(--shadow);
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.crest {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #111316;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  border: 2px solid #000;
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.22);
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.identity p,
.combat-header p,
.profile-card p {
  color: var(--muted);
  font-size: 12px;
}

.top-stats {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.threat-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #0f1218;
  font-size: 12px;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(420px, 1fr) minmax(260px, 330px);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(25, 29, 36, 0.94);
  box-shadow: 0 12px 28px var(--shadow);
}

.side-panel,
.combat-panel,
.encounter-panel {
  padding: 12px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.combat-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel-head,
.combat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h2,
.combat-header h2 {
  font-size: 15px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.quests-head {
  margin-top: 4px;
}

.zone-list,
.quest-list,
.encounter-list,
.inventory-list,
.equipment-list {
  display: grid;
  gap: 8px;
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 9px;
}

.zone-card,
.encounter-card {
  cursor: pointer;
}

.zone-card:hover,
.encounter-card:hover,
.zone-card.active,
.encounter-card.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(72, 209, 181, 0.18);
}

.zone-card h3,
.quest-card h3,
.encounter-card h3,
.item-row h3 {
  font-size: 13px;
  margin-bottom: 4px;
}

.tiny {
  color: var(--muted);
  font-size: 11px;
}

.bar {
  height: 9px;
  border: 1px solid #090b0e;
  background: #0a0c10;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: var(--fill, var(--green));
  transition: width 0.25s ease;
}

.quest-card.done {
  border-color: rgba(105, 210, 123, 0.58);
}

.quest-reward,
.rarity {
  color: var(--gold);
  font-weight: 700;
}

.arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 72px minmax(150px, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 300px;
  padding: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(72, 209, 181, 0.06), transparent 34%),
    #111722;
  overflow: hidden;
}

.combatant {
  position: relative;
  min-height: 274px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.combatant h3 {
  font-size: 13px;
  text-align: center;
}

.sprite-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
}

.sprite-wrap .sprite-asset {
  width: clamp(92px, 13vw, 148px);
  height: clamp(92px, 13vw, 148px);
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.24));
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.sprite-wrap .assassin-attack-sprite {
  width: clamp(168px, 24vw, 280px);
  height: clamp(118px, 17vw, 196px);
  max-width: 94%;
  object-fit: contain;
  image-rendering: auto;
  transform: translateX(12px);
  z-index: 3;
}

.sprite-wrap .mage-attack-sprite {
  width: clamp(172px, 25vw, 292px);
  height: clamp(118px, 17vw, 196px);
  max-width: 94%;
  object-fit: contain;
  image-rendering: auto;
  transform: translateX(6px);
  z-index: 3;
}

.pet {
  position: absolute;
  bottom: 14px;
  right: 12%;
  width: clamp(42px, 5vw, 58px);
  height: clamp(42px, 5vw, 58px);
  z-index: 2;
}

.hp-readout {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

.turn-lane {
  display: grid;
  place-items: center;
}

.turn-track {
  width: 4px;
  height: 78%;
  background: repeating-linear-gradient(to bottom, var(--line), var(--line) 10px, transparent 10px, transparent 18px);
}

.damage-float {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-weight: 900;
  text-shadow: 0 2px #000;
  animation: float-damage 0.9s ease forwards;
  pointer-events: none;
}

.hero-side.strike .sprite-wrap {
  animation: strike-right 0.32s ease;
}

.enemy-side.strike .sprite-wrap {
  animation: strike-left 0.32s ease;
}

.hit .sprite-wrap {
  animation: hurt-flash 0.35s ease;
}

.ability-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.game-btn,
.icon-btn {
  min-height: 38px;
  border: 1px solid #0b0d10;
  background: var(--gold);
  color: #16140c;
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.18);
  font-weight: 800;
  cursor: pointer;
}

.game-btn.secondary {
  background: var(--panel-2);
  color: var(--ink);
  border-color: var(--line);
}

.game-btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.game-btn.auto-active {
  background: var(--teal);
  color: #06110f;
}

.combat-log {
  height: 132px;
  margin-top: 10px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #0c0f14;
  color: #d7d2c2;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.log-line {
  margin-bottom: 4px;
}

.encounter-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.encounter-card {
  min-height: 128px;
  display: grid;
  gap: 5px;
}

.encounter-card .mini-sprite {
  width: 48px;
  height: 48px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.avatar-frame {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #0b0d10;
  background: #10151f;
}

.avatar-frame img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #111722;
}

.sprite-swatch {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 6px 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d121a;
}

.sprite-swatch img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-swatch span {
  max-width: 100%;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

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

.stat-tile {
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #111722;
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat-tile strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.equipment-row,
.item-row {
  display: grid;
  gap: 6px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #111722;
  color: var(--ink);
  cursor: pointer;
}

.empty {
  color: var(--muted);
  padding: 10px;
  border: 1px dashed var(--line);
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  top: 92px;
  left: 50%;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #090b0f;
  box-shadow: 0 12px 28px var(--shadow);
  animation: toast-in 2.5s ease forwards;
  font-weight: 700;
}

@keyframes float-damage {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.82);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -14px) scale(1.18);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56px) scale(1);
  }
}

@keyframes strike-right {
  50% {
    transform: translateX(26px) scale(1.04);
  }
}

@keyframes strike-left {
  50% {
    transform: translateX(-26px) scale(1.04);
  }
}

@keyframes hurt-flash {
  30% {
    filter: brightness(2.4) saturate(0.4);
  }
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  12%,
  82% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr);
  }

  .class-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-grid > .side-panel:last-child {
    grid-column: 1 / -1;
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 8px;
  }

  .auth-layout,
  .creator-top,
  .saved-character-grid,
  .class-grid {
    grid-template-columns: 1fr;
  }

  .character-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .class-card {
    min-height: 0;
    grid-template-columns: 132px 1fr;
    grid-template-rows: auto;
  }

  .class-card .sprite-asset {
    width: 126px;
    height: 126px;
  }

  .class-body p {
    min-height: 0;
  }

  .topbar,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-stats {
    justify-content: flex-start;
  }

  .game-grid {
    display: grid;
  }

  .arena {
    grid-template-columns: 1fr;
  }

  .turn-lane {
    display: none;
  }

  .ability-bar,
  .encounter-list,
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .ability-bar,
  .encounter-list,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .gender-toggle,
  .class-stats {
    grid-template-columns: 1fr;
  }

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

  .identity {
    min-width: 0;
  }
}

/* Medieval premium skin */
:root {
  --bg: #090705;
  --panel: rgba(28, 22, 16, 0.92);
  --panel-2: rgba(41, 31, 21, 0.95);
  --ink: #f7ead3;
  --muted: #b9a789;
  --line: rgba(221, 169, 91, 0.28);
  --gold: #f2b84d;
  --teal: #65d883;
  --red: #d44a4a;
  --green: #65d883;
  --violet: #9b66ff;
  --blue: #67d7ff;
  --shadow: rgba(0, 0, 0, 0.48);
  --radius: 18px;
  --line-strong: rgba(255, 201, 103, 0.58);
  --gold-2: #ffdc86;
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(242, 184, 77, 0.18), transparent 32rem),
    radial-gradient(circle at 82% 22%, rgba(101, 216, 131, 0.08), transparent 30rem),
    radial-gradient(circle at 20% 75%, rgba(103, 215, 255, 0.06), transparent 28rem),
    linear-gradient(180deg, #11100f 0%, #090705 60%, #040302 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.app-shell {
  width: min(1760px, calc(100% - 28px));
  margin: 14px auto 36px;
  padding: 0;
}

.panel,
.topbar,
.auth-card,
.creator-card,
.saved-characters {
  border-color: var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 230, 164, 0.055), transparent 120px),
    linear-gradient(180deg, var(--panel), rgba(13, 10, 8, 0.94));
  box-shadow: 0 18px 50px var(--shadow), inset 0 0 0 1px rgba(255, 226, 158, 0.08);
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  min-height: 80px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  padding: 14px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 223, 143, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(38, 29, 20, 0.96), rgba(17, 13, 10, 0.96));
  backdrop-filter: blur(14px);
}

.identity {
  min-width: 0;
}

.crest {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #141007;
  background:
    radial-gradient(circle at 34% 28%, #fff4bf, transparent 20%),
    linear-gradient(145deg, #e8b349, #95ce60 48%, #334a25);
  border: 1px solid rgba(255, 231, 161, 0.8);
  box-shadow: 0 0 28px rgba(242, 184, 77, 0.28);
}

.crest.large {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

h1,
.entry-brand h1,
.character-header h1,
.panel-head h2,
.combat-header h2,
.profile-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.entry-brand {
  padding-top: 20px;
}

.entry-brand h1 {
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.auth-card,
.creator-card,
.saved-characters {
  padding: 18px;
}

input {
  border-color: rgba(255, 215, 143, 0.18);
  border-radius: 12px;
  background: rgba(2, 2, 2, 0.34);
}

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(242, 184, 77, 0.12);
}

.game-btn,
.icon-btn,
.btn,
.row-actions button {
  min-height: 42px;
  border: 1px solid rgba(255, 228, 154, 0.48);
  border-radius: 12px;
  color: #1b1005;
  background: linear-gradient(180deg, #ffdf83, #d6912e);
  box-shadow: 0 8px 22px rgba(242, 184, 77, 0.16), inset 0 -4px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.game-btn:hover,
.row-actions button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.game-btn.secondary,
.row-actions button,
.gender-option {
  color: var(--ink);
  border-color: rgba(255, 215, 143, 0.22);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.game-btn.auto-active,
.gender-option.active {
  color: #1b1005;
  border-color: rgba(255, 228, 154, 0.76);
  background: linear-gradient(180deg, #ffdf83, #d6912e);
}

.chip,
.threat-pill,
.panel-head span {
  border-color: rgba(255, 215, 143, 0.22);
  border-radius: 12px;
  background: rgba(2, 2, 2, 0.36);
  color: var(--gold-2);
  font-weight: 900;
}

.game-grid {
  grid-template-columns: 290px minmax(0, 1fr) 330px;
}

.side-panel,
.combat-panel,
.encounter-panel {
  padding: 0;
}

.panel-head,
.combat-header {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 215, 143, 0.12);
}

.zone-list,
.quest-list,
.equipment-list,
.inventory-list,
.sprite-gallery,
.stat-grid,
.profile-card {
  margin: 12px;
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row,
.stat-tile,
.sprite-swatch,
.profile-card,
.saved-character-card,
.class-card {
  border-color: rgba(255, 215, 143, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row {
  padding: 12px;
}

.zone-card {
  position: relative;
  overflow: hidden;
}

.zone-card::before,
.class-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 90% 0%, rgba(242, 184, 77, 0.18), transparent 46%);
  transition: opacity 0.18s ease;
}

.zone-card:hover,
.zone-card.active,
.encounter-card:hover,
.encounter-card.active,
.class-card:hover,
.class-card.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(242, 184, 77, 0.12);
}

.zone-card.active::before,
.class-card.active::before {
  opacity: 1;
}

.bar {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.bar span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.combat-header {
  display: grid;
  grid-template-columns: 1fr auto;
  background:
    radial-gradient(circle at 20% 0%, rgba(242, 184, 77, 0.15), transparent 25rem),
    rgba(255, 255, 255, 0.025);
}

.arena {
  margin: 14px;
  min-height: 380px;
  padding: clamp(14px, 2vw, 28px);
  border-color: rgba(255, 215, 143, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.72)),
    radial-gradient(ellipse at center 74%, rgba(242, 184, 77, 0.16), transparent 38%),
    radial-gradient(circle at 20% 28%, rgba(82, 166, 255, 0.16), transparent 9rem),
    radial-gradient(circle at 80% 28%, rgba(82, 166, 255, 0.13), transparent 9rem),
    linear-gradient(180deg, #151820 0%, #10100f 46%, #080706 100%);
}

.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 88%, rgba(242, 184, 77, 0.14), transparent 7rem),
    radial-gradient(circle at 88% 88%, rgba(212, 74, 74, 0.12), transparent 8rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.4), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.4));
}

.combatant {
  z-index: 1;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.55));
}

.combatant h3 {
  font-size: 14px;
  text-shadow: 0 2px 0 #000;
}

.sprite-wrap {
  min-height: 190px;
}

.sprite-wrap .sprite-asset {
  width: clamp(132px, 16vw, 188px);
  height: clamp(132px, 16vw, 188px);
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.45));
  animation: breathe 2.7s ease-in-out infinite;
}

.pet {
  width: clamp(54px, 6vw, 74px);
  height: clamp(54px, 6vw, 74px);
}

.turn-lane {
  z-index: 2;
}

.turn-track {
  display: none;
}

.turn-lane::after {
  content: "VS";
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 231, 171, 0.85);
  border-radius: 50%;
  color: #1d1004;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 950;
  background: linear-gradient(180deg, #ffe196, #c47b22);
  box-shadow: 0 0 34px rgba(242, 184, 77, 0.3);
}

.ability-bar {
  padding: 0 14px 14px;
  margin-top: 0;
}

.combat-log {
  min-height: 155px;
  height: 155px;
  margin: 0 14px 14px;
  border-color: rgba(255, 215, 143, 0.14);
  border-radius: 16px;
  background: rgba(2, 2, 2, 0.46);
  color: #e8dcc6;
}

.encounter-panel .panel-head {
  border-bottom: 0;
}

.encounter-list {
  padding: 0 14px 14px;
}

.encounter-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  min-height: 92px;
  align-items: center;
}

.encounter-card .mini-sprite {
  width: 54px;
  height: 54px;
}

.profile-card {
  border-radius: 16px;
  background:
    radial-gradient(circle at 22% 25%, rgba(101, 216, 131, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.045);
}

.avatar-frame,
.party-slot,
.sprite-swatch {
  border-color: rgba(255, 215, 143, 0.15);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 25%, rgba(101, 216, 131, 0.2), transparent 50%),
    rgba(0, 0, 0, 0.3);
}

.avatar-frame img {
  width: 62px;
  height: 62px;
}

.sprite-gallery {
  border-radius: 16px;
  background: transparent;
  border: 0;
  padding: 0;
}

.stat-tile {
  min-height: 62px;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.25);
}

.stat-tile span {
  font-weight: 850;
  text-transform: uppercase;
}

.class-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 4%, rgba(242, 184, 77, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.04);
}

.class-card .sprite-asset {
  z-index: 1;
}

.class-stats span,
.pros-cons span {
  border-color: rgba(255, 215, 143, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.012);
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 18px, 760px);
  }

  .topbar {
    grid-template-columns: 1fr;
    position: static;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .arena {
    grid-template-columns: 1fr;
    min-height: 540px;
  }

  .turn-lane {
    display: grid;
  }

  .turn-lane::after {
    margin: -8px auto;
  }

  .ability-bar {
    grid-template-columns: 1fr 1fr;
  }

  .ability-bar .game-btn:last-child {
    grid-column: 1 / -1;
  }

  .encounter-list {
    grid-template-columns: 1fr;
  }
}

/* Login scene background */
#authScreen.entry-screen {
  width: 100%;
  min-height: 100vh;
  margin-left: 0;
  margin-top: 0;
  padding: clamp(270px, 32vw, 390px) 18px 42px;
  align-content: start;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(2, 2, 3, 0.05) 0%, rgba(2, 2, 3, 0.08) 34%, rgba(2, 2, 3, 0.72) 68%, rgba(2, 2, 3, 0.92) 100%),
    url("./assets/backgrounds/login-nocthara.png") center top / cover no-repeat;
}

.app-shell:has(#authScreen:not([hidden])) {
  width: 100%;
  margin: 0;
}

#authScreen .entry-brand {
  width: min(760px, 100%);
  min-height: 0;
  padding: 0;
}

#authScreen .entry-brand .crest,
#authScreen .entry-brand h1,
#authScreen .entry-brand p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#authScreen .auth-layout {
  width: min(760px, calc(100vw - 28px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  align-items: stretch;
  gap: 18px;
}

#authScreen .auth-card {
  position: relative;
  isolation: isolate;
  min-height: 292px;
  padding: 60px 18px 16px;
  border: 4px solid #d9a747;
  border-radius: 0;
  outline: 3px solid rgba(23, 11, 5, 0.96);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 228, 137, 0.12), transparent 30%),
    radial-gradient(circle at 80% 85%, rgba(118, 56, 18, 0.28), transparent 34%),
    linear-gradient(90deg, rgba(255, 220, 134, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 220, 134, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(71, 45, 28, 0.96), rgba(20, 13, 9, 0.98) 62%, rgba(7, 5, 4, 0.98));
  background-size: auto, auto, 9px 9px, 9px 9px, auto;
  box-shadow:
    0 0 0 2px rgba(255, 238, 170, 0.18) inset,
    0 0 0 8px rgba(58, 35, 17, 0.92),
    0 0 0 11px rgba(222, 169, 72, 0.55),
    0 12px 0 rgba(0, 0, 0, 0.72),
    12px 12px 0 rgba(0, 0, 0, 0.36);
  backdrop-filter: none;
  image-rendering: pixelated;
}

#authScreen .auth-card::selection {
  background: rgba(255, 218, 118, 0.34);
}

#authScreen .auth-card::before,
#authScreen .auth-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 32px;
  height: 32px;
  pointer-events: none;
  background:
    linear-gradient(#ffe58d, #ffe58d) left top / 32px 5px no-repeat,
    linear-gradient(#ffe58d, #ffe58d) left top / 5px 32px no-repeat,
    linear-gradient(135deg, #5a2c0b 0 50%, transparent 51%) right bottom / 13px 13px no-repeat;
}

#authScreen .auth-card::before {
  left: 10px;
  top: 10px;
}

#authScreen .auth-card::after {
  right: 10px;
  bottom: 10px;
  transform: rotate(180deg);
}

#authScreen .auth-card .panel-head {
  position: absolute;
  z-index: 2;
  left: 34px;
  right: 34px;
  top: -18px;
  display: block;
  min-height: 60px;
  padding: 8px 14px 8px;
  border: 4px solid #d9a747;
  border-radius: 0;
  outline: 3px solid rgba(22, 10, 5, 0.95);
  background:
    linear-gradient(90deg, transparent 0 9px, rgba(255, 236, 159, 0.22) 9px 13px, transparent 13px calc(100% - 13px), rgba(255, 236, 159, 0.22) calc(100% - 13px) calc(100% - 9px), transparent calc(100% - 9px)),
    linear-gradient(180deg, #7c2aa3 0%, #3f115b 100%);
  box-shadow:
    0 0 0 2px rgba(255, 234, 155, 0.16) inset,
    0 6px 0 rgba(0, 0, 0, 0.46);
  text-align: center;
}

#authScreen #signupForm .panel-head {
  background:
    linear-gradient(90deg, transparent 0 9px, rgba(255, 236, 159, 0.22) 9px 13px, transparent 13px calc(100% - 13px), rgba(255, 236, 159, 0.22) calc(100% - 13px) calc(100% - 9px), transparent calc(100% - 9px)),
    linear-gradient(180deg, #128447 0%, #0b431e 100%);
}

#authScreen .auth-card .panel-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0;
  color: #ffeaa3;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #1b0d05,
    -1px -1px 0 rgba(255, 255, 214, 0.42);
}

#authScreen .auth-card .panel-head span {
  display: block;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  margin: 7px auto 0;
  padding: 2px 8px;
  border: 2px solid rgba(255, 227, 146, 0.48);
  border-radius: 0;
  color: #ffeaa3;
  background: rgba(0, 0, 0, 0.36);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

#authScreen .auth-card label {
  color: #ffe3a1;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

#authScreen .auth-card input {
  min-height: 45px;
  margin-top: 6px;
  border: 4px solid #d9a747;
  border-radius: 0;
  color: #fff2c8;
  background:
    linear-gradient(90deg, rgba(255, 218, 118, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 218, 118, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #140f0d, #050403);
  background-size: 8px 8px, 8px 8px, auto;
  box-shadow:
    0 0 0 2px rgba(41, 20, 6, 0.78) inset,
    0 4px 0 rgba(0, 0, 0, 0.45);
}

#authScreen .auth-card input:focus {
  border-color: #ffecaa;
  box-shadow:
    0 0 0 2px rgba(255, 235, 156, 0.22) inset,
    0 0 16px rgba(161, 66, 209, 0.36),
    0 4px 0 rgba(0, 0, 0, 0.45);
}

#authScreen #signupForm input:focus {
  box-shadow:
    0 0 0 2px rgba(255, 235, 156, 0.22) inset,
    0 0 16px rgba(58, 202, 99, 0.36),
    0 4px 0 rgba(0, 0, 0, 0.45);
}

#authScreen .auth-card .game-btn {
  min-height: 48px;
  margin-top: 6px;
  border: 4px solid #d9a747;
  border-radius: 0;
  color: #ffeaa3;
  background:
    linear-gradient(90deg, transparent 0 12px, rgba(255, 236, 159, 0.16) 12px 16px, transparent 16px calc(100% - 16px), rgba(255, 236, 159, 0.16) calc(100% - 16px) calc(100% - 12px), transparent calc(100% - 12px)),
    linear-gradient(180deg, #8a32b0 0%, #5d167d 48%, #2a0c3f 100%);
  box-shadow:
    0 6px 0 #1a0907,
    0 0 0 2px rgba(255, 246, 191, 0.2) inset;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #140606,
    -1px -1px 0 rgba(255, 255, 214, 0.28);
}

#authScreen .auth-card .game-btn.secondary {
  color: #ffeaa3;
  border-color: #d9a747;
  background:
    linear-gradient(90deg, transparent 0 12px, rgba(255, 236, 159, 0.16) 12px 16px, transparent 16px calc(100% - 16px), rgba(255, 236, 159, 0.16) calc(100% - 16px) calc(100% - 12px), transparent calc(100% - 12px)),
    linear-gradient(180deg, #178c4c 0%, #0f642f 48%, #062f15 100%);
}

#authScreen .auth-card .game-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

#authScreen .auth-card .game-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 3px 0 #1a0907,
    0 0 0 2px rgba(255, 246, 191, 0.2) inset;
}

@media (min-width: 1500px) {
  #authScreen.entry-screen {
    padding-top: 405px;
  }
}

@media (max-width: 980px) {
  #authScreen.entry-screen {
    padding-top: clamp(230px, 38vw, 330px);
    background-position: center top;
  }
}

@media (max-width: 680px) {
  #authScreen.entry-screen {
    padding-top: 250px;
    background-size: auto 100vh;
    background-position: center top;
    overflow-x: hidden;
  }

  #authScreen .auth-layout {
    width: min(344px, calc(100vw - 52px));
    grid-template-columns: 1fr;
  }
}

/* Image-backed login panels */
#authScreen.entry-screen {
  padding-top: clamp(255px, 25vw, 310px);
}

#authScreen .auth-layout {
  width: min(880px, calc(100vw - 24px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-items: center;
  align-items: start;
}

#authScreen .auth-card {
  width: min(430px, 100%);
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  overflow: visible;
  background: url("./assets/ui/login-panel.png") center top / contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.54));
}

#authScreen #signupForm.auth-card {
  background-image: url("./assets/ui/signup-panel.png");
}

#authScreen .auth-card::before,
#authScreen .auth-card::after,
#authScreen .auth-card .panel-head {
  display: none;
}

#authScreen .auth-card .panel-field,
#authScreen .auth-card .panel-check,
#authScreen .auth-card .game-btn {
  position: absolute;
  display: block;
  margin: 0;
}

#authScreen .auth-card .panel-field > span,
#authScreen .auth-card .panel-check > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#authScreen .auth-card .panel-field input {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  color: #ffe7a6;
  background: rgba(8, 5, 3, 0.18);
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.65vw, 18px);
  font-weight: 800;
  text-shadow: 2px 2px 0 #120805;
  caret-color: #ffdd7a;
}

#authScreen .auth-card .panel-field input:focus {
  outline: 2px solid rgba(255, 225, 124, 0.8);
  outline-offset: -4px;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 214, 92, 0.22) inset;
}

#authScreen #signupForm .panel-field input:focus {
  box-shadow: 0 0 18px rgba(62, 226, 104, 0.18) inset;
}

#authScreen #loginForm .email-field {
  left: 30.2%;
  top: 31.2%;
  width: 52.8%;
  height: 8.5%;
}

#authScreen #loginForm .password-field {
  left: 30.2%;
  top: 42.1%;
  width: 52.8%;
  height: 8.5%;
}

#authScreen #signupForm .email-field {
  left: 29.7%;
  top: 30.8%;
  width: 54.1%;
  height: 8.5%;
}

#authScreen #signupForm .password-field {
  left: 29.7%;
  top: 41.9%;
  width: 54.1%;
  height: 8.5%;
}

#authScreen .auth-card .panel-check input {
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

#authScreen .auth-card .panel-check::after {
  content: "";
  position: absolute;
  left: 25%;
  top: 16%;
  width: 48%;
  height: 30%;
  opacity: 0;
  border-left: 4px solid #ffe684;
  border-bottom: 4px solid #ffe684;
  background: none;
  filter: drop-shadow(1px 1px 0 #160806);
  pointer-events: none;
  transform: rotate(-45deg);
}

#authScreen .auth-card .panel-check:has(input:checked)::after {
  opacity: 1;
}

#authScreen #loginForm .remember-field {
  left: 18.2%;
  top: 53.25%;
  width: 4.4%;
  height: 4.4%;
}

#authScreen #signupForm .terms-field {
  left: 17.35%;
  top: 53.05%;
  width: 4.4%;
  height: 4.4%;
}

#authScreen .auth-card .game-btn {
  left: 24.2%;
  top: 61%;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
}

#authScreen .auth-card .game-btn.secondary {
  color: transparent;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

#authScreen .auth-card .game-btn:hover {
  transform: none;
  filter: drop-shadow(0 0 7px rgba(255, 223, 115, 0.9));
}

#authScreen .auth-card .game-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

#authScreen .auth-card .game-btn:focus-visible,
#authScreen .auth-card .panel-check input:focus-visible {
  outline: 2px solid rgba(255, 225, 124, 0.9);
  outline-offset: 3px;
}

@media (min-width: 1500px) {
  #authScreen.entry-screen {
    padding-top: 330px;
  }

  #authScreen .auth-layout {
    width: min(980px, calc(100vw - 24px));
  }

  #authScreen .auth-card {
    width: min(470px, 100%);
  }
}

@media (max-width: 980px) {
  #authScreen.entry-screen {
    padding-top: clamp(220px, 34vw, 285px);
  }

  #authScreen .auth-layout {
    width: min(800px, calc(100vw - 20px));
  }
}

@media (max-width: 760px) {
  #authScreen.entry-screen {
    padding-top: 245px;
    overflow-x: hidden;
  }

  #authScreen .auth-layout {
    width: min(430px, calc(100vw - 14px));
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #authScreen .auth-card {
    width: min(430px, 100%);
  }
}

/* Validated Nocthara UI assets */
.ui-icon {
  width: 19px;
  height: 19px;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -4px;
  background: center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #050302);
}

.ui-icon-gold {
  background-image: url("./assets/validated-ui/gold-crop.png");
}

.ui-icon-potion {
  width: 22px;
  height: 24px;
  vertical-align: -7px;
  background-image: url("./assets/validated-ui/potion-health-crop.png");
}

.quest-reward,
.inline-reward,
.potion-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.top-stats .chip {
  position: relative;
  min-height: 36px;
  padding: 7px 10px;
  border-color: rgba(214, 157, 61, 0.42);
  background:
    linear-gradient(180deg, rgba(43, 28, 17, 0.92), rgba(9, 7, 5, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 224, 133, 0.08);
}

.chip-gold::before,
.chip-hp::before,
.chip-xp::before {
  content: "";
  width: 20px;
  height: 20px;
  display: inline-block;
  margin-right: 3px;
  background: center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #050302);
}

.chip-gold::before {
  background-image: url("./assets/validated-ui/gold-crop.png");
}

.chip-hp::before {
  background-image: url("./assets/validated-ui/potion-health-crop.png");
}

.chip-xp::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffe46d 0 32%, #c58519 33% 64%, transparent 65%);
}

.game-btn,
.row-actions button,
.gender-option {
  min-height: 46px;
  padding: 8px 20px 10px;
  border: 0;
  color: #ffe8a8;
  background: url("./assets/validated-ui/button-gold-crop.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  text-shadow:
    2px 2px 0 #130805,
    -1px -1px 0 rgba(255, 255, 214, 0.22);
  image-rendering: pixelated;
}

.game-btn.secondary,
.row-actions button,
.gender-option {
  color: #f4dcff;
  background-image: url("./assets/validated-ui/button-purple-crop.png");
}

.game-btn.auto-active,
.gender-option.active {
  color: #edffd8;
  background-image: url("./assets/validated-ui/button-green-crop.png");
}

.game-btn:hover,
.row-actions button:hover,
.gender-option:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) drop-shadow(0 0 7px rgba(255, 223, 115, 0.38));
}

.game-btn:disabled,
.row-actions button:disabled {
  filter: grayscale(0.8) brightness(0.68);
  opacity: 0.62;
}

.bar {
  height: 14px;
  border: 0;
  padding: 3px 5px;
  background:
    linear-gradient(180deg, rgba(236, 180, 65, 0.5), rgba(65, 34, 12, 0.68)),
    #050403;
  box-shadow:
    0 0 0 1px rgba(255, 216, 120, 0.38),
    inset 0 0 0 1px rgba(0, 0, 0, 0.78);
}

.bar span {
  border-radius: 1px;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.22),
    inset 0 -2px rgba(0, 0, 0, 0.25);
}

.hp-readout .bar {
  height: 18px;
}

.asset-empty {
  min-height: 128px;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: 88px 10px 10px;
  text-align: center;
  background:
    url("./assets/validated-ui/chest.png") center 4px / 98px auto no-repeat,
    rgba(9, 7, 5, 0.42);
  image-rendering: pixelated;
}

#authScreen .auth-card .panel-check {
  background: url("./assets/validated-ui/checkbox-empty-crop.png") center / contain no-repeat;
  image-rendering: pixelated;
}

#authScreen .auth-card .panel-check::after {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: url("./assets/validated-ui/checkbox-checked-purple-crop.png") center / contain no-repeat;
  transform: none;
  filter: drop-shadow(1px 1px 0 #120805);
}

#authScreen #signupForm .terms-field::after {
  background-image: url("./assets/validated-ui/checkbox-checked-green-crop.png");
}

/* New official frame set */
#gameScreen .panel,
#characterScreen .panel {
  position: relative;
  border: 0;
  background:
    linear-gradient(180deg, rgba(28, 18, 12, 0.72), rgba(8, 6, 5, 0.8));
  box-shadow: none;
}

#gameScreen .panel::before,
#characterScreen .panel::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/validated-ui/panel-medium-frame.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.52));
}

#gameScreen .panel > *,
#characterScreen .panel > * {
  position: relative;
  z-index: 1;
}

#gameScreen .combat-panel::before,
#characterScreen .creator-card::before {
  inset: -18px;
  background-image: url("./assets/validated-ui/panel-large-frame.png");
}

#characterScreen .saved-characters::before,
#gameScreen .encounter-panel::before {
  background-image: url("./assets/validated-ui/panel-medium-frame.png");
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 142, 54, 0.1), transparent 42%),
    rgba(9, 7, 5, 0.62);
}

#gameScreen .side-panel {
  padding: 20px 18px;
}

#gameScreen .panel-head,
#gameScreen .combat-header,
#characterScreen .character-header {
  color: #ffe6a8;
  text-shadow: 2px 2px 0 #120805;
}

#gameScreen .zone-card,
#gameScreen .quest-card,
#gameScreen .encounter-card,
#gameScreen .item-row,
#gameScreen .equipment-row,
#gameScreen .profile-card,
#gameScreen .sprite-gallery,
#gameScreen .stat-tile,
#characterScreen .class-card,
#characterScreen .saved-character-card,
#characterScreen .stat-tile {
  border-color: rgba(221, 169, 78, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 128, 0.08), transparent 45%),
    rgba(10, 7, 5, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 135, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

#gameScreen .zone-card:hover,
#gameScreen .encounter-card:hover,
#gameScreen .zone-card.active,
#gameScreen .encounter-card.active,
#characterScreen .class-card:hover,
#characterScreen .class-card.active {
  border-color: rgba(255, 226, 144, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 135, 0.16),
    0 0 18px rgba(207, 154, 62, 0.2);
}

.game-btn,
.row-actions button,
.gender-option {
  min-height: 42px;
  padding: 8px 18px 10px;
  color: #ffe8a8;
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_dourado_normal_512x128.png");
}

.game-btn:hover,
.row-actions button:hover,
.gender-option:hover {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_dourado_hover_512x128.png");
}

.game-btn:active,
.row-actions button:active,
.gender-option:active {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_dourado_pressionado_512x128.png");
}

.game-btn:disabled,
.row-actions button:disabled {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_dourado_desativado_512x128.png");
}

.game-btn.secondary,
.row-actions button,
.gender-option {
  color: #f7e1ff;
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_roxo_normal_512x128.png");
}

.game-btn.secondary:hover,
.row-actions button:hover,
.gender-option:hover {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_roxo_hover_512x128.png");
}

.game-btn.secondary:active,
.row-actions button:active,
.gender-option:active {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_roxo_pressionado_512x128.png");
}

.game-btn.secondary:disabled,
.row-actions button:disabled {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_roxo_desativado_512x128.png");
}

.game-btn.auto-active,
.gender-option.active {
  color: #edffd8;
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_verde_normal_512x128.png");
}

.game-btn.auto-active:hover,
.gender-option.active:hover {
  background-image: url("./assets/validated-ui/official-buttons/botao_grande_verde_hover_512x128.png");
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  background: transparent;
  background-image: none;
}

@media (max-width: 900px) {
  #gameScreen .panel::before,
  #characterScreen .panel::before {
    inset: -10px;
  }

  #gameScreen .side-panel,
  #gameScreen .combat-panel,
  #gameScreen .encounter-panel,
  #characterScreen .creator-card,
  #characterScreen .saved-characters {
    padding: 16px;
  }
}

/* Frame correction: use the new art as scalable borders, not stretched full panels. */
#gameScreen .panel,
#characterScreen .panel {
  border: 24px solid transparent;
  border-image-source: url("./assets/validated-ui/panel-medium-frame.png");
  border-image-slice: 96 fill;
  border-image-width: 24px;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 142, 54, 0.1), transparent 42%),
    rgba(9, 7, 5, 0.72);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.32);
}

#gameScreen .panel::before,
#characterScreen .panel::before {
  display: none;
}

#gameScreen .combat-panel,
#characterScreen .creator-card {
  border-width: 28px;
  border-image-source: url("./assets/validated-ui/panel-large-frame.png");
  border-image-slice: 112 fill;
  border-image-width: 28px;
}

#characterScreen .saved-characters,
#gameScreen .encounter-panel {
  border-image-source: url("./assets/validated-ui/panel-medium-frame.png");
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  padding: 12px;
}

@media (max-width: 900px) {
  #gameScreen .panel,
  #characterScreen .panel {
    border-width: 18px;
    border-image-width: 18px;
  }

  #gameScreen .combat-panel,
  #characterScreen .creator-card {
    border-width: 22px;
    border-image-width: 22px;
  }
}

/* Performance guard: keep official buttons now; panel frames stay available for specific screens. */
#gameScreen .panel,
#characterScreen .panel {
  border: 1px solid rgba(221, 169, 78, 0.22);
  border-image: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 128, 0.08), transparent 45%),
    rgba(10, 7, 5, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 135, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.34);
}

#gameScreen .panel::before,
#characterScreen .panel::before {
  display: none;
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  padding: 18px;
}

.toast {
  border: 0;
  min-height: 72px;
  padding: 18px 28px 20px;
  color: #ffe7a6;
  background:
    url("./assets/validated-ui/panel-small-frame.png") center / 100% 100% no-repeat,
    transparent;
  box-shadow: none;
  text-shadow: 2px 2px 0 #120805;
}

/* PixelLab UI kit test - Nocthara sheet 2026-07-04 */
#gameScreen .panel,
#characterScreen .panel {
  position: relative;
  border: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(79, 35, 111, 0.16), transparent 46%),
    rgba(6, 5, 5, 0.68);
  box-shadow: none;
  overflow: visible;
}

#gameScreen .panel::before,
#characterScreen .panel::before {
  content: "";
  display: block;
  position: absolute;
  inset: -12px;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/validated-ui/nocthara-test-panel.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.48));
}

#gameScreen .combat-panel::before,
#characterScreen .creator-card::before {
  inset: -16px;
}

#gameScreen .panel > *,
#characterScreen .panel > * {
  position: relative;
  z-index: 1;
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  padding: 24px;
}

.game-btn,
.row-actions button,
.gender-option {
  min-height: 52px;
  padding: 10px 24px 12px;
  border: 0;
  color: #ffe7aa;
  background: url("./assets/validated-ui/nocthara-test-button.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow:
    2px 2px 0 #120805,
    0 0 8px rgba(255, 220, 113, 0.3);
}

.game-btn.secondary,
.row-actions button,
.gender-option {
  color: #f2ddff;
  background-image: url("./assets/validated-ui/nocthara-test-button.png");
}

.game-btn.auto-active,
.gender-option.active {
  color: #efffd7;
  filter: brightness(1.14) saturate(1.18) drop-shadow(0 0 8px rgba(80, 220, 105, 0.28));
}

.game-btn:hover,
.row-actions button:hover,
.gender-option:hover {
  transform: translateY(-1px);
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(158, 74, 213, 0.36));
}

.game-btn:active,
.row-actions button:active,
.gender-option:active {
  transform: translateY(1px);
  filter: brightness(0.92);
}

.game-btn:disabled,
.row-actions button:disabled {
  opacity: 0.58;
  filter: grayscale(0.7) brightness(0.66);
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}

/* Final button proportion lock for the separated 193x69-ish button art. */
.game-btn,
.row-actions button,
.gender-option {
  min-width: 184px;
  width: auto;
  height: 66px;
  min-height: 66px;
  padding: 9px 28px 13px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  background-size: 100% 100%;
  image-rendering: pixelated;
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, 184px);
  gap: 10px;
  justify-content: center;
}

#gameScreen .ability-bar .game-btn {
  width: 184px;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  font-size: 14px;
}

.compact-btn {
  min-width: 154px;
  width: 154px;
  height: 55px;
  min-height: 55px;
  padding: 7px 23px 10px;
}

#gameScreen .row-actions button {
  min-width: 116px;
  height: 42px;
  min-height: 42px;
  padding: 4px 18px 7px;
  font-size: 13px;
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}

#heroCombatant .sprite-wrap .sprite-asset.pet,
.sprite-wrap .sprite-asset.pet {
  width: clamp(40px, 4.2vw, 58px);
  height: clamp(40px, 4.2vw, 58px);
  bottom: 8px;
  right: 18%;
  transform: translate(10px, 8px);
  animation-duration: 3.1s;
}

.pet-slot img {
  width: 32px;
  height: 32px;
}

.boss-tag {
  justify-content: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  color: #ffb8b8;
}

#heroCombatant .sprite-wrap .sprite-asset.pet,
.sprite-wrap .sprite-asset.pet {
  width: clamp(40px, 4.2vw, 58px);
  height: clamp(40px, 4.2vw, 58px);
  bottom: 8px;
  right: 18%;
  transform: translate(10px, 8px);
  animation-duration: 3.1s;
}

.pet-slot img {
  width: 32px;
  height: 32px;
}

.boss-tag {
  justify-content: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  color: #ffb8b8;
}

/* Final visual direction override: classic dark UI, pixel assets only for buttons/icons/items/sprites. */
#gameScreen .game-grid {
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) minmax(290px, 330px) !important;
  gap: 16px !important;
  align-items: start !important;
}

.topbar,
#gameScreen .panel,
#characterScreen .panel,
#inventoryScreen .panel,
#missionScreen .panel,
#mapScreen .panel {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-image: none !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(34, 38, 45, 0.97), rgba(24, 27, 33, 0.97)) !important;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px rgba(255, 255, 255, 0.04) !important;
}

#gameScreen .panel::before,
#characterScreen .panel::before,
#inventoryScreen .panel::before,
#missionScreen .panel::before,
#mapScreen .panel::before,
#gameScreen .side-panel::before,
#gameScreen .game-grid > .side-panel:last-child::before {
  display: none !important;
  content: none !important;
  background-image: none !important;
}

#gameScreen .side-panel,
#gameScreen .game-grid > .side-panel:last-child,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters,
#inventoryScreen .panel,
#missionScreen .panel,
#mapScreen .panel {
  min-height: 0 !important;
  padding: 14px !important;
  overflow: hidden !important;
}

#gameScreen .combat-panel {
  padding: 16px !important;
}

#gameScreen .panel-head,
#gameScreen .combat-header,
#characterScreen .panel-head,
#inventoryScreen .panel-head,
#missionScreen .panel-head,
#mapScreen .panel-head {
  margin: 0 0 12px !important;
  padding: 0 0 10px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: transparent !important;
}

.panel-head h2,
.combat-header h2,
.panel-title-btn {
  color: #f1eef7 !important;
  font-family: "Segoe UI", system-ui, sans-serif !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

.panel-head span,
.combat-header p,
.tiny,
.panel-counter {
  color: #979ba7 !important;
}

.zone-list,
.quest-list,
.equipment-list,
.inventory-list,
.sprite-gallery,
.stat-grid,
.profile-card {
  margin: 0 !important;
}

#gameScreen .side-panel:first-of-type .zone-list,
#gameScreen .side-panel .inventory-list,
#gameScreen .side-panel .equipment-list {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row,
.stat-tile,
.sprite-swatch,
.profile-card,
.saved-character-card,
.class-card,
.equip-slot,
.detail-tile,
.bag-slot,
.mission-card,
.map-region-info {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(37, 41, 49, 0.84), rgba(25, 28, 34, 0.84)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035) !important;
}

.zone-card:hover,
.zone-card.active,
.encounter-card:hover,
.encounter-card.active,
.class-card:hover,
.class-card.active {
  border-color: rgba(157, 114, 231, 0.72) !important;
  box-shadow:
    inset 0 0 0 1px rgba(157, 114, 231, 0.18),
    0 0 16px rgba(121, 83, 184, 0.13) !important;
}

.arena,
.world-map-stage {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 8px !important;
  background:
    radial-gradient(circle at 50% 35%, rgba(121, 83, 184, 0.14), transparent 42%),
    linear-gradient(180deg, #11141b, #090a0d) !important;
}

.mini-link,
.tab-btn,
.slot-actions button,
#gameScreen .row-actions button,
.icon-nav-btn {
  border-radius: 8px !important;
  border: 1px solid rgba(157, 114, 231, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(47, 51, 61, 0.96), rgba(19, 21, 27, 0.96)) !important;
  color: #f3eaff !important;
  text-shadow: none !important;
}

.mini-link:hover,
.tab-btn:hover,
.slot-actions button:hover,
#gameScreen .row-actions button:hover,
.icon-nav-btn:hover,
.tab-btn.active {
  background:
    linear-gradient(180deg, rgba(121, 83, 184, 0.94), rgba(71, 49, 113, 0.94)) !important;
  filter: none !important;
}

@media (max-width: 1180px) {
  #gameScreen .game-grid {
    grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) !important;
  }

  #gameScreen .game-grid > .side-panel:last-child {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 780px) {
  #gameScreen .game-grid {
    grid-template-columns: 1fr !important;
  }
}

.boss-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 5px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 108, 108, 0.42);
  border-radius: 999px;
  color: #ffd8d8;
  background: rgba(142, 38, 66, 0.24);
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
}

.encounter-card.boss-card {
  border-color: rgba(255, 108, 108, 0.52) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 108, 108, 0.12),
    0 0 16px rgba(142, 38, 66, 0.18) !important;
}

.encounter-card .mini-sprite,
.sprite-gallery .sprite-asset {
  object-fit: contain;
}

.combatant.enemy-side .sprite-asset {
  max-width: min(240px, 100%);
  max-height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.44));
}

.combatant.enemy-side .sprite-wrap {
  transform: none;
}

.combatant.hero-side .sprite-wrap .pet {
  transform: translate(10px, 8px) scaleX(-1);
}

.ability-bar {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.forge-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 12px;
  padding: 12px;
}

.forge-workbench,
.forge-material-panel {
  min-width: 0;
}

.forge-tabs {
  margin-bottom: 14px;
}

.forge-slot-grid {
  display: grid;
  gap: 10px;
}

.forge-slot-grid.three-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.forge-slot-grid.two-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.forge-slot {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(217, 178, 91, 0.26);
  background: rgba(8, 9, 12, 0.7);
}

.forge-slot > span,
.forge-slot > small {
  color: #aaa196;
  font-size: 10px;
}

.forge-slot select,
.shop-quantity select {
  width: 100%;
  min-width: 0;
}

.forge-check {
  display: flex;
  align-items: center;
  gap: 7px;
}

.forge-action-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-top: 1px solid rgba(217, 178, 91, 0.18);
}

.forge-material-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.forge-material-row > span {
  color: #c5ad78;
  font-size: 8px;
}

.forge-material-row strong,
.forge-material-row small { display: block; }
.forge-material-row small { color: #969086; font-size: 9px; }

.gem-socket-preview {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.gem-socket-preview span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #695633;
  color: #a99c81;
  background: #090a0d;
}

.gem-socket-preview span.filled {
  color: #f3d37f;
  box-shadow: inset 0 0 14px rgba(142, 77, 210, 0.26);
}

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

.forge-synthesis-columns > section,
.forge-destroy-box {
  padding: 12px;
  border: 1px solid rgba(217, 178, 91, 0.2);
  background: rgba(8, 9, 12, 0.55);
}

.forge-item-picker {
  max-height: 350px;
  display: grid;
  gap: 5px;
  margin: 10px 0;
  overflow: auto;
}

.forge-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.forge-pick small { color: #aaa196; }
.forge-destroy-box { max-width: 620px; margin: 0 auto; }
.game-btn.danger { border-color: #803836; color: #ffd0c7; background: linear-gradient(#54201f, #260e0e); }

.shop-quantity {
  min-width: 100px;
  display: grid;
  gap: 4px;
  color: #aaa196;
  font-size: 9px;
}

.forge-inventory-chest {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(217,178,91,.22);
}

#forgeInventoryChest,
.market-backpack-grid {
  max-height: 390px;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(132px,1fr));
  gap: 7px;
  overflow: auto;
}

.forge-chest-item,
.market-backpack-item {
  min-width: 0;
  min-height: 142px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  color: #eadfca;
  background: rgba(8,9,12,.72);
  text-align: center;
  cursor: pointer;
}

.forge-chest-item.selected,
.market-backpack-item.selected {
  outline: 2px solid #d6a94c;
  box-shadow: inset 0 0 18px rgba(214,169,76,.13);
}

.forge-chest-item:disabled { opacity: .46; cursor: not-allowed; }
.forge-chest-icon { width: 62px; height: 62px; object-fit: contain; }
.forge-chest-item strong,.market-backpack-item strong { font-size: 11px; overflow-wrap: anywhere; }
.forge-chest-item small,.market-backpack-item small { color: #a49b8c; font-size: 8px; }

.market-sell-slot {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(217,178,91,.22);
  background: rgba(8,9,12,.72);
}
.market-sell-slot small { display:block; color:#aaa196; }
.market-backpack { margin-bottom: 14px; padding: 10px; border: 1px solid rgba(217,178,91,.18); }
.market-backpack-item .market-item-icon { width: 58px; height: 58px; }

.game-global-chat {
  position: fixed;
  z-index: 45;
  right: 14px;
  bottom: 14px;
  width: min(360px, calc(100vw - 28px));
  padding: 8px;
  box-shadow: 0 12px 35px rgba(0,0,0,.55);
}
.game-global-chat>header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.game-global-chat>header span { display:block; color:#8f887b; font-size:8px; }
.game-global-chat .compact-btn { min-width:88px; min-height:32px; padding:5px 9px; }
.game-global-chat.minimized { width:220px; }
.game-global-chat.minimized .game-chat-body { display:none; }
#gameGlobalChatMessages { height:230px; display:flex; flex-direction:column; gap:5px; margin-top:7px; overflow:auto; }
#gameGlobalChatMessages article { padding:6px; border-bottom:1px solid rgba(255,255,255,.07); background:rgba(5,6,8,.72); }
#gameGlobalChatMessages p { margin:2px 0; overflow-wrap:anywhere; }
#gameGlobalChatMessages small { color:#817b70; font-size:8px; }
#gameGlobalChatForm { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px; margin-top:6px; }

.guild-donation-ranking { margin-top:14px; }
.guild-donation-ranking article { display:grid; grid-template-columns:36px minmax(0,1fr) auto auto; gap:9px; padding:8px; border-bottom:1px solid rgba(255,255,255,.07); }

@media (max-width: 860px) {
  .forge-page-grid,
  .forge-synthesis-columns { grid-template-columns: 1fr; }
  .forge-slot-grid.three-slots,
  .forge-slot-grid.two-slots { grid-template-columns: 1fr; }
}

.community-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 12px;
  padding: 12px;
}

.community-main-panel,
.global-chat-panel { min-width: 0; }
.community-tabs { margin-bottom: 12px; }

#globalChatMessages {
  height: min(620px, 62vh);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

#globalChatMessages article {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(8,9,12,.58);
}

#globalChatMessages p { margin: 3px 0; overflow-wrap: anywhere; }
#globalChatMessages small { color: #827d75; font-size: 8px; }
#globalChatForm { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-top: 9px; }

.community-empty-state {
  max-width: 680px;
  display: grid;
  gap: 12px;
  margin: 20px auto;
  padding: 22px;
  border: 1px solid rgba(217,178,91,.24);
  background: rgba(8,9,12,.62);
  text-align: center;
}

.guild-ranking,
.guild-member-list,
.market-list { display: grid; gap: 7px; }
.guild-ranking article,
.guild-member-list article { display: flex; justify-content: space-between; padding: 9px; border-bottom: 1px solid rgba(255,255,255,.07); }

.guild-dashboard,
.guild-tools,
.forge-synthesis-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.guild-summary,.guild-boss,.guild-tools>section { padding: 14px; border: 1px solid rgba(217,178,91,.22); background: rgba(8,9,12,.58); }
.guild-tools { margin: 12px 0; }
.guild-tools>section { display: grid; gap: 8px; }

.market-controls,
.market-sell-box { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid rgba(217,178,91,.18); }
.market-controls label { flex: 1; }
.market-sell-box { display: grid; grid-template-columns: minmax(160px,1fr) 160px auto; }
.market-sell-box h3,.market-sell-box small { grid-column: 1/-1; }
.market-card { display: grid; grid-template-columns: 58px minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.1); background: rgba(8,9,12,.62); }
.market-item-icon { width: 54px; height: 54px; object-fit: contain; }

.mining-panel { max-width: 900px; margin: 0 auto; }
.mining-pet-picker { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 8px; margin: 14px 0; }
.mining-pet-picker label { display: grid; grid-template-columns: auto 52px minmax(0,1fr); align-items: center; gap: 6px; padding: 8px; border: 1px solid rgba(255,255,255,.1); }
.mining-pet-picker img { width: 50px; height: 50px; object-fit: contain; }
.mining-progress { display: grid; gap: 10px; margin-top: 18px; }

.future-event-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.future-event-grid article { min-height: 230px; display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid rgba(217,178,91,.22); background: rgba(8,9,12,.65); }
.future-event-grid .game-btn { margin-top: auto; }

.achievement-summary { display: flex; justify-content: space-between; margin-bottom: 10px; }
.achievement-grid { max-height: 70vh; display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 8px; overflow: auto; }
.achievement-card { min-height: 170px; display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(8,9,12,.66); }
.achievement-card .game-btn { margin-top: auto; }
.achievement-card.done { box-shadow: inset 0 0 14px rgba(105,210,123,.1); }
.admin-boost-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.admin-boost-grid label { display: grid; gap: 6px; }

@media (max-width: 900px) {
  .community-page-grid { grid-template-columns: 1fr; }
  .global-chat-panel { order: 2; }
  #globalChatMessages { height: 300px; }
  .guild-dashboard,.guild-tools,.future-event-grid { grid-template-columns: 1fr; }
  .market-sell-box { grid-template-columns: 1fr; }
  .market-sell-box h3,.market-sell-box small { grid-column: auto; }
  .market-card { grid-template-columns: 48px minmax(0,1fr); }
  .market-card>strong,.market-card>.game-btn { grid-column: 2; }
  .admin-boost-grid { grid-template-columns: 1fr; }
}

/* Classic dark UI direction.
   Large UI surfaces stay clean and modern; pixel art remains for buttons, icons, items and sprites. */
:root {
  --classic-bg: #101114;
  --classic-shell: #15171c;
  --classic-panel: #1d2026;
  --classic-panel-soft: #22262d;
  --classic-panel-deep: #0d0f13;
  --classic-line: #303540;
  --classic-line-soft: rgba(255, 255, 255, 0.07);
  --classic-text: #f1eef7;
  --classic-muted: #979ba7;
  --classic-purple: #7953b8;
  --classic-purple-2: #9d72e7;
  --classic-green: #67d487;
}

body {
  color: var(--classic-text);
  background:
    radial-gradient(circle at 17% 10%, rgba(121, 83, 184, 0.16), transparent 32%),
    radial-gradient(circle at 84% 8%, rgba(86, 56, 142, 0.16), transparent 30%),
    linear-gradient(180deg, #121419 0%, #0b0c10 100%);
}

body::before {
  opacity: 0.16;
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 18px 18px;
}

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px;
}

.topbar,
#gameScreen .panel,
#characterScreen .panel,
#inventoryScreen .panel,
#missionScreen .panel,
#mapScreen .panel {
  border: 1px solid var(--classic-line-soft) !important;
  border-image: none !important;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(34, 38, 45, 0.96), rgba(24, 27, 33, 0.96)) !important;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px rgba(255, 255, 255, 0.04);
}

#gameScreen .panel::before,
#characterScreen .panel::before,
#inventoryScreen .panel::before,
#missionScreen .panel::before,
#mapScreen .panel::before,
#gameScreen .side-panel::before {
  display: none !important;
  content: none !important;
}

#gameScreen .panel > *,
#characterScreen .panel > *,
#inventoryScreen .panel > *,
#missionScreen .panel > *,
#mapScreen .panel > *,
#gameScreen .side-panel > * {
  position: relative;
  z-index: 1;
}

.topbar {
  min-height: 86px;
  padding: 14px 18px;
  align-items: center;
}

.identity h1,
.entry-brand h1,
.character-header h1 {
  color: var(--classic-text);
  letter-spacing: 0;
  text-shadow: none;
}

.identity p,
.entry-brand p,
.character-header p {
  color: var(--classic-muted);
}

.crest {
  border: 1px solid rgba(157, 114, 231, 0.52);
  border-radius: 8px;
  color: #f6efff;
  background:
    linear-gradient(135deg, rgba(121, 83, 184, 0.95), rgba(66, 211, 142, 0.64));
  box-shadow: 0 0 18px rgba(121, 83, 184, 0.22);
}

.top-stats {
  justify-content: center;
}

.chip,
.threat-pill {
  min-height: 34px;
  border: 1px solid var(--classic-line);
  border-radius: 8px;
  color: #e7e1f3;
  background: rgba(12, 14, 18, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.top-actions {
  gap: 10px;
}

.icon-nav-btn {
  width: 90px;
  min-height: 64px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(44, 47, 56, 0.95), rgba(22, 24, 30, 0.95));
  border: 1px solid rgba(157, 114, 231, 0.34);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 0 0 2px rgba(0, 0, 0, 0.14);
}

.icon-nav-btn:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(121, 83, 184, 0.92), rgba(82, 56, 132, 0.92));
  filter: drop-shadow(0 0 10px rgba(121, 83, 184, 0.28));
}

#gameScreen .game-grid {
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) minmax(290px, 330px);
  align-items: start;
  gap: 16px;
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  min-height: 0;
  padding: 14px;
  gap: 12px;
  overflow: hidden;
}

#gameScreen .side-panel {
  display: flex;
  flex-direction: column;
}

#gameScreen .combat-panel {
  padding: 16px;
}

#gameScreen .encounter-panel {
  padding: 14px;
}

#gameScreen .panel-head,
#gameScreen .combat-header,
#characterScreen .panel-head,
#inventoryScreen .panel-head,
#missionScreen .panel-head,
#mapScreen .panel-head {
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--classic-line-soft);
  background: transparent;
}

.panel-head h2,
.combat-header h2,
.panel-title-btn {
  color: var(--classic-text);
  font-size: 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  text-shadow: none;
}

.panel-head span,
.combat-header p,
.tiny,
.panel-counter {
  color: var(--classic-muted);
}

.panel-title-btn {
  cursor: pointer;
}

.panel-title-btn:hover {
  color: var(--classic-purple-2);
  filter: none;
}

.zone-list,
.quest-list,
.equipment-list,
.inventory-list,
.sprite-gallery,
.stat-grid,
.profile-card {
  margin: 0 !important;
}

.zone-list,
.quest-list,
.equipment-list,
.inventory-list {
  display: grid;
  gap: 8px;
}

#gameScreen .side-panel:first-of-type .zone-list,
#gameScreen .side-panel .inventory-list,
#gameScreen .side-panel .equipment-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row,
.stat-tile,
.sprite-swatch,
.profile-card,
.saved-character-card,
.class-card,
.equip-slot,
.detail-tile,
.bag-slot,
.mission-card,
.map-region-info {
  border: 1px solid var(--classic-line-soft) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(37, 41, 49, 0.82), rgba(25, 28, 34, 0.82)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.zone-card,
.quest-card,
.encounter-card,
.item-row,
.equipment-row {
  padding: 10px;
}

.zone-card::before,
.class-card::before {
  display: none;
}

.zone-card:hover,
.zone-card.active,
.encounter-card:hover,
.encounter-card.active,
.class-card:hover,
.class-card.active {
  border-color: rgba(157, 114, 231, 0.72) !important;
  box-shadow:
    inset 0 0 0 1px rgba(157, 114, 231, 0.18),
    0 0 16px rgba(121, 83, 184, 0.13);
}

.zone-card h3,
.quest-card h3,
.encounter-card h3,
.item-row h3,
.equipment-row h3 {
  color: #f2edf9;
}

.bar {
  height: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(7, 8, 11, 0.86);
}

.bar span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--classic-purple), var(--classic-purple-2));
}

.arena {
  border: 1px solid var(--classic-line-soft);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(121, 83, 184, 0.14), transparent 42%),
    linear-gradient(180deg, #11141b, #090a0d);
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.34);
}

.combatant {
  border-radius: 8px;
}

#gameScreen .hp-readout .bar {
  height: 18px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(7, 8, 11, 0.92);
}

#gameScreen .hp-readout .bar span {
  border-radius: inherit;
}

.ability-bar,
.encounter-list {
  gap: 10px;
}

.mini-link,
.tab-btn,
.slot-actions button,
#gameScreen .row-actions button {
  border-radius: 8px;
  border: 1px solid rgba(157, 114, 231, 0.28);
  background:
    linear-gradient(180deg, rgba(47, 51, 61, 0.96), rgba(19, 21, 27, 0.96));
  color: #f3eaff;
  text-shadow: none;
}

.mini-link:hover,
.tab-btn:hover,
.slot-actions button:hover,
#gameScreen .row-actions button:hover {
  background:
    linear-gradient(180deg, rgba(121, 83, 184, 0.94), rgba(71, 49, 113, 0.94));
  filter: none;
}

.tab-btn.active {
  border-color: rgba(157, 114, 231, 0.72);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(121, 83, 184, 0.96), rgba(76, 53, 122, 0.96));
  filter: none;
}

.inventory-page-grid,
.mission-page-grid,
.map-page-grid {
  gap: 16px;
}

.bag-slot.empty {
  background:
    url("./assets/test-ui/icon-empty.png") center / 42px 40px no-repeat,
    linear-gradient(180deg, rgba(34, 38, 45, 0.7), rgba(18, 20, 25, 0.7)) !important;
}

.world-map-stage {
  border: 1px solid var(--classic-line-soft);
  border-radius: 8px;
  background: #0b0c10;
}

.act-btn {
  border-radius: 8px;
  border-color: var(--classic-line-soft);
  background:
    linear-gradient(180deg, rgba(37, 41, 49, 0.9), rgba(18, 20, 25, 0.9));
  text-shadow: none;
}

.act-btn.active {
  border-color: rgba(157, 114, 231, 0.72);
  color: #fff;
  box-shadow:
    inset 0 0 18px rgba(121, 83, 184, 0.18),
    0 0 14px rgba(121, 83, 184, 0.14);
}

.map-region-button {
  border-radius: 8px;
  border-color: rgba(157, 114, 231, 0.34);
  background:
    linear-gradient(180deg, rgba(32, 35, 43, 0.9), rgba(11, 12, 16, 0.88));
  font-family: "Segoe UI", system-ui, sans-serif;
  text-shadow: none;
}

.map-region-button:hover,
.map-region-button.active {
  border-color: rgba(157, 114, 231, 0.8);
  box-shadow: 0 0 18px rgba(121, 83, 184, 0.24);
}

@media (max-width: 1180px) {
  #gameScreen .game-grid {
    grid-template-columns: minmax(270px, 310px) minmax(0, 1fr);
  }

  #gameScreen .game-grid > .side-panel:last-child {
    grid-column: 1 / -1;
    padding: 14px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 10px;
  }

  #gameScreen .game-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  #gameScreen .side-panel,
  #gameScreen .game-grid > .side-panel:last-child,
  #gameScreen .combat-panel,
  #gameScreen .encounter-panel {
    padding: 12px;
  }
}

/* Vertical sidebars v2: selected the medium tall frame for the main game columns. */
#gameScreen .game-grid {
  grid-template-columns: minmax(286px, 335px) minmax(0, 1fr) minmax(300px, 348px);
  align-items: start;
}

#gameScreen .side-panel {
  position: relative;
  min-height: 690px;
  padding: 78px 34px 60px;
  border: 0 !important;
  border-image: none !important;
  background: transparent !important;
  box-shadow: none;
  gap: 10px;
  overflow: visible;
}

#gameScreen .game-grid > .side-panel:last-child {
  padding: 86px 44px 68px;
}

#gameScreen .game-grid > .side-panel:last-child::before {
  background-image: url("./assets/validated-ui/sidebars/sidebar-double-large.png");
}

#gameScreen .side-panel::before {
  content: "";
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/validated-ui/sidebars/sidebar-tall-medium.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 18px 18px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 12px rgba(132, 65, 178, 0.14));
}

#gameScreen .side-panel > * {
  position: relative;
  z-index: 1;
}

#gameScreen .side-panel .panel-head {
  margin: 0;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(255, 230, 168, 0.12);
  background: transparent;
}

#gameScreen .side-panel .panel-head.compact,
#gameScreen .side-panel .quests-head {
  margin-top: 8px;
}

#gameScreen .side-panel .panel-head h2,
#gameScreen .side-panel .panel-title-btn {
  color: #ffe9ad;
  font-size: 17px;
}

#gameScreen .side-panel .panel-head span,
#gameScreen .side-panel .panel-counter {
  color: #c8b891;
}

#gameScreen .side-panel .zone-list,
#gameScreen .side-panel .quest-list,
#gameScreen .side-panel .equipment-list,
#gameScreen .side-panel .inventory-list,
#gameScreen .side-panel .sprite-gallery,
#gameScreen .side-panel .stat-grid,
#gameScreen .side-panel .profile-card {
  margin: 0;
}

#gameScreen .side-panel .zone-card,
#gameScreen .side-panel .quest-card,
#gameScreen .side-panel .item-row,
#gameScreen .side-panel .equipment-row,
#gameScreen .side-panel .stat-tile,
#gameScreen .side-panel .sprite-swatch,
#gameScreen .side-panel .profile-card {
  border-color: rgba(255, 220, 141, 0.18);
  background:
    linear-gradient(180deg, rgba(29, 20, 15, 0.58), rgba(9, 6, 7, 0.58));
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 230, 168, 0.04);
}

#gameScreen .side-panel .zone-card,
#gameScreen .side-panel .quest-card,
#gameScreen .side-panel .item-row,
#gameScreen .side-panel .equipment-row {
  padding: 9px;
}

#gameScreen .side-panel:first-of-type .zone-list {
  max-height: 348px;
  overflow: auto;
  padding-right: 3px;
}

#gameScreen .side-panel .inventory-list,
#gameScreen .side-panel .equipment-list {
  max-height: 225px;
  overflow: auto;
  padding-right: 3px;
}

#gameScreen .side-panel .mini-link {
  min-width: 58px;
  min-height: 27px;
  padding: 3px 9px 5px;
}

#gameScreen .side-panel .profile-card {
  padding: 8px;
}

#gameScreen .side-panel .avatar-frame {
  width: 64px;
  height: 64px;
}

#gameScreen .side-panel .avatar-frame::before {
  width: 64px;
  height: 64px;
}

#gameScreen .side-panel .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#gameScreen .side-panel .stat-tile {
  min-height: 54px;
  padding: 8px;
}

#gameScreen .side-panel .sprite-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

@media (max-width: 1180px) {
  #gameScreen .game-grid {
    grid-template-columns: minmax(286px, 335px) minmax(0, 1fr);
  }

  #gameScreen .game-grid > .side-panel:last-child {
    grid-column: 1 / -1;
    min-height: 560px;
    background: transparent !important;
  }

  #gameScreen .game-grid > .side-panel:last-child::before {
    background-image: url("./assets/validated-ui/sidebars/sidebar-double-large.png");
  }

  #gameScreen .game-grid > .side-panel:last-child .stat-grid,
  #gameScreen .game-grid > .side-panel:last-child .sprite-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  #gameScreen .game-grid {
    grid-template-columns: 1fr;
  }

  #gameScreen .side-panel,
  #gameScreen .game-grid > .side-panel:last-child {
    min-height: 0;
    padding: 60px 28px 50px;
  }

  #gameScreen .side-panel::before,
  #gameScreen .game-grid > .side-panel:last-child::before {
    background-image: url("./assets/validated-ui/sidebars/sidebar-tall-medium.png");
  }

  #gameScreen .side-panel:first-of-type .zone-list,
  #gameScreen .side-panel .inventory-list,
  #gameScreen .side-panel .equipment-list {
    max-height: none;
  }
}

/* Stable gameplay buttons while the final Illustrator UI is being prepared. */
.game-btn,
.gender-option {
  min-width: 184px;
  width: auto;
  height: 66px;
  min-height: 66px;
  padding: 9px 28px 13px;
  border: 0;
  color: #ffe9ad;
  background: url("./assets/validated-ui/botao-nocthara-medio-normal.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.34);
  image-rendering: pixelated;
}

.game-btn:hover,
.gender-option:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/botao-nocthara-medio-hover.png");
}

.game-btn:active,
.gender-option:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/botao-nocthara-medio-pressionado.png");
}

.game-btn.secondary,
.gender-option {
  color: #f5e4ff;
}

.game-btn.auto-active,
.gender-option.active {
  color: #f2ffd7;
  background-image: url("./assets/validated-ui/botao-nocthara-medio-hover.png");
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, 184px);
  justify-content: center;
  gap: 10px;
}

#gameScreen .ability-bar .game-btn {
  width: 184px;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  font-size: 14px;
}

.compact-btn {
  width: 136px;
  min-width: 136px;
  height: 50px;
  min-height: 50px;
  padding: 5px 18px 8px;
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-nav-btn,
.mini-link,
.tab-btn,
.slot-actions button,
#gameScreen .row-actions button {
  border: 0;
  color: #ffe9ad;
  background: url("./assets/test-ui/window-clean.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 #130805;
  image-rendering: pixelated;
  cursor: pointer;
}

.icon-nav-btn {
  width: 86px;
  min-height: 64px;
  padding: 5px 8px 8px;
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 12px;
}

.icon-nav-btn img,
.nav-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
}

.mini-link {
  min-width: 62px;
  min-height: 28px;
  padding: 4px 10px 6px;
  font-size: 12px;
}

.panel-counter {
  padding: 0 14px;
  color: #cfc6b6;
}

.page-screen {
  min-height: calc(100vh - 28px);
}

.page-topbar {
  margin-bottom: 14px;
}

.inventory-page-grid,
.mission-page-grid {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.inventory-page-grid {
  grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
}

.mission-page-grid {
  grid-template-columns: 1fr;
}

#inventoryScreen .panel,
#missionScreen .panel {
  border: 30px solid transparent;
  border-image-source: url("./assets/validated-ui/nocthara-test-panel.png");
  border-image-slice: 42 34 35 34 fill;
  border-image-width: 30px;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0%, rgba(80, 31, 114, 0.15), transparent 44%),
    rgba(7, 5, 5, 0.76);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.36);
}

.inventory-character-layout {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: start;
}

.inventory-avatar {
  min-height: 128px;
  display: grid;
  place-items: center;
  background: url("./assets/test-ui/character-tab.png") center / 96px 96px no-repeat;
}

.inventory-avatar img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  image-rendering: pixelated;
}

.equipment-slot-grid,
.character-detail-grid {
  display: grid;
  gap: 8px;
}

.equipment-slot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equip-slot,
.detail-tile {
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 230, 168, 0.18);
  background: rgba(15, 12, 14, 0.72);
}

.equip-slot span,
.detail-tile span,
.bag-slot span {
  display: block;
  color: #c7bda9;
  font-size: 11px;
}

.equip-slot strong,
.detail-tile strong {
  display: block;
  margin-top: 3px;
  color: #ffe9ad;
}

.character-detail-grid {
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.tab-btn {
  min-width: 146px;
  min-height: 42px;
  padding: 6px 14px 8px;
  color: #d8ccba;
}

.tab-btn.active {
  color: #f2ffd7;
  filter: drop-shadow(0 0 8px rgba(126, 232, 91, 0.26));
}

.bag-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}

.bag-slot {
  position: relative;
  min-height: 92px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid rgba(255, 230, 168, 0.16);
  background: rgba(10, 8, 10, 0.72);
}

.bag-slot.empty {
  background:
    url("./assets/test-ui/icon-empty.png") center / 42px 40px no-repeat,
    rgba(10, 8, 10, 0.46);
}

.bag-slot.empty span {
  opacity: 0.45;
}

.bag-slot strong {
  color: #f5ead2;
  font-size: 12px;
  line-height: 1.05;
}

.pet-slot img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.slot-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 4px;
}

.slot-actions button,
#gameScreen .row-actions button {
  min-width: 76px;
  min-height: 26px;
  padding: 3px 8px 5px;
  font-size: 11px;
}

.mission-list-full {
  display: grid;
  gap: 10px;
}

.mission-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(255, 230, 168, 0.18);
  background: rgba(15, 12, 14, 0.72);
}

.mission-icon {
  display: grid;
  place-items: center;
}

.mission-icon img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
}

.mission-status {
  color: #c7bda9;
  font-size: 12px;
}

.rarity,
.item-slot {
  color: #f5f1e6;
}

.rarity-comum {
  color: #f4f4f4;
  border-color: rgba(244, 244, 244, 0.34);
}

.rarity-incomum {
  color: #69d27b;
  border-color: rgba(105, 210, 123, 0.44);
}

.rarity-raro {
  color: #6ab7ff;
  border-color: rgba(106, 183, 255, 0.48);
}

.rarity-epico {
  color: #b878ff;
  border-color: rgba(184, 120, 255, 0.5);
}

.rarity-lendario {
  color: #ff9a3d;
  border-color: rgba(255, 154, 61, 0.52);
}

.rarity-mistico {
  color: #ff4d5d;
  border-color: rgba(255, 77, 93, 0.56);
}

.rarity-celestial {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
  animation: celestialPulse 2.4s linear infinite;
}

@keyframes celestialPulse {
  0% { filter: drop-shadow(0 0 5px #ff4d5d); }
  33% { filter: drop-shadow(0 0 5px #69d27b); }
  66% { filter: drop-shadow(0 0 5px #6ab7ff); }
  100% { filter: drop-shadow(0 0 5px #ff4d5d); }
}

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

  .top-actions {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .mission-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .mission-card .game-btn,
  .mission-card .mission-status {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .inventory-character-layout,
  .equipment-slot-grid,
  .character-detail-grid {
    grid-template-columns: 1fr;
  }

  .bag-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}

/* Official Nocthara button set from the validated reference folder. */
.game-btn,
.gender-option {
  width: auto;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  padding: 9px 28px 13px;
  border: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffe9ad;
  background: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_normal_384x112_crop.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.34);
  white-space: normal;
  image-rendering: pixelated;
}

.game-btn:hover,
.gender-option:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_hover_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(255, 225, 115, 0.24));
}

.game-btn:active,
.gender-option:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_pressionado_384x112_crop.png");
  filter: brightness(0.96);
}

.game-btn:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_desativado_384x112_crop.png");
  opacity: 0.62;
  filter: grayscale(0.72) brightness(0.68);
}

.game-btn.secondary,
.gender-option {
  color: #f7e2ff;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_normal_384x112_crop.png");
}

.game-btn.secondary:hover,
.gender-option:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_hover_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(185, 91, 255, 0.28));
}

.game-btn.secondary:active,
.gender-option:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_pressionado_384x112_crop.png");
}

.game-btn.secondary:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_desativado_384x112_crop.png");
}

.game-btn.auto-active,
.gender-option.active {
  color: #f2ffd7;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_normal_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(126, 232, 91, 0.25));
}

.game-btn.auto-active:hover,
.gender-option.active:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_hover_384x112_crop.png");
}

.game-btn.auto-active:active,
.gender-option.active:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_pressionado_384x112_crop.png");
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, 184px);
  justify-content: center;
  gap: 10px;
}

#gameScreen .ability-bar .game-btn {
  width: 184px;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  font-size: 14px;
}

.compact-btn {
  width: 128px;
  min-width: 128px;
  height: 48px;
  min-height: 48px;
  padding: 5px 18px 8px;
  font-size: 14px;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_normal_256x96_crop.png");
}

.compact-btn:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_hover_256x96_crop.png");
}

.compact-btn:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_pressionado_256x96_crop.png");
}

#gameScreen .row-actions button {
  width: 118px;
  min-width: 118px;
  height: 44px;
  min-height: 44px;
  padding: 4px 16px 7px;
  border: 0;
  box-sizing: border-box;
  color: #f7e2ff;
  background: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_normal_256x96_crop.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.28);
  image-rendering: pixelated;
}

#gameScreen .row-actions button:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_hover_256x96_crop.png");
  filter: drop-shadow(0 0 7px rgba(185, 91, 255, 0.28));
}

#gameScreen .row-actions button:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_pressionado_256x96_crop.png");
}

#gameScreen .row-actions button:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_desativado_256x96_crop.png");
  opacity: 0.62;
  filter: grayscale(0.72) brightness(0.68);
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}

#heroCombatant .sprite-wrap .sprite-asset.pet,
.sprite-wrap .sprite-asset.pet {
  width: clamp(40px, 4.2vw, 58px);
  height: clamp(40px, 4.2vw, 58px);
  bottom: 8px;
  right: 18%;
  transform: translate(10px, 8px);
  animation-duration: 3.1s;
}

.pet-slot img {
  width: 32px;
  height: 32px;
}

.boss-tag {
  justify-content: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  color: #ffb8b8;
}

/* Button proportion fix: keep the 225-ish art close to a 3:1 silhouette. */
.game-btn,
.row-actions button,
.gender-option {
  min-width: 154px;
  height: 52px;
  min-height: 52px;
  padding: 7px 24px 10px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  image-rendering: pixelated;
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 9px;
}

#gameScreen .ability-bar .game-btn {
  width: 100%;
  min-width: 158px;
  height: 52px;
}

.compact-btn {
  min-width: 150px;
  height: 52px;
}

#gameScreen .row-actions button {
  min-width: 118px;
  height: 42px;
  min-height: 42px;
  padding: 4px 18px 7px;
  font-size: 14px;
}

.potion-action .ui-icon {
  flex: 0 0 auto;
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0;
}

#gameScreen .equipment-row,
#gameScreen .item-row {
  position: relative;
  min-height: 64px;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(18, 14, 13, 0.64), rgba(8, 6, 6, 0.72));
}

#gameScreen .equipment-row::before,
#gameScreen .item-row::before,
#gameScreen .avatar-frame::before {
  content: "";
  width: 46px;
  height: 46px;
  grid-row: 1 / span 3;
  background: url("./assets/validated-ui/nocthara-test-slot.png") center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}

#gameScreen .equipment-row h3,
#gameScreen .equipment-row p,
#gameScreen .item-row h3,
#gameScreen .item-row p,
#gameScreen .item-row .row-actions {
  grid-column: 2;
}

#gameScreen .item-row .row-actions {
  margin-top: 2px;
}

#gameScreen .row-actions button {
  min-height: 34px;
  padding: 4px 18px 6px;
}

#gameScreen .avatar-frame {
  position: relative;
  width: 70px;
  height: 70px;
  border: 0;
  background: transparent;
}

#gameScreen .avatar-frame::before {
  position: absolute;
  inset: 0;
  width: 70px;
  height: 70px;
  background-size: 100% 100%;
}

#gameScreen .avatar-frame img {
  position: relative;
  z-index: 1;
}

#gameScreen .hp-readout .bar {
  height: 26px;
  padding: 7px 13px 8px;
  border: 0;
  border-radius: 0;
  background: url("./assets/validated-ui/nocthara-test-hp-bar.png") center / 100% 100% no-repeat;
  box-shadow: none;
}

#gameScreen .hp-readout .bar span {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(180deg, #ff6d5f, #a60910 56%, #56050b);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(176, 20, 23, 0.35);
}

/* World map window. */
.panel-title-btn {
  border: 0;
  padding: 0;
  color: #ffe9ad;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  text-align: left;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.34);
  cursor: pointer;
}

.panel-title-btn:hover {
  color: #ffffff;
  filter: drop-shadow(0 0 7px rgba(255, 225, 115, 0.32));
}

.map-panel-head {
  grid-template-columns: 1fr auto auto;
}

.map-page-grid {
  width: min(1580px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

#mapScreen .panel {
  border: 30px solid transparent;
  border-image-source: url("./assets/validated-ui/nocthara-test-panel.png");
  border-image-slice: 42 34 35 34 fill;
  border-image-width: 30px;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0%, rgba(80, 31, 114, 0.15), transparent 44%),
    rgba(7, 5, 5, 0.76);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.36);
}

.act-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(82px, 1fr));
  gap: 7px;
  margin: 8px 0 12px;
}

.act-btn {
  min-height: 50px;
  padding: 7px 8px 9px;
  border: 1px solid rgba(255, 230, 168, 0.18);
  color: #cfc6b6;
  background:
    linear-gradient(180deg, rgba(36, 29, 25, 0.88), rgba(10, 8, 8, 0.92));
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  text-align: center;
  text-shadow: 2px 2px 0 #130805;
  cursor: pointer;
}

.act-btn strong,
.act-btn span {
  display: block;
}

.act-btn span {
  margin-top: 2px;
  font-size: 10px;
  color: #8f8575;
}

.act-btn.active {
  color: #ffe9ad;
  border-color: rgba(255, 225, 115, 0.58);
  box-shadow:
    inset 0 0 18px rgba(247, 183, 51, 0.14),
    0 0 12px rgba(247, 183, 51, 0.14);
}

.act-btn.locked {
  opacity: 0.58;
  filter: grayscale(0.45);
}

.act-btn.locked::after {
  content: "X";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: #ff7171;
  font-size: 12px;
}

.world-map-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 230, 168, 0.18);
  background: rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.56),
    0 16px 24px rgba(0, 0, 0, 0.32);
}

.world-map-image {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  image-rendering: pixelated;
}

.world-map-overlay {
  position: absolute;
  inset: 0;
}

.map-region-button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 230, 168, 0.36);
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(36, 27, 18, 0.82), rgba(9, 7, 7, 0.8));
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10px, 0.95vw, 15px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 #130805;
  cursor: pointer;
  box-shadow:
    inset 0 0 12px rgba(247, 183, 51, 0.12),
    0 0 10px rgba(0, 0, 0, 0.42);
}

.map-region-button:hover,
.map-region-button.active {
  z-index: 2;
  color: #ffffff;
  border-color: rgba(255, 225, 115, 0.78);
  box-shadow:
    inset 0 0 16px rgba(247, 183, 51, 0.2),
    0 0 14px rgba(247, 183, 51, 0.24);
}

.map-region-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f7b733;
  box-shadow: 0 0 8px rgba(247, 183, 51, 0.68);
}

.map-region-button.active .map-region-dot {
  background: #69d27b;
  box-shadow: 0 0 10px rgba(105, 210, 123, 0.86);
}

.map-region-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 230, 168, 0.16);
  background: rgba(12, 9, 10, 0.72);
}

.map-region-info h2 {
  margin: 2px 0 4px;
  color: #ffe9ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #130805;
}

.map-region-info p {
  margin: 0;
  color: #cfc6b6;
}

@media (max-width: 980px) {
  .act-row {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
  }

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

@media (max-width: 680px) {
  .world-map-stage {
    overflow-x: auto;
  }

  .world-map-image,
  .world-map-overlay {
    min-width: 860px;
  }

  .world-map-overlay {
    width: 860px;
  }

  .act-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #gameScreen .side-panel,
  #gameScreen .combat-panel,
  #gameScreen .encounter-panel,
  #characterScreen .creator-card,
  #characterScreen .saved-characters {
    padding: 20px;
  }

  #gameScreen .panel::before,
  #characterScreen .panel::before {
    inset: -8px;
  }
}

/* PixelLab UI kit test adjustment: use the panel art as a scalable frame. */
#gameScreen .panel,
#characterScreen .panel {
  border: 30px solid transparent;
  border-image-source: url("./assets/validated-ui/nocthara-test-panel.png");
  border-image-slice: 42 34 35 34 fill;
  border-image-width: 30px;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0%, rgba(79, 35, 111, 0.12), transparent 44%),
    rgba(7, 5, 5, 0.72);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.36);
}

#gameScreen .panel::before,
#characterScreen .panel::before {
  display: none;
}

#gameScreen .side-panel,
#gameScreen .combat-panel,
#gameScreen .encounter-panel,
#characterScreen .creator-card,
#characterScreen .saved-characters {
  padding: 8px;
}

#gameScreen .combat-panel,
#characterScreen .creator-card {
  border-width: 34px;
  border-image-width: 34px;
}

@media (max-width: 900px) {
  #gameScreen .panel,
  #characterScreen .panel {
    border-width: 24px;
    border-image-width: 24px;
  }

  #gameScreen .side-panel,
  #gameScreen .combat-panel,
  #gameScreen .encounter-panel,
  #characterScreen .creator-card,
  #characterScreen .saved-characters {
    padding: 8px;
  }
}

/* Official medium button test - separated Nocthara states. */
.game-btn,
.row-actions button,
.gender-option {
  min-width: 184px;
  width: auto;
  height: 66px;
  min-height: 66px;
  padding: 9px 28px 13px;
  border: 0;
  color: #ffe9ad;
  background: url("./assets/validated-ui/botao-nocthara-medio-normal.png") center / 100% 100% no-repeat;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
  image-rendering: pixelated;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.34);
}

.game-btn.secondary,
.row-actions button,
.gender-option {
  color: #f5e4ff;
  background-image: url("./assets/validated-ui/botao-nocthara-medio-normal.png");
}

.game-btn:hover,
.row-actions button:hover,
.gender-option:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/botao-nocthara-medio-hover.png");
  filter: drop-shadow(0 0 8px rgba(126, 232, 91, 0.24));
}

.game-btn:active,
.row-actions button:active,
.gender-option:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/botao-nocthara-medio-pressionado.png");
  filter: brightness(0.96);
}

.game-btn.auto-active,
.gender-option.active {
  color: #f2ffd7;
  background-image: url("./assets/validated-ui/botao-nocthara-medio-hover.png");
  filter: drop-shadow(0 0 8px rgba(126, 232, 91, 0.28));
}

.game-btn:disabled,
.row-actions button:disabled {
  background-image: url("./assets/validated-ui/botao-nocthara-medio-normal.png");
  opacity: 0.58;
  filter: grayscale(0.78) brightness(0.62);
}

#gameScreen .row-actions button {
  min-width: 116px;
  height: 42px;
  min-height: 42px;
  padding: 4px 18px 7px;
  font-size: 13px;
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, 184px);
  gap: 10px;
  justify-content: center;
}

#gameScreen .ability-bar .game-btn {
  width: 184px;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  font-size: 14px;
}

.compact-btn {
  min-width: 154px;
  width: 154px;
  height: 55px;
  min-height: 55px;
  padding: 7px 23px 10px;
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}

/* Final official Nocthara buttons: validated reference set. */
.game-btn,
.gender-option {
  width: auto;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  padding: 9px 28px 13px;
  border: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffe9ad;
  background: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_normal_384x112_crop.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.34);
  white-space: normal;
  image-rendering: pixelated;
}

.game-btn:hover,
.gender-option:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_hover_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(255, 225, 115, 0.24));
}

.game-btn:active,
.gender-option:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_pressionado_384x112_crop.png");
  filter: brightness(0.96);
}

.game-btn:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_dourado_desativado_384x112_crop.png");
  opacity: 0.62;
  filter: grayscale(0.72) brightness(0.68);
}

.game-btn.secondary,
.gender-option {
  color: #f7e2ff;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_normal_384x112_crop.png");
}

.game-btn.secondary:hover,
.gender-option:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_hover_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(185, 91, 255, 0.28));
}

.game-btn.secondary:active,
.gender-option:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_pressionado_384x112_crop.png");
}

.game-btn.secondary:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_roxo_desativado_384x112_crop.png");
}

.game-btn.auto-active,
.gender-option.active {
  color: #f2ffd7;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_normal_384x112_crop.png");
  filter: drop-shadow(0 0 8px rgba(126, 232, 91, 0.25));
}

.game-btn.auto-active:hover,
.gender-option.active:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_hover_384x112_crop.png");
}

.game-btn.auto-active:active,
.gender-option.active:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_medio_verde_pressionado_384x112_crop.png");
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, 184px);
  justify-content: center;
  gap: 10px;
}

#gameScreen .ability-bar .game-btn {
  width: 184px;
  min-width: 184px;
  height: 66px;
  min-height: 66px;
  font-size: 14px;
}

.compact-btn {
  width: 128px;
  min-width: 128px;
  height: 48px;
  min-height: 48px;
  padding: 5px 18px 8px;
  font-size: 14px;
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_normal_256x96_crop.png");
}

.compact-btn:hover {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_hover_256x96_crop.png");
}

.compact-btn:active {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_pressionado_256x96_crop.png");
}

#gameScreen .row-actions button {
  width: 118px;
  min-width: 118px;
  height: 44px;
  min-height: 44px;
  padding: 4px 16px 7px;
  border: 0;
  box-sizing: border-box;
  color: #f7e2ff;
  background: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_normal_256x96_crop.png") center / 100% 100% no-repeat;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    2px 2px 0 #130805,
    0 0 8px rgba(255, 226, 128, 0.28);
  image-rendering: pixelated;
}

#gameScreen .row-actions button:hover {
  transform: translateY(-1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_hover_256x96_crop.png");
  filter: drop-shadow(0 0 7px rgba(185, 91, 255, 0.28));
}

#gameScreen .row-actions button:active {
  transform: translateY(1px);
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_pressionado_256x96_crop.png");
}

#gameScreen .row-actions button:disabled {
  background-image: url("./assets/validated-ui/official-buttons/cropped/botao_pequeno_roxo_desativado_256x96_crop.png");
  opacity: 0.62;
  filter: grayscale(0.72) brightness(0.68);
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  filter: none;
}


#heroCombatant .sprite-wrap .sprite-asset.pet,
.sprite-wrap .sprite-asset.pet {
  width: clamp(40px, 4.2vw, 58px);
  height: clamp(40px, 4.2vw, 58px);
  bottom: 8px;
  right: 18%;
  transform: translate(10px, 8px);
  animation-duration: 3.1s;
}

.pet-slot img {
  width: 32px;
  height: 32px;
}

.boss-tag {
  justify-content: center;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  color: #ffb8b8;
}

/* Balance and layout pass - 2026-07-06. */
#gameScreen .top-actions {
  display: none;
}

#gameScreen .profile-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 2px 0 0;
}

#gameScreen .profile-action {
  min-width: 0;
  min-height: 72px;
  padding: 6px 4px 5px;
  border: 1px solid rgba(255, 220, 141, 0.22);
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(30, 21, 18, 0.82), rgba(8, 6, 7, 0.88));
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.38),
    0 1px 0 rgba(255, 230, 168, 0.05);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 1px 1px 0 #130805;
  cursor: pointer;
}

#gameScreen .profile-action:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 225, 115, 0.68);
  box-shadow:
    inset 0 0 14px rgba(247, 183, 51, 0.12),
    0 0 10px rgba(247, 183, 51, 0.14);
}

#gameScreen .profile-action img {
  width: 36px;
  height: 38px;
  display: block;
  margin: 0 auto 4px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 0 #050302);
}

#gameScreen .profile-action span {
  display: block;
  overflow-wrap: anywhere;
}

#gameScreen .chip,
.page-topbar .chip {
  border-color: rgba(255, 220, 141, 0.28);
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(34, 25, 18, 0.9), rgba(8, 6, 7, 0.88));
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.32),
    0 1px 0 rgba(255, 230, 168, 0.05);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  text-shadow: 1px 1px 0 #130805;
}

#gameScreen .chip-gold {
  color: #ffd975;
}

#gameScreen .chip-hp {
  color: #ff8f86;
}

#gameScreen .chip-xp,
#gameScreen .chip-pet {
  color: #d9b8ff;
}

#gameScreen .chip-penalty {
  color: #ff9b9b;
}

#gameScreen .stat-tile {
  border-color: rgba(255, 220, 141, 0.22);
  background:
    linear-gradient(180deg, rgba(30, 21, 18, 0.78), rgba(8, 6, 7, 0.72));
}

#gameScreen .stat-tile span {
  color: #c8b891;
}

#gameScreen .stat-tile strong {
  color: #ffe9ad;
  font-family: Georgia, "Times New Roman", serif;
  text-shadow: 1px 1px 0 #130805;
}

#gameScreen .hp-readout .bar,
.hp-readout .bar {
  height: 25px;
  padding: 5px 12px 6px;
  border: 0;
  border-radius: 0;
  background: url("./assets/validated-ui/hp-bar-243x25.png") center / 100% 100% no-repeat;
  box-shadow: none;
  image-rendering: pixelated;
}

#gameScreen .hp-readout .bar span,
.hp-readout .bar span {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff6d5f, #a60910 56%, #56050b);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -2px rgba(0, 0, 0, 0.42),
    0 0 7px rgba(176, 20, 23, 0.35);
}

#authScreen.entry-screen {
  min-height: 100dvh;
  padding: clamp(172px, 23vh, 260px) clamp(10px, 2vw, 22px) 26px;
  align-content: start;
  justify-items: center;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(2, 2, 3, 0.02) 0%, rgba(2, 2, 3, 0.16) 42%, rgba(2, 2, 3, 0.78) 76%, rgba(2, 2, 3, 0.94) 100%),
    url("./assets/backgrounds/login-nocthara.png") center top / cover no-repeat;
}

#authScreen .auth-layout {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(290px, 420px));
  justify-content: center;
  align-items: start;
  gap: clamp(8px, 1.4vw, 16px);
}

#authScreen .auth-card {
  width: min(420px, calc((100vw - 36px) / 2), calc(100dvh - 250px));
  min-width: 290px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  overflow: visible;
  background: url("./assets/ui/login-panel.png") center top / contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.54));
}

#authScreen #signupForm.auth-card {
  background-image: url("./assets/ui/signup-panel.png");
}

#authScreen .auth-card::before,
#authScreen .auth-card::after,
#authScreen .auth-card .panel-head {
  display: none;
}

#authScreen .auth-card .game-btn,
#authScreen .auth-card .game-btn:hover,
#authScreen .auth-card .game-btn:active,
#authScreen .auth-card .game-btn.secondary {
  min-width: 0;
  width: 54.6%;
  height: 7.3%;
  min-height: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  background-image: none;
  border: 0;
  box-shadow: none;
  text-shadow: none;
  filter: none;
}

@media (max-width: 900px) {
  #authScreen.entry-screen {
    padding-top: clamp(150px, 22vh, 205px);
  }

  #authScreen .auth-layout {
    width: min(390px, 100%);
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #authScreen .auth-card {
    width: min(370px, calc(100vw - 18px));
    min-width: 0;
  }
}

@media (max-width: 1180px) {
  #gameScreen .profile-action-grid {
    grid-template-columns: repeat(6, minmax(64px, 1fr));
  }
}

@media (max-width: 560px) {
  #gameScreen .profile-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Classic button/UI correction - image buttons were too brittle. */
body:has(#authScreen:not([hidden])) {
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(2, 2, 3, 0.02) 0%, rgba(2, 2, 3, 0.1) 42%, rgba(2, 2, 3, 0.72) 78%, rgba(2, 2, 3, 0.94) 100%),
    url("./assets/backgrounds/login-nocthara.png") center center / cover no-repeat fixed,
    #050406;
}

.app-shell:has(#authScreen:not([hidden])) {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
}

#authScreen.entry-screen {
  width: 100%;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(2, 2, 3, 0.02) 0%, rgba(2, 2, 3, 0.08) 45%, rgba(2, 2, 3, 0.7) 78%, rgba(2, 2, 3, 0.94) 100%),
    url("./assets/backgrounds/login-nocthara.png") center center / cover no-repeat;
}

#gameScreen .game-btn,
#characterScreen .game-btn,
#mapScreen .game-btn,
#inventoryScreen .game-btn,
#missionScreen .game-btn,
#gameScreen .row-actions button,
#characterScreen .gender-option,
.mini-link,
.tab-btn,
.act-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(255, 219, 135, 0.46);
  border-radius: 6px;
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 -3px 0 rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(0, 0, 0, 0.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  white-space: normal;
  image-rendering: auto;
  cursor: pointer;
  filter: none;
}

#gameScreen .game-btn.secondary,
#characterScreen .game-btn.secondary,
#mapScreen .game-btn.secondary,
#inventoryScreen .game-btn.secondary,
#missionScreen .game-btn.secondary,
#gameScreen .row-actions button,
.mini-link,
.tab-btn {
  color: #eadcff;
  border-color: rgba(190, 144, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(207, 168, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%);
}

#gameScreen .game-btn:hover,
#characterScreen .game-btn:hover,
#mapScreen .game-btn:hover,
#inventoryScreen .game-btn:hover,
#missionScreen .game-btn:hover,
#gameScreen .row-actions button:hover,
#characterScreen .gender-option:hover,
.mini-link:hover,
.tab-btn:hover,
.act-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 231, 156, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 232, 160, 0.2), transparent 36%),
    linear-gradient(180deg, #3d2d21 0%, #1d1511 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.36),
    0 4px 0 rgba(0, 0, 0, 0.52),
    0 0 12px rgba(247, 183, 51, 0.12);
  filter: none;
}

#gameScreen .game-btn:active,
#characterScreen .game-btn:active,
#mapScreen .game-btn:active,
#inventoryScreen .game-btn:active,
#missionScreen .game-btn:active,
#gameScreen .row-actions button:active,
#characterScreen .gender-option:active,
.mini-link:active,
.tab-btn:active,
.act-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(0, 0, 0, 0.52);
}

#gameScreen .game-btn.auto-active,
#characterScreen .gender-option.active,
.tab-btn.active,
.act-btn.active {
  color: #efffd8;
  border-color: rgba(138, 230, 99, 0.56);
  background:
    linear-gradient(180deg, rgba(174, 255, 128, 0.14), transparent 38%),
    linear-gradient(180deg, #263a24 0%, #101c11 100%);
}

#gameScreen .game-btn:disabled,
#characterScreen .game-btn:disabled,
#mapScreen .game-btn:disabled,
#inventoryScreen .game-btn:disabled,
#missionScreen .game-btn:disabled,
#gameScreen .row-actions button:disabled {
  opacity: 0.52;
  filter: grayscale(0.55);
  cursor: not-allowed;
}

#gameScreen .ability-bar {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

#gameScreen .ability-bar .game-btn,
.compact-btn {
  width: auto;
  min-width: 0;
  min-height: 42px;
  height: auto;
}

#gameScreen .row-actions button {
  width: auto;
  min-width: 86px;
  min-height: 32px;
  padding: 7px 12px 8px;
  font-size: 12px;
}

/* Character skills page. */
#skillScreen .game-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(190, 144, 255, 0.42);
  border-radius: 6px;
  color: #eadcff;
  background:
    linear-gradient(180deg, rgba(207, 168, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 -3px 0 rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(0, 0, 0, 0.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  cursor: pointer;
}

#skillScreen .panel {
  border: 30px solid transparent;
  border-image-source: url("./assets/validated-ui/nocthara-test-panel.png");
  border-image-slice: 42 34 35 34 fill;
  border-image-width: 30px;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0%, rgba(79, 35, 111, 0.12), transparent 44%),
    rgba(7, 5, 5, 0.72);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.36);
}

.skill-page-grid {
  width: min(1420px, 100%);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.skill-tree-panel,
.skill-detail-panel {
  padding: 10px;
}

.skill-tree {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.skill-node {
  position: relative;
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 220, 141, 0.22);
  color: #c8b891;
  background:
    linear-gradient(180deg, rgba(28, 22, 18, 0.82), rgba(8, 6, 7, 0.88));
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.34),
    0 1px 0 rgba(255, 230, 168, 0.05);
  font-family: Georgia, "Times New Roman", serif;
  text-align: left;
  cursor: pointer;
}

.skill-node::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 2px;
  height: 12px;
  background: rgba(255, 220, 141, 0.22);
}

.skill-node:nth-child(n + 6)::after {
  display: none;
}

.skill-node.unlocked {
  color: #ffe9ad;
  border-color: rgba(138, 230, 99, 0.42);
  background:
    linear-gradient(180deg, rgba(174, 255, 128, 0.1), transparent 36%),
    linear-gradient(180deg, #263320 0%, #10180f 100%);
}

.skill-node.legendary,
.skill-detail-card.legendary {
  border-color: rgba(255, 92, 92, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 80, 80, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(58, 20, 24, 0.86), rgba(12, 6, 8, 0.9));
  box-shadow:
    inset 0 0 20px rgba(255, 72, 72, 0.1),
    0 0 16px rgba(255, 72, 72, 0.14);
}

.skill-node.selected {
  border-color: rgba(255, 225, 115, 0.82);
  box-shadow:
    inset 0 0 18px rgba(247, 183, 51, 0.14),
    0 0 14px rgba(247, 183, 51, 0.18);
}

.skill-node.locked {
  opacity: 0.62;
  filter: grayscale(0.45);
}

.skill-level,
.skill-node em {
  color: #c8b891;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-node strong {
  color: inherit;
  font-size: 15px;
  line-height: 1.08;
  text-shadow: 1px 1px 0 #120806;
}

.skill-detail-card {
  display: grid;
  gap: 14px;
  min-height: 360px;
  padding: 14px;
  border: 1px solid rgba(255, 220, 141, 0.22);
  background:
    linear-gradient(180deg, rgba(30, 21, 18, 0.78), rgba(8, 6, 7, 0.72));
}

.skill-detail-title {
  display: grid;
  gap: 6px;
}

.skill-detail-title span,
.skill-detail-title strong,
.skill-effect-grid span {
  color: #c8b891;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-detail-title h3 {
  color: #ffe9ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.05;
  text-shadow: 2px 2px 0 #120806;
}

.skill-detail-card p {
  color: #d6c6a4;
  line-height: 1.45;
}

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

.skill-effect-grid div {
  min-height: 96px;
  padding: 11px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  background: rgba(5, 4, 5, 0.38);
}

.skill-rank-bar {
  height: 14px;
  padding: 3px;
  border: 1px solid rgba(255, 220, 141, 0.26);
  background: rgba(5, 4, 5, 0.5);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.42);
}

.skill-rank-bar span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: linear-gradient(90deg, #7650ff, #f7b733);
  box-shadow: 0 0 8px rgba(247, 183, 51, 0.28);
}

@media (max-width: 980px) {
  .skill-page-grid {
    grid-template-columns: 1fr;
  }

  .skill-tree {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-effect-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .skill-tree {
    grid-template-columns: 1fr;
  }
}

/* Invisible world-map click zones. */
.world-map-overlay {
  pointer-events: none;
}

.map-region-button,
.map-region-button:hover,
.map-region-button.active {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  filter: none;
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}

.map-region-button:focus-visible {
  outline: 2px solid rgba(255, 225, 115, 0.65);
  outline-offset: 2px;
}

.map-region-button .map-region-dot,
.map-region-button strong {
  display: none;
}

/* Equipment item sprites. */
.item-icon,
.equip-item-icon,
.bag-item-icon {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.42));
}

.item-row.has-item-icon,
.equipment-row.has-item-icon {
  grid-template-columns: 48px minmax(0, 1fr);
}

.item-row.has-item-icon::before,
.equipment-row.has-item-icon::before {
  display: none !important;
}

.item-icon {
  width: 46px;
  height: 46px;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: center;
}

.equip-slot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.equip-slot.has-equip-icon {
  grid-template-columns: 42px minmax(0, 1fr);
}

.equip-item-icon {
  width: 38px;
  height: 38px;
  justify-self: center;
}

.bag-slot.item-slot {
  min-height: 132px;
}

.bag-item-icon {
  width: 42px;
  height: 42px;
  margin: 8px auto 2px;
}

.unequip-btn,
.attribute-btn {
  min-height: 26px;
  border: 1px solid rgba(255, 220, 141, 0.22);
  border-radius: 7px;
  color: #ffe9ad;
  background: linear-gradient(180deg, rgba(47, 51, 61, 0.96), rgba(19, 21, 27, 0.96));
  cursor: pointer;
}

.unequip-btn {
  width: 100%;
  margin-top: 6px;
  font-size: 11px;
}

.attribute-panel {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  border-radius: 8px;
  background: rgba(8, 7, 9, 0.58);
}

.attribute-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}

.attribute-panel-head span,
.attribute-panel-head small {
  color: #c8b891;
  font-size: 11px;
}

.attribute-panel-head strong {
  display: block;
  color: #ffe9ad;
}

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

.attribute-btn {
  min-width: 0;
  padding: 6px 4px;
  display: grid;
  gap: 2px;
  place-items: center;
}

.attribute-btn span {
  color: #c8b891;
  font-size: 10px;
}

.attribute-btn strong {
  color: #f5ead2;
  font-size: 16px;
}

.attribute-btn em {
  color: #69d27b;
  font-style: normal;
  font-weight: 900;
}

.attribute-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.equip-slot.rarity-lendario,
.bag-slot.rarity-lendario {
  box-shadow:
    inset 0 0 15px rgba(255, 154, 61, 0.18),
    0 0 12px rgba(255, 154, 61, 0.24);
}

.equip-slot.rarity-mistico,
.bag-slot.rarity-mistico {
  box-shadow:
    inset 0 0 16px rgba(255, 77, 93, 0.2),
    0 0 14px rgba(255, 77, 93, 0.26);
}

.equip-slot.rarity-celestial,
.bag-slot.rarity-celestial {
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.22),
    0 0 16px rgba(106, 183, 255, 0.32);
}

@media (max-width: 620px) {
  .attribute-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#shopScreen .game-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(255, 219, 135, 0.46);
  border-radius: 6px;
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 -3px 0 rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(0, 0, 0, 0.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  white-space: normal;
  cursor: pointer;
}

#shopScreen .game-btn.secondary {
  color: #eadcff;
  border-color: rgba(190, 144, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(207, 168, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%);
}

#shopScreen .game-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 231, 156, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 232, 160, 0.2), transparent 36%),
    linear-gradient(180deg, #3d2d21 0%, #1d1511 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.36),
    0 4px 0 rgba(0, 0, 0, 0.52),
    0 0 12px rgba(247, 183, 51, 0.12);
}

#shopScreen .game-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(0, 0, 0, 0.52);
}

#shopScreen .game-btn:disabled {
  opacity: 0.52;
  filter: grayscale(0.55);
  cursor: not-allowed;
}

.shop-page-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
}

#shopScreen .panel {
  border: 1px solid var(--classic-line-soft);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(121, 83, 184, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(31, 34, 41, 0.94), rgba(14, 16, 20, 0.96));
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.34);
}

.shop-hero-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}

.shop-stall-art {
  width: min(100%, 720px);
  height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.5));
}

.gold-shop-block {
  display: grid;
  gap: 10px;
}

.gold-shop-block .shop-card {
  grid-template-columns: 58px minmax(0, 1fr);
}

.gold-shop-block .shop-card .game-btn {
  grid-column: 1 / -1;
  width: 100%;
}

.shop-list-panel {
  padding: 14px;
}

.shop-list {
  display: grid;
  gap: 10px;
}

.cash-shop-panel {
  min-width: 0;
}

.cash-shop-panel > .panel-head > div {
  min-width: 0;
}

.cash-shop-panel > .panel-head p {
  margin: 3px 0 0;
}

.cash-shop-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid rgba(255, 220, 141, 0.14);
  border-radius: 6px;
  background: rgba(5, 6, 8, 0.48);
}

.cash-shop-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #b9b3aa;
  background: transparent;
  font: 800 13px Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.cash-shop-tab:hover,
.cash-shop-tab.active {
  color: #fff0bd;
  border-color: rgba(255, 220, 141, 0.3);
  background: linear-gradient(180deg, rgba(121, 83, 184, 0.42), rgba(39, 24, 58, 0.5));
}

.cash-shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cash-shop-filters label {
  flex: 1 1 150px;
  display: grid;
  gap: 4px;
  color: #c7bda9;
  font-size: 11px;
}

.cash-shop-filters select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  border-radius: 5px;
  color: #f5ead2;
  background: #111318;
}

.cash-shop-info,
.cash-shop-summary {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border-left: 3px solid #7953b8;
  color: #cfc6b9;
  background: rgba(121, 83, 184, 0.08);
  font-size: 12px;
  line-height: 1.4;
}

.cash-shop-summary {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cash-shop-list {
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

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

.cash-product-grid {
  display: grid;
  gap: 10px;
}

.cash-product-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 220, 141, 0.16);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(19, 21, 26, 0.94), rgba(8, 9, 12, 0.92));
  overflow: hidden;
}

.cash-product-art {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 220, 141, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
}

.cash-product-art img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  image-rendering: pixelated;
}

.cash-product-copy {
  min-width: 0;
}

.cash-product-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cash-product-title h3 {
  margin: 0;
  color: #f5ead2;
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cash-product-title > span {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cash-product-copy p {
  margin: 5px 0;
  color: #bdb5a8;
  font-size: 12px;
  line-height: 1.32;
}

.cash-product-copy .pet-affinity {
  color: #8ed9a3;
  font-weight: 800;
}

.cash-product-copy .pet-special-effect {
  color: #ffc472;
}

.cash-product-copy small {
  display: block;
  color: #8f8a83;
  font-size: 10px;
  line-height: 1.3;
}

.cash-buy-btn {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 38px;
}

.ore-art span {
  width: 42px;
  height: 42px;
  transform: rotate(45deg);
  border: 2px solid color-mix(in srgb, var(--ore-color), white 32%);
  border-radius: 5px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ore-color), white 28%), var(--ore-color) 55%, #17131b);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ore-color), transparent 38%);
}

.xp-potion-art {
  position: relative;
}

.xp-potion-art img {
  filter: hue-rotate(245deg) saturate(1.35);
}

.xp-potion-art strong {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 30px;
  padding: 3px 4px;
  border: 1px solid rgba(255, 224, 130, 0.42);
  border-radius: 4px;
  color: #fff0b0;
  background: #22142f;
  font-size: 10px;
  text-align: center;
}

.legendary-cash-pet {
  border-color: rgba(255, 163, 61, 0.68);
  background:
    linear-gradient(145deg, rgba(65, 33, 16, 0.5), rgba(17, 12, 12, 0.95));
  animation: legendaryCardGlow 2.2s ease-in-out infinite;
}

.legendary-pet-aura,
.legendary-owned-pet {
  animation: legendaryCardGlow 2.2s ease-in-out infinite;
}

.legendary-pet-sprite {
  animation: legendarySpriteGlow 1.8s ease-in-out infinite !important;
}

.pet-slot small {
  display: block;
  color: #aaa196;
  font-size: 9px;
  line-height: 1.25;
}

@keyframes legendaryCardGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 185, 79, 0.12), 0 0 8px rgba(255, 132, 38, 0.22); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 225, 137, 0.3), 0 0 18px rgba(255, 161, 49, 0.52); }
}

@keyframes legendarySpriteGlow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 139, 40, 0.72)) brightness(1); }
  50% { filter: drop-shadow(0 0 13px rgba(255, 220, 100, 0.96)) brightness(1.18); }
}

.shop-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 220, 141, 0.16);
  border-radius: 8px;
  background: rgba(9, 10, 13, 0.58);
}

.shop-item-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 220, 141, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.shop-item-icon img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-item-copy h3 {
  margin: 0 0 4px;
  color: #f5ead2;
  font-size: 16px;
}

.shop-item-copy p {
  margin: 0 0 6px;
  color: var(--classic-muted);
  font-size: 13px;
  line-height: 1.35;
}

.shop-item-copy span {
  color: #ffe9ad;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .shop-page-grid {
    grid-template-columns: 1fr;
  }

  .cash-shop-panel {
    order: -1;
  }

  .shop-hero-panel {
    min-height: 280px;
  }

  .shop-stall-art {
    height: 210px;
  }
}

@media (max-width: 620px) {
  .shop-card {
    grid-template-columns: 52px 1fr;
  }

  .shop-card .game-btn {
    grid-column: 1 / -1;
  }

  .cash-pet-grid {
    grid-template-columns: 1fr;
  }

  .cash-shop-summary {
    flex-direction: column;
  }

  .cash-product-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cash-product-art {
    width: 72px;
    height: 72px;
  }

  .cash-product-art img {
    width: 64px;
    height: 64px;
  }
}

#pvpScreen .game-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(255, 219, 135, 0.46);
  border-radius: 6px;
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 -3px 0 rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(0, 0, 0, 0.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  white-space: normal;
  cursor: pointer;
}

#pvpScreen .game-btn.secondary {
  color: #eadcff;
  border-color: rgba(190, 144, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(207, 168, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%);
}

#pvpScreen .game-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 231, 156, 0.78);
}

.pvp-page-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

#pvpScreen .panel {
  border: 1px solid var(--classic-line-soft);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(121, 83, 184, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(31, 34, 41, 0.94), rgba(14, 16, 20, 0.96));
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.34);
  padding: 14px;
}

.pvp-summary-panel,
.pvp-log-panel {
  grid-column: 1 / -1;
}

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

.pvp-summary-grid div,
.rank-row,
.pvp-opponent-card {
  border: 1px solid rgba(255, 220, 141, 0.16);
  border-radius: 8px;
  background: rgba(9, 10, 13, 0.58);
}

.pvp-summary-grid div {
  min-height: 72px;
  padding: 12px;
}

.pvp-summary-grid span,
.rank-row p,
.rank-row small,
.pvp-opponent-card p {
  display: block;
  color: var(--classic-muted);
  font-size: 12px;
}

.pvp-summary-grid strong {
  display: block;
  margin-top: 6px;
  color: #ffe9ad;
  font-size: 20px;
}

.rank-list,
.pvp-opponent-list {
  display: grid;
  gap: 8px;
}

.rank-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.rank-position {
  color: #ffe9ad;
  font-size: 18px;
  text-align: center;
}

.rank-row h3,
.pvp-opponent-card h3 {
  margin: 0 0 4px;
  color: #f5ead2;
  font-size: 15px;
}

.rank-row > span {
  color: #ffe9ad;
  font-weight: 900;
  text-align: right;
}

.rank-row small {
  margin-top: 3px;
  font-weight: 600;
}

.pvp-opponent-card {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.pvp-result-log {
  min-height: 180px;
}

@media (max-width: 900px) {
  .pvp-page-grid {
    grid-template-columns: 1fr;
  }

  .pvp-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .pvp-summary-grid,
  .rank-row,
  .pvp-opponent-card {
    grid-template-columns: 1fr;
  }

  .rank-row > span {
    text-align: left;
  }
}

#adminScreen .game-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(255, 219, 135, 0.46);
  border-radius: 6px;
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 190, 0.06),
    inset 0 -3px 0 rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(0, 0, 0, 0.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  white-space: normal;
  cursor: pointer;
}

#adminScreen .game-btn.secondary {
  color: #eadcff;
  border-color: rgba(190, 144, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(207, 168, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%);
}

#adminScreen .game-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 231, 156, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 232, 160, 0.2), transparent 36%),
    linear-gradient(180deg, #3d2d21 0%, #1d1511 100%);
}

.admin-page-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

#adminScreen .panel {
  border: 1px solid var(--classic-line-soft);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(121, 83, 184, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(31, 34, 41, 0.94), rgba(14, 16, 20, 0.96));
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.34);
}

.admin-lock-panel,
.admin-card {
  padding: 14px;
}

.admin-form,
.admin-resource-grid,
.admin-vip-row,
.admin-item-grid {
  display: grid;
  gap: 10px;
}

.admin-resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-vip-row {
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
}

.admin-item-card {
  grid-column: 1 / -1;
}

.admin-item-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.admin-item-select {
  grid-column: span 3;
}

#adminScreen label {
  display: grid;
  gap: 5px;
  color: #c8b891;
  font-size: 12px;
  font-weight: 800;
}

#adminScreen input,
#adminScreen select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  border-radius: 7px;
  color: #f5ead2;
  background: rgba(6, 7, 10, 0.76);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
}

#adminScreen select option {
  color: #f5ead2;
  background: #11131a;
}

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

.admin-summary-grid div {
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 220, 141, 0.13);
  border-radius: 8px;
  background: rgba(6, 7, 10, 0.48);
}

.admin-summary-grid span {
  display: block;
  color: var(--classic-muted);
  font-size: 11px;
}

.admin-summary-grid strong {
  display: block;
  color: #ffe9ad;
  margin-top: 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .admin-tools-grid,
  .admin-resource-grid,
  .admin-vip-row,
  .admin-item-grid {
    grid-template-columns: 1fr;
  }

  .admin-item-select {
    grid-column: auto;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }
}

.name-with-vip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  vertical-align: middle;
}

.name-with-vip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-name-rgb > span {
  color: #ffe9ad;
  background: linear-gradient(90deg, #ff4d5d, #ffdf6b, #69d27b, #6ab7ff, #b878ff, #ff4d5d);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: vipNameShift 4s linear infinite;
  filter: drop-shadow(0 0 5px rgba(255, 219, 135, 0.28));
}

@keyframes vipNameShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}

.vip-badge {
  width: 38px;
  height: 28px;
  flex: 0 0 auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 4px rgba(255, 196, 76, 0.42))
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}

.detail-vip-badge {
  width: 34px;
  height: 24px;
}

.selection-vip-badge,
.combat-vip-badge,
.rank-vip-badge {
  width: 30px;
  height: 22px;
}

#playerName .name-with-vip {
  justify-content: flex-start;
}

.item-lock-mark,
.slot-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 219, 135, 0.38);
  border-radius: 4px;
  color: #ffe9ad;
  background: rgba(61, 42, 20, 0.68);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  padding: 3px 5px;
}

.slot-lock-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
}

.bag-slot.locked-item {
  outline: 1px solid rgba(255, 219, 135, 0.38);
  box-shadow:
    inset 0 0 16px rgba(255, 219, 135, 0.08),
    0 0 12px rgba(255, 183, 69, 0.14);
}

.pet-slot.active-pet {
  outline: 1px solid rgba(105, 210, 123, 0.55);
  box-shadow:
    inset 0 0 16px rgba(105, 210, 123, 0.08),
    0 0 12px rgba(105, 210, 123, 0.2);
}

.slot-actions button:disabled,
.row-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

#heroCombatant .sprite-wrap .assassin-attack-sprite {
  width: clamp(168px, 24vw, 280px);
  height: clamp(118px, 17vw, 196px);
  max-width: 94%;
  object-fit: contain;
  image-rendering: auto;
  transform: translateX(12px);
  z-index: 3;
}

#heroCombatant .sprite-wrap .mage-attack-sprite {
  width: clamp(172px, 25vw, 292px);
  height: clamp(118px, 17vw, 196px);
  max-width: 94%;
  object-fit: contain;
  image-rendering: auto;
  transform: translateX(6px);
  z-index: 3;
}

/* Android/PWA compact play mode. Keep the fight first and collapse side information on narrow screens. */
@media (max-width: 780px) {
  body {
    background-size: 10px 10px, 10px 10px, auto, auto, auto;
  }

  .app-shell {
    padding: 8px 8px 82px;
  }

  #gameScreen .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 58px;
    padding: 8px;
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(25, 28, 34, 0.97), rgba(10, 11, 14, 0.98));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  }

  #gameScreen .identity p {
    display: none;
  }

  #gameScreen .identity h1 {
    font-size: 18px;
  }

  #gameScreen .top-stats {
    order: 2;
    width: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #gameScreen .top-stats::-webkit-scrollbar {
    display: none;
  }

  #gameScreen .top-stats .chip {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 9px;
    font-size: 11px;
  }

  #gameScreen .top-actions {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    width: auto;
    padding: 6px;
    border: 1px solid rgba(255, 230, 168, 0.18);
    border-radius: 10px;
    background:
      linear-gradient(180deg, rgba(31, 34, 41, 0.96), rgba(9, 10, 13, 0.98));
    box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.42);
  }

  #gameScreen .icon-nav-btn {
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    gap: 2px;
  }

  #gameScreen .icon-nav-btn img {
    width: 26px;
    height: 26px;
  }

  #gameScreen .icon-nav-btn span {
    font-size: 10px;
    line-height: 1;
  }

  #gameScreen #logoutButton {
    min-width: 58px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }

  #gameScreen .game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #gameScreen .combat-column {
    order: 1;
  }

  #gameScreen .game-grid > .side-panel:first-child {
    order: 2;
  }

  #gameScreen .game-grid > .side-panel:last-child {
    order: 3;
  }

  #gameScreen .combat-panel {
    padding: 10px;
  }

  #gameScreen .combat-header {
    gap: 8px;
  }

  #gameScreen .combat-header h2 {
    font-size: 18px;
  }

  #gameScreen .combat-header p,
  #gameScreen .threat-pill {
    font-size: 11px;
  }

  #gameScreen .arena {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #gameScreen .turn-lane {
    display: none;
  }

  #gameScreen .combatant {
    min-height: 214px;
    padding: 8px;
  }

  #gameScreen .sprite-wrap {
    min-height: 124px;
  }

  #gameScreen .sprite-wrap .sprite-asset {
    width: clamp(88px, 34vw, 132px);
    height: clamp(88px, 34vw, 132px);
  }

  #gameScreen #heroCombatant .sprite-wrap .assassin-attack-sprite,
  #gameScreen #heroCombatant .sprite-wrap .mage-attack-sprite {
    width: min(88vw, 260px);
    height: min(48vw, 170px);
  }

  #gameScreen .ability-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  #gameScreen .ability-bar .game-btn {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 12px;
  }

  #gameScreen .encounter-panel {
    padding: 10px;
  }

  #gameScreen .encounter-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  #gameScreen .encounter-card {
    flex: 0 0 152px;
    min-height: 118px;
    padding: 8px;
  }

  #gameScreen .side-panel {
    max-height: 58px;
    overflow: hidden;
    padding: 8px 10px;
    border-radius: 8px;
    transition: max-height 0.22s ease, box-shadow 0.22s ease;
  }

  #gameScreen .side-panel:focus-within,
  #gameScreen .side-panel:hover {
    max-height: 76vh;
    overflow: auto;
    box-shadow: 0 18px 26px rgba(0, 0, 0, 0.42);
  }

  #gameScreen .side-panel::after {
    content: "toque para expandir";
    display: block;
    margin-top: 4px;
    color: rgba(216, 204, 186, 0.62);
    font-size: 10px;
    text-align: center;
  }

  #gameScreen .side-panel:focus-within::after,
  #gameScreen .side-panel:hover::after {
    display: none;
  }

  #gameScreen .side-panel .panel-head {
    min-height: 38px;
    margin: 0;
  }

  #gameScreen .side-panel .panel-head h2,
  #gameScreen .side-panel .panel-title-btn {
    font-size: 14px;
  }

  #gameScreen .side-panel .zone-list,
  #gameScreen .side-panel .quest-list,
  #gameScreen .side-panel .equipment-list,
  #gameScreen .side-panel .inventory-list {
    max-height: 34vh;
    overflow: auto;
  }

  #gameScreen .profile-card {
    grid-template-columns: 48px 1fr;
    gap: 8px;
    min-height: 42px;
  }

  #gameScreen .avatar-frame {
    width: 46px;
    height: 46px;
  }

  #gameScreen .avatar-frame img {
    width: 42px;
    height: 42px;
  }

  #gameScreen .profile-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  #gameScreen .profile-action {
    min-height: 58px;
    padding: 5px 4px;
  }

  #gameScreen .profile-action img {
    width: 29px;
    height: 31px;
  }

  #gameScreen .profile-action span {
    font-size: 10px;
  }
}

@media (max-width: 430px) {
  #gameScreen .top-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    left: 6px;
    right: 6px;
    bottom: 6px;
  }

  #gameScreen .icon-nav-btn span {
    font-size: 9px;
  }

  #gameScreen .ability-bar {
    grid-template-columns: 1fr;
  }
}

/* Skills, system dialogs and payment surfaces. */
.skill-node {
  height: 224px;
  min-height: 224px;
  grid-template-rows: 14px 78px 38px 34px;
  align-content: start;
  justify-items: center;
  text-align: center;
  overflow: hidden;
}

.skill-icon-frame,
.skill-detail-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 220, 141, 0.3);
  border-radius: 6px;
  background: rgba(5, 5, 7, 0.72);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55);
}

.skill-icon-frame {
  width: 76px;
  height: 76px;
}

.skill-icon-frame img,
.skill-detail-icon img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 5px;
  box-sizing: border-box;
  object-fit: contain;
  image-rendering: pixelated;
}

#skillScreen .skill-icon-frame img {
  width: 74px !important;
  height: 74px !important;
  max-width: 74px;
  max-height: 74px;
}

.skill-node strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.skill-node em {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.08;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.skill-node.legendary .skill-icon-frame,
.skill-detail-card.legendary .skill-detail-icon {
  border-color: rgba(255, 103, 88, 0.72);
  box-shadow: inset 0 0 15px rgba(255, 62, 62, 0.12), 0 0 12px rgba(255, 76, 76, 0.28);
}

.skill-node.locked .skill-icon-frame img {
  filter: grayscale(0.82) brightness(0.62);
}

.skill-detail-heading {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.skill-detail-icon {
  width: 104px;
  height: 104px;
}

.classic-ui-btn,
.inventory-modal-actions .game-btn,
.inventory-modal-actions .game-btn.secondary {
  min-width: 124px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 220, 141, 0.42);
  border-radius: 6px;
  color: #ffe9ad;
  background: linear-gradient(180deg, #3a2c22 0%, #17110f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 242, 188, 0.08), 0 3px 0 rgba(0, 0, 0, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px 0 #120806;
  cursor: pointer;
  image-rendering: auto;
  filter: none;
}

.classic-ui-btn:hover,
.inventory-modal-actions .game-btn:hover,
.inventory-modal-actions .game-btn.secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 232, 163, 0.78);
  background: linear-gradient(180deg, #503d2c 0%, #201613 100%);
  filter: none;
}

.classic-ui-btn:active,
.inventory-modal-actions .game-btn:active,
.inventory-modal-actions .game-btn.secondary:active {
  transform: translateY(1px);
  background: linear-gradient(180deg, #1a1312 0%, #33231f 100%);
}

.classic-ui-btn:disabled,
.inventory-modal-actions .game-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.7);
  background: linear-gradient(180deg, #282421 0%, #141311 100%);
}

.real-money-shop-panel {
  grid-column: 1 / -1;
}

.real-money-product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.real-money-product {
  min-height: 220px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 220, 141, 0.2);
  border-radius: 7px;
  background: rgba(9, 10, 13, 0.62);
}

.real-money-product > span {
  color: #b99de7;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.real-money-product h3 {
  color: #ffe9ad;
  font-size: 18px;
}

.real-money-product p {
  color: var(--classic-muted);
  font-size: 12px;
  line-height: 1.4;
}

.real-money-product > strong {
  color: #7ee6a0;
  font-size: 19px;
}

.real-money-product.vip-product {
  border-color: rgba(255, 208, 92, 0.38);
  background: linear-gradient(180deg, rgba(104, 72, 16, 0.2), rgba(9, 10, 13, 0.68));
}

body.system-modal-open {
  overflow: hidden;
}

.system-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 4, 7, 0.82);
  backdrop-filter: blur(5px);
}

.system-modal-backdrop[hidden] {
  display: none;
}

.pvp-battle-dialog,
.offline-reward-dialog,
.pix-payment-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(255, 220, 141, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, #20232a, #0d0f13);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
}

.offline-reward-dialog,
.pix-payment-dialog {
  width: min(720px, calc(100vw - 32px));
}

.system-modal-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 220, 141, 0.2);
  background: rgba(9, 10, 13, 0.48);
}

.system-modal-header span {
  color: #9c9180;
  font-size: 10px;
  text-transform: uppercase;
}

.system-modal-header h2 {
  margin-top: 3px;
  color: #ffe9ad;
  font-size: 22px;
}

.system-modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  border-radius: 50%;
  color: #f1e3c8;
  background: rgba(255, 255, 255, 0.05);
  font-size: 25px;
  cursor: pointer;
}

.pvp-battle-content,
.offline-reward-content,
.pix-payment-content {
  padding: 14px;
}

.pvp-arena-stage {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(125, 76, 168, 0.18), transparent 44%), #090b10;
}

.pvp-fighter {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.pvp-fighter h3 {
  min-height: 28px;
  color: #ffe9ad;
  font-size: 19px;
}

.pvp-fighter > span {
  color: #a9a194;
  font-size: 11px;
}

.pvp-fighter .pvp-fighter-sprite {
  width: min(220px, 23vw);
  height: 220px;
  object-fit: contain;
  image-rendering: pixelated;
}

.pvp-fighter.enemy .pvp-fighter-sprite {
  transform: scaleX(-1);
}

.pvp-versus {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid #d6a94c;
  border-radius: 50%;
  color: #29170e;
  background: #f1c55c;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 900;
}

.pvp-hp-bar {
  width: min(240px, 100%);
  height: 14px;
  padding: 2px;
  border: 1px solid rgba(255, 225, 151, 0.32);
  background: #090909;
}

.pvp-hp-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #801919, #e14242);
  transition: width 0.22s ease;
}

.pvp-mp-bar {
  width: min(240px, 100%);
  height: 5px;
  padding: 1px;
  border: 1px solid rgba(153, 193, 255, 0.28);
  background: #08090e;
}

.pvp-mp-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #244aa8, #57a9ff);
  box-shadow: 0 0 5px rgba(69, 145, 255, 0.45);
  transition: width 0.22s ease;
}

.combat-mp-line {
  width: 100%;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid rgba(113, 171, 255, 0.26);
  background: #070910;
}

.combat-mp-line > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #254aa6, #62b6ff);
  box-shadow: 0 0 5px rgba(75, 153, 255, 0.52);
}

.hp-readout > small {
  color: #8dc2ff;
  font-size: 9px;
}

.combat-skill-btn small {
  display: block;
  margin-top: 2px;
  color: #8fc5ff;
  font-size: 8px;
}

.healing-float {
  color: #61e587 !important;
  text-shadow: 1px 1px 0 #071c0b, 0 0 8px rgba(64, 255, 116, 0.62) !important;
}

.pvp-fighter > small {
  color: #8abfff;
  font-size: 9px;
}

.pvp-effect-list {
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.pvp-effect-list span {
  padding: 2px 5px;
  border: 1px solid rgba(214, 169, 76, 0.28);
  color: #e8d19a;
  background: rgba(13, 10, 15, 0.84);
  font-size: 8px;
  text-transform: uppercase;
}

.pvp-float-text {
  position: absolute;
  z-index: 5;
  top: 42%;
  left: 50%;
  pointer-events: none;
  color: #fff1c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #160807, 0 0 8px rgba(255, 211, 105, 0.5);
  animation: pvp-float-damage 0.72s ease-out forwards;
}

.pvp-float-text.critical {
  color: #ff3b35;
  font-size: 36px;
  text-shadow: 2px 2px 0 #210000, 0 0 14px rgba(255, 30, 20, 0.85);
}

.pvp-float-text.healing { color: #63e68a; }
.pvp-float-text.dodged { color: #80cfff; font-size: 18px; }

@keyframes pvp-float-damage {
  from { opacity: 0; transform: translate(-50%, 12px) scale(0.82); }
  28% { opacity: 1; transform: translate(-50%, -5px) scale(1.08); }
  to { opacity: 0; transform: translate(-50%, -42px) scale(1); }
}

.pvp-fighter > strong {
  color: #e7d9bd;
  font-size: 11px;
}

.pvp-fighter.hero.pvp-strike { transform: translateX(24px); }
.pvp-fighter.enemy.pvp-strike { transform: translateX(-24px); }
.pvp-fighter.pvp-hit { filter: brightness(1.9) saturate(0.4); }

.pvp-live-log {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 220, 141, 0.14);
  color: #d8c9ab;
  background: rgba(5, 6, 8, 0.68);
  text-align: center;
}

.pvp-battle-result,
.payment-approved {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 0;
}

.pvp-battle-result strong {
  font-size: 24px;
}

.pvp-battle-result .win { color: #77e18e; }
.pvp-battle-result .loss { color: #ff7676; }

.offline-summary-lead {
  margin-bottom: 12px;
  color: #d9c9aa;
}

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

.offline-summary-grid div {
  min-height: 76px;
  padding: 11px;
  border: 1px solid rgba(255, 220, 141, 0.16);
  border-radius: 6px;
  background: rgba(7, 8, 11, 0.64);
}

.offline-summary-grid span {
  display: block;
  color: #9c9180;
  font-size: 10px;
  text-transform: uppercase;
}

.offline-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: #ffe9ad;
  font-size: 17px;
}

.offline-warning {
  margin: 10px 0;
  padding: 9px 11px;
  border-left: 3px solid #d89a4b;
  color: #e0c99e;
  background: rgba(216, 154, 75, 0.08);
}

.offline-reward-content > .classic-ui-btn {
  display: block;
  margin: 14px auto 0;
}

.pix-payment-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pix-qr-code {
  width: 260px;
  height: 260px;
  padding: 8px;
  border-radius: 6px;
  background: white;
  object-fit: contain;
}

.pix-payment-copy {
  display: grid;
  gap: 10px;
}

.pix-payment-copy h3,
.payment-approved h3,
.payment-error h3 {
  color: #ffe9ad;
  font-size: 20px;
}

.pix-payment-copy > strong {
  color: #7ee6a0;
  font-size: 22px;
}

.pix-payment-copy p,
.payment-approved p,
.payment-error p {
  color: #c9bea8;
  line-height: 1.4;
}

.pix-payment-copy textarea {
  width: 100%;
  height: 72px;
  resize: none;
  padding: 9px;
  border: 1px solid rgba(255, 220, 141, 0.22);
  color: #e9dfca;
  background: #08090c;
  font-size: 10px;
}

.payment-link {
  display: inline-grid;
  place-items: center;
}

.payment-status {
  width: max-content;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-status.pending {
  color: #ffe39b;
  background: rgba(218, 154, 58, 0.16);
}

.payment-loading,
.payment-error {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.combatant h3 .vip-name-rgb > span,
.pvp-fighter h3 .vip-name-rgb > span {
  text-shadow: none;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.75)) drop-shadow(0 0 8px rgba(132, 194, 255, 0.5));
}

@media (max-width: 980px) {
  .real-money-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .skill-node {
    height: 210px;
    min-height: 210px;
  }

  .skill-detail-heading {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .skill-detail-icon {
    width: 82px;
    height: 82px;
  }

  .real-money-product-grid,
  .offline-summary-grid {
    grid-template-columns: 1fr;
  }

  .system-modal-backdrop {
    padding: 7px;
  }

  .pvp-battle-dialog,
  .offline-reward-dialog,
  .pix-payment-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .pvp-arena-stage {
    min-height: 330px;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    gap: 5px;
    padding: 10px 5px;
  }

  .pvp-versus {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .pvp-fighter h3 {
    font-size: 13px;
  }

  .pvp-fighter .pvp-fighter-sprite {
    width: min(140px, 35vw);
    height: 160px;
  }

  .pix-payment-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .pix-payment-copy {
    width: 100%;
  }

  .pix-qr-code {
    width: min(260px, 78vw);
    height: min(260px, 78vw);
  }
}

/* Inventory inspection and clean icon navigation - 2026-07-10. */
#gameScreen .profile-action,
#gameScreen .profile-action:hover,
#gameScreen .profile-action:active {
  min-height: 94px;
  padding: 5px 3px;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffe9ad;
  background: transparent;
  box-shadow: none;
}

#gameScreen .profile-action:hover {
  transform: translateY(-2px);
}

#gameScreen .profile-action:focus-visible {
  outline: 1px solid rgba(255, 225, 115, 0.72);
  outline-offset: 2px;
}

#gameScreen .profile-action img {
  width: 58px;
  height: 61px;
  margin: 0 auto 5px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.48));
  transition: transform 0.16s ease, filter 0.16s ease;
}

#gameScreen .profile-action:hover img {
  transform: scale(1.07);
  filter: drop-shadow(0 0 8px rgba(255, 214, 105, 0.38));
}

#gameScreen .profile-action span {
  font-size: 11px;
  line-height: 1.05;
}

#inventoryScreen .inventory-character-layout {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

#inventoryScreen .inventory-avatar {
  width: 154px;
  min-height: 142px;
  margin: 0 auto;
}

#inventoryScreen .equipment-slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

#inventoryScreen .equip-slot {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 112px;
  min-height: 112px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 230, 168, 0.17);
  border-radius: 6px;
  display: grid;
  grid-template-rows: auto 42px minmax(23px, auto) auto;
  align-content: start;
  justify-items: center;
  gap: 3px;
  color: #f5ead2;
  background: rgba(10, 9, 12, 0.76);
  text-align: center;
  overflow: hidden;
}

#inventoryScreen button.equip-slot {
  font: inherit;
  cursor: pointer;
}

#inventoryScreen button.equip-slot:hover,
#inventoryScreen button.equip-slot:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 222, 133, 0.62);
  box-shadow: 0 0 10px rgba(255, 195, 76, 0.14);
  outline: none;
}

#inventoryScreen .equip-slot-label {
  width: 100%;
  color: #a9a194;
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#inventoryScreen .equip-slot-art {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

#inventoryScreen .equip-item-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}

#inventoryScreen .equip-slot strong {
  min-width: 0;
  min-height: 25px;
  margin: 0;
  display: -webkit-box;
  color: #ffe9ad;
  font-size: 11px;
  line-height: 1.05;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#inventoryScreen .equip-slot small {
  color: #a9a194;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

#inventoryScreen .equip-slot.empty {
  grid-template-rows: auto 1fr;
  opacity: 0.58;
}

#inventoryScreen .equip-slot-empty {
  align-self: center;
  color: #706a62;
  font-size: 11px;
}

#inventoryScreen .bag-slot-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  grid-auto-rows: 140px;
  align-items: stretch;
  gap: 8px;
}

#inventoryScreen .bag-slot {
  box-sizing: border-box;
  width: 100%;
  height: 140px;
  min-height: 140px;
  max-height: 140px;
  padding: 8px 6px;
  display: grid;
  grid-template-rows: 14px 58px minmax(25px, auto) auto auto;
  align-content: start;
  justify-items: center;
  gap: 3px;
  border-radius: 6px;
  font: inherit;
  text-align: center;
  overflow: hidden;
}

#inventoryScreen button.bag-slot {
  color: inherit;
  cursor: pointer;
}

#inventoryScreen button.bag-slot:hover,
#inventoryScreen button.bag-slot:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 222, 133, 0.64);
  box-shadow: 0 0 10px rgba(255, 195, 76, 0.16);
  outline: none;
}

#inventoryScreen .bag-slot.empty {
  grid-template-rows: 1fr;
}

#inventoryScreen .bag-item-icon,
#inventoryScreen .pet-slot img {
  width: 56px;
  height: 56px;
  margin: 0;
  object-fit: contain;
  image-rendering: pixelated;
}

#inventoryScreen .bag-slot strong {
  min-width: 0;
  min-height: 25px;
  display: -webkit-box;
  color: #f5ead2;
  font-size: 11px;
  line-height: 1.08;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#inventoryScreen .bag-slot > span:not(.slot-index):not(.slot-lock-badge):not(.active-pet-badge),
#inventoryScreen .bag-slot > small {
  max-width: 100%;
  color: #a9a194;
  font-size: 9px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#inventoryScreen .slot-index {
  justify-self: start;
  color: #6f6961;
  font-size: 9px;
}

#inventoryScreen .slot-lock-badge,
#inventoryScreen .active-pet-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  padding: 2px 4px;
  border: 1px solid rgba(255, 221, 124, 0.34);
  border-radius: 3px;
  color: #ffe69a;
  background: rgba(24, 16, 12, 0.88);
  font-size: 8px;
  line-height: 1;
}

#inventoryScreen .active-pet-badge {
  color: #9ff0ae;
  border-color: rgba(105, 210, 123, 0.4);
}

#inventoryScreen .material-slot {
  grid-template-rows: 18px 1fr auto;
  align-content: center;
}

.inventory-modal-open {
  overflow: hidden;
}

.inventory-modal-backdrop[hidden] {
  display: none !important;
}

.inventory-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 16px;
  display: grid;
  place-items: center;
  background: rgba(3, 4, 6, 0.78);
  backdrop-filter: blur(4px);
}

.inventory-compare-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(90vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 220, 141, 0.34);
  border-radius: 8px;
  color: #eee6da;
  background:
    linear-gradient(180deg, rgba(35, 37, 44, 0.99), rgba(12, 13, 17, 0.99));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.inventory-modal-header {
  min-height: 70px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 220, 141, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(12, 10, 12, 0.58);
}

.inventory-modal-header span {
  color: #9d9488;
  font-size: 10px;
  text-transform: uppercase;
}

.inventory-modal-header h2 {
  margin: 3px 0 0;
  color: #ffe9ad;
  font-size: 21px;
}

.inventory-modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #e8dfd1;
  background: rgba(255, 255, 255, 0.06);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.inventory-modal-close:hover,
.inventory-modal-close:focus-visible {
  color: #fff1bd;
  background: rgba(255, 190, 75, 0.12);
  outline: 1px solid rgba(255, 221, 130, 0.5);
}

.inventory-modal-content {
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

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

.inventory-compare-grid.single-compare {
  grid-template-columns: minmax(0, 410px);
  justify-content: center;
}

.inspect-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 220, 141, 0.18);
  border-radius: 7px;
  background: rgba(8, 9, 12, 0.66);
}

.inspect-label {
  display: block;
  margin-bottom: 9px;
  color: #9e968b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.inspect-item-head {
  min-height: 82px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.inspect-art {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 220, 141, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
}

.inspect-item-icon,
.inspect-pet-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
}

.inspect-item-head h3 {
  margin: 0;
  color: #ffe9ad;
  font-size: 17px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.inspect-item-head p,
.inspect-item-head small {
  display: block;
  margin: 5px 0 0;
  color: #aaa197;
  font-size: 11px;
}

.inspect-stat-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.inspect-stat-grid > div {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.025);
}

.inspect-stat-grid span {
  color: #8f8880;
  font-size: 9px;
}

.inspect-stat-grid strong {
  color: #eee4d4;
  font-size: 13px;
}

.inspect-stat-grid em {
  min-width: 30px;
  font-size: 10px;
  font-style: normal;
  text-align: right;
}

.compare-up {
  color: #7ee48e;
}

.compare-down {
  color: #ff7e86;
}

.compare-same {
  color: #77716b;
}

.inspect-meta {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  color: #9f978d;
  font-size: 10px;
  line-height: 1.3;
}

.inspect-locked,
.inspect-warning {
  color: #ffc573;
}

.empty-inspect {
  min-height: 250px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #8d867d;
}

.inventory-modal-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-modal-actions .game-btn {
  width: auto;
  min-width: 132px;
  min-height: 42px;
  height: auto;
  padding: 8px 16px 10px;
}

.inventory-modal-actions .modal-danger {
  color: #ffd1d1;
  border-color: rgba(255, 105, 112, 0.38);
}

.inspect-warning {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-left: 3px solid #d88a3d;
  background: rgba(216, 138, 61, 0.08);
  font-size: 11px;
}

@media (max-width: 760px) {
  #gameScreen .profile-action,
  #gameScreen .profile-action:hover,
  #gameScreen .profile-action:active {
    min-height: 76px;
    padding: 4px 2px;
  }

  #gameScreen .profile-action img {
    width: 45px;
    height: 47px;
    margin-bottom: 3px;
  }

  #inventoryScreen .inventory-character-layout {
    grid-template-columns: 1fr;
  }

  #inventoryScreen .inventory-avatar {
    width: min(180px, 100%);
    margin: 0 auto;
  }

  #inventoryScreen .equipment-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #inventoryScreen .bag-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 132px;
  }

  #inventoryScreen .bag-slot {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
    grid-template-rows: 12px 52px minmax(23px, auto) auto auto;
  }

  #inventoryScreen .bag-item-icon,
  #inventoryScreen .pet-slot img {
    width: 50px;
    height: 50px;
  }

  .inventory-modal-backdrop {
    padding: 7px;
  }

  .inventory-compare-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .inventory-modal-header {
    min-height: 60px;
    padding: 9px 10px;
  }

  .inventory-modal-header h2 {
    font-size: 18px;
  }

  .inventory-modal-content {
    padding: 9px;
  }

  .inventory-compare-grid,
  .inventory-compare-grid.single-compare {
    grid-template-columns: 1fr;
  }

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

  .inventory-modal-actions .game-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  #inventoryScreen .bag-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.pvp-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .pvp-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .pvp-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* One rarity language across inventory, equipment, pets and comparisons. */
.rarity-comum { --rarity-color: #f4f4f4; --rarity-border: rgba(244, 244, 244, 0.58); }
.rarity-incomum { --rarity-color: #69d27b; --rarity-border: rgba(105, 210, 123, 0.68); }
.rarity-raro { --rarity-color: #63b4ff; --rarity-border: rgba(99, 180, 255, 0.72); }
.rarity-epico { --rarity-color: #b878ff; --rarity-border: rgba(184, 120, 255, 0.76); }
.rarity-lendario { --rarity-color: #ff9a3d; --rarity-border: rgba(255, 154, 61, 0.82); }
.rarity-mistico { --rarity-color: #ff4d5d; --rarity-border: rgba(255, 77, 93, 0.86); }
.rarity-celestial { --rarity-color: #ffffff; --rarity-border: rgba(255, 255, 255, 0.9); }

#inventoryScreen .equip-slot[class*="rarity-"],
#inventoryScreen .bag-slot[class*="rarity-"],
.inspect-card[class*="rarity-"],
.cash-product-card[class*="rarity-"] {
  border-color: var(--rarity-border) !important;
}

#inventoryScreen button.equip-slot[class*="rarity-"]:hover,
#inventoryScreen button.equip-slot[class*="rarity-"]:focus-visible,
#inventoryScreen button.bag-slot[class*="rarity-"]:hover,
#inventoryScreen button.bag-slot[class*="rarity-"]:focus-visible {
  border-color: var(--rarity-color) !important;
}

#inventoryScreen .equip-slot[class*="rarity-"] > strong,
#inventoryScreen .equip-slot[class*="rarity-"] > small,
#inventoryScreen .bag-slot[class*="rarity-"] > strong,
#inventoryScreen .bag-slot[class*="rarity-"] > span:not(.slot-index):not(.slot-lock-badge):not(.active-pet-badge),
.inspect-card[class*="rarity-"] .inspect-item-head h3,
.inspect-card[class*="rarity-"] .inspect-item-head p,
.cash-product-card[class*="rarity-"] .cash-product-title h3,
.cash-product-card[class*="rarity-"] .cash-product-title > span {
  color: var(--rarity-color);
}

.inspect-card[class*="rarity-"] .inspect-art {
  border-color: var(--rarity-border);
}

#inventoryScreen .rarity-lendario,
.inspect-card.rarity-lendario,
.cash-product-card.rarity-lendario {
  box-shadow: inset 0 0 16px rgba(255, 154, 61, 0.16), 0 0 12px rgba(255, 154, 61, 0.24);
}

#inventoryScreen .rarity-mistico,
.inspect-card.rarity-mistico,
.cash-product-card.rarity-mistico {
  box-shadow: inset 0 0 17px rgba(255, 77, 93, 0.18), 0 0 13px rgba(255, 77, 93, 0.28);
}

#inventoryScreen .rarity-celestial,
.inspect-card.rarity-celestial,
.cash-product-card.rarity-celestial {
  animation: celestialRarityFrame 3s linear infinite;
}

#inventoryScreen .rarity-celestial > strong,
#inventoryScreen .rarity-celestial > small,
#inventoryScreen .rarity-celestial > span:not(.slot-index):not(.slot-lock-badge):not(.active-pet-badge),
.inspect-card.rarity-celestial .inspect-item-head h3,
.inspect-card.rarity-celestial .inspect-item-head p,
.cash-product-card.rarity-celestial .cash-product-title h3,
.cash-product-card.rarity-celestial .cash-product-title > span {
  color: #fff;
  background: linear-gradient(90deg, #ff5967, #ffd15c, #70e58b, #6cbcff, #c47cff, #ff5967);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: celestialRarityText 3s linear infinite;
}

@keyframes celestialRarityFrame {
  0% { border-color: #ff5967; box-shadow: inset 0 0 17px rgba(255, 89, 103, 0.18), 0 0 13px rgba(255, 89, 103, 0.34); }
  25% { border-color: #ffd15c; box-shadow: inset 0 0 17px rgba(255, 209, 92, 0.18), 0 0 13px rgba(255, 209, 92, 0.34); }
  50% { border-color: #70e58b; box-shadow: inset 0 0 17px rgba(112, 229, 139, 0.18), 0 0 13px rgba(112, 229, 139, 0.34); }
  75% { border-color: #6cbcff; box-shadow: inset 0 0 17px rgba(108, 188, 255, 0.18), 0 0 13px rgba(108, 188, 255, 0.34); }
  100% { border-color: #c47cff; box-shadow: inset 0 0 17px rgba(196, 124, 255, 0.18), 0 0 13px rgba(196, 124, 255, 0.34); }
}

@keyframes celestialRarityText {
  from { background-position: 0% 50%; }
  to { background-position: 260% 50%; }
}

/* Final classic controls: newer screens must never inherit pixel-button assets. */
.page-screen .game-btn,
.page-screen .tab-btn,
#gameScreen .game-global-chat .game-btn {
  min-width: 116px;
  width: auto;
  min-height: 40px;
  height: auto;
  padding: 9px 18px 10px;
  border: 1px solid rgba(255, 219, 135, 0.46);
  border-radius: 6px;
  color: #ffe9ad;
  background:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%);
  background-image:
    linear-gradient(180deg, rgba(255, 230, 158, 0.14), transparent 38%),
    linear-gradient(180deg, #31241c 0%, #17100e 100%) !important;
  background-size: auto !important;
  box-shadow: inset 0 0 0 1px rgba(255,245,190,.06), inset 0 -3px 0 rgba(0,0,0,.38), 0 3px 0 rgba(0,0,0,.52);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 1px 1px 0 #120806;
  white-space: normal;
  image-rendering: auto;
  filter: none;
  cursor: pointer;
}

.page-screen .game-btn.secondary,
.page-screen .tab-btn,
#gameScreen .game-global-chat .game-btn.secondary {
  color: #eadcff;
  border-color: rgba(190,144,255,.42);
  background-image:
    linear-gradient(180deg, rgba(207,168,255,.13), transparent 38%),
    linear-gradient(180deg, #30243d 0%, #17101e 100%) !important;
}

.page-screen .game-btn:hover,
.page-screen .tab-btn:hover,
#gameScreen .game-global-chat .game-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,231,156,.78);
  background-image:
    linear-gradient(180deg, rgba(255,232,160,.2), transparent 36%),
    linear-gradient(180deg, #3d2d21 0%, #1d1511 100%) !important;
  filter: none;
}

.page-screen .game-btn:active,
.page-screen .tab-btn:active,
#gameScreen .game-global-chat .game-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.5), 0 1px 0 rgba(0,0,0,.52);
}

.page-screen .tab-btn.active,
.page-screen .game-btn.auto-active {
  color: #efffd8;
  border-color: rgba(138,230,99,.56);
  background-image:
    linear-gradient(180deg, rgba(174,255,128,.14), transparent 38%),
    linear-gradient(180deg, #263a24 0%, #101c11 100%) !important;
}

.page-screen .game-btn:disabled,
.page-screen .tab-btn:disabled {
  opacity: .52;
  filter: grayscale(.55);
  cursor: not-allowed;
}

#gameScreen .game-global-chat {
  position: fixed !important;
  inset: auto 14px 14px auto !important;
  z-index: 90 !important;
  width: min(360px, calc(100vw - 28px)) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 8px !important;
  overflow: visible !important;
  border: 1px solid rgba(217,178,91,.3) !important;
  background: linear-gradient(180deg, #1c1d22, #101115) !important;
}

#gameScreen .game-global-chat.minimized { width: 220px !important; }
#gameScreen .game-global-chat::before,
#gameScreen .game-global-chat::after { display: none !important; content: none !important; }

.enemy-resource-spacer {
  visibility: hidden !important;
  pointer-events: none !important;
}

#gameScreen .combatant {
  grid-template-rows: 34px minmax(150px, 1fr) 62px !important;
}

#gameScreen .combatant > h3 {
  min-height: 34px;
  display: grid;
  place-items: center;
  margin: 0;
}

#gameScreen .combatant > .hp-readout {
  min-height: 62px;
  align-content: start;
}

/* Nocthara navigation art: wide named icons and square captioned icons. */
#gameScreen .profile-action-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-flow: row;
  gap: 7px 6px;
  align-items: stretch;
}

#gameScreen .profile-action,
#gameScreen .profile-action:hover,
#gameScreen .profile-action:active {
  grid-column: span 2;
  width: 100%;
  min-width: 0;
  min-height: 98px;
  padding: 4px 2px 3px;
  justify-content: flex-start;
}

#gameScreen .profile-action.profile-action-wide,
#gameScreen .profile-action.profile-action-wide:hover,
#gameScreen .profile-action.profile-action-wide:active {
  grid-column: span 3;
  min-height: 94px;
  padding: 2px;
  justify-content: center;
}

#gameScreen .profile-action img {
  width: min(74px, 100%);
  height: 72px;
  margin: 0 auto 4px;
  object-fit: contain;
  image-rendering: auto;
}

#gameScreen .profile-action.profile-action-wide img {
  width: min(116px, 100%);
  height: 90px;
  margin: 0 auto;
}

#gameScreen .profile-action span {
  width: 100%;
  min-height: 18px;
  display: grid;
  place-items: center;
  padding-inline: 2px;
  overflow-wrap: normal;
  font-size: 10px;
  line-height: 1.05;
}

@media (max-width: 760px) {
  #gameScreen .profile-action,
  #gameScreen .profile-action:hover,
  #gameScreen .profile-action:active { min-height: 86px; }
  #gameScreen .profile-action.profile-action-wide,
  #gameScreen .profile-action.profile-action-wide:hover,
  #gameScreen .profile-action.profile-action-wide:active { min-height: 82px; }
  #gameScreen .profile-action img { width: min(62px, 100%); height: 60px; }
  #gameScreen .profile-action.profile-action-wide img { width: min(102px, 100%); height: 78px; }
}

#gameScreen .game-global-chat:not(.minimized) {
  position: relative !important;
  inset: auto !important;
  width: min(740px, calc(100% - 28px)) !important;
  margin: 12px auto 24px !important;
}

#gameScreen .game-global-chat.minimized {
  position: fixed !important;
  inset: auto 14px 14px auto !important;
  width: 220px !important;
  margin: 0 !important;
}

@media (max-width: 620px) {
  #gameScreen .game-global-chat:not(.minimized) {
    width: calc(100% - 14px) !important;
    margin: 7px auto 14px !important;
  }
  #gameScreen .game-global-chat.minimized {
    inset: auto 7px 7px auto !important;
    width: 190px !important;
  }
}

/* Decorative combat frame supplied for the battle arena. */
#gameScreen .arena {
  isolation: isolate;
}

#gameScreen .arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  background: none;
  border: 44px 88px solid transparent;
  border-image-source: url("./assets/ui/battle-frame.png?v=2");
  border-image-slice: 76 180 76 180;
  border-image-width: 44px 88px;
  border-image-repeat: stretch;
  image-rendering: auto;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.62));
}

#gameScreen .arena::after {
  z-index: 0;
}

@media (max-width: 760px) {
  #gameScreen .arena::before {
    border: 38px 58px solid transparent;
    border-image-width: 38px 58px;
  }
}

/* Floating global chat, offset from the right character sidebar. */
#gameScreen .game-global-chat:not(.minimized) {
  position: fixed !important;
  inset: auto !important;
  right: calc((100vw - min(1640px, calc(100vw - 28px))) / 2 + 330px) !important;
  bottom: 14px !important;
  z-index: 90 !important;
  width: min(360px, calc(100vw - 28px)) !important;
  max-height: min(520px, calc(100vh - 28px));
  margin: 0 !important;
}

@media (max-width: 780px) {
  #gameScreen .game-global-chat:not(.minimized) {
    right: 7px !important;
    bottom: 7px !important;
    width: calc(100vw - 14px) !important;
    max-height: calc(100vh - 14px);
  }

  #gameScreen #gameGlobalChatMessages {
    height: min(230px, 42vh);
  }
}

@media (max-width: 620px) {
  #gameScreen .game-global-chat { inset: auto 7px 7px auto !important; width: calc(100vw - 14px) !important; }
  #gameScreen .game-global-chat.minimized { width: 190px !important; }
  .page-screen .game-btn,
  .page-screen .tab-btn { min-width: 0; padding-inline: 11px; }
}
