:root {
  --bg-night: #07131d;
  --bg-deep: #102433;
  --bg-cloud: #e8d5b5;
  --line-soft: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 214, 138, 0.34);
  --text-main: #f7f5ef;
  --text-muted: #b8c7d3;
  --text-dark: #13212b;
  --gold: #efb55f;
  --gold-soft: #ffe1a6;
  --sea: #6bd2ff;
  --sea-soft: #b6efff;
  --panel: rgba(8, 19, 29, 0.82);
  --panel-strong: rgba(12, 28, 40, 0.94);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.24);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(107, 210, 255, 0.22), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(239, 181, 95, 0.26), transparent 18%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #cfe8ff 0%, #7bb7ea 17%, #163046 40%, #08131e 72%, #061018 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  height: 240px;
  background:
    radial-gradient(circle at 8% 80%, rgba(255, 255, 255, 0.85), transparent 24%),
    radial-gradient(circle at 26% 82%, rgba(255, 255, 255, 0.8), transparent 18%),
    radial-gradient(circle at 52% 88%, rgba(255, 255, 255, 0.78), transparent 20%),
    radial-gradient(circle at 76% 78%, rgba(255, 255, 255, 0.74), transparent 22%),
    radial-gradient(circle at 94% 84%, rgba(255, 255, 255, 0.8), transparent 18%);
  opacity: 0.5;
}

body::after {
  top: 0;
  height: 220px;
  background:
    radial-gradient(circle at 15% 22%, rgba(255, 255, 255, 0.18), transparent 20%),
    radial-gradient(circle at 45% 12%, rgba(255, 255, 255, 0.12), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.14), transparent 20%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 22, 33, 0.68);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.26));
}

.brand-mark-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark-kicker {
  color: var(--sea-soft);
  font-size: 0.68rem;
}

.brand-mark strong {
  font-size: 1.22rem;
}

.site-nav {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text-main);
}

.header-actions,
.hero-actions,
.cta-actions,
.login-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.header-user-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.header-user-box[hidden] {
  display: none;
}

.header-user-label {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.header-user-box strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.primary-button {
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  box-shadow: 0 14px 32px rgba(239, 181, 95, 0.18);
}

.secondary-button,
.ghost-button {
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}

.auth-switch {
  display: flex;
  gap: 10px;
  margin: 18px 0 14px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-switch-button {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-main);
  background: transparent;
}

.auth-switch-button.active {
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.hero-section,
.content-section {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(10, 24, 34, 0.94), rgba(7, 19, 29, 0.88));
  box-shadow: var(--shadow-lg);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 28px;
  padding: 48px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 223, 155, 0.24), transparent 16%),
    radial-gradient(circle at 74% 22%, rgba(107, 210, 255, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(7, 28, 44, 0.84), rgba(6, 18, 28, 0.94));
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: auto -8% -18% 42%;
  height: 320px;
  background:
    radial-gradient(circle at 18% 52%, rgba(255, 255, 255, 0.32), transparent 28%),
    radial-gradient(circle at 42% 48%, rgba(255, 255, 255, 0.26), transparent 22%),
    radial-gradient(circle at 76% 56%, rgba(255, 255, 255, 0.24), transparent 28%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-copy h1,
.section-heading h2,
.login-modal h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.06;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  max-width: 12ch;
}

.hero-text,
.section-description,
.feature-card p,
.faction-card p,
.chapter-card p,
.modal-copy,
.login-status {
  color: var(--text-muted);
  line-height: 1.7;
  min-height: 28px;
}

.section-kicker,
.hero-card-label,
.feature-step,
.faction-name {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--sea-soft);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
}

.hero-points {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0;
  margin: 26px 0 0;
  list-style: none;
}

.hero-points li {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.hero-panel {
  display: grid;
  gap: 16px;
  position: relative;
}

.hero-logo-showcase {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(255, 250, 224, 0.22), transparent 34%),
    radial-gradient(circle at 50% 24%, rgba(255, 210, 125, 0.28), transparent 20%),
    linear-gradient(180deg, rgba(18, 49, 72, 0.92), rgba(9, 20, 30, 0.96));
}

.hero-logo-glow {
  position: absolute;
  inset: 12% 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 226, 159, 0.44), transparent 46%);
  filter: blur(18px);
}

.hero-logo-image {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.34));
}

.hero-card,
.feature-card,
.faction-card,
.chapter-card,
.cta-section,
.login-modal {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.hero-card,
.feature-card,
.faction-card,
.chapter-card,
.cta-section {
  background: var(--panel);
}

.hero-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.hero-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.hero-card-gold {
  background:
    radial-gradient(circle at top right, rgba(255, 226, 159, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(48, 34, 12, 0.95), rgba(19, 20, 23, 0.92));
}

.hero-card-blue {
  background:
    radial-gradient(circle at top left, rgba(107, 210, 255, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(7, 37, 52, 0.96), rgba(11, 20, 28, 0.92));
}

.hero-stat-grid,
.feature-grid,
.faction-grid {
  display: grid;
  gap: 16px;
}

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

.hero-stat-grid article {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.hero-stat-grid strong {
  font-size: 1.6rem;
}

.content-section {
  padding: 36px;
  margin-top: 26px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
}

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

.feature-card,
.faction-card {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.feature-card h3,
.faction-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.spotlight-section {
  background:
    radial-gradient(circle at right center, rgba(239, 181, 95, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(10, 24, 34, 0.94), rgba(7, 19, 29, 0.88));
}

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

.faction-card-royal {
  background:
    linear-gradient(180deg, rgba(46, 32, 10, 0.92), rgba(10, 21, 30, 0.96));
}

.faction-card-pirate {
  background:
    linear-gradient(180deg, rgba(8, 39, 52, 0.95), rgba(9, 20, 29, 0.96));
}

.chapter-list {
  display: grid;
  gap: 14px;
}

#historia {
  background:
    radial-gradient(circle at right top, rgba(255, 214, 138, 0.14), transparent 18%),
    linear-gradient(180deg, rgba(10, 24, 34, 0.96), rgba(6, 15, 22, 0.94));
}

.chapter-card {
  padding: 0;
  overflow: hidden;
}

.chapter-card summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
  background: rgba(255, 255, 255, 0.03);
}

.chapter-card[open] summary {
  background:
    linear-gradient(90deg, rgba(255, 220, 161, 0.12), rgba(107, 210, 255, 0.08));
}

.chapter-card summary::-webkit-details-marker {
  display: none;
}

.chapter-card strong {
  font-size: 1.2rem;
}

.chapter-card p {
  margin: 0;
  padding: 0 22px 22px;
}

.chapter-body {
  display: grid;
  gap: 0;
  padding: 0 0 14px;
}

.chapter-body p {
  max-width: 78ch;
  font-size: 1.04rem;
  line-height: 1.85;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at right center, rgba(255, 219, 143, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(12, 29, 42, 0.94), rgba(8, 18, 28, 0.96));
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 14, 0.72);
  backdrop-filter: blur(8px);
}

.login-modal {
  position: relative;
  width: min(540px, calc(100vw - 24px));
  margin: 8vh auto 0;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(239, 181, 95, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(12, 28, 40, 0.98), rgba(8, 19, 29, 0.98));
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form[hidden] {
  display: none !important;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}

.login-form input {
  min-height: 48px;
  padding: 0 14px;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.login-form input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(239, 181, 95, 0.16);
}

.login-actions {
  margin-top: 6px;
}

@media (max-width: 980px) {
  .site-header,
  .hero-section,
  .cta-section {
    border-radius: 24px;
  }

  .site-header,
  .cta-section {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav,
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-section,
  .feature-grid,
  .faction-grid {
    grid-template-columns: 1fr;
  }

  .hero-logo-showcase {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 18px;
  }

  .site-header {
    position: static;
    padding: 18px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .content-section,
  .hero-section,
  .login-modal {
    padding: 22px;
  }

  .hero-copy h1 {
    max-width: none;
  }

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