:root {
  --bg: #111217;
  --panel: #1d1f27;
  --card: #2b2f3a;
  --card-width: 170px;
  --card-height: 245px;
  --card-header-height: 30px;
  --card-footer-height: 108px;
  --card-name-size: 0.9rem;
  --card-type-size: 0.7rem;
  --card-desc-size: 0.78rem;
  --gold: #d6a84f;
  --red: #d85757;
  --blue: #4f88d6;
  --purple: #a06cd5;
  --text: #e6e6e6;
  --muted: #b0b5c0;
}

* {
  box-sizing: border-box;
}

body,
#app,
.screen,
.card,
button,
img,
.enemy-slot,
.fighter,
.fighter-info,
.enemy-info-card,
.battle-panel,
.panel,
.hud,
.hand,
.battle-actions-panel {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

body.performance-mode {
  background-attachment: scroll;
}

body.performance-mode .fighter-img,
body.performance-mode .menu-logo,
body.performance-mode .treasure-relic-orb,
body.performance-mode .map-node--available,
body.performance-mode .end-turn--pulse {
  animation: none !important;
}

body.performance-mode .panel,
body.performance-mode .battle-panel,
body.performance-mode .battle-actions-panel,
body.performance-mode .map-act-card,
body.performance-mode .map-side-panel,
body.performance-mode .treasure-panel,
body.performance-mode .shop-panel,
body.performance-mode .event-panel,
body.performance-mode .rest-panel {
  backdrop-filter: none !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34) !important;
}

body.performance-mode .card,
body.performance-mode .enemy-slot,
body.performance-mode .relic-icon {
  transition-duration: 80ms !important;
}

body.performance-mode .screen-enter,
body.performance-mode .screen-fade {
  animation-duration: 120ms !important;
}

body.performance-mode .floating-text {
  animation-duration: 520ms !important;
}

.performance-debug {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 2000;
  padding: 6px 8px;
  border: 1px solid rgba(214, 168, 79, 0.35);
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.82);
  color: #e6e6e6;
  font-size: 11px;
  pointer-events: auto;
  cursor: inherit;
}

.lore-popup {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 8, 0.34);
}

.lore-popup.hidden {
  display: none;
}

.lore-popup--map {
  place-items: end start;
  background: transparent;
}

.lore-popup--map .lore-card {
  margin: 0 0 26px 26px;
}

.lore-card {
  position: relative;
  width: min(520px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(214, 168, 79, 0.38);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 168, 79, 0.12), transparent 38%),
    linear-gradient(160deg, rgba(18, 20, 29, 0.94), rgba(8, 10, 15, 0.92));
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45), 0 0 24px rgba(214, 168, 79, 0.1);
  animation: lore-popup-in 160ms ease both;
}

.lore-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(214, 168, 79, 0.42);
  background: rgba(214, 168, 79, 0.12);
  color: #f5d98d;
  font-size: 1.1rem;
}

.lore-title {
  color: #f5d98d;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lore-text {
  margin: 5px 0 0;
  color: #d7dce7;
  line-height: 1.42;
  font-size: 0.94rem;
}

.lore-close {
  grid-column: 2;
  justify-self: start;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.lore-close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(230, 230, 230, 0.78);
  box-shadow: none;
}

.lore-popup--boss .lore-card,
.lore-popup--pressagio .lore-card {
  border-color: rgba(160, 108, 213, 0.5);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5), 0 0 26px rgba(160, 108, 213, 0.16);
}

.menu-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 8, 0.62);
}

.menu-confirm-modal.hidden {
  display: none;
}

.menu-confirm-card {
  width: min(430px, calc(100vw - 36px));
  padding: 22px;
  border-radius: 16px;
  border: 1px solid rgba(214, 168, 79, 0.42);
  background: linear-gradient(160deg, rgba(18, 20, 29, 0.96), rgba(8, 10, 15, 0.94));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58), 0 0 34px rgba(214, 168, 79, 0.12);
  text-align: center;
}

.menu-confirm-card h2 {
  margin: 0 0 8px;
  color: #f5d98d;
}

.menu-confirm-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.menu-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

button.danger,
.secondary.danger {
  border-color: rgba(216, 87, 87, 0.5);
  color: #ffc0c0;
}

.save-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2300;
  padding: 9px 13px;
  border: 1px solid rgba(214, 168, 79, 0.38);
  border-radius: 12px;
  background: rgba(9, 11, 16, 0.9);
  color: #f5d98d;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  font-size: 0.86rem;
  transition: opacity 140ms ease, transform 140ms ease;
}

.save-toast.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

@keyframes lore-popup-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #1b1f2a 0%, #0e0f14 55%, #0b0c10 100%);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  overflow: hidden;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
}

body[data-screen="menu"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.8), rgba(8, 10, 14, 0.8)),
    url("../assets/backgrounds/menu-bg.png");
}

body[data-screen="character"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.78), rgba(8, 10, 14, 0.84)),
    url("../assets/backgrounds/menu-bg.png");
}

body[data-screen="battle"],
body[data-screen="reward"],
body[data-screen="remove"],
body[data-screen="upgrade"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.72), rgba(8, 10, 14, 0.72)),
    url("../assets/backgrounds/battle-ruins.png");
}

body[data-screen="map"] {
  background-image:
    radial-gradient(circle at 50% 42%, rgba(52, 69, 103, 0.16), transparent 46%),
    linear-gradient(rgba(6, 8, 13, 0.28), rgba(6, 8, 13, 0.54)),
    url("../assets/backgrounds/map-bg.png"),
    radial-gradient(circle at 45% 12%, #26324b 0%, #11131b 46%, #07080d 100%);
}

body[data-screen="map"][data-act="0"] {
  background-image:
    radial-gradient(circle at 54% 45%, rgba(214, 168, 79, 0.1), transparent 42%),
    linear-gradient(rgba(6, 8, 13, 0.28), rgba(6, 8, 13, 0.58)),
    url("../assets/backgrounds/map-act1-bg.png"),
    url("../assets/backgrounds/map-bg.png");
}

body[data-screen="map"][data-act="1"] {
  background-image:
    radial-gradient(circle at 50% 45%, rgba(100, 90, 190, 0.16), transparent 46%),
    linear-gradient(rgba(6, 8, 13, 0.3), rgba(6, 8, 13, 0.62)),
    url("../assets/backgrounds/map-act2-bg.png"),
    url("../assets/backgrounds/map-bg.png");
}

body[data-screen="map"][data-act="2"] {
  background-image:
    radial-gradient(circle at 52% 42%, rgba(160, 64, 90, 0.18), transparent 46%),
    linear-gradient(rgba(6, 8, 13, 0.34), rgba(6, 8, 13, 0.66)),
    url("../assets/backgrounds/map-act3-bg.png"),
    url("../assets/backgrounds/map-bg.png");
}

body[data-screen="treasure"] {
  background-image:
    radial-gradient(circle at 50% 34%, rgba(214, 168, 79, 0.18), transparent 36%),
    linear-gradient(rgba(7, 8, 12, 0.64), rgba(7, 8, 12, 0.88)),
    url("../assets/backgrounds/treasure-bg.png"),
    radial-gradient(circle at 50% 8%, #2a2640 0%, #11131b 48%, #07080d 100%);
}

body[data-screen="event"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.75), rgba(8, 10, 14, 0.75)),
    url("../assets/backgrounds/event-bg.png");
}

body[data-screen="rest"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.75), rgba(8, 10, 14, 0.75)),
    url("../assets/backgrounds/rest-bg.png");
}

body[data-screen="victory"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.65), rgba(8, 10, 14, 0.65)),
    url("../assets/backgrounds/victory-bg.png");
}

body[data-screen="defeat"] {
  background-image: linear-gradient(rgba(8, 10, 14, 0.75), rgba(8, 10, 14, 0.75)),
    url("../assets/backgrounds/defeat-bg.png");
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(214, 168, 79, 0.08) 0%, rgba(214, 168, 79, 0) 40%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 46%);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

body[data-screen="battle"] #app {
  max-width: none;
  padding: 0;
}

body[data-screen="battle"] .app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 24px;
  background: rgba(12, 14, 20, 0.8);
  border-bottom: 1px solid rgba(214, 168, 79, 0.2);
  backdrop-filter: blur(10px);
  z-index: 10;
}

body[data-screen="battle"] .game-topbar-brand {
  font-size: 1.4rem;
}

body[data-screen="battle"] .run-status {
  background: rgba(29, 33, 44, 0.8);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 46px;
}

.game-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #f0cf82;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.logo-small {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(214, 168, 79, 0.2));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#audio-toggle-btn {
  min-width: 112px;
  white-space: nowrap;
}

body[data-screen="menu"] #app {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body[data-screen="menu"] .app-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  padding: 18px 28px;
  margin: 0;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.78), rgba(6, 7, 10, 0));
}

body[data-screen="menu"] .game-topbar-brand {
  display: none;
}

.main-menu {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 720px) minmax(240px, 320px);
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 96px 28px 58px;
  overflow: hidden;
}

.main-menu::before,
.main-menu::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

.main-menu::before {
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(214, 168, 79, 0.16), transparent 28%),
    radial-gradient(circle at 75% 30%, rgba(160, 108, 213, 0.14), transparent 26%),
    linear-gradient(90deg, rgba(3, 4, 7, 0.76), rgba(8, 10, 16, 0.36), rgba(3, 4, 7, 0.82));
  z-index: -2;
}

.main-menu::after {
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 36%, rgba(0, 0, 0, 0.72) 100%);
  z-index: -1;
}

.menu-hero,
.menu-side-panel {
  background: linear-gradient(180deg, rgba(18, 20, 28, 0.82), rgba(8, 10, 15, 0.72));
  border: 1px solid rgba(214, 168, 79, 0.32);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

.menu-hero {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px clamp(24px, 5vw, 64px);
  animation: menu-panel-in 0.56s ease both;
}

.menu-logo-wrap {
  margin-bottom: 28px;
  text-align: center;
}

.menu-logo {
  width: min(560px, 88vw);
  max-height: 230px;
  filter: drop-shadow(0 0 28px rgba(214, 168, 79, 0.34)) drop-shadow(0 16px 34px rgba(0, 0, 0, 0.55));
  animation: menu-logo-idle 5.5s ease-in-out infinite;
}

.menu-title-fallback {
  margin: 0;
  color: #f3d27a;
  letter-spacing: 0.08em;
}

.menu-logo:not(.missing) + .menu-title-fallback {
  display: none;
}

.menu-subtitle {
  max-width: 520px;
  margin: 6px auto 0;
  color: #cfd3dc;
  font-size: 1rem;
  line-height: 1.45;
}

.menu-actions {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-button {
  position: relative;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  background: linear-gradient(180deg, rgba(42, 46, 58, 0.96), rgba(20, 23, 31, 0.96));
  color: #f2f4f8;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow: hidden;
}

.menu-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(214, 168, 79, 0.16), transparent);
  transform: translateX(-120%);
  transition: transform 280ms ease;
}

.menu-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(214, 168, 79, 0.62);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34), 0 0 22px rgba(214, 168, 79, 0.16);
}

.menu-button:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.menu-button--primary {
  color: #16110a;
  background: linear-gradient(180deg, #f0c76d, #c99331);
  box-shadow: 0 12px 28px rgba(214, 168, 79, 0.24);
}

.menu-button:disabled {
  color: rgba(230, 230, 230, 0.45);
}

.menu-xp-bar,
.result-xp-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(214, 168, 79, 0.18);
}

.menu-xp-bar {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.menu-xp-bar span,
.result-xp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6a84f, #8cc4ff);
  box-shadow: 0 0 16px rgba(214, 168, 79, 0.35);
}

.menu-side-panel {
  align-self: center;
  padding: 18px;
  animation: menu-panel-in 0.7s ease both;
}

.menu-panel-title {
  margin: 4px 0 10px;
  color: #f3d27a;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.menu-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.menu-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #cfd3dc;
}

.menu-stat strong {
  color: #fff0c2;
}

.menu-small-text,
.menu-footer {
  color: rgba(230, 230, 230, 0.64);
  font-size: 0.84rem;
}

.menu-footer {
  position: fixed;
  left: 28px;
  right: 28px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.menu-ambient-card {
  position: fixed;
  width: 150px;
  height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(214, 168, 79, 0.2);
  background:
    linear-gradient(180deg, rgba(214, 168, 79, 0.12), rgba(28, 20, 48, 0.18)),
    url("../assets/cards/card-power.png") center / cover no-repeat;
  opacity: 0.18;
  filter: blur(0.2px);
  pointer-events: none;
}

.menu-ambient-card--left {
  left: 6vw;
  bottom: 16vh;
  transform: rotate(-12deg);
}

.menu-ambient-card--right {
  right: 7vw;
  top: 18vh;
  transform: rotate(10deg);
}

.collection-panel {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  height: calc(100vh - 112px);
  height: calc(100dvh - 112px);
  margin: 18px auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.collection-panel-section {
  margin-top: 16px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.collection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.collection-subtabs {
  margin-bottom: 12px;
}

.collection-tab {
  background: rgba(18, 20, 28, 0.85);
  color: var(--muted);
  border: 1px solid rgba(214, 168, 79, 0.22);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: none;
}

.collection-tab.active {
  color: #16110a;
  background: linear-gradient(180deg, #f0c76d, #c99331);
  border-color: rgba(214, 168, 79, 0.68);
  box-shadow: 0 10px 22px rgba(214, 168, 79, 0.22);
}

.collection-profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.collection-profile div {
  padding: 8px 10px;
  border: 1px solid rgba(214, 168, 79, 0.18);
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.56);
}

.collection-profile span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.collection-profile strong {
  color: #f5d98d;
}

.collection-grid .card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
}

.collection-grid,
.collection-relics {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 4px 8px 120px 4px;
  scrollbar-color: rgba(214, 168, 79, 0.72) rgba(12, 14, 20, 0.72);
  scrollbar-width: thin;
}

.collection-grid {
  max-height: none;
}

.collection-relics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: none;
}

.collection-grid::-webkit-scrollbar,
.collection-relics::-webkit-scrollbar {
  width: 10px;
}

.collection-grid::-webkit-scrollbar-track,
.collection-relics::-webkit-scrollbar-track {
  background: rgba(12, 14, 20, 0.72);
  border-radius: 999px;
}

.collection-grid::-webkit-scrollbar-thumb,
.collection-relics::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(214, 168, 79, 0.9), rgba(133, 95, 34, 0.9));
  border-radius: 999px;
  border: 2px solid rgba(12, 14, 20, 0.72);
}

.collection-relic {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(214, 168, 79, 0.18);
}

.collection-relic--locked {
  opacity: 0.58;
  filter: grayscale(0.85);
  border-style: dashed;
}

.collection-relic img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.collection-relic span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.card--locked {
  opacity: 0.58;
  filter: grayscale(0.85);
  cursor: default;
}

.card--locked .art,
.card--locked .card-content {
  filter: blur(1px);
}

.locked-label {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  z-index: 8;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(214, 168, 79, 0.28);
  color: #f5d98d;
  font-size: 0.72rem;
  text-align: center;
  pointer-events: none;
}

.character-select-panel {
  width: min(980px, calc(100vw - 32px));
  margin: 92px auto 40px;
}

.character-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.character-card {
  display: grid;
  grid-template-rows: 260px 1fr auto;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.9), rgba(8, 10, 14, 0.82));
  border: 1px solid rgba(214, 168, 79, 0.32);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.character-card img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}

.character-card h3 {
  margin: 0 0 8px;
  color: #f2cf83;
}

.character-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.character-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-stats span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e9edf7;
  font-size: 0.82rem;
}

.map-panel,
.shop-panel,
.treasure-panel {
  max-width: 1040px;
  margin: 36px auto;
}

.run-map {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.map-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  opacity: 0.58;
}

.map-row--current {
  opacity: 1;
}

.map-node {
  min-width: 150px;
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(31, 35, 47, 0.92), rgba(12, 14, 20, 0.9));
  border: 1px solid rgba(214, 168, 79, 0.28);
}

.map-node span {
  font-size: 1.5rem;
  color: #f3d27a;
}

.map-node small {
  color: var(--muted);
}

.map-node:disabled {
  cursor: default;
}

.map-row--done .map-node {
  filter: grayscale(0.7);
}

.map-footer {
  display: flex;
  gap: 18px;
  justify-content: center;
  color: var(--muted);
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.shop-item,
.shop-service {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.74);
  border: 1px solid rgba(214, 168, 79, 0.18);
}

.shop-item .card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
}

.shop-service {
  min-height: 160px;
  align-content: center;
}

.shop-service strong {
  color: #f3d27a;
}

/* Tesouro */
body[data-screen="treasure"] #app {
  min-height: 100vh;
}

#screen-treasure.active {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 76px 18px 22px;
}

body[data-screen="treasure"]::before {
  background:
    radial-gradient(circle at 50% 46%, transparent 28%, rgba(0, 0, 0, 0.58) 100%),
    radial-gradient(circle at 35% 25%, rgba(214, 168, 79, 0.12), transparent 30%),
    radial-gradient(circle at 70% 62%, rgba(79, 136, 214, 0.1), transparent 34%);
}

.treasure-panel {
  width: min(680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px);
  text-align: center;
  border-radius: 22px;
  border: 1px solid rgba(246, 204, 118, 0.52);
  background:
    linear-gradient(180deg, rgba(18, 17, 24, 0.92), rgba(9, 11, 17, 0.92)),
    radial-gradient(circle at 50% 0%, rgba(214, 168, 79, 0.18), transparent 48%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.52),
    0 0 48px rgba(214, 168, 79, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(13px);
  animation: treasure-panel-in 420ms ease both;
}

.treasure-kicker {
  margin-bottom: 8px;
  color: #f3d27a;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.treasure-panel h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  color: #ffe3a1;
  text-shadow: 0 0 26px rgba(214, 168, 79, 0.28);
}

.treasure-lead {
  margin: 10px auto 24px;
  max-width: 480px;
  color: var(--muted);
}

.treasure-relic-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(214, 168, 79, 0.22);
  background:
    radial-gradient(circle at 50% 24%, rgba(214, 168, 79, 0.16), transparent 46%),
    rgba(255, 255, 255, 0.035);
}

.treasure-relic-orb {
  position: relative;
  width: clamp(128px, 22vw, 176px);
  height: clamp(128px, 22vw, 176px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(246, 204, 118, 0.45);
  background:
    radial-gradient(circle at 50% 44%, rgba(246, 204, 118, 0.22), rgba(79, 136, 214, 0.08) 48%, rgba(8, 10, 14, 0.84) 72%);
  box-shadow:
    0 0 44px rgba(214, 168, 79, 0.28),
    inset 0 0 30px rgba(246, 204, 118, 0.1);
  animation: treasure-relic-float 2600ms ease-in-out infinite;
}

.treasure-relic-orb::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: conic-gradient(from 20deg, transparent, rgba(214, 168, 79, 0.24), transparent 38%, rgba(79, 136, 214, 0.18), transparent 72%);
  filter: blur(8px);
  opacity: 0.72;
  z-index: -1;
}

.treasure-relic-orb img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 16px rgba(246, 204, 118, 0.24));
  animation: treasure-relic-pop 520ms ease both;
}

.treasure-relic-orb img.missing {
  display: none;
}

.treasure-relic-fallback {
  display: none;
  color: #f3d27a;
  font-size: 4rem;
  text-shadow: 0 0 26px rgba(214, 168, 79, 0.45);
}

.treasure-relic-orb img.missing + .treasure-relic-fallback {
  display: block;
}

.treasure-relic-copy span {
  color: #f3d27a;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.treasure-relic-copy h3 {
  margin: 5px 0 8px;
  color: #fff0c2;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.treasure-relic-copy p {
  max-width: 460px;
  margin: 0 auto;
  color: #d5d8e0;
  line-height: 1.45;
}

.treasure-gold {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 22px auto;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(246, 204, 118, 0.36);
  background: rgba(214, 168, 79, 0.1);
  box-shadow: 0 0 26px rgba(214, 168, 79, 0.12);
  animation: treasure-gold-rise 620ms 140ms ease both;
}

.treasure-coin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    url("../assets/ui/gold-coin.png") center / cover no-repeat,
    radial-gradient(circle at 35% 25%, #fff0b9 0%, #e6b64f 36%, #9d6d1f 100%);
  border: 1px solid rgba(255, 232, 172, 0.62);
  box-shadow: 0 0 16px rgba(214, 168, 79, 0.36);
}

.treasure-gold strong,
.treasure-gold small {
  display: block;
  text-align: left;
}

.treasure-gold strong {
  color: #ffe08c;
  font-size: 1.35rem;
}

.treasure-gold small {
  color: var(--muted);
}

.treasure-continue {
  min-width: 230px;
  padding: 13px 22px;
  font-size: 1rem;
  box-shadow: 0 0 24px rgba(214, 168, 79, 0.18);
}

.treasure-run-summary {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.treasure-run-summary div {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.86rem;
}

.treasure-run-summary strong {
  color: var(--text);
}

@keyframes treasure-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes treasure-relic-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes treasure-relic-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes treasure-gold-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .treasure-panel {
    padding: 22px 16px;
  }

  .treasure-relic-card {
    padding: 16px;
  }

  .treasure-gold {
    border-radius: 18px;
  }

  .treasure-continue {
    width: 100%;
    min-width: 0;
  }
}

/* Mapa de jornada */
body[data-screen="map"] #app {
  max-width: none;
  width: 100vw;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

body[data-screen="map"] .app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 10px 16px;
  background: rgba(8, 10, 16, 0.72);
  border-bottom: 1px solid rgba(214, 168, 79, 0.18);
  backdrop-filter: blur(8px);
}

body[data-screen="map"] .game-topbar-brand {
  font-size: 1.18rem;
}

body[data-screen="map"]::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.34) 100%),
    linear-gradient(135deg, rgba(214, 168, 79, 0.09), transparent 32%),
    radial-gradient(circle at 70% 30%, rgba(99, 87, 178, 0.16), transparent 34%);
}

.map-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 62px 14px 14px;
  animation: map-fade-in 360ms ease both;
  font-family: "Cinzel", "Georgia", serif;
  overflow: hidden;
  background-image:
    var(--map-background-image, var(--map-act-bg, url("../assets/backgrounds/map-bg.png"))),
    var(--map-fallback-bg, url("../assets/backgrounds/map-bg.png")),
    radial-gradient(circle at 50% 40%, rgba(83, 55, 140, 0.35), transparent 40%),
    linear-gradient(135deg, #151826, #171321 45%, #0f121c);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(5, 6, 12, 0.35);
  pointer-events: none;
}

.map-shell.act-1 {
  --map-accent-local: #d6a84f;
  --map-path-local: rgba(214, 168, 79, 0.9);
  --map-node-local: rgba(214, 168, 79, 0.28);
}

.map-viewport.act-1 {
  --map-path-local: rgba(214, 168, 79, 0.9);
  --map-node-local: rgba(214, 168, 79, 0.28);
}

.map-shell.act-2 {
  --map-accent-local: #7eb5ff;
  --map-path-local: rgba(126, 181, 255, 0.88);
  --map-node-local: rgba(126, 181, 255, 0.26);
}

.map-viewport.act-2 {
  --map-path-local: rgba(126, 181, 255, 0.88);
  --map-node-local: rgba(126, 181, 255, 0.26);
}

.map-shell.act-3 {
  --map-accent-local: #c678e8;
  --map-path-local: rgba(198, 120, 232, 0.88);
  --map-node-local: rgba(198, 120, 232, 0.28);
}

.map-viewport.act-3 {
  --map-path-local: rgba(198, 120, 232, 0.88);
  --map-node-local: rgba(198, 120, 232, 0.28);
}

.map-act-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 16px;
  min-height: 86px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(18, 20, 29, 0.9), rgba(24, 23, 34, 0.72)),
    radial-gradient(circle at 18% 0%, rgba(214, 168, 79, 0.12), transparent 42%);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.map-act-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.map-act-tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 79, 0.4);
  background: rgba(214, 168, 79, 0.12);
  color: #f5d98d;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-act-card h2 {
  margin: 0 0 6px;
  color: #f5d98d;
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  text-shadow: 0 0 24px rgba(214, 168, 79, 0.22);
}

.map-act-card p {
  max-width: 680px;
  margin: 0;
}

.map-act-progress {
  min-width: 230px;
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--muted);
}

.map-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.map-progress-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, rgba(214, 168, 79, 0.3), rgba(214, 168, 79, 0.9));
  box-shadow: 0 0 12px rgba(214, 168, 79, 0.4);
}

.map-act-progress strong {
  color: #f3d27a;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-act-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-act-steps span {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 230, 230, 0.58);
  font-size: 0.76rem;
}

.map-act-steps span.active {
  border-color: rgba(214, 168, 79, 0.72);
  background: rgba(214, 168, 79, 0.14);
  color: #f8ddb0;
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.18);
}

.map-act-steps span.done {
  border-color: rgba(120, 180, 255, 0.35);
  color: rgba(172, 205, 255, 0.86);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 12px;
  margin-top: 10px;
  height: calc(100% - 98px);
  min-height: 0;
}

.map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 18px;
  background-image:
    var(--map-background-image, var(--map-act-bg, url("../assets/backgrounds/map-bg.png"))),
    var(--map-fallback-bg, url("../assets/backgrounds/map-bg.png")),
    radial-gradient(circle at 50% 40%, rgba(83, 55, 140, 0.35), transparent 40%),
    linear-gradient(135deg, #151826, #171321 45%, #0f121c);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 54px rgba(0, 0, 0, 0.38), 0 24px 58px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(5, 6, 12, 0.28);
  pointer-events: none;
}

.map-viewport--dragging {
  cursor: grabbing;
}

.map-viewport--debug {
  outline: 2px solid rgba(255, 80, 80, 0.9);
}

.map-viewport--debug .run-map {
  outline: 2px solid rgba(80, 160, 255, 0.85);
}

.map-frame {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid rgba(214, 168, 79, 0.18);
  background: url("../assets/map/map-frame.png") center / cover no-repeat;
  opacity: 0.58;
  pointer-events: none;
  z-index: 1;
}

.run-map {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  min-height: 0;
  height: 680px;
  width: 1180px;
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: visible;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 18%, rgba(160, 108, 213, 0.08), transparent 42%),
    radial-gradient(circle at 70% 68%, rgba(79, 136, 214, 0.08), transparent 46%);
  will-change: transform;
  z-index: 2;
  transform-origin: 0 0;
  transform: translate3d(0, 0, 0);
}

.run-map.map-atlas {
  position: absolute;
  left: 0;
  top: 0;
  width: max(1400px, 120vw);
  height: max(850px, 90vh);
}

.run-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 18, 0.1), rgba(10, 12, 18, 0.26)),
    radial-gradient(circle at 50% 20%, var(--act-glow, rgba(214, 168, 79, 0.18)), transparent 48%);
  pointer-events: none;
  z-index: 0;
}

.run-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(214, 168, 79, 0.08), transparent 52%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.map-fog {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.06), transparent 34%),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.05), transparent 38%);
  opacity: 0.34;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

.map-connections {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.map-link {
  fill: none;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-link-glow {
  fill: none;
  stroke: url("#map-path-glow-pattern");
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.map-link-glow--available {
  opacity: 0.72;
  filter: drop-shadow(0 0 8px rgba(214, 168, 79, 0.62));
}

.map-link-glow--completed {
  opacity: 0.48;
  filter: drop-shadow(0 0 7px rgba(120, 180, 255, 0.5));
}

.map-link-glow--preview,
.map-link-glow--travel {
  opacity: 0.9;
  stroke-width: 14;
  filter: drop-shadow(0 0 11px rgba(255, 215, 140, 0.85));
}

.map-link--locked {
  stroke: rgba(170, 180, 205, 0.24);
  stroke-width: 3.2;
  stroke-dasharray: 3 8;
}

.map-link--blocked {
  stroke: rgba(150, 96, 124, 0.3);
  stroke-width: 3.4;
  stroke-dasharray: 2 7;
  opacity: 0.72;
}

.map-link--available {
  stroke: var(--map-path-local, rgba(214, 168, 79, 0.9));
  stroke-width: 5.2;
  filter: drop-shadow(0 0 8px rgba(214, 168, 79, 0.72));
}

.map-link--completed {
  stroke: rgba(108, 175, 255, 0.82);
  stroke-width: 4.8;
  filter: drop-shadow(0 0 7px rgba(120, 180, 255, 0.5));
}

.map-link--preview {
  stroke: rgba(255, 225, 145, 0.98);
  stroke-width: 6;
  filter: drop-shadow(0 0 12px rgba(214, 168, 79, 0.85));
}

.map-link--travel {
  stroke: rgba(255, 215, 140, 0.98);
  stroke-width: 6.5;
  filter: drop-shadow(0 0 14px rgba(255, 215, 140, 0.9));
  animation: map-link-travel 0.5s ease;
}

.map-node {
  position: absolute;
  z-index: 4;
  width: 78px;
  height: 78px;
  min-width: 0;
  min-height: 78px;
  padding: 0;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: box-shadow 170ms ease, border-color 170ms ease, opacity 170ms ease, filter 170ms ease;
}

.map-node .map-node-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f4d17c;
  font-size: 1.55rem;
  line-height: 1;
  background-color: rgba(14, 16, 23, 0.88);
  background-size: 92% 92%, 92% 92%;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid rgba(214, 168, 79, 0.45);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.46),
    0 0 18px var(--map-node-local, rgba(214, 168, 79, 0.25)),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.map-node .map-node-icon--asset .map-node-fallback {
  opacity: 0;
}

.map-node .map-node-aura {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 86px;
  height: 86px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--map-node-local, rgba(214, 168, 79, 0.24)), transparent 66%);
  opacity: 0;
  pointer-events: none;
}

.map-node--available .map-node-aura,
.map-node--completed .map-node-aura {
  opacity: 1;
}

.map-node--available .map-node-aura {
  animation: map-node-pulse 2.6s ease-in-out infinite;
}

.map-node .map-node-icon--battle { background-image: url("../assets/map/node-battle.png"), url("../assets/backgrounds/node-battle.png"); }
.map-node .map-node-icon--elite { background-image: url("../assets/map/node-elite.png"), url("../assets/backgrounds/node-elite.png"); }
.map-node .map-node-icon--event { background-image: url("../assets/map/node-event.png"), url("../assets/backgrounds/node-event.png"); }
.map-node .map-node-icon--rest { background-image: url("../assets/map/node-rest.png"), url("../assets/backgrounds/node-rest.png"); }
.map-node .map-node-icon--treasure { background-image: url("../assets/map/node-treasure.png"), url("../assets/backgrounds/node-treasure.png"); }
.map-node .map-node-icon--shop { background-image: url("../assets/map/node-shop.png"), url("../assets/backgrounds/node-shop.png"); }
.map-node .map-node-icon--boss { background-image: url("../assets/map/node-boss.png"), url("../assets/backgrounds/node-boss.png"); }

.map-node strong {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 94px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.76);
  border: 1px solid rgba(214, 168, 79, 0.18);
  font-size: 0.66rem;
  color: #f0e2c1;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
}

.map-node small {
  display: none;
  color: var(--muted);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-node:disabled {
  cursor: default;
}

.map-node[aria-disabled="true"] {
  cursor: help;
}

.map-node--available {
  cursor: pointer;
  animation: none;
}

.map-node--available .map-node-icon {
  border-color: rgba(246, 204, 118, 0.9);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(214, 168, 79, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.map-node--available:hover {
  transform: translate(-50%, -50%);
  filter: brightness(1.1);
}

button.map-node:hover:not(:disabled),
button.map-node:active:not(:disabled) {
  transform: translate(-50%, -50%);
}

.map-node--completed {
  opacity: 0.92;
}

.map-node--completed .map-node-icon {
  border-color: rgba(120, 180, 255, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), 0 0 18px rgba(120, 180, 255, 0.28);
}

.map-node--current {
  opacity: 1;
}

.map-node--current .map-node-icon {
  border-color: rgba(255, 215, 140, 0.82);
  box-shadow: 0 0 24px rgba(214, 168, 79, 0.42), 0 12px 26px rgba(0, 0, 0, 0.44);
}

.map-node--skipped,
.map-node--locked {
  opacity: 0.42;
  filter: grayscale(0.7);
}

.map-node--boss {
  width: 112px;
  height: 112px;
  min-height: 112px;
}

.map-node--boss .map-node-icon {
  width: 92px;
  height: 92px;
  font-size: 2.1rem;
  border-color: rgba(217, 110, 194, 0.72);
  box-shadow:
    0 0 32px rgba(160, 108, 213, 0.5),
    0 18px 38px rgba(0, 0, 0, 0.56),
    inset 0 0 20px rgba(216, 87, 87, 0.2);
}

.map-node--risk {
  filter: saturate(1.12);
}

.map-node--risk .map-node-icon {
  border-color: rgba(216, 87, 87, 0.58);
  box-shadow: 0 0 22px rgba(216, 87, 87, 0.3), 0 14px 28px rgba(0, 0, 0, 0.46);
}

.map-node--preview {
  filter: brightness(1.18);
}

.map-node--travel {
  animation: map-node-travel 0.5s ease;
}

.map-node--boss strong {
  top: 108px;
  max-width: 86px;
  font-size: 0.68rem;
}

.map-node--boss .map-node-icon {
  width: 92px;
  height: 92px;
  color: #f5c77b;
  background-color: rgba(160, 108, 213, 0.2);
}

.map-node--battle { border-color: rgba(214, 168, 79, 0.38); }
.map-node--elite { border-color: rgba(216, 87, 87, 0.54); }
.map-node--event { border-color: rgba(160, 108, 213, 0.5); }
.map-node--rest { border-color: rgba(110, 229, 155, 0.38); }
.map-node--treasure { border-color: rgba(245, 211, 122, 0.58); }
.map-node--shop { border-color: rgba(79, 136, 214, 0.48); }

.map-node--elite .map-node-icon { color: #ff9b8f; background-color: rgba(216, 87, 87, 0.16); }
.map-node--event .map-node-icon { color: #d6b4ff; background-color: rgba(160, 108, 213, 0.18); }
.map-node--rest .map-node-icon { color: #9ff0c5; background-color: rgba(110, 229, 155, 0.14); }
.map-node--treasure .map-node-icon { color: #ffe08c; background-color: rgba(214, 168, 79, 0.2); }
.map-node--shop .map-node-icon { color: #a7d1ff; background-color: rgba(79, 136, 214, 0.16); }

.map-node-check,
.map-node-next {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.72rem;
  background: #1b2940;
  color: #acd6ff;
  border: 1px solid rgba(120, 180, 255, 0.55);
}

.map-node-next {
  top: -10px;
  right: -10px;
  bottom: auto;
  color: #16130b;
  background: #d6a84f;
  border-color: rgba(255, 229, 167, 0.8);
  font-weight: 800;
  font-size: 0;
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.65);
}

.map-node-next::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #171105;
}

.map-node--chosen {
  filter: brightness(1.18);
}

.map-side-panel {
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(214, 168, 79, 0.26);
  border-radius: 16px;
  background: rgba(11, 13, 19, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.map-node-details {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(214, 168, 79, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.map-node-details h3 {
  margin: 0;
  color: #f5d98d;
  font-size: 1rem;
}

.map-node-details p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.map-detail-kicker {
  color: rgba(245, 217, 141, 0.82);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-relics-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.map-relics-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(230, 230, 230, 0.6);
}

.map-tooltip {
  position: absolute;
  z-index: 6;
  min-width: 200px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(214, 168, 79, 0.42);
  background: rgba(12, 14, 20, 0.92);
  color: #e9edf7;
  transform: translate(-50%, -100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.map-tooltip-title {
  font-weight: 700;
  color: #f5d98d;
}

.map-tooltip-sub {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(230, 230, 230, 0.6);
}

.map-tooltip-body {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #d4d9e4;
}

.map-tooltip-state {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(230, 230, 230, 0.55);
}

.map-side-panel h3 {
  margin: 0;
  color: #f3d27a;
}

.map-stats {
  display: grid;
  gap: 8px;
}

.map-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.map-stats strong {
  color: var(--text);
}

@keyframes map-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .map-shell {
    width: 100vw;
    height: calc(100vh - 54px);
    margin: 0;
    padding: 8px;
  }

  .map-act-card {
    display: grid;
    padding: 10px;
  }

  .map-act-progress {
    justify-items: start;
    min-width: 0;
  }

  .map-act-steps {
    justify-content: flex-start;
  }

  .map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 8px;
    height: calc(100% - 112px);
  }

  .map-viewport {
    height: 100%;
  }

  .map-connections {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .map-node {
    width: 72px;
    height: 72px;
    min-height: 72px;
  }

  .map-node--boss {
    width: 92px;
    height: 92px;
    min-height: 92px;
  }

  .map-node .map-node-icon {
    width: 58px;
    height: 58px;
    font-size: 1.1rem;
  }

  .map-node--boss .map-node-icon {
    width: 76px;
    height: 76px;
  }

  .map-node strong {
    top: 66px;
    max-width: 68px;
    font-size: 0.62rem;
  }

  .map-node--boss strong {
    top: 88px;
  }

  .map-node small {
    font-size: 0.52rem;
  }

  .map-side-panel {
    padding: 9px;
  }

  .map-stats {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .map-stats div {
    padding: 6px 8px;
    font-size: 0.76rem;
  }

  .map-node-details p,
  .map-relics-panel {
    display: none;
  }
}

@media (max-width: 560px) {
  .map-layout {
    grid-template-columns: 1fr;
    height: calc(100% - 128px);
  }

  .map-viewport {
    height: 100%;
  }

  .map-node {
    width: 82px;
  }

  .map-node--boss {
    width: 96px;
  }

  .map-stats {
    display: none;
  }

  .map-side-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .map-side-panel h3,
  .map-node-details {
    display: none;
  }
}

@keyframes map-node-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes map-node-travel {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes map-link-travel {
  0% {
    stroke-dasharray: 1 10;
    opacity: 0.6;
  }
  100% {
    stroke-dasharray: 0 0;
    opacity: 1;
  }
}

/* Salas de evento, descanso e loja */
.event-scene,
.rest-scene,
.shop-scene {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.event-panel,
.rest-panel,
.shop-panel {
  width: 100%;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 20px;
  border: 1px solid rgba(214, 168, 79, 0.32);
  background:
    linear-gradient(160deg, rgba(16, 18, 26, 0.9), rgba(8, 10, 16, 0.9)),
    radial-gradient(circle at 30% 10%, rgba(214, 168, 79, 0.16), transparent 46%);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.event-kicker,
.rest-kicker,
.shop-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 210, 122, 0.8);
}

.event-options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.event-option {
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(214, 168, 79, 0.3);
  background: rgba(12, 14, 20, 0.78);
  color: #f0f2f7;
}

.event-option strong {
  display: block;
  font-size: 0.98rem;
}

.event-option span {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rest-header {
  margin-bottom: 12px;
}

.rest-lead {
  color: var(--muted);
}

.rest-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}

.rest-status div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.rest-status strong {
  color: #f5d98d;
}

.rest-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rest-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(214, 168, 79, 0.34);
  background: rgba(12, 14, 20, 0.8);
  color: #f0f2f7;
}

.rest-card strong {
  display: block;
  font-size: 1rem;
}

.rest-card span {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rest-card em {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(216, 87, 87, 0.85);
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.shop-lead {
  margin: 6px 0 0;
  color: var(--muted);
}

.shop-gold-pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 79, 0.46);
  background: rgba(214, 168, 79, 0.16);
  color: #ffe3a1;
  font-weight: 700;
  white-space: nowrap;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.shop-item,
.shop-service {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(10, 12, 18, 0.78);
  border: 1px solid rgba(214, 168, 79, 0.22);
}

.shop-price {
  font-size: 0.8rem;
  color: rgba(243, 210, 122, 0.85);
}

.shop-service strong {
  color: #f3d27a;
}

.shop-service span {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.shop-service em {
  font-size: 0.78rem;
  color: #ffe08c;
}

.shop-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

/* Tesouro com escolhas */
.treasure-choice-list {
  display: grid;
  gap: 12px;
  margin: 16px auto 22px;
  max-width: 520px;
}

.treasure-choice-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(214, 168, 79, 0.34);
  background: rgba(12, 14, 20, 0.85);
  color: #f0f2f7;
}

.treasure-choice-card strong {
  display: block;
  font-size: 0.98rem;
}

.treasure-choice-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.treasure-choice-card em {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f3d27a;
}

.treasure-panel--choosing .treasure-relic-card,
.treasure-panel--choosing .treasure-gold,
.treasure-panel--choosing .treasure-run-summary {
  display: none;
}

#screen-reward.active,
#screen-event.active,
#screen-rest.active,
#screen-shop.active,
#screen-remove.active,
#screen-upgrade.active {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 76px 18px 22px;
}

#screen-reward.active::before,
#screen-event.active::before,
#screen-rest.active::before,
#screen-shop.active::before,
#screen-remove.active::before,
#screen-upgrade.active::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
  z-index: -1;
}

.reward-panel,
.remove-panel {
  width: min(980px, calc(100vw - 34px));
  max-height: calc(100vh - 110px);
  margin: 0 auto;
  overflow: auto;
  text-align: center;
  border-color: rgba(214, 168, 79, 0.34);
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.48), 0 0 34px rgba(214, 168, 79, 0.12);
}

.reward-panel .actions {
  justify-content: center;
}

.reward-cards {
  justify-content: center;
}

/* Transicao entre salas */
.room-transition {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 10, 0.72);
  z-index: 80;
}

.room-transition.hidden {
  display: none;
}

.room-transition-card {
  padding: 28px 34px;
  border-radius: 18px;
  border: 1px solid rgba(214, 168, 79, 0.4);
  background: rgba(12, 14, 20, 0.9);
  text-align: center;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  animation: room-transition-in 0.36s ease both;
}

.room-transition-card span {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 210, 122, 0.8);
}

.room-transition-card h2 {
  margin: 10px 0 6px;
  color: #f5d98d;
}

.room-transition-card p {
  margin: 0;
  color: var(--muted);
}

@keyframes room-transition-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-logo-idle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo {
  width: min(360px, 90%);
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.small,
.small-text {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.small-text {
  color: var(--muted);
  padding: 0;
}

.hidden {
  display: none !important;
}

.run-status {
  background: #202533;
  border: 1px solid #303747;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screen-fade 0.28s ease;
}

.screen.screen-enter .panel,
.screen.screen-enter .battle-screen {
  animation: panel-enter 0.34s ease both;
}

#screen-victory.screen-enter .panel,
#screen-defeat.screen-enter .panel {
  animation: dramatic-enter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.battle-screen {
  position: relative;
  min-height: 100vh;
  padding: 80px 24px 200px;
}

.battle-arena {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  min-height: 50vh;
  padding-top: 30px;
}

.fighter {
  position: relative;
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.fighter--idle {
  animation: idle-float 5.2s ease-in-out infinite;
}

.fighter-img {
  width: min(360px, 85%);
  height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6));
  animation: idle-float 5.2s ease-in-out infinite;
}

.fighter-info {
  background: rgba(15, 17, 24, 0.78);
  border: 1px solid rgba(214, 168, 79, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  min-width: 220px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.fighter-name {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.fighter-relics {
  margin-top: 6px;
}

.enemy-intent {
  position: absolute;
  top: 0;
  right: 10%;
  transform: translateY(-10px);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(18, 20, 28, 0.85);
  border: 1px solid rgba(214, 168, 79, 0.35);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.enemy-intent.intent-attack {
  color: #ff8a8a;
  border-color: rgba(216, 87, 87, 0.5);
}

.enemy-intent.intent-defense {
  color: #8fb7ff;
  border-color: rgba(79, 136, 214, 0.5);
}

.enemy-intent.intent-debuff {
  color: #c4a1ff;
  border-color: rgba(160, 108, 213, 0.6);
}

.enemy-intent.intent-buff {
  color: #f1d18a;
  border-color: rgba(214, 168, 79, 0.5);
}

.center-effects-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.combat-log {
  position: fixed;
  left: 24px;
  bottom: 160px;
  width: 260px;
  background: rgba(15, 17, 24, 0.82);
  border: 1px solid rgba(214, 168, 79, 0.2);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 6;
}

.combat-log-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.combat-log .log {
  min-height: 0;
  max-height: 140px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.85rem;
}

.battle-bottom {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 280px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 7;
}

.battle-actions-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.9), rgba(10, 11, 16, 0.85));
  border: 1px solid rgba(214, 168, 79, 0.26);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  z-index: 9;
}

.battle-actions-panel .end-turn {
  width: 100%;
  font-size: 1rem;
}

.battle-actions-panel .secondary {
  width: 100%;
}

.turn-damage-preview {
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(12, 14, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d9deea;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
}

.turn-damage-preview--danger {
  color: #ffb3b3;
  border-color: rgba(216, 87, 87, 0.45);
  box-shadow: 0 0 16px rgba(216, 87, 87, 0.18);
}

.deck-counters {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(15, 17, 24, 0.7);
  border: 1px solid rgba(214, 168, 79, 0.2);
  border-radius: 12px;
  padding: 8px 10px;
  backdrop-filter: blur(8px);
}

.deck-counters .counter {
  color: var(--muted);
  font-size: 0.85rem;
}

.end-turn {
  align-self: stretch;
  margin-right: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #f0c76d, var(--gold));
}

.end-turn--pulse {
  animation: end-turn-pulse 1.6s ease-in-out infinite;
}

.hand {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 6px 12px 0;
  max-width: 100%;
}

.auto-end-hint {
  min-height: 16px;
  font-size: 0.78rem;
  color: rgba(230, 230, 230, 0.7);
  text-align: center;
}

.auto-end-hint--active {
  color: #f4d48f;
  text-shadow: 0 0 12px rgba(214, 168, 79, 0.5);
}

.hand .card {
  margin: 0 -4px;
}

.panel {
  background:
    linear-gradient(160deg, rgba(22, 24, 33, 0.9), rgba(10, 12, 18, 0.88));
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.game-screen,
.game-scene {
  width: 100%;
  min-height: 100%;
}

.hud-panel,
.compact-panel,
.floating-hud {
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.game-title {
  color: #f5d98d;
  text-shadow: 0 0 20px rgba(214, 168, 79, 0.22);
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.panel.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.button-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

button {
  background: linear-gradient(180deg, #e3ba62, #b9852e);
  color: #111;
  border: 1px solid rgba(255, 229, 167, 0.45);
  border-radius: 7px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 150ms ease, filter 180ms ease, box-shadow 180ms ease;
}

button.primary {
  background: var(--gold);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 8px 18px rgba(214, 168, 79, 0.2);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  filter: brightness(0.98);
}

button.secondary {
  background: rgba(30, 34, 46, 0.82);
  color: var(--text);
  border: 1px solid rgba(214, 168, 79, 0.22);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.battle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.combat-visuals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.portrait {
  background: linear-gradient(160deg, rgba(214, 168, 79, 0.12), rgba(20, 24, 32, 0.9));
  border: 1px solid rgba(214, 168, 79, 0.25);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.portrait img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  margin-bottom: 6px;
}

.portrait img.missing {
  display: none;
}

.portrait-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.piles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

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

.log {
  background: #151821;
  border: 1px solid #2c3241;
  border-radius: 8px;
  padding: 10px;
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  font-size: 0.9rem;
  color: #cfd3dc;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  background: #2a2e3a;
  border: 1px solid #404755;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.badge.red {
  border-color: var(--red);
  color: var(--red);
}

.badge.blue {
  border-color: var(--blue);
  color: var(--blue);
}

.badge.purple {
  border-color: var(--purple);
  color: var(--purple);
}

.intent-box {
  margin-top: 8px;
  background: #272c38;
  border-radius: 6px;
  padding: 8px;
}

.hand-panel {
  position: relative;
  overflow: hidden;
}

.hand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(214, 168, 79, 0.08), transparent 50%);
  pointer-events: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-width), 1fr));
  gap: 12px;
}

.card-grid .card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
  background: #171a22;
  border: 1px solid rgba(214, 168, 79, 0.18);
  border-radius: 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform-origin: center bottom;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card.card--playable,
.card.playable {
  box-shadow: 0 0 16px rgba(214, 168, 79, 0.2);
  border-color: rgba(214, 168, 79, 0.46);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.card.card--playable:hover,
.card.playable:hover {
  transform: translateY(-24px) scale(1.08);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.46), 0 0 22px rgba(214, 168, 79, 0.32);
  filter: brightness(1.08) saturate(1.08);
  z-index: 20;
  border-color: rgba(214, 168, 79, 0.7);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(214, 168, 79, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.0) 0%, rgba(8, 10, 14, 0.35) 55%, rgba(8, 10, 14, 0.8) 100%);
  pointer-events: none;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  opacity: 0;
  box-shadow: inset 0 0 18px var(--type-glow, rgba(214, 168, 79, 0.35));
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card.card--playable:hover::before,
.card.playable:hover::before {
  opacity: 1;
}

.card.disabled,
.card.card--disabled {
  opacity: 0.5;
  filter: grayscale(0.65) brightness(0.72);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card.disabled:hover,
.card.card--disabled:hover {
  transform: none;
  box-shadow: none;
  filter: grayscale(0.65) brightness(0.72);
}

.card-dragging {
  cursor: grabbing;
}

.card--drag-source {
  opacity: 0.42;
  filter: saturate(0.75) brightness(0.85);
}

.card-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5000;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.06);
  opacity: 0.96;
  box-shadow: 0 26px 55px rgba(0, 0, 0, 0.58), 0 0 30px rgba(214, 168, 79, 0.34);
}

.card.playing,
.card.card--playing {
  animation: card-play 0.25s ease forwards;
}

.card.enter,
.card.card--drawn {
  animation: card-enter 0.34s ease both;
}

.card .art {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214, 168, 79, 0.2), rgba(22, 26, 35, 0.8));
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) brightness(0.95);
  transition: filter 180ms ease, transform 220ms ease;
}

.card:hover .art {
  filter: saturate(1.16) brightness(1.02);
  transform: scale(1.025);
}

.card .art.art--custom {
  filter: saturate(1.1) brightness(0.98);
}

.card .card-header {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: var(--card-header-height);
  padding: 4px 8px 4px 44px;
  border-radius: 8px;
  background: rgba(10, 12, 18, 0.78);
  border: 1px solid rgba(214, 168, 79, 0.2);
  z-index: 3;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.card .card-content {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: var(--card-footer-height);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.card .cost {
  align-self: flex-start;
  background: rgba(12, 14, 20, 0.8);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.card .name {
  font-weight: 700;
  font-size: var(--card-name-size);
  color: #f3d27a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .type {
  font-size: var(--card-type-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cfd3dc;
}

.card .desc {
  font-size: var(--card-desc-size);
  line-height: 1.2;
  color: #e4e7ee;
  display: block;
  overflow: hidden;
}

.card.type-ataque {
  border-color: rgba(216, 87, 87, 0.7);
  --type-glow: rgba(216, 87, 87, 0.34);
}

.card.type-ataque .art {
  background-image: linear-gradient(135deg, rgba(216, 87, 87, 0.25), rgba(22, 26, 35, 0.85)),
    url("../assets/cards/card-attack.png");
}

.card.type-defesa {
  border-color: rgba(79, 136, 214, 0.7);
  --type-glow: rgba(79, 136, 214, 0.34);
}

.card.type-defesa .art {
  background-image: linear-gradient(135deg, rgba(79, 136, 214, 0.25), rgba(22, 26, 35, 0.85)),
    url("../assets/cards/card-defense.png");
}

.card.type-habilidade {
  border-color: rgba(160, 108, 213, 0.7);
  --type-glow: rgba(160, 108, 213, 0.34);
}

.card.type-habilidade .art {
  background-image: linear-gradient(135deg, rgba(160, 108, 213, 0.25), rgba(22, 26, 35, 0.85)),
    url("../assets/cards/card-skill.png");
}

.card.type-poder {
  border-color: rgba(214, 168, 79, 0.8);
  --type-glow: rgba(214, 168, 79, 0.36);
}

.card.type-poder .art {
  background-image: linear-gradient(135deg, rgba(214, 168, 79, 0.28), rgba(22, 26, 35, 0.85)),
    url("../assets/cards/card-power.png");
}

.card.type-maldicao {
  border-color: rgba(160, 108, 213, 0.9);
  box-shadow: inset 0 0 0 1px rgba(160, 108, 213, 0.3);
  --type-glow: rgba(216, 87, 87, 0.32);
}

.card.type-maldicao .art {
  background-image: linear-gradient(135deg, rgba(160, 108, 213, 0.3), rgba(22, 26, 35, 0.85)),
    url("../assets/cards/card-curse.png");
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5;
}

.overlay-content {
  background: var(--panel);
  border: 1px solid #2f3440;
  border-radius: 12px;
  padding: 16px;
  max-width: 960px;
  width: 100%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.reward-cards {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: flex-end;
  padding: 18px 0;
}

.reward-cards .card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.deck-grid .card {
  width: var(--card-width);
  height: var(--card-height);
  min-height: var(--card-height);
}

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

.battle-progress {
  position: fixed;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 45;
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
}

.card.rarity-inicial {
  border-color: #6b707d;
}

.card.rarity-comum {
  border-color: #7b8291;
  box-shadow: inset 0 0 0 1px rgba(210, 220, 235, 0.08);
}

.card.rarity-incomum {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(79, 136, 214, 0.18), 0 0 14px rgba(79, 136, 214, 0.12);
}

.card.rarity-rara {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(214, 168, 79, 0.26), 0 0 18px rgba(160, 108, 213, 0.16);
}

.card.rarity-maldicao {
  border-color: #7f2637;
  background: #2b2235;
  box-shadow: inset 0 0 0 1px rgba(216, 87, 87, 0.18), 0 0 18px rgba(80, 0, 20, 0.22);
}

.card--text-dense .card-description {
  line-height: 1.12;
}

.card--desc-ellipsis .card-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.battle-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.deck-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-summary .badge {
  font-size: 0.8rem;
}

.icon-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}

.icon-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #1b1f29;
  border: 1px solid #313747;
  font-size: 0.8rem;
  cursor: help;
  transition: transform 150ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.icon-item:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 168, 79, 0.55);
  box-shadow: 0 0 12px rgba(214, 168, 79, 0.16);
}

.icon-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.icon-item img.missing {
  display: none;
}

.floating-text,
.float-text {
  position: fixed;
  font-weight: 700;
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 1100;
  animation: float-up 0.9s ease forwards;
  text-shadow: 0 6px 10px rgba(0, 0, 0, 0.45);
}

.float-text.damage,
.floating-text--damage {
  color: #ff7777;
}

.float-text.block,
.floating-text--block {
  color: #7db3ff;
}

.float-text.heal,
.floating-text--heal {
  color: #7ff0b2;
}

.float-text.status,
.floating-text--debuff {
  color: #c7a7ff;
}

.floating-text--buff {
  color: #f3d27a;
}

.floating-text--energy {
  color: #8fc8ff;
}

.log-entry-new {
  animation: log-entry-in 0.24s ease both;
}

.attack-swipe {
  position: absolute;
  width: 80px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.0), rgba(255, 215, 140, 0.9), rgba(255, 255, 255, 0.0));
  box-shadow: 0 0 18px rgba(255, 215, 140, 0.65);
  transform: translate(0, 0) rotate(-12deg);
  animation: attack-swipe 0.3s ease forwards;
}

.shake {
  animation: shake 0.25s ease;
}

.damage-flash {
  animation: damage-flash 0.25s ease;
}

.block-flash {
  animation: block-flash 0.3s ease;
}

.heal-flash {
  animation: heal-flash 0.35s ease;
}

.buff-flash {
  animation: buff-flash 0.42s ease;
}

.debuff-flash {
  animation: debuff-flash 0.42s ease;
}

.enemy-attacking {
  animation: enemy-attack 0.36s ease;
}

.enemy-defending {
  animation: block-flash 0.44s ease;
}

.enemy-buffing {
  animation: buff-flash 0.46s ease;
}

.enemy-debuffing {
  animation: debuff-flash 0.46s ease;
}

@keyframes card-play {
  0% {
    transform: translateY(-24px) scale(1.08);
    opacity: 1;
  }
  55% {
    transform: translateY(-86px) scale(1.15);
    opacity: 0.88;
  }
  100% {
    transform: translateY(-122px) scale(0.88);
    opacity: 0;
  }
}

@keyframes card-enter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes screen-fade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-enter {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dramatic-enter {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    filter: brightness(0.7);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes idle-float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54px) scale(0.98);
  }
}

@keyframes attack-swipe {
  0% {
    opacity: 0.2;
    transform: translate(0, 0) rotate(-12deg) scale(0.8);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) rotate(6deg) scale(1.1);
  }
}

@keyframes shake {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-6px, 2px);
  }
  40% {
    transform: translate(6px, -2px);
  }
  60% {
    transform: translate(-4px, 1px);
  }
  80% {
    transform: translate(4px, -1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes end-turn-pulse {
  0% {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(214, 168, 79, 0.25);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  }
}

@keyframes damage-flash {
  0% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(216, 87, 87, 0.9));
  }
  100% {
    filter: none;
  }
}

@keyframes block-flash {
  0% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(79, 136, 214, 0.9));
  }
  100% {
    filter: none;
  }
}

@keyframes buff-flash {
  0% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(214, 168, 79, 0.95));
  }
  100% {
    filter: none;
  }
}

@keyframes debuff-flash {
  0% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(160, 108, 213, 0.95));
  }
  100% {
    filter: none;
  }
}

@keyframes enemy-attack {
  0% {
    transform: translateX(0);
  }
  38% {
    transform: translateX(-24px) scale(1.035);
    filter: drop-shadow(0 0 12px rgba(255, 215, 140, 0.55));
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes log-entry-in {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heal-flash {
  0% {
    filter: none;
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(110, 229, 155, 0.9));
  }
  100% {
    filter: none;
  }
}

/* Refatoracao HUD - camada tematica de batalha */
body[data-screen="battle"] {
  overflow: hidden;
}

body[data-screen="menu"],
body[data-screen="character"],
body[data-screen="battle"],
body[data-screen="map"],
body[data-screen="treasure"],
body[data-screen="reward"],
body[data-screen="remove"],
body[data-screen="event"],
body[data-screen="rest"],
body[data-screen="victory"],
body[data-screen="defeat"] {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

body[data-screen="battle"] .app-header {
  background: linear-gradient(90deg, rgba(9, 10, 14, 0.92), rgba(21, 23, 31, 0.74));
  border-bottom: 1px solid rgba(214, 168, 79, 0.34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

body[data-screen="battle"] .game-topbar-brand {
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(214, 168, 79, 0.22);
}

.battle-screen {
  min-height: 100vh;
  padding: 74px 22px 228px;
}

.battle-status-strip {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  z-index: 8;
  pointer-events: none;
}

.turn-banner,
.battle-insight,
.battle-panel,
.fighter-info,
.battle-bottom-bar {
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.88), rgba(10, 11, 16, 0.78));
  border: 1px solid rgba(214, 168, 79, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.turn-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  color: #f2cf83;
  font-weight: 800;
  font-size: 0.86rem;
  text-align: center;
}

.battle-insight {
  border-radius: 12px;
  padding: 8px 11px;
  color: #d8dde9;
  font-size: 0.82rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-arena {
  min-height: calc(100vh - 330px);
  padding: 44px 300px 0;
  align-items: end;
}

.fighter {
  flex: 0 1 360px;
  z-index: 2;
}

.fighter-player {
  align-items: flex-start;
}

.fighter-enemy {
  align-items: flex-end;
}

.enemy-party {
  flex: 1 1 560px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
  position: relative;
  z-index: 3;
}

.enemy-party.enemies-count-1 {
  justify-content: flex-end;
}

.enemy-slot {
  position: relative;
  width: 260px;
  min-width: 220px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: auto;
}

.enemy-slot * {
  pointer-events: none;
}

.enemy-slot:hover:not(:disabled),
.enemy-slot:active:not(:disabled) {
  transform: none;
  filter: brightness(1.05);
  box-shadow: none;
}

.enemies-count-1 .enemy-slot {
  width: 300px;
}

.enemies-count-2 .enemy-slot {
  width: 245px;
}

.enemies-count-3 .enemy-slot {
  width: 205px;
  gap: 6px;
}

.enemy-image-area {
  width: 100%;
  height: min(250px, 32vh);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

.enemies-count-1 .enemy-image-area {
  height: min(285px, 35vh);
}

.enemies-count-3 .enemy-image-area {
  height: min(205px, 28vh);
}

.enemy-slot .fighter-img,
.enemy-slot .enemy-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.enemy-info-card {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}

.enemy-info-card .fighter-name {
  margin-bottom: 5px;
  line-height: 1.05;
}

.enemy-info-card .fighter-stats,
.enemy-info-card .status-row {
  justify-content: center;
}

.enemy-info-card .status-row {
  margin-top: 5px;
  min-height: 24px;
}

.enemy-slot--selected .fighter-info {
  border-color: rgba(246, 204, 118, 0.86);
  box-shadow: 0 0 26px rgba(214, 168, 79, 0.28), 0 12px 30px rgba(0, 0, 0, 0.42);
}

.enemy-slot--selected::before {
  content: none;
}

.enemy-slot--selected::after {
  content: none;
}

.enemy-slot--acting .fighter-info {
  box-shadow: 0 0 30px rgba(79, 136, 214, 0.45), 0 14px 32px rgba(0, 0, 0, 0.45);
  border-color: rgba(79, 136, 214, 0.55);
}

.enemy-slot.drag-target--valid .fighter-info,
#player-fighter.drag-target--valid .fighter-info {
  border-color: rgba(246, 204, 118, 0.95);
  box-shadow: 0 0 34px rgba(214, 168, 79, 0.42), 0 14px 34px rgba(0, 0, 0, 0.48);
}

.enemy-slot.drag-target--valid .fighter-img,
#player-fighter.drag-target--valid .fighter-img {
  filter: brightness(1.12) saturate(1.08);
}

.target-marker {
  display: none;
  width: fit-content;
  margin: -2px auto 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #d6a84f;
  color: #17120a;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enemy-slot--selected .target-marker {
  display: block;
}

.card-suggested-defense {
  box-shadow: 0 0 18px rgba(79, 136, 214, 0.36), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card-suggested-attack {
  box-shadow: 0 0 18px rgba(216, 87, 87, 0.28), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card-suggested-aoe {
  box-shadow: 0 0 20px rgba(214, 168, 79, 0.36), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card-suggested-utility {
  box-shadow: 0 0 18px rgba(160, 108, 213, 0.32), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.end-turn-suggested {
  box-shadow: 0 0 22px rgba(214, 168, 79, 0.36);
}

.end-turn-danger {
  border: 1px solid rgba(216, 87, 87, 0.62);
  box-shadow: 0 0 22px rgba(216, 87, 87, 0.32);
}

.fighter-img {
  width: min(380px, 34vw);
  height: min(330px, 42vh);
  position: relative;
  z-index: 1;
}

.fighter-info {
  min-width: 280px;
  border-radius: 14px;
  padding: 12px;
  position: relative;
  z-index: 4;
}

.fighter-name {
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.fighter-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 70px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.stat-chip img,
.status-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.stat-chip--hp {
  color: #ff8a8a;
}

.stat-chip--block {
  color: #8fb7ff;
}

.stat-chip--energy {
  color: #f3d27a;
  border-color: rgba(214, 168, 79, 0.28);
}

.status-row,
.power-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
  align-items: center;
}

.status-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: help;
}

.status-icon strong {
  font-size: 0.82rem;
  color: #eef2fb;
}

.status-icon img.missing {
  display: none;
}

.status-fallback {
  display: none;
  font-weight: 800;
  font-size: 0.85rem;
  color: #eef2fb;
}

.status-icon img.missing + .status-fallback {
  display: inline;
}

.status-icon--arcaneCharge {
  border-color: rgba(214, 168, 79, 0.34);
  background: rgba(44, 34, 82, 0.46);
}

.status-icon--max {
  box-shadow: 0 0 14px rgba(214, 168, 79, 0.28);
}

.status-empty,
.mini-label {
  color: rgba(230, 230, 230, 0.55);
  font-size: 0.78rem;
}

.mini-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.mini-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.mini-icon img.missing {
  display: none;
}

.mini-icon .mini-fallback {
  display: none;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
}

.mini-icon img.missing + .mini-fallback {
  display: inline;
}

.enemy-slot .enemy-info-card {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}

.enemy-intent {
  position: static;
  inset: auto;
  transform: none;
  min-width: 0;
  max-width: 100%;
  width: fit-content;
  margin: 6px auto 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(12, 14, 20, 0.68);
  text-align: center;
  z-index: auto;
  font-size: 0.78rem;
  line-height: 1;
  border: 1px solid rgba(214, 168, 79, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.enemies-count-3 .enemy-intent {
  font-size: 0.72rem;
  padding: 5px 7px;
}

.intent-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.intent-kicker {
  display: none;
}

.intent-title {
  font-size: inherit;
  color: #fff0c2;
  white-space: nowrap;
}

.intent-detail {
  display: none;
}

.combat-log {
  left: 18px;
  top: 116px;
  bottom: auto;
  width: 280px;
}

.relic-panel {
  position: fixed;
  right: 18px;
  top: 116px;
  width: 256px;
  padding: 12px;
  z-index: 24;
  border-color: rgba(214, 168, 79, 0.38);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38), 0 0 22px rgba(214, 168, 79, 0.08);
}

.relic-panel .combat-log-title {
  color: #f5d98d;
  letter-spacing: 0.08em;
}

.combat-log .log {
  max-height: 170px;
}

.log-entry-new {
  padding: 5px 7px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.log-tone-damage {
  color: #ff9a9a;
  border-left-color: var(--red);
}

.log-tone-block {
  color: #9dc2ff;
  border-left-color: var(--blue);
}

.log-tone-heal {
  color: #91f0bb;
  border-left-color: #6ee59b;
}

.log-tone-buff {
  color: #f1d18a;
  border-left-color: var(--gold);
}

.log-tone-debuff {
  color: #d2b4ff;
  border-left-color: var(--purple);
}

.relic-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.relic-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(214, 168, 79, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  justify-content: center;
  padding: 5px;
  border-radius: 10px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.relic-icon:hover {
  transform: scale(1.08);
  border-color: rgba(246, 204, 118, 0.78);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.relic-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.relic-icon--active {
  animation: relic-activate 0.85s ease;
}

.relic-icon--new {
  animation: relic-activate 1.1s ease;
  border-color: rgba(246, 204, 118, 0.9);
}

.battle-bottom {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 280px));
  height: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 60;
}

.battle-bottom-bar {
  display: none;
}

#battle-node-progress {
  display: none;
}

.deck-counters {
  padding: 8px 10px;
  background: rgba(15, 17, 24, 0.7);
  border: 1px solid rgba(214, 168, 79, 0.2);
  border-radius: 12px;
}

.pile-counter {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.62);
  border: 1px solid rgba(214, 168, 79, 0.16);
}

.pile-counter strong {
  color: #fff0c2;
  margin-left: 4px;
}

.end-turn {
  align-self: stretch;
  margin: 0;
  min-width: 0;
}

.hand {
  position: fixed;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 700;
  width: min(980px, calc(100vw - 280px));
  height: 286px;
  align-items: flex-end;
  gap: 10px;
  padding: 76px 18px 0;
  perspective: none;
  pointer-events: auto;
  overflow: visible;
}

.hand .card {
  flex: 0 0 var(--card-width);
  margin: 0;
  transform: none;
  z-index: var(--card-z, 1);
}

.hand .card.card--playable:hover,
.hand .card.playable:hover {
  transform: translateY(-28px) scale(1.055);
  z-index: 900;
}

.hand .card.card--disabled:hover {
  transform: none;
}

.card {
  border-radius: 12px;
  border-width: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(8, 10, 14, 0) 32%),
    linear-gradient(180deg, rgba(8, 10, 14, 0) 42%, rgba(8, 10, 14, 0.78) 72%, rgba(4, 5, 8, 0.94) 100%);
}

.card .card-content {
  min-height: 0;
  justify-content: flex-start;
  padding: 8px 10px;
}

.card .cost {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff6d6;
  background: radial-gradient(circle, #385c95, #10213f);
  border: 1px solid rgba(214, 168, 79, 0.7);
  box-shadow: 0 0 16px rgba(79, 136, 214, 0.35);
}

.upgrade-seal {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 5;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #1b1206;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe59a, #c9922e);
  border: 1px solid rgba(255, 241, 180, 0.8);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.48);
}

.card.card--upgraded {
  border-color: #f3d27a;
  box-shadow: inset 0 0 0 1px rgba(214, 168, 79, 0.32), 0 0 20px rgba(214, 168, 79, 0.2);
}

.card .name {
  font-size: var(--card-name-size);
}

.card .type {
  letter-spacing: 0.06em;
  color: #f1d18a;
  font-size: var(--card-type-size);
}

.card .desc {
  color: #f4f6fb;
  font-size: var(--card-desc-size);
}

@keyframes relic-activate {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(214, 168, 79, 0);
  }
  45% {
    transform: translateY(-5px) scale(1.12);
    box-shadow: 0 0 24px rgba(214, 168, 79, 0.75);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(214, 168, 79, 0);
  }
}

@media (max-width: 900px) {
  .main-menu {
    grid-template-columns: 1fr;
    padding-top: 86px;
  }

  .menu-hero {
    min-height: auto;
    padding: 30px 20px;
  }

  .menu-side-panel {
    width: min(620px, 100%);
    justify-self: center;
  }

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

  .fighter-img {
    height: 240px;
  }

  .hand .card {
    width: 138px;
    min-height: 205px;
    margin: 0;
  }

  .battle-actions-panel {
    right: 12px;
    bottom: 140px;
    width: 180px;
  }

  .battle-bottom,
  .hand {
    width: min(760px, calc(100vw - 40px));
  }

  .combat-log {
    left: 12px;
    width: 220px;
  }

  .battle-arena {
    padding-left: 240px;
    padding-right: 220px;
  }

  .relic-panel {
    width: 200px;
  }
}

@media (max-width: 720px) {
  .character-options {
    grid-template-columns: 1fr;
  }

  .character-card {
    grid-template-rows: 190px 1fr auto;
  }

  .character-card img {
    height: 190px;
  }

  body[data-screen="menu"] .app-header {
    padding: 12px 14px;
  }

  body[data-screen="menu"] .game-topbar-brand {
    display: none;
  }

  .main-menu {
    padding: 74px 14px 70px;
  }

  .menu-logo {
    max-height: 150px;
  }

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

  .menu-footer {
    left: 14px;
    right: 14px;
    flex-direction: column;
    gap: 4px;
  }

  .battle-actions-panel {
    right: 10px;
    bottom: 150px;
    width: 170px;
    padding: 10px;
  }

  .battle-bottom,
  .hand {
    width: min(640px, calc(100vw - 30px));
  }

  .hand {
    gap: 6px;
    padding-top: 64px;
  }

  .battle-arena {
    flex-direction: column;
    align-items: center;
  }

  .enemy-party {
    justify-content: center;
    flex-wrap: wrap;
  }

  .enemy-intent {
    position: static;
    transform: none;
    margin: 6px auto 0;
  }

  .combat-log {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .battle-bottom {
    inset: 0;
  }

  body[data-screen="battle"] {
    overflow: auto;
  }

  .battle-screen {
    padding-bottom: 250px;
  }

  .battle-status-strip {
    position: static;
    transform: none;
    width: 100%;
    grid-template-columns: 1fr;
    margin-bottom: 10px;
  }

  .relic-panel {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .battle-bottom-bar {
    position: fixed;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    flex-wrap: wrap;
  }

  .hand {
    height: 286px;
  }
}

/* Responsividade real: tablet e mobile */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.screen.active {
  width: 100%;
  height: 100%;
}

.map-viewport {
  touch-action: none;
}

button,
.card,
.enemy-slot,
.map-node {
  -webkit-touch-callout: none;
}

@media (max-width: 1024px) {
  #app {
    max-width: none;
    padding: 14px;
  }

  .app-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    min-height: 58px;
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    background: rgba(8, 10, 14, 0.9);
    border-bottom: 1px solid rgba(214, 168, 79, 0.24);
    backdrop-filter: none;
  }

  .game-topbar-brand {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }

  .logo-small {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .small,
  .header-actions button {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 0.76rem;
  }

  #performance-toggle-btn,
  #reset-btn {
    display: none;
  }

  main {
    height: 100%;
  }

  .main-menu,
  .character-select-panel,
  #screen-howto .panel,
  #screen-credits .panel {
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-menu {
    height: 100dvh;
    min-height: 0;
    padding: 78px 14px calc(18px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    align-content: start;
  }

  .menu-hero {
    min-height: auto;
    padding: 24px 18px;
  }

  .menu-logo {
    max-height: 170px;
  }

  .menu-side-panel {
    width: 100%;
  }

  .character-select-panel,
  .collection-panel {
    width: min(980px, calc(100vw - 24px));
    margin: 72px auto 12px;
  }

  .collection-grid,
  .collection-relics,
  .deck-grid,
  #remove-list,
  #upgrade-list,
  .shop-items {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay-content {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 34px);
    overflow: auto;
    margin: 12px;
  }

  .map-shell {
    height: 100dvh;
    padding: 70px 12px calc(12px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .map-act-card {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .map-act-card h2 {
    font-size: 1rem;
    margin: 0;
  }

  .map-run-summary,
  .map-act-progress strong {
    font-size: 0.78rem;
  }

  .map-layout {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 280px);
    gap: 10px;
    height: calc(100dvh - 160px);
    min-height: 0;
  }

  .map-viewport {
    width: 100%;
    height: 100%;
    min-height: 420px;
  }

  .map-side-panel {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .map-node {
    width: 72px;
    min-width: 58px;
    min-height: 86px;
    grid-template-rows: 58px auto;
  }

  .run-map.map-atlas {
    will-change: transform;
  }

  #screen-reward.active,
  #screen-event.active,
  #screen-rest.active,
  #screen-shop.active,
  #screen-remove.active,
  #screen-upgrade.active,
  #screen-treasure.active,
  #screen-victory.active,
  #screen-defeat.active {
    height: 100dvh;
    min-height: 0;
    padding: 70px 12px calc(12px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .reward-panel,
  .remove-panel,
  .event-panel,
  .rest-panel,
  .shop-panel,
  .treasure-panel,
  #screen-victory .panel,
  #screen-defeat .panel {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  :root {
    --card-width: 136px;
    --card-height: 198px;
    --card-header-height: 24px;
    --card-footer-height: 86px;
    --card-name-size: 0.74rem;
    --card-type-size: 0.6rem;
    --card-desc-size: 0.62rem;
  }
  button {
    min-height: 44px;
  }

  body,
  body[data-screen="battle"] {
    overflow: hidden;
  }

  body::before {
    opacity: 0.55;
  }

  .panel,
  .battle-panel,
  .battle-actions-panel,
  .map-act-card,
  .map-side-panel,
  .treasure-panel,
  .shop-panel,
  .event-panel,
  .rest-panel,
  .fighter-info,
  .battle-insight,
  .turn-banner {
    backdrop-filter: none !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  }

  .fighter-img,
  .menu-logo,
  .treasure-relic-orb,
  .map-node--available {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  body[data-screen="menu"] #app,
  body[data-screen="map"] #app,
  body[data-screen="battle"] #app {
    min-height: 100dvh;
  }

  .app-header {
    min-height: 54px;
    padding: calc(7px + env(safe-area-inset-top)) 9px 7px;
  }

  .game-topbar-brand span {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #run-status {
    display: none;
  }

  #audio-toggle-btn {
    min-width: 0;
  }

  .header-actions button {
    min-height: 38px;
    padding: 7px 8px;
  }

  .menu-actions {
    width: 100%;
  }

  .menu-button {
    min-height: 48px;
    padding: 13px 14px;
  }

  .menu-stats,
  .collection-profile,
  .rest-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-options {
    grid-template-columns: 1fr;
  }

  .character-card {
    grid-template-rows: 150px auto auto;
  }

  .character-card img {
    height: 150px;
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    max-height: none;
    padding-bottom: 120px;
  }

  .collection-grid .card {
    width: var(--card-width);
    height: var(--card-height);
    min-height: var(--card-height);
  }

  .collection-relics {
    grid-template-columns: 1fr;
    max-height: none;
    padding-bottom: 120px;
  }

  .map-shell {
    padding: 60px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .map-act-card {
    border-radius: 14px;
  }

  .map-act-progress {
    display: none;
  }

  .map-layout {
    display: block;
    height: calc(100dvh - 146px);
    position: relative;
  }

  .map-viewport {
    height: calc(100dvh - 250px);
    min-height: 360px;
    border-radius: 16px;
  }

  .map-side-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 25;
    max-height: 128px;
    padding: 10px;
    border-radius: 14px;
    overflow-y: auto;
  }

  .map-side-panel h3,
  .map-relics-panel,
  .map-stats div:nth-child(n+4) {
    display: none;
  }

  .map-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    font-size: 0.78rem;
  }

  .map-node-details {
    margin-top: 6px;
    padding: 7px;
  }

  .map-node-details h3,
  .map-node-details p {
    margin: 0;
    font-size: 0.78rem;
  }

  #map-deck-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.75rem;
  }

  .map-tooltip {
    display: none !important;
  }

  /* Batalha mobile */
  body[data-screen="battle"] .app-header {
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    min-height: 50px;
  }

  .battle-screen {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: calc(54px + env(safe-area-inset-top)) 8px calc(198px + env(safe-area-inset-bottom));
  }

  .battle-status-strip {
    position: fixed;
    top: calc(54px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    z-index: 80;
  }

  .turn-banner {
    padding: 6px 9px;
    font-size: 0.74rem;
  }

  .battle-insight {
    padding: 6px 8px;
    font-size: 0.74rem;
    max-height: 30px;
  }

  .battle-arena {
    height: calc(100dvh - 300px);
    min-height: 265px;
    padding: 44px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 6px;
  }

  .enemy-party {
    order: 1;
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 2px 4px 8px;
  }

  .enemy-slot,
  .enemies-count-1 .enemy-slot,
  .enemies-count-2 .enemy-slot,
  .enemies-count-3 .enemy-slot {
    flex: 0 0 116px;
    width: 116px;
    min-width: 116px;
    scroll-snap-align: center;
  }

  .enemy-image-area,
  .enemies-count-1 .enemy-image-area,
  .enemies-count-3 .enemy-image-area {
    height: 94px;
  }

  .enemy-info-card {
    padding: 6px;
    border-radius: 10px;
  }

  .enemy-info-card .fighter-name {
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .enemy-info-card .fighter-stats {
    gap: 4px;
    margin-bottom: 3px;
  }

  .enemy-info-card .stat-chip {
    min-width: 0;
    padding: 4px 5px;
    font-size: 0.7rem;
  }

  .enemy-info-card .stat-chip img,
  .enemy-info-card .status-icon img {
    width: 16px;
    height: 16px;
  }

  .enemy-info-card .status-row {
    min-height: 18px;
    gap: 3px;
  }

  .enemy-intent {
    margin-top: 4px;
    padding: 4px 6px;
    font-size: 0.68rem;
  }

  .fighter-player {
    order: 2;
    flex: 0 0 auto;
    align-items: stretch;
    width: 100%;
  }

  .fighter-player .fighter-img {
    display: none;
  }

  .fighter-player .fighter-info {
    width: 100%;
    min-width: 0;
    padding: 8px;
  }

  .fighter-player .fighter-name {
    display: none;
  }

  .fighter-player .fighter-stats {
    margin: 0;
    gap: 6px;
  }

  .fighter-player .stat-chip {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    padding: 5px 6px;
    font-size: 0.78rem;
  }

  .status-row,
  .power-row {
    min-height: 22px;
    gap: 4px;
  }

  .relic-panel {
    position: fixed;
    left: 8px;
    right: auto;
    top: auto;
    bottom: calc(154px + env(safe-area-inset-bottom));
    width: calc(100vw - 174px);
    max-width: 250px;
    z-index: 74;
    padding: 7px;
    border-radius: 12px;
  }

  .relic-panel .combat-log-title {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }

  .relic-row {
    gap: 5px;
    max-height: 34px;
    overflow: hidden;
  }

  .relic-icon {
    width: 32px;
    height: 32px;
    padding: 3px;
    border-radius: 8px;
  }

  .relic-icon img {
    width: 24px;
    height: 24px;
  }

  .combat-log {
    display: none;
  }

  .battle-actions-panel {
    position: fixed;
    right: 8px;
    bottom: calc(154px + env(safe-area-inset-bottom));
    width: 156px;
    z-index: 75;
    padding: 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .battle-actions-panel .end-turn {
    min-height: 44px;
    font-size: 0.78rem;
    line-height: 1.05;
  }

  .battle-actions-panel .secondary {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .turn-damage-preview,
  .auto-end-hint {
    font-size: 0.68rem;
  }

  .deck-counters {
    display: none;
  }

  .battle-bottom {
    position: static;
    width: auto;
    height: 0;
    padding: 0;
    transform: none;
  }

  .hand {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100vw;
    height: calc(148px + env(safe-area-inset-bottom));
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    background: linear-gradient(180deg, rgba(7, 8, 12, 0), rgba(7, 8, 12, 0.92) 18%, rgba(7, 8, 12, 0.98));
    z-index: 70;
  }

  .hand::-webkit-scrollbar {
    display: none;
  }

  .hand .card,
  .hand .card.card--playable,
  .hand .card.playable {
    flex: 0 0 var(--card-width);
    width: var(--card-width);
    min-height: var(--card-height);
    height: var(--card-height);
    margin: 0;
    scroll-snap-align: center;
    touch-action: pan-x;
  }

  .hand .card.card--playable:hover,
  .hand .card.playable:hover,
  .hand .card.card--playable:active,
  .hand .card.playable:active {
    transform: translateY(-6px) scale(1.025);
  }

  .card .desc {
    line-height: 1.12;
  }

  .card .cost {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }

  .upgrade-seal {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .reward-cards,
  .card-grid {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding: 6px 4px 12px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .reward-cards .card,
  .card-grid .card {
    flex: 0 0 145px;
    width: 145px;
    min-height: 210px;
    scroll-snap-align: center;
  }

  #remove-list,
  #upgrade-list,
  .deck-grid,
  .collection-grid {
    display: grid;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .shop-items {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 210px);
  }

  .shop-header {
    position: sticky;
    top: 0;
    z-index: 3;
    align-items: flex-start;
    background: rgba(10, 12, 18, 0.92);
    padding-bottom: 8px;
  }

  .rest-options {
    grid-template-columns: 1fr;
  }

  .event-option,
  .rest-card,
  .treasure-choice-card {
    min-height: 52px;
    padding: 12px;
  }

  .treasure-relic-orb {
    width: 116px;
    height: 116px;
  }

  .treasure-panel h2,
  .event-panel h2,
  .rest-panel h2,
  .shop-panel h2,
  .reward-panel h2 {
    font-size: 1.35rem;
  }

  .menu-confirm-card,
  .lore-card {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  :root {
    --card-width: 112px;
    --card-height: 164px;
    --card-header-height: 22px;
    --card-footer-height: 74px;
    --card-name-size: 0.7rem;
    --card-type-size: 0.58rem;
    --card-desc-size: 0.58rem;
  }
  .header-actions {
    flex-wrap: nowrap;
  }

  .header-actions button {
    font-size: 0.68rem;
    padding: 6px 7px;
  }

  .game-topbar-brand span {
    display: none;
  }

  .main-menu {
    padding-left: 10px;
    padding-right: 10px;
  }

  .menu-logo {
    max-height: 118px;
  }

  .menu-subtitle {
    font-size: 0.88rem;
  }

  .menu-stats,
  .collection-profile,
  .rest-status,
  .map-stats {
    grid-template-columns: 1fr;
  }

  .map-viewport {
    height: calc(100dvh - 238px);
    min-height: 330px;
  }

  .map-node {
    min-width: 48px;
    width: 56px;
    height: 56px;
    min-height: 48px;
  }

  .map-node strong,
  .map-node small,
  .map-node-label {
    display: none;
  }

  .battle-status-strip {
    grid-template-columns: 1fr;
  }

  .battle-arena {
    height: calc(100dvh - 312px);
    padding-top: 58px;
  }

  .enemy-slot,
  .enemies-count-1 .enemy-slot,
  .enemies-count-2 .enemy-slot,
  .enemies-count-3 .enemy-slot {
    flex-basis: 104px;
    width: 104px;
    min-width: 104px;
  }

  .enemy-image-area,
  .enemies-count-1 .enemy-image-area,
  .enemies-count-3 .enemy-image-area {
    height: 78px;
  }

  .fighter-player .stat-chip {
    font-size: 0.7rem;
    padding: 4px;
  }

  .battle-actions-panel {
    width: 142px;
  }

  .relic-panel {
    width: calc(100vw - 158px);
  }

  .hand {
    height: calc(140px + env(safe-area-inset-bottom));
  }

  .hand .card,
  .hand .card.card--playable,
  .hand .card.playable {
    flex-basis: var(--card-width);
    width: var(--card-width);
    height: var(--card-height);
    min-height: var(--card-height);
  }

  .card .desc {
    -webkit-line-clamp: 3;
  }

  .reward-cards .card,
  .card-grid .card {
    flex-basis: var(--card-width);
    width: var(--card-width);
    min-height: var(--card-height);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --card-width: 100px;
    --card-height: 138px;
    --card-header-height: 20px;
    --card-footer-height: 62px;
    --card-name-size: 0.66rem;
    --card-type-size: 0.56rem;
    --card-desc-size: 0.56rem;
  }
  .app-header {
    min-height: 42px;
    padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
  }

  .battle-screen {
    padding-top: calc(42px + env(safe-area-inset-top));
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }

  .battle-status-strip {
    top: calc(44px + env(safe-area-inset-top));
    grid-template-columns: auto minmax(0, 1fr);
  }

  .battle-arena {
    height: calc(100dvh - 190px);
    min-height: 150px;
    padding-top: 30px;
  }

  .fighter-player .fighter-info {
    display: none;
  }

  .enemy-image-area,
  .enemies-count-1 .enemy-image-area,
  .enemies-count-3 .enemy-image-area {
    height: 68px;
  }

  .enemy-info-card .status-row {
    display: none;
  }

  .battle-actions-panel,
  .relic-panel {
    bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .hand {
    height: calc(112px + env(safe-area-inset-bottom));
  }

  .hand .card,
  .hand .card.card--playable,
  .hand .card.playable {
    flex-basis: var(--card-width);
    width: var(--card-width);
    height: var(--card-height);
    min-height: var(--card-height);
  }

  .card .desc {
    line-height: 1.05;
  }

  .map-shell {
    padding-top: 48px;
  }

  .map-act-card {
    display: none;
  }

  .map-layout,
  .map-viewport {
    height: calc(100dvh - 64px);
  }

  .map-side-panel {
    max-height: 94px;
  }
}

/* Cartas: painel textual fosco com ajuste por carta */
.card .card-content {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  height: 38%;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  background:
    linear-gradient(180deg, rgba(13, 16, 24, 0.84), rgba(6, 8, 13, 0.78)),
    radial-gradient(circle at 18% 0%, rgba(214, 168, 79, 0.12), transparent 42%);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.38),
    0 8px 18px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(3px);
}

body.performance-mode .card .card-content,
body.is-mobile .card .card-content {
  backdrop-filter: none;
}

.card .card-name,
.card .name.card-name {
  flex: 0 0 auto;
  margin: 0;
  color: #ffe39d;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-type,
.card .type.card-type {
  flex: 0 0 auto;
  margin: 0;
  color: rgba(241, 209, 138, 0.88);
  font-size: 0.64rem;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-description,
.card .desc.card-description {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  color: #f3f6ff;
  font-size: var(--card-desc-size);
  line-height: 1.2;
  overflow: hidden;
}

.card--text-dense .card-content {
  gap: 2px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.card--text-dense .card-description {
  line-height: 1.08;
}

.card--text-dense .card-type {
  margin-bottom: 0;
}

.card--text-very-dense .card-content {
  gap: 1px;
  padding: 7px 8px;
}

.card--text-very-dense .card-type {
  display: none;
}

.tutor-modal {
  z-index: 140;
}

.tutor-modal .modal-panel {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 42px));
  overflow: auto;
}

.tutor-modal .card-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-width), 1fr));
  gap: 12px;
  margin: 14px 0;
}

.card-selection-option {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.card--text-very-dense .card-description {
  line-height: 1.04;
}

.collection-grid .card .card-content,
.deck-grid .card .card-content,
.reward-cards .card .card-content {
  height: var(--card-footer-height);
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
}

.collection-grid .card .card-name,
.deck-grid .card .card-name,
.reward-cards .card .card-name {
  font-size: var(--card-name-size);
}

.collection-grid .card .card-type,
.deck-grid .card .card-type,
.reward-cards .card .card-type {
  font-size: var(--card-type-size);
}

.collection-grid .card .card-description,
.deck-grid .card .card-description,
.reward-cards .card .card-description {
  font-size: var(--card-desc-size);
}

@media (max-width: 768px) {
  .card .card-content {
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: var(--card-footer-height);
    padding: 8px 10px;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .card .card-content {
    height: var(--card-footer-height);
    padding: 8px 10px;
  }
}

/* Padronizacao final das cartas: mesmo corpo, nome no topo e texto sem scroll */
.card,
.hand .card,
.reward-cards .card,
.deck-grid .card,
.collection-grid .card,
.card-grid .card,
.shop-item .card,
.card-selection-grid .card,
.tutor-modal .card {
  width: var(--card-width);
  height: var(--card-height);
  min-width: var(--card-width);
  max-width: var(--card-width);
  min-height: var(--card-height);
  max-height: var(--card-height);
  aspect-ratio: 170 / 245;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.card.type-ataque,
.card.type-defesa,
.card.type-habilidade,
.card.type-poder,
.card.type-maldicao {
  padding: 0;
}

.card .card-header {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: var(--card-header-height);
  min-height: var(--card-header-height);
  max-height: var(--card-header-height);
  z-index: 6;
  display: flex;
  align-items: center;
  padding: 3px 34px 3px 45px;
  border-radius: 9px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 18, 25, 0.9), rgba(8, 10, 15, 0.78)),
    radial-gradient(circle at 18% 0%, var(--card-type-soft, rgba(214, 168, 79, 0.16)), transparent 52%);
  border: 1px solid var(--card-type-border-soft, rgba(214, 168, 79, 0.28));
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.36), 0 6px 14px rgba(0, 0, 0, 0.22);
}

.card .card-name,
.card .name.card-name {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: #fff0ba;
  font-size: var(--card-name-size);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-content {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  height: var(--card-footer-height);
  min-height: var(--card-footer-height);
  max-height: var(--card-footer-height);
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(11, 14, 20, 0.9), rgba(5, 7, 11, 0.82)),
    radial-gradient(circle at 20% 0%, var(--card-type-soft, rgba(214, 168, 79, 0.12)), transparent 44%);
  border: 1px solid var(--card-type-border-soft, rgba(214, 168, 79, 0.25));
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.42), 0 8px 18px rgba(0, 0, 0, 0.34);
}

.card .card-type,
.card .type.card-type {
  flex: 0 0 auto;
  max-width: 100%;
  margin: 0;
  color: rgba(245, 219, 154, 0.9);
  font-size: var(--card-type-size);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .card-description,
.card .desc.card-description {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  margin: 0;
  color: #f4f7ff;
  font-size: var(--card-desc-size);
  line-height: 1.16;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .cost {
  z-index: 8;
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card.type-ataque {
  --card-type-border: rgba(222, 70, 70, 0.9);
  --card-type-border-soft: rgba(222, 70, 70, 0.38);
  --card-type-soft: rgba(222, 70, 70, 0.2);
  --type-glow: rgba(222, 70, 70, 0.38);
  border-color: var(--card-type-border);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.12), 0 0 16px rgba(222, 70, 70, 0.16), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card.type-defesa {
  --card-type-border: rgba(78, 145, 232, 0.9);
  --card-type-border-soft: rgba(78, 145, 232, 0.38);
  --card-type-soft: rgba(78, 145, 232, 0.2);
  --type-glow: rgba(78, 145, 232, 0.38);
  border-color: var(--card-type-border);
  box-shadow: inset 0 0 0 1px rgba(130, 180, 255, 0.12), 0 0 16px rgba(78, 145, 232, 0.16), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card.type-habilidade {
  --card-type-border: rgba(120, 190, 128, 0.88);
  --card-type-border-soft: rgba(173, 192, 96, 0.38);
  --card-type-soft: rgba(120, 190, 128, 0.18);
  --type-glow: rgba(173, 192, 96, 0.34);
  border-color: var(--card-type-border);
  box-shadow: inset 0 0 0 1px rgba(220, 210, 120, 0.1), 0 0 16px rgba(120, 190, 128, 0.14), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card.type-poder {
  --card-type-border: rgba(176, 108, 226, 0.92);
  --card-type-border-soft: rgba(214, 168, 79, 0.42);
  --card-type-soft: rgba(176, 108, 226, 0.2);
  --type-glow: rgba(176, 108, 226, 0.42);
  border-color: var(--card-type-border);
  box-shadow: inset 0 0 0 1px rgba(246, 207, 122, 0.16), 0 0 20px rgba(176, 108, 226, 0.2), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card.type-maldicao,
.card.rarity-maldicao {
  --card-type-border: rgba(48, 33, 66, 0.98);
  --card-type-border-soft: rgba(132, 64, 150, 0.44);
  --card-type-soft: rgba(103, 36, 125, 0.22);
  --type-glow: rgba(103, 36, 125, 0.35);
  width: var(--card-width);
  height: var(--card-height);
  min-width: var(--card-width);
  max-width: var(--card-width);
  min-height: var(--card-height);
  max-height: var(--card-height);
  border-color: var(--card-type-border);
  background: #17131d;
  box-shadow: inset 0 0 0 1px rgba(183, 86, 210, 0.14), 0 0 18px rgba(57, 18, 72, 0.34), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card.rarity-rara:not(.type-maldicao) {
  box-shadow: inset 0 0 0 1px rgba(214, 168, 79, 0.22), 0 0 20px var(--type-glow, rgba(214, 168, 79, 0.2)), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.card--text-dense .card-content {
  gap: 2px;
  padding: 7px 8px;
}

.card--text-dense .card-description {
  line-height: 1.06;
}

.card--text-very-dense .card-content {
  gap: 1px;
  padding: 6px 7px;
}

.card--text-very-dense .card-type {
  display: none;
}

.card--desc-ellipsis .card-description,
.card--name-ellipsis .card-name,
.card--type-ellipsis .card-type {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .card .card-header {
    top: 7px;
    left: 7px;
    right: 7px;
    padding-left: 42px;
    padding-right: 30px;
  }

  .card .card-content {
    left: 7px;
    right: 7px;
    bottom: 7px;
    height: var(--card-footer-height);
    min-height: var(--card-footer-height);
    max-height: var(--card-footer-height);
    padding: 7px 8px;
  }
}

/* Medalhao de custo destacado para fora da carta */
.card,
.hand .card,
.reward-cards .card,
.deck-grid .card,
.collection-grid .card,
.card-grid .card,
.shop-item .card,
.card-selection-grid .card,
.tutor-modal .card {
  overflow: visible;
}

.card .art,
.card::before,
.card::after {
  border-radius: inherit;
  overflow: hidden;
}

.card .card-header {
  left: 9px;
  right: 9px;
  padding-left: 24px;
  padding-right: 32px;
}

.card .cost {
  position: absolute;
  top: -12px;
  left: -12px;
  z-index: 12;
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff9df;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.75);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.45), transparent 20%),
    radial-gradient(circle, var(--cost-core, #365b92) 0%, var(--cost-rim, #101d35) 72%);
  border: 2px solid var(--card-type-border-soft, rgba(214, 168, 79, 0.65));
  box-shadow:
    0 0 0 2px rgba(6, 7, 10, 0.72),
    0 0 16px var(--type-glow, rgba(214, 168, 79, 0.34)),
    inset 0 -5px 9px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.card.type-ataque {
  --cost-core: #b93336;
  --cost-rim: #3c1015;
}

.card.type-defesa {
  --cost-core: #326ac1;
  --cost-rim: #0b244c;
}

.card.type-habilidade {
  --cost-core: #6d9948;
  --cost-rim: #273813;
}

.card.type-poder {
  --cost-core: #7b4bc3;
  --cost-rim: #26133d;
}

.card.type-maldicao,
.card.rarity-maldicao {
  --cost-core: #2a1737;
  --cost-rim: #08060c;
}

.card--name-ellipsis .card-name {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 0.94;
}

.hand,
.hand-panel,
.reward-cards,
.deck-grid,
.collection-grid,
.card-grid,
.card-row,
.shop-items,
.card-selection-grid,
.tutor-modal .card-selection-grid {
  overflow: visible;
}

.reward-cards,
.card-grid,
.deck-grid,
.collection-grid,
.card-row,
.card-selection-grid,
.tutor-modal .card-selection-grid {
  padding-top: max(18px, 0.9rem);
  padding-left: max(18px, 0.9rem);
  gap: max(16px, 1rem);
}

.collection-content,
.deck-overlay-content,
.modal-panel,
.shop-items {
  overflow-x: visible;
}

.collection-panel .collection-grid,
.collection-panel .collection-relics {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px 18px 128px 22px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 168, 79, 0.78) rgba(12, 14, 20, 0.72);
}

.collection-panel .collection-grid::-webkit-scrollbar,
.collection-panel .collection-relics::-webkit-scrollbar {
  width: 10px;
}

.collection-panel .collection-grid::-webkit-scrollbar-track,
.collection-panel .collection-relics::-webkit-scrollbar-track {
  background: rgba(12, 14, 20, 0.72);
  border-radius: 999px;
}

.collection-panel .collection-grid::-webkit-scrollbar-thumb,
.collection-panel .collection-relics::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(214, 168, 79, 0.92), rgba(133, 95, 34, 0.92));
  border: 2px solid rgba(12, 14, 20, 0.72);
  border-radius: 999px;
}

@media (max-width: 768px) {
  .card .card-header {
    padding-left: 20px;
    padding-right: 28px;
  }

  .card .cost {
    top: -10px;
    left: -10px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    min-height: 34px;
    max-height: 34px;
    font-size: 0.88rem;
  }

  .reward-cards,
  .card-grid,
  .deck-grid,
  .collection-grid,
  .card-row,
  .card-selection-grid,
  .tutor-modal .card-selection-grid {
    padding-top: 16px;
    padding-left: 16px;
    gap: 14px;
  }
}
