:root {
  --wood-950: #160a05;
  --wood-900: #24120a;
  --wood-800: #381e11;
  --wood-700: #4f2c19;
  --wood-600: #6b3d24;
  --brass: #d4a024;
  --brass-bright: #ffd166;
  --parchment: #f8eed4;
  --parchment-2: #efe0bb;
  --parchment-3: #dfc690;
  --ink: #24140a;
  --ink-soft: #5c3d26;
  --crimson: #b93228;
  --crimson-dark: #881f17;
  --emerald: #1c8c53;
  --ocean: #1b4b72;
  --violet: #6c3eb8;
  --shadow: 0 12px 32px rgba(10, 4, 2, 0.45);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #2a140a 0%, #160a05 60%, #0e0503 100%);
  color: var(--parchment);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

@keyframes tabFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.5; } }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 209, 102, 0.55), 0 4px 0 #701610; }
  50% { box-shadow: 0 0 28px rgba(255, 209, 102, 0.9), 0 4px 0 #701610; }
}
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* NAVBAR */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(36, 18, 10, 0.98), rgba(22, 10, 5, 0.96));
  border-bottom: 3px solid var(--wood-600);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-link { display: flex; align-items: center; gap: 10px; margin-right: 4px; }
.brand-link img { height: 42px; width: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
.brand-meta { display: grid; line-height: 1.1; }
.brand-meta strong { font-family: "Luckiest Guy", Impact, serif; font-size: 16px; letter-spacing: 0.5px; color: var(--brass-bright); font-weight: 400; }
.online-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: #9cf4bd; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ce67a; display: inline-block; animation: pulseDot 1.8s infinite; }

.nav-tabs { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; justify-content: center; }
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  background: rgba(56, 30, 17, 0.65);
  color: var(--parchment-2);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}
.nav-tab img { width: 18px; height: 18px; image-rendering: pixelated; }
.nav-tab:hover { background: var(--wood-700); border-color: var(--brass); color: #fff; }
.nav-tab.active { background: linear-gradient(180deg, #5d331d, #3b1e0f); border-color: var(--brass-bright); color: var(--brass-bright); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.auth-user { display: flex; align-items: center; gap: 6px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--wood-800); border: 1.5px solid var(--brass); font-size: 12px; color: var(--brass-bright); }
.user-chip img { width: 16px; height: 16px; image-rendering: pixelated; }
.mobile-menu-btn { display: none; margin-left: auto; background: var(--wood-700); border: 2px solid var(--brass); color: var(--brass-bright); border-radius: 8px; padding: 6px 11px; font-size: 18px; font-weight: 900; cursor: pointer; }

/* BUTTONS */
.btn-wood {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 2px solid var(--wood-700);
  background: linear-gradient(180deg, #fff5dc, #e4c98e);
  color: var(--ink);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.btn-wood:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-wood.ghost { background: rgba(56, 30, 17, 0.85); color: var(--parchment); border-color: var(--wood-600); }
.btn-wood.ocean { background: linear-gradient(180deg, #2b6ea3, #174166); color: #fff; border-color: #6ab4f5; }
.btn-wood.sm { padding: 6px 10px; font-size: 12px; }
.btn-wood img { width: 16px; height: 16px; image-rendering: pixelated; }

.btn-play-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 2px solid var(--brass-bright);
  background: linear-gradient(180deg, #e04436 0%, #b93228 55%, #8a1d14 100%);
  color: #fff6e0;
  font-family: "Luckiest Guy", Impact, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.7px;
  cursor: pointer;
  animation: glowPulse 2.2s infinite;
  transition: transform 0.15s ease;
}
.btn-play-glow:hover { transform: translateY(-2px) scale(1.02); }
.btn-play-glow.lg { padding: 14px 28px; font-size: 20px; }
.btn-play-glow.block { width: 100%; }
.btn-play-glow img { width: 20px; height: 20px; image-rendering: pixelated; }

.maint-strip { background: #9d231a; color: #fff6e0; text-align: center; padding: 8px 14px; font-weight: 800; font-size: 13px; border-bottom: 2px solid var(--brass-bright); }

/* MAIN CONTAINER */
.spa-main { max-width: 1320px; margin: 0 auto; padding: 20px 16px 48px; animation: tabFade 0.2s ease; }
.section-stack { display: grid; gap: 22px; }

/* HERO */
.hero-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid var(--wood-600);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(212, 160, 36, 0.6);
  min-height: 360px;
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 34px 32px;
  background-size: cover;
  background-position: center;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(16, 7, 3, 0.92) 0%, rgba(28, 12, 6, 0.78) 58%, rgba(16, 7, 3, 0.55) 100%);
}
.hero-left, .hero-right { position: relative; z-index: 2; }
.hero-logo { max-width: 310px; width: 85%; height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7)); margin-bottom: 10px; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(36, 18, 10, 0.85);
  border: 1.5px solid var(--brass);
  font-size: 12px;
  font-weight: 900;
  color: var(--brass-bright);
  margin-bottom: 10px;
}
.hero-left h1 {
  margin: 0 0 10px;
  font-family: "Luckiest Guy", Impact, serif;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 400;
  color: #fff6e0;
  text-shadow: 0 3px 0 #1b0f08;
  line-height: 1.15;
}
.hero-left p { margin: 0 0 18px; color: var(--parchment-2); font-size: 15px; line-height: 1.55; max-width: 580px; }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-stats-board {
  background: linear-gradient(180deg, rgba(248, 238, 212, 0.96), rgba(223, 198, 144, 0.95));
  color: var(--ink);
  border: 3px solid var(--wood-700);
  box-shadow: inset 0 0 0 2px var(--brass), 0 12px 30px rgba(0,0,0,0.55);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 12px;
}
.hero-stats-board h3 { margin: 0; font-family: "Luckiest Guy", serif; font-weight: 400; font-size: 20px; color: var(--wood-800); display: flex; align-items: center; gap: 8px; }
.stats-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-pill-card {
  background: #fff9ea;
  border: 2px solid var(--wood-600);
  border-radius: 10px;
  padding: 10px 12px;
}
.stat-pill-card small { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--ink-soft); }
.stat-pill-card b { font-size: 19px; font-weight: 900; color: var(--crimson-dark); }

/* PARCHMENT PANEL */
.parchment-card {
  background: linear-gradient(180deg, #fff6e0, #ead4a6);
  color: var(--ink);
  border: 3px solid var(--wood-700);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(212, 160, 36, 0.75);
  border-radius: 16px;
  padding: 22px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 2px dashed rgba(92, 61, 38, 0.35);
  padding-bottom: 10px;
}
.card-title-row h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Luckiest Guy", Impact, serif;
  font-weight: 400;
  font-size: 24px;
  color: var(--wood-800);
}
.card-title-row h2 img { width: 26px; height: 26px; image-rendering: pixelated; }

/* SALA DOS CAMPEÕES (TOP 3 PEDESTAL) */
.champions-hall {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--wood-700);
  box-shadow: var(--shadow), inset 0 0 0 2px var(--brass);
  background: #0d1633 url("/assets/champions-hall.webp") center bottom / cover no-repeat;
  min-height: 410px;
  padding: 22px 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.champions-hall::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 34, 0.72) 0%, rgba(10, 14, 34, 0.18) 45%, rgba(10, 14, 34, 0.78) 100%);
}
.champions-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.champions-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Luckiest Guy", Impact, serif;
  font-weight: 400;
  font-size: 28px;
  color: var(--brass-bright);
  text-shadow: 0 3px 0 #1b0f08;
}
.champions-head img { width: 32px; height: 32px; }
.champions-sub { font-size: 13px; color: #dbe9ff; font-weight: 700; background: rgba(11, 20, 48, 0.7); padding: 5px 12px; border-radius: 99px; border: 1px solid rgba(255, 209, 102, 0.45); }

.podium-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 18px;
  max-width: 960px;
  width: 100%;
  margin: 26px auto 4px;
}
.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(28, 17, 11, 0.88), rgba(16, 9, 5, 0.94));
  border: 2.5px solid var(--brass);
  border-radius: 16px;
  padding: 14px 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.podium-slot.rank-1 {
  transform: translateY(-20px);
  border-color: #ffe382;
  box-shadow: 0 0 32px rgba(255, 209, 102, 0.5), 0 16px 34px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, rgba(64, 34, 14, 0.92), rgba(24, 11, 5, 0.96));
}
.podium-slot.rank-2 { border-color: #c7d9f0; }
.podium-slot.rank-3 { border-color: #d78d52; }

.podium-rank-badge {
  font-family: "Luckiest Guy", serif;
  font-size: 15px;
  padding: 3px 12px;
  border-radius: 99px;
  margin-bottom: 8px;
  color: #160a05;
  background: var(--brass-bright);
}
.podium-slot.rank-2 .podium-rank-badge { background: #d8e6f8; }
.podium-slot.rank-3 .podium-rank-badge { background: #e39b61; }

.podium-avatar-wrap { position: relative; width: 88px; height: 88px; margin-bottom: 8px; animation: floatUp 3.2s ease-in-out infinite; }
.podium-slot.rank-1 .podium-avatar-wrap { width: 108px; height: 108px; }
.podium-avatar {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  border: 3px solid var(--brass-bright);
  background: #1a2d4c;
}
.podium-crown {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.7));
}
.podium-name { font-size: 17px; font-weight: 900; color: #fff6e0; }
.podium-guild { font-size: 12px; font-weight: 800; color: #9ecaff; min-height: 16px; }
.podium-stats { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 12px; font-weight: 800; }
.podium-stats span { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 8px; padding: 3px 8px; color: var(--parchment); }

/* MAPS & NEWS GRID */
.cards-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.map-showcase-card {
  background: #fff9eb;
  border: 2px solid var(--wood-600);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
}
.map-showcase-card .map-head {
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--wood-800), var(--ocean));
  color: #fff6e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.map-showcase-card .map-body { padding: 12px 14px; font-size: 13px; color: var(--ink-soft); }
.lvl-badge { background: var(--brass-bright); color: var(--ink); font-weight: 900; font-size: 11px; padding: 2px 8px; border-radius: 99px; }

.news-card {
  background: #fff9ea;
  border: 2px solid var(--wood-600);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.14s ease;
}
.news-card:hover { transform: translateY(-2px); border-color: var(--crimson); }
.news-thumb { height: 135px; background: var(--wood-800) center/cover no-repeat; position: relative; }
.news-cat { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 99px; background: var(--crimson); color: #fff; font-size: 11px; font-weight: 900; border: 1px solid var(--brass-bright); }
.news-card-body { padding: 12px 14px; display: grid; gap: 6px; flex: 1; }
.news-card-body h4 { margin: 0; font-size: 16px; color: var(--wood-800); }
.news-card-body p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.news-card-foot { margin-top: auto; padding-top: 6px; font-size: 11px; font-weight: 800; color: var(--ocean); }

/* RANKING TOP 100 TABLE */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.inp { padding: 9px 12px; border-radius: 9px; border: 2px solid var(--wood-600); background: #fffdf5; color: var(--ink); font-size: 13px; font-weight: 700; }
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 2px solid var(--wood-700); background: #fffbf0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--wood-800); color: var(--brass-bright); text-align: left; padding: 10px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(92, 61, 38, 0.18); color: var(--ink); vertical-align: middle; }
.tbl tr:hover td { background: rgba(212, 160, 36, 0.14); }
.rank-player-cell { display: flex; align-items: center; gap: 10px; }
.rank-avatar { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--wood-700); object-fit: cover; background: #1d2d44; }
.tag-pill { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--wood-800); color: var(--brass-bright); font-size: 11px; font-weight: 900; }

/* MARKET SPRITE CARDS */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.offer-card { background: #fffaf0; border: 2px solid var(--wood-600); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.offer-head { display: flex; align-items: center; gap: 10px; }
.item-sprite-box { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--wood-700); background-color: #24120a; flex-shrink: 0; image-rendering: pixelated; }

/* FAQ & RULES */
.faq-item { background: #fff9ea; border: 2px solid var(--wood-600); border-radius: 12px; overflow: hidden; }
.faq-item.highlight { border-color: var(--crimson); box-shadow: inset 0 0 0 1px var(--brass); background: #fff4d8; }
.faq-q { width: 100%; text-align: left; padding: 13px 16px; background: transparent; border: none; font-size: 15px; font-weight: 900; color: var(--wood-800); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { padding: 0 16px 14px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

/* MODALS */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(10, 4, 2, 0.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-parchment {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff6e0, #ead4a6);
  color: var(--ink);
  border: 3px solid var(--wood-700);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.75), inset 0 0 0 2px var(--brass);
  border-radius: 16px;
  padding: 24px;
}
.news-modal-box { max-width: 660px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--wood-700); background: var(--crimson); color: #fff; font-weight: 900; cursor: pointer; }
.modal-logo { display: block; max-width: 210px; margin: 0 auto 12px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.switch-btn { padding: 8px; border-radius: 9px; border: 2px solid var(--wood-600); background: rgba(255,255,255,0.4); font-weight: 900; color: var(--wood-800); cursor: pointer; }
.switch-btn.active { background: var(--wood-800); color: var(--brass-bright); border-color: var(--brass); }
.portal-form { display: grid; gap: 11px; }
.portal-form label { display: grid; gap: 4px; }
.portal-form label span { font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--wood-700); }
.portal-form input { padding: 10px 12px; border-radius: 9px; border: 2px solid var(--wood-600); background: #fffdf5; color: var(--ink); font-size: 14px; font-weight: 700; }
.err-box { background: #fbe1df; border: 1.5px solid var(--crimson); color: #7e1912; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.auth-hint { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); text-align: center; }

.footer-wood { border-top: 3px solid var(--wood-700); background: #140905; padding: 26px 16px; margin-top: 24px; }
.footer-inner { max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-col strong { font-family: "Luckiest Guy", serif; font-size: 18px; color: var(--brass-bright); font-weight: 400; }
.footer-col p { margin: 6px 0 0; font-size: 12px; color: var(--parchment-2); max-width: 480px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; font-weight: 800; color: var(--brass-bright); }
.footer-links a:hover { text-decoration: underline; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; }
.toast-msg { background: var(--wood-800); color: var(--brass-bright); border: 2px solid var(--brass); padding: 10px 14px; border-radius: 10px; font-weight: 800; font-size: 13px; box-shadow: var(--shadow); }

@media (max-width: 960px) {
  .hero-card { grid-template-columns: 1fr; padding: 24px 20px; }
  .cards-grid-3 { grid-template-columns: 1fr; }
  .cards-grid-2 { grid-template-columns: 1fr; }
  .podium-grid { grid-template-columns: 1fr; gap: 12px; }
  .podium-slot.rank-1 { transform: none; order: -1; }
  .mobile-menu-btn { display: inline-flex; }
  .nav-tabs { display: none; width: 100%; order: 4; justify-content: flex-start; padding-top: 6px; }
  .nav-tabs.open { display: flex; }
}
