:root {
  --gold: #f6d178;
  --gold-strong: #c98b24;
  --panel: rgba(26, 18, 44, 0.8);
  --panel-border: rgba(255, 227, 160, 0.48);
  --text: #f6f1e8;
  --muted: #d9cdbb;
  --shadow: rgba(9, 6, 16, 0.55);
  --green: #9ee17e;
  --blue: #7fd8ff;
  --red: #ff7f8f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: #0e0f18;
  overflow: hidden;
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.screen {
  position: relative;
  height: 100vh;
  width: 100%;
  display: none;
  overflow: hidden;
}

.screen.active,
.screen.screen-village.logged-in,
.screen.screen-starter-plains.active {
  display: grid;
}

.hidden {
  display: none !important;
}

.background-layer,
.screen-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#settingsModal.screen-overlay {
  pointer-events: auto;
}

.background-layer {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: none;
}

.background-login {
  background-image: url("./fundodeinicio.png");
  background-size: 100% 100%;
}

.background-village {
  background-image: url("./vilainicial.png");
  background-size: 100% 100%;
}

.background-class-select {
  background-image: url("./Fundoselectclasse.png");
  background-size: 100% 100%;
}

.background-starter-plains {
  background-image: url("./Starter-Plains-lvl1-10.png");
  background-size: 100% 100%;
}

.screen-overlay {
  background:
    radial-gradient(circle at top, rgba(90, 152, 255, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(6, 10, 22, 0.18) 0%, rgba(8, 10, 18, 0.5) 100%);
}

.village-overlay {
  background:
    linear-gradient(180deg, rgba(12, 22, 12, 0.12) 0%, rgba(12, 16, 10, 0.32) 100%);
}

.class-select-overlay {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 248, 204, 0.18), transparent 25%),
    linear-gradient(180deg, rgba(14, 22, 16, 0.18) 0%, rgba(8, 18, 20, 0.42) 100%);
}

.plains-overlay {
  background:
    linear-gradient(180deg, rgba(0, 21, 34, 0.22) 0%, rgba(8, 31, 18, 0.3) 36%, rgba(16, 22, 8, 0.46) 100%);
}

.auth-shell,
.logout-button,
.class-select-layout,
.plains-topbar,
.starter-plains-layout {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.start-button {
  position: relative;
  transform: translateY(-90px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(84vw, 340px);
  padding: 18px 34px;
  border: 1px solid rgba(255, 229, 172, 0.65);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(253, 247, 200, 0.92) 0%, rgba(255, 205, 86, 0.94) 18%, rgba(177, 89, 23, 0.96) 72%, rgba(66, 26, 11, 0.96) 100%);
  color: #fff7e4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 244, 215, 0.2) inset,
    0 18px 46px rgba(25, 8, 2, 0.48),
    0 0 30px rgba(255, 194, 90, 0.34);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  animation: startPulse 2.8s ease-in-out infinite;
}

.start-button:hover {
  transform: translateY(-93px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(255, 244, 215, 0.28) inset,
    0 22px 56px rgba(25, 8, 2, 0.52),
    0 0 42px rgba(255, 201, 92, 0.4);
  filter: saturate(1.08);
}

.start-button-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, transparent 0deg, rgba(255, 245, 204, 0.48) 90deg, transparent 180deg, rgba(255, 189, 76, 0.42) 270deg, transparent 360deg);
  animation: spinGlow 5s linear infinite;
}

.start-button-text {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 12px rgba(45, 12, 0, 0.5);
}

.auth-panel,
.welcome-card,
.hub-card,
.battle-scene-card,
.plains-info-card,
.plains-title-card {
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(35, 20, 63, 0.86) 0%, rgba(20, 11, 35, 0.9) 100%);
  box-shadow:
    0 20px 55px var(--shadow),
    inset 0 1px 0 rgba(255, 244, 212, 0.18);
  backdrop-filter: blur(10px);
}

.auth-panel {
  width: min(88vw, 390px);
  padding: 20px 20px 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.94);
  transition: opacity 220ms ease, transform 260ms ease;
}

.auth-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.auth-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.auth-copy,
.welcome-card p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.auth-copy.compact {
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 14px;
}

.tab-button,
.primary-button,
.logout-button,
.panel-close,
.next-button,
.choose-class-button,
.world-button,
.back-button,
.explore-button {
  border: 0;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, filter 150ms ease;
}

.tab-button,
.primary-button,
.logout-button,
.world-button,
.back-button,
.explore-button {
  border-radius: 16px;
}

.panel-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fceacc;
}

.tab-button {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tab-button.active {
  background: linear-gradient(180deg, #f6d178 0%, #c98b24 100%);
  color: #2c1804;
  box-shadow: 0 10px 24px rgba(201, 139, 36, 0.3);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #f0e6d6;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 235, 190, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  outline: none;
}

.auth-form input::placeholder {
  color: rgba(245, 237, 221, 0.62);
}

.auth-form input:focus {
  border-color: rgba(246, 209, 120, 0.72);
  box-shadow: 0 0 0 3px rgba(246, 209, 120, 0.16);
}

.primary-button {
  margin-top: 6px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #f5e0a5 0%, #c78b29 100%);
  color: #241302;
  box-shadow: 0 14px 28px rgba(199, 139, 41, 0.32);
}

.primary-button:hover,
.logout-button:hover,
.tab-button:hover,
.world-button:hover,
.back-button:hover,
.explore-button:hover {
  transform: translateY(-1px);
}

.auth-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #ffe8a7;
  font-weight: 700;
  font-size: 0.9rem;
}

.screen-village {
  align-items: center;
  justify-items: center;
}

.logout-button {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(58, 30, 21, 0.96) 0%, rgba(116, 54, 26, 0.96) 100%);
  color: #fff4db;
  border: 1px solid rgba(255, 229, 183, 0.34);
  box-shadow: 0 10px 24px rgba(42, 17, 7, 0.28);
}

.tutorial-scene {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 64px));
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(320px, 470px);
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 88px auto 24px;
}

.mentor-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: end;
  animation: floatMerlyn 3.6s ease-in-out infinite;
}

.mentor-image {
  width: min(24vw, 250px);
  min-width: 170px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(18, 16, 42, 0.35));
}

.welcome-card {
  width: min(92vw, 460px);
  padding: 30px;
}

.tutorial-dialog {
  position: relative;
  margin: 0;
  max-width: 470px;
}

.tutorial-dialog::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 110px;
  width: 34px;
  height: 34px;
  background: inherit;
  border-left: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  transform: rotate(45deg);
}

.next-button,
.world-button,
.back-button,
.explore-button,
.choose-class-button {
  border: 1px solid rgba(255, 217, 165, 0.35);
  color: #2d1400;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: inset 0 1px 0 rgba(255, 245, 214, 0.45);
}

.next-button,
.choose-class-button {
  padding: 13px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffcb83 0%, #ff9d33 45%, #c86b18 100%);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.village-hub {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  align-self: stretch;
}

.tutorial-popup,
.reward-modal {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.66);
  backdrop-filter: blur(8px);
}

.tutorial-popup {
  grid-template-columns: minmax(180px, 240px) minmax(320px, 560px);
  gap: 18px;
}

.tutorial-popup-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: end;
}

.tutorial-popup-image {
  width: min(100%, 220px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.34));
}

.tutorial-popup-card,
.reward-card {
  width: min(92vw, 560px);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 230, 179, 0.4);
  background: linear-gradient(180deg, rgba(28, 24, 58, 0.94) 0%, rgba(14, 14, 34, 0.94) 100%);
  box-shadow:
    0 24px 55px rgba(5, 8, 14, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tutorial-popup-card p:last-of-type {
  color: #ece3d2;
  line-height: 1.65;
}

.hub-card {
  padding: 28px;
}

.profile-toggle,
.world-chip {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(255, 229, 183, 0.34);
  color: #fff4db;
  box-shadow: 0 10px 24px rgba(42, 17, 7, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.profile-toggle {
  top: 22px;
  right: 22px;
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 244, 214, 0.9) 0%, rgba(236, 179, 72, 0.88) 26%, rgba(94, 49, 20, 0.96) 100%);
  display: grid;
  place-items: center;
  animation: villageBadgePulse 2.8s ease-in-out infinite;
}

.profile-toggle-icon {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #321904;
}

.profile-toggle:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 16px 30px rgba(42, 17, 7, 0.34),
    0 0 26px rgba(255, 207, 110, 0.22);
  filter: saturate(1.08);
}

.hero-hub-card {
  position: absolute;
  top: 108px;
  right: 22px;
  width: min(430px, calc(100vw - 44px));
  padding: 22px;
  background: linear-gradient(180deg, rgba(34, 21, 61, 0.92) 0%, rgba(18, 12, 36, 0.94) 100%);
}

.profile-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.profile-close {
  flex: 0 0 auto;
}

.hero-hub-card p:last-of-type {
  color: #ece6db;
  line-height: 1.6;
}

.hero-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 14px;
  align-items: center;
}

.hero-summary-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: end;
  min-height: 170px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 18%, rgba(173, 230, 255, 0.26) 0%, rgba(74, 102, 211, 0.08) 54%, rgba(4, 9, 18, 0.14) 100%);
}

.hero-summary-image {
  width: min(100%, 136px);
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(9, 13, 24, 0.38));
}

.hero-summary-content {
  display: grid;
  gap: 10px;
}

.hero-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-summary-row span {
  color: #cfd7e7;
}

.hero-summary-row strong {
  color: #fff;
}

/* Inventário V2.0 - Estilo Integrado ao Jogo */
.inventory-panel {
  position: absolute;
  top: 80px;
  right: 120px; /* Afastado da barra lateral direita */
  width: 320px;
  background: rgba(11, 15, 14, 0.98);
  border: 1px solid rgba(218, 230, 190, 0.3);
  box-shadow: 0 15px 35px rgba(0,0,0,0.9);
  z-index: 100;
  padding: 20px;
  border-radius: 12px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 15px;
  max-height: 350px;
  overflow-y: auto;
}

.inventory-slot-box {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  cursor: pointer;
}

.inventory-slot-box:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(77, 166, 255, 0.5);
  transform: translateY(-2px);
}

.inventory-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.currency-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffeb3b;
  font-weight: 600;
  font-size: 15px;
}

.gold-icon {
  font-size: 18px;
}
  color: #fff4d3;
}

.world-chip {
  right: 22px;
  bottom: 22px;
  min-width: 240px;
  padding: 16px 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 22% 30%, rgba(255, 242, 180, 0.34) 0%, transparent 24%),
    linear-gradient(180deg, rgba(95, 52, 22, 0.96) 0%, rgba(160, 92, 28, 0.98) 54%, rgba(90, 47, 16, 0.98) 100%);
  display: grid;
  justify-items: start;
  gap: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  animation: exploreGlow 2.4s ease-in-out infinite;
}

.world-chip span {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffdd97;
}

.world-chip:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 18px 36px rgba(42, 17, 7, 0.36),
    0 0 34px rgba(255, 199, 97, 0.28);
  filter: saturate(1.1);
}

.screen-class-select {
  align-items: center;
  justify-items: center;
  overflow-y: auto;
}

.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(187, 250, 255, 0.98) 0%, rgba(108, 224, 255, 0.7) 44%, transparent 72%);
  box-shadow: 0 0 20px rgba(118, 214, 255, 0.4);
  animation: riseParticle 8s linear infinite;
}

.particle-a { left: 8%; top: 80%; animation-delay: 0s; }
.particle-b { left: 22%; top: 68%; animation-delay: 1.1s; }
.particle-c { left: 47%; top: 84%; animation-delay: 2.4s; }
.particle-d { left: 66%; top: 76%; animation-delay: 0.8s; }
.particle-e { left: 84%; top: 70%; animation-delay: 3.1s; }
.particle-f { left: 92%; top: 86%; animation-delay: 1.8s; }

.class-select-layout {
  width: min(1320px, calc(100vw - 40px));
  display: grid;
  gap: 18px;
  padding: 46px 0 24px;
  align-content: start;
}

.class-intro-card {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px 30px;
  border: 1px solid rgba(240, 229, 181, 0.4);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 40, 34, 0.78) 0%, rgba(16, 20, 26, 0.84) 100%);
  backdrop-filter: blur(8px);
  box-shadow:
    0 20px 40px rgba(9, 17, 14, 0.34),
    inset 0 1px 0 rgba(255, 249, 216, 0.15);
  text-align: center;
}

.class-intro-card h2 {
  margin-bottom: 8px;
}

.class-intro-card p:last-child {
  margin: 0;
  max-width: 920px;
  margin-inline: auto;
  color: #e4e6d8;
  line-height: 1.5;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

.class-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 250px 1fr;
  padding: 16px 16px 20px;
  border: 1px solid rgba(247, 238, 199, 0.44);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(19, 23, 37, 0.7) 0%, rgba(12, 14, 25, 0.9) 100%);
  box-shadow:
    0 24px 45px rgba(5, 8, 14, 0.42),
    inset 0 1px 0 rgba(255, 252, 220, 0.16);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  min-width: 0;
}

.class-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 227, 151, 0.66);
  box-shadow:
    0 28px 52px rgba(5, 8, 14, 0.5),
    0 0 28px rgba(255, 215, 120, 0.16),
    inset 0 1px 0 rgba(255, 252, 220, 0.18);
}

.class-card-glow {
  position: absolute;
  inset: auto -12% -10% -12%;
  height: 45%;
  filter: blur(10px);
  opacity: 0.65;
}

.class-warrior .class-card-glow {
  background: radial-gradient(circle, rgba(77, 175, 255, 0.26) 0%, transparent 62%);
}

.class-mage .class-card-glow {
  background: radial-gradient(circle, rgba(186, 96, 255, 0.28) 0%, transparent 62%);
}

.class-archer .class-card-glow {
  background: radial-gradient(circle, rgba(128, 255, 160, 0.22) 0%, transparent 62%);
}

.class-portrait {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: end;
  justify-content: center;
}

.class-image {
  width: min(100%, 210px);
  height: auto;
  transform-origin: center bottom;
  animation: classFloat 3.2s ease-in-out infinite;
  filter: drop-shadow(0 18px 28px rgba(8, 12, 18, 0.38));
}

.class-mage .class-image {
  animation-delay: 0.5s;
}

.class-archer .class-image {
  animation-delay: 1s;
}

.class-card-body {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 10px;
}

.class-tag {
  margin: 0;
  color: #ffe4a5;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.class-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.class-role {
  margin: 0;
  color: #b8f0ff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-story {
  margin: 0;
  color: #dee5ef;
  line-height: 1.5;
}

.choose-class-button {
  margin-top: 10px;
  padding: 14px 18px;
}

.screen-starter-plains {
  align-content: center;
  justify-items: center;
  padding: 16px 24px 20px;
}

.plains-topbar {
  width: min(1240px, 100%);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 12px;
}

.starter-plains-layout {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: calc(100vh - 110px);
  align-items: center;
}

.battle-scene-card {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(20, 56, 31, 0.72) 0%, rgba(16, 31, 20, 0.88) 100%);
  min-height: 0;
}

.battle-scene-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.battle-scene-subtitle {
  margin: 0;
  max-width: 480px;
  color: #e6f1e3;
  line-height: 1.5;
  text-align: right;
}

.battle-arena {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(220px, 0.55fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: stretch;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.combatant-card,
.battle-control-card,
.plains-info-card {
  position: relative;
  border-radius: 26px;
  border: 1px solid rgba(255, 246, 221, 0.18);
  background: linear-gradient(180deg, rgba(10, 23, 30, 0.78) 0%, rgba(9, 17, 15, 0.88) 100%);
  box-shadow:
    0 18px 40px rgba(7, 12, 10, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.combatant-card {
  min-height: 0;
  padding: 16px;
}

.player-card {
  background:
    radial-gradient(circle at 50% 24%, rgba(108, 199, 255, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(16, 24, 52, 0.85) 0%, rgba(10, 19, 29, 0.92) 100%);
}

.enemy-card {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 214, 105, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(48, 31, 15, 0.82) 0%, rgba(24, 18, 12, 0.92) 100%);
}

.combatant-hp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.combatant-hp span {
  font-weight: 700;
}

.combatant-hp strong {
  color: #fff0ba;
}

.hp-bar-shell,
.attack-timer-bar,
.search-progress-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.hp-bar-fill,
.attack-timer-fill,
.search-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 140ms linear;
}

.player-hp-fill {
  background: linear-gradient(90deg, #7ee86b 0%, #bef7a3 100%);
}

.enemy-hp-fill {
  background: linear-gradient(90deg, #ffad4a 0%, #ffd789 100%);
}

.player-figure,
.enemy-stage-slot {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: end;
  justify-content: center;
  margin: 12px 0 16px;
  border-radius: 22px;
  overflow: hidden;
}

.player-figure {
  background:
    radial-gradient(circle at 50% 15%, rgba(109, 217, 255, 0.28), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.16) 100%);
}

.battle-player-image {
  width: min(100%, 250px);
  height: auto;
  display: block;
  transform: scaleX(-1);
  transform-origin: center bottom;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.floating-hero {
  animation: classFloat 3.4s ease-in-out infinite;
}

.enemy-stage-slot {
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 231, 148, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.18) 100%);
}

.empty-slot {
  color: #f8ecd4;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-slot-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 236, 186, 0.48);
  font-size: 2.4rem;
  font-weight: 700;
}

.empty-slot p {
  margin: 0;
  width: 100%;
  text-align: center;
}

.monster-image {
  width: min(100%, 270px);
  max-width: 270px;
  max-height: 260px;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.28));
}

.monster-label {
  margin: 0;
  color: #f2eadc;
  font-weight: 700;
}

.attack-timer {
  display: grid;
  gap: 8px;
}

.attack-timer-head,
.search-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.attack-timer-head strong,
.search-progress-head strong {
  color: #fff0c4;
}

.player-timer-fill {
  background: linear-gradient(90deg, #5bc5ff 0%, #bef5ff 100%);
}

.enemy-timer-fill {
  background: linear-gradient(90deg, #ffb75e 0%, #ffe3af 100%);
}

.battle-control-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 18px;
  min-height: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 211, 127, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(34, 28, 17, 0.82) 0%, rgba(17, 18, 13, 0.9) 100%);
}

.battle-status-box {
  width: 100%;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.battle-status-box p:last-child {
  margin: 0;
  color: #efe8dc;
  line-height: 1.6;
  text-align: center;
}

.explore-button {
  min-width: 190px;
  padding: 16px 24px;
  background: linear-gradient(180deg, #ffe7aa 0%, #f0bb57 44%, #af6d1c 100%);
  font-size: 1.1rem;
}

.explore-button[disabled] {
  cursor: wait;
  filter: grayscale(0.1);
  opacity: 0.76;
}

.search-progress {
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.search-progress-fill {
  background: linear-gradient(90deg, #ffe08e 0%, #fff4cc 100%);
}

.skill-slots {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.skill-slot {
  min-height: 66px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(202, 233, 255, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: #d6ebfb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.damage-number {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 6;
  transform: translate(-50%, 0);
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  background: rgba(16, 17, 25, 0.75);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  animation: damageRise 1s ease-out forwards;
}

.damage-number.player-hit {
  color: #ffd6db;
}

.damage-number.enemy-hit {
  color: #fff0c0;
}

.reward-card {
  text-align: center;
}

.reward-summary-text {
  color: #ebdfce;
  line-height: 1.6;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0 14px;
}

.reward-stat,
.reward-loot-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.reward-stat span,
.reward-loot-box span {
  display: block;
  margin-bottom: 8px;
  color: #dcdff4;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.reward-stat strong,
.reward-loot-box strong {
  color: #fff0c0;
  font-size: 1.2rem;
}

.hit-shake {
  animation: hitShake 280ms ease;
}

@keyframes startPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 244, 215, 0.2) inset,
      0 18px 46px rgba(25, 8, 2, 0.48),
      0 0 30px rgba(255, 194, 90, 0.34);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(255, 244, 215, 0.28) inset,
      0 24px 60px rgba(25, 8, 2, 0.6),
      0 0 48px rgba(255, 208, 112, 0.44);
  }
}

@keyframes spinGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes floatMerlyn {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes classFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes riseParticle {
  0% {
    transform: translateY(12px) scale(0.8);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translateY(-120px) scale(1.25);
    opacity: 0;
  }
}

@keyframes exploreGlow {
  0%, 100% {
    box-shadow:
      0 10px 24px rgba(42, 17, 7, 0.28),
      0 0 0 rgba(255, 199, 97, 0);
  }

  50% {
    box-shadow:
      0 18px 38px rgba(42, 17, 7, 0.34),
      0 0 28px rgba(255, 199, 97, 0.24);
  }
}

@keyframes villageBadgePulse {
  0%, 100% {
    box-shadow:
      0 10px 24px rgba(42, 17, 7, 0.28),
      0 0 0 rgba(255, 207, 110, 0);
  }

  50% {
    box-shadow:
      0 14px 28px rgba(42, 17, 7, 0.34),
      0 0 18px rgba(255, 207, 110, 0.2);
  }
}

@keyframes damageRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -66px) scale(1.06);
  }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

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

@media (max-width: 980px) {
  .battle-arena,
  .tutorial-scene,
  .hero-summary,
  .class-grid,
  .tutorial-popup {
    grid-template-columns: 1fr;
  }

  .class-select-layout {
    width: min(100%, calc(100vw - 28px));
    padding-top: 38px;
  }

  .class-intro-card {
    width: 100%;
    padding: 16px 20px;
  }

  .battle-scene-header,
  .plains-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .battle-scene-subtitle {
    text-align: left;
  }

  .player-figure,
  .enemy-stage-slot {
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .screen-starter-plains,
  .auth-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-panel,
  .welcome-card,
  .hub-card,
  .battle-scene-card,
  .plains-info-card,
  .plains-title-card {
    padding: 20px;
    border-radius: 22px;
  }

  .auth-panel {
    width: min(92vw, 360px);
    padding: 18px 18px 16px;
  }

  .village-hub {
    width: 100%;
  }

  .profile-toggle {
    top: 18px;
    right: 18px;
    width: 72px;
    height: 72px;
  }

  .hero-hub-card {
    top: 92px;
    right: 14px;
    left: 14px;
    width: auto;
    padding: 18px;
  }

  .world-chip {
    right: 14px;
    bottom: 14px;
    min-width: 190px;
    padding: 14px 16px;
  }

  .tutorial-scene {
    width: min(100%, calc(100vw - 24px));
    margin-top: 96px;
  }

  .screen-class-select {
    align-items: start;
    padding: 80px 16px 40px;
  }

  .starter-plains-layout {
    width: 100%;
    max-height: none;
  }

  .battle-scene-card {
    padding: 16px;
  }

  .combatant-card,
  .battle-control-card {
    min-height: auto;
  }

  .combatant-card {
    padding: 16px;
  }

  .monster-avatar {
    width: 190px;
    height: 190px;
  }

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

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

.class-card-disabled {
  opacity: 0.48;
  filter: grayscale(0.7);
}

.class-card-disabled:hover {
  transform: none;
  border-color: rgba(247, 238, 199, 0.28);
  box-shadow:
    0 24px 45px rgba(5, 8, 14, 0.28),
    inset 0 1px 0 rgba(255, 252, 220, 0.08);
}

.class-card-disabled .choose-class-button {
  cursor: not-allowed;
  opacity: 0.72;
}

.screen-starter-plains {
  align-content: stretch;
  justify-items: stretch;
  padding: 0;
  background: #101713;
}

.screen-starter-plains.active {
  display: block;
}

.exploration-shell {
  display: grid;
  grid-template-columns: 1fr;
  background: #1c3220;
}

.inventory-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  align-content: start;
  justify-items: center;
  height: 100vh;
  padding: 14px 10px;
  border-right: 1px solid rgba(218, 230, 190, 0.18);
  background: rgba(11, 15, 14, 0.96);
  box-shadow: 8px 0 22px rgba(4, 8, 7, 0.28);
}

.inventory-sidebar .back-button {
  width: 78px;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 8px;
  background: #e2c16e;
  color: #19140a;
  font-size: 0.86rem;
  line-height: 1;
  box-shadow: none;
}

.inventory-slots {
  display: grid;
  gap: 10px;
  align-content: start;
}

.inventory-slot {
  width: 68px;
  height: 68px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 7px;
  border: 1px solid rgba(230, 230, 205, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    #1c2320;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(0, 0, 0, 0.22);
}

.inventory-slot span {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(226, 193, 110, 0.2);
  color: #e9d18f;
  font-size: 0.72rem;
  font-weight: 700;
}

.skill-slot-icon {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background-repeat: no-repeat;
  background-size: 500% 300%;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.32));
}

.inventory-slot strong {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  min-height: 16px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(4, 7, 6, 0.72);
  color: #fff0aa;
  font-size: 0.63rem;
  line-height: 1;
}

.inventory-slot.skill-cooldown .skill-slot-icon {
  filter: grayscale(0.85) brightness(0.58);
}

.world-stage {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: #1a301d;
}

#worldCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #1a301d;
  cursor: crosshair;
  image-rendering: pixelated;
}

.map-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.map-hud-block {
  pointer-events: auto;
  min-width: 140px;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(225, 232, 198, 0.22);
  border-radius: 8px;
  background: rgba(8, 12, 11, 0.76);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.map-hud-block strong {
  color: #f1df9e;
  font-size: 0.9rem;
}

.map-hud-block span {
  color: #d7e1d0;
  font-size: 0.78rem;
}

.map-hud-right {
  justify-items: end;
  text-align: right;
}

@media (max-width: 720px) {
  .exploration-shell {
    grid-template-columns: 1fr;
    background: #1c3220;
  }

  .inventory-sidebar {
    padding: 10px 7px;
    gap: 10px;
    transition: transform 0.3s ease;
  }

  .inventory-sidebar.collapsed {
    transform: translateX(-100%);
  }

  .sidebar-toggle-btn {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 21, 16, 0.9);
    border: 1px solid var(--panel-border);
    border-left: none;
    color: var(--gold);
    padding: 10px 5px;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    z-index: 1001;
    font-size: 14px;
  }

  .inventory-sidebar .back-button {
    width: 58px;
    padding: 9px 5px;
    font-size: 0.72rem;
  }

  .inventory-slots {
    gap: 7px;
  }

  .inventory-slot {
    width: 54px;
    height: 54px;
    padding: 6px;
  }

  .skill-slot-icon {
    width: 34px;
    height: 34px;
  }

  .inventory-slot strong {
    font-size: 0.56rem;
  }

  .map-hud {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .map-hud-block {
    min-width: 112px;
    padding: 7px 8px;
  }
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 0.9rem;
  color: #d1d5db;
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 45px !important;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  z-index: 10;
}

.password-toggle:hover {
  opacity: 0.8;
}

.hud-hero-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 15px;
}

.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 180px;
}

.hud-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-bar-label {
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  width: 25px;
}

.hud-bar-bg {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.hud-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  pointer-events: none;
  z-index: 2;
  line-height: 10px;
}


.hud-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.3s ease;
}

.hp-fill { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.mp-fill { background: linear-gradient(90deg, #3498db, #2980b9); }
.xp-fill { background: linear-gradient(90deg, #f1c40f, #f39c12); }

/* SISTEMA DE INVENTARIO E DROPS */
.inventory-slot-box { position: relative; display: flex; align-items: center; justify-content: center; }
.item-icon { font-size: 24px; pointer-events: none; }
.item-amount { position: absolute; bottom: 2px; right: 5px; font-size: 11px; color: #fff; font-weight: 900; text-shadow: 1px 1px 2px #000; pointer-events: none; }
.item-tooltip { 
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); 
    background: rgba(10, 10, 15, 0.95); color: #fff; padding: 5px 10px; 
    border-radius: 6px; font-size: 11px; white-space: nowrap; 
    pointer-events: none; opacity: 0; transition: opacity 0.2s; 
    z-index: 1000; border: 1px solid #ffd700; 
}
.inventory-slot-box:hover .item-tooltip { opacity: 1; }
.inventory-slot-box.filled { background: rgba(255, 152, 0, 0.1) !important; border-color: rgba(255, 152, 0, 0.4) !important; }

/* MODAL DE EVOLUÇÃO */
#evolutionModal .class-card:hover { transform: scale(1.05); background: rgba(255,255,255,0.05); }
#evolveButton { animation: pulseGlow 2s infinite; }
@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px #ffd700; }
  50% { box-shadow: 0 0 20px #ffd700; }
  100% { box-shadow: 0 0 5px #ffd700; }
}
