@font-face {
  font-family: 'Cormorant Garamond Local';
  src: url('/cormorant-garamond-variable.ttf') format('truetype');
  font-display: swap;
  font-style: normal;
  font-weight: 300 700;
}

:root {
  --space-0: #050713;
  --cream: #e9ddc7;
  --cream-muted: #ead9c4;
  --gold: #d7b46f;
  --gold-light: #f1d99d;
  --amber: #a96935;
  --font-game: Georgia, 'Times New Roman', serif;
  --font-brand: 'Cormorant Garamond Local', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; padding: 0; background: var(--space-0); }
html { scroll-behavior: smooth; }
body, button { font-family: var(--font-game); }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.game-shell {
  min-height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--cream);
  background: var(--space-0);
}

.hero {
  position: relative;
  min-height: max(1000px, 100svh);
  margin: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}

.cosmos-background,
.cosmic-sheen { position: absolute; inset: 0; pointer-events: none; }

.cosmos-background {
  z-index: -3;
  background: url('/hero-observatory-bg.png') center 67% / cover no-repeat;
  transform: scale(1.004);
}

.cosmic-sheen {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 47%, transparent 0 23%, rgba(4, 6, 15, 0.035) 47%, rgba(4, 6, 15, 0.34) 100%),
    linear-gradient(180deg, rgba(4, 6, 15, 0.04) 0%, rgba(4, 6, 15, 0.01) 64%, rgba(4, 6, 15, 0.15) 100%);
}

.cosmic-sheen::after {
  position: absolute;
  inset: 0;
  content: '';
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 48% 34%, rgba(255, 244, 211, 0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 63% 17%, rgba(183, 151, 255, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 37% 12%, rgba(255, 244, 211, 0.72) 0 1px, transparent 2px);
  animation: shimmer 4.6s ease-in-out infinite alternate;
}

.topbar {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: clamp(28px, 2.45vw, 48px);
  left: clamp(28px, 2.45vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-right { display: flex; align-items: center; gap: 20px; }

.frame-control {
  position: relative;
  display: inline-flex;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  padding: 0 20px;
  cursor: pointer;
  background: transparent;
  text-transform: uppercase;
  white-space: nowrap;
  transition: filter 180ms ease, transform 180ms ease;
}

.frame-control::after {
  position: absolute;
  z-index: -1;
  inset: -1px;
  border: 12px solid transparent;
  border-image: url('/button-frame-gold.svg') 16 / 12px / 0 stretch;
  content: '';
  pointer-events: none;
}

.sound-control { min-width: 236px; color: #39281d; font-size: 1rem; }
.sound-control::after { border-image-source: url('/sound-button-frame.svg'); border-image-slice: 16 fill; }
.login-control { min-width: 202px; color: var(--cream); font-size: 1rem; font-weight: 600; }

.login-control::before {
  position: absolute;
  z-index: -2;
  inset: 4px;
  content: '';
  background: linear-gradient(180deg, rgba(37, 38, 50, 0.92), rgba(12, 15, 25, 0.92));
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

.sound-bars {
  display: inline-flex;
  width: 22px;
  height: 18px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--amber);
}

.sound-bars i { display: block; width: 2px; border-radius: 999px; background: currentColor; transition: height 180ms ease; }
.sound-bars i:nth-child(1) { height: 8px; }
.sound-bars i:nth-child(2) { height: 17px; }
.sound-bars i:nth-child(3) { height: 11px; }
.sound-control[aria-pressed='false'] .sound-bars i { height: 3px; }

.person-icon { position: relative; width: 25px; height: 25px; color: var(--gold-light); }
.person-icon::before, .person-icon::after { position: absolute; left: 50%; content: ''; transform: translateX(-50%); }
.person-icon::before { top: 1px; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.person-icon::after { bottom: 1px; width: 20px; height: 11px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 14px 14px 0 0; }

.language-switcher, .language-item { display: flex; align-items: center; }
.language-switcher { gap: 11px; color: var(--cream); font-size: 1.35rem; font-weight: 600; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7); }
.language-item { gap: 11px; }
.language-switcher button { min-width: 30px; min-height: 42px; border: 0; padding: 0; cursor: pointer; background: transparent; color: rgba(255, 247, 232, 0.7); transition: color 180ms ease, transform 180ms ease; }
.language-switcher button.active, .language-switcher button:hover { color: var(--cream); transform: translateY(-1px); }
.language-divider { color: rgba(255, 247, 232, 0.45); font-weight: 400; }

.hero-copy {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 15%;
  left: 15%;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
}

.emblem {
  width: 104px;
  height: 104px;
  margin-top: -1px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(235, 193, 107, 0.22));
  animation: emblem-breathe 5s ease-in-out infinite alternate;
}

#hero-title {
  max-width: 100%;
  margin: 5px 0 0;
  background-image:
    linear-gradient(180deg, transparent 22%, rgba(255, 252, 235, 0.25) 39%, transparent 53%, rgba(133, 82, 37, 0.28) 78%, transparent 90%),
    linear-gradient(112deg, #f4dfb7 0%, #fff9ec 14%, #dfb77e 26%, #fff9ec 38%, #ac7946 49%, #f4dfb7 53%, #fff9ec 65%, #dfb77e 78%, #fff9ec 89%, #f4dfb7 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: #f4dfb7;
  font-family: var(--font-brand);
  font-size: clamp(5.8rem, 5.2vw, 6.35rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.88;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(101, 62, 30, 0.76)) drop-shadow(0 7px 16px rgba(0, 0, 0, 0.46));
}

.subtitle-rule { display: flex; width: min(820px, 74vw); align-items: center; justify-content: center; gap: 14px; margin-top: 25px; }
.subtitle-rule span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(241, 217, 157, 0.58), transparent); }
.subtitle-rule i { width: 11px; height: 11px; border: 1px solid var(--gold); background: var(--gold-light); box-shadow: 0 0 17px rgba(246, 209, 136, 0.82); transform: rotate(45deg); }

.hero-subtitle, .hero-lead { margin: 0; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.78); }
.hero-subtitle { margin-top: 12px; color: var(--cream); font-size: clamp(1.35rem, 1.31vw, 1.6rem); font-weight: 700; line-height: 1.25; text-transform: uppercase; }
.hero-lead { max-width: 610px; margin-top: 10px; color: var(--cream); font-size: 1rem; font-weight: 600; line-height: 1.48; text-wrap: balance; }

.hero-actions {
  position: absolute;
  z-index: 4;
  top: 648px;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.hero-actions button { pointer-events: auto; }

.ornate-panel {
  --ornate-frame: url('/ornate-frame-gold.svg');
  --surface-tint: linear-gradient(135deg, rgba(255, 253, 247, 0.22), rgba(190, 179, 191, 0.27));
  --frame-glow: rgba(246, 193, 125, 0.45);
  --glint-color: #fff1ce;
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  transition: filter 180ms ease, transform 180ms ease;
}

.ornate-panel::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(115deg, transparent 4%, rgba(255, 255, 255, 0.31) 8%, transparent 13%, transparent 84%, rgba(255, 255, 255, 0.25) 90%, transparent 96%),
    var(--surface-tint),
    url('/pearl-surface.png');
  background-position: center;
  background-size: 100% 100%;
  clip-path: polygon(12px 1px, calc(100% - 12px) 1px, calc(100% - 7px) 6px, calc(100% - 1px) 10px, calc(100% - 1px) calc(100% - 10px), calc(100% - 7px) calc(100% - 6px), calc(100% - 12px) calc(100% - 1px), 12px calc(100% - 1px), 7px calc(100% - 6px), 1px calc(100% - 10px), 1px 10px, 7px 6px);
  content: '';
  pointer-events: none;
}

.ornate-panel::after { position: absolute; z-index: -1; inset: 0; border: 16px solid transparent; border-image: var(--ornate-frame) 16 / 16px / 0 stretch; content: ''; pointer-events: none; filter: drop-shadow(0 0 2px var(--frame-glow)) drop-shadow(0 0 7px var(--frame-glow)); }
.ornate-glints { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.ornate-glints::before, .ornate-glints::after { position: absolute; width: 52px; height: 1px; content: ''; background: linear-gradient(90deg, transparent, #fffef8, transparent); box-shadow: 0 0 5px var(--glint-color), 0 0 10px var(--glint-color); }
.ornate-glints::before { top: 1px; left: 18px; }
.ornate-glints::after { right: 18px; bottom: 1px; }

.primary-cta, .secondary-cta { display: inline-flex; align-items: center; justify-content: center; gap: 15px; text-transform: uppercase; }
.primary-cta { --surface-tint: linear-gradient(180deg, rgba(255, 249, 233, 0.18), rgba(214, 198, 177, 0.25)); width: min(450px, calc(100vw - 32px)); min-height: 55px; color: #2d2118; font-size: 1.25rem; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85); }
.secondary-cta { --surface-tint: linear-gradient(125deg, rgba(22, 34, 62, 0.96), rgba(34, 46, 78, 0.94) 48%, rgba(15, 26, 50, 0.98)); width: min(380px, calc(100vw - 52px)); min-height: 44px; color: #f6e0b1; font-size: 1rem; font-weight: 700; text-shadow: 0 1px 2px #090f21; }

.line-icon { display: inline-flex; width: 52px; height: 52px; flex: 0 0 auto; align-items: center; justify-content: center; color: #856239; }
.line-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.25; }
.entry-icon { width: 31px; height: 31px; color: #785735; }
.long-arrow { min-width: 34px; font-size: 1.75rem; font-weight: 400; line-height: 1; }

.sector-dock {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 68px;
  left: 0;
  display: grid;
  width: min(1500px, 89vw);
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.sector-card { display: grid; min-height: 124px; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 11px; padding: 14px 17px; color: #28201e; text-align: left; }
.sector-card.featured { --ornate-frame: url('/ornate-frame-violet.svg'); --surface-tint: linear-gradient(125deg, rgba(132, 136, 221, 0.74), rgba(192, 161, 230, 0.72) 52%, rgba(143, 134, 205, 0.82)); --frame-glow: rgba(156, 142, 255, 0.72); --glint-color: #ffcafa; color: #261d33; }
.sector-copy { min-width: 0; }
.sector-copy strong, .sector-copy > span { display: block; }
.sector-copy strong { font-size: 1.18rem; font-weight: 400; line-height: 1.2; text-transform: uppercase; }
.sector-copy > span { margin-top: 7px; font-size: 1rem; line-height: 1.38; }

.bottom-quote { position: absolute; z-index: 4; right: 8vw; bottom: 23px; left: 8vw; margin: 0; color: var(--gold-light); font-size: 1.08rem; font-weight: 600; line-height: 1.4; text-align: center; text-transform: uppercase; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.78); }

.frame-control:hover, .ornate-panel:hover { filter: brightness(1.07); transform: translateY(-2px); }

.cosmos-dialog, .preview-dialog {
  width: min(550px, calc(100vw - 34px));
  max-width: none;
  gap: 0;
  border: 1px solid rgba(235, 196, 130, 0.58);
  border-radius: 7px;
  padding: 38px;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(38, 39, 60, 0.98), rgba(13, 17, 31, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), 0 0 36px rgba(215, 180, 111, 0.16);
  font-family: var(--font-game);
  text-align: center;
}

[data-slot='dialog-overlay'] { background: rgba(3, 5, 10, 0.74); backdrop-filter: blur(9px); }
.preview-dialog { position: fixed; inset: 0; margin: auto; height: max-content; }
.preview-dialog::backdrop { background: rgba(3, 5, 10, 0.74); backdrop-filter: blur(9px); }
.dialog-kicker { margin: 0 0 11px; color: var(--gold-light); font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; }
.dialog-title { margin: 0; color: var(--cream); font-family: var(--font-brand); font-size: 2.25rem; font-weight: 500; line-height: 1.1; }
.dialog-description { margin: 16px 0 0; color: var(--cream-muted); font-family: var(--font-game); font-size: 1.05rem; line-height: 1.55; }
.dialog-button { --surface-tint: linear-gradient(180deg, rgba(255, 249, 233, 0.18), rgba(214, 198, 177, 0.25)); display: block; width: 210px; min-height: 48px; margin: 26px auto 0; color: #2d2118; font-weight: 700; text-transform: uppercase; }

@keyframes shimmer { from { opacity: 0.28; } to { opacity: 0.7; } }
@keyframes emblem-breathe { from { opacity: 0.9; transform: scale(0.985); } to { opacity: 1; transform: scale(1.015); } }

@media (max-width: 1500px) {
  .sector-dock { width: min(1240px, 94vw); gap: 10px; }
  .sector-card { min-height: 112px; grid-template-columns: 45px minmax(0, 1fr); padding: 11px 12px; }
  .sector-card .line-icon { width: 45px; height: 45px; }
  .sector-copy strong { font-size: 1rem; }
  .sector-copy > span { font-size: 0.87rem; }
}

@media (max-width: 1100px) {
  .hero { min-height: 1110px; overflow-y: auto; }
  .topbar { top: 15px; right: 20px; left: 20px; }
  .sound-control { min-width: 52px; width: 52px; padding: 0; }
  .sound-control > span:last-child, .login-control > span:last-child { display: none; }
  .login-control { min-width: 52px; width: 52px; padding: 0; }
  .hero-copy { right: 6%; left: 6%; }
  .emblem { width: 92px; height: 92px; margin-top: 72px; }
  #hero-title { font-size: clamp(3.3rem, 10vw, 5.2rem); }
  .hero-lead { max-width: 620px; }
  .hero-actions { top: 570px; }
  .sector-dock { top: 720px; bottom: auto; width: min(760px, calc(100% - 34px)); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sector-card:last-child { grid-column: 1 / -1; width: calc(50% - 5px); justify-self: center; }
  .bottom-quote { bottom: 26px; }
}

@media (max-width: 650px) {
  .hero { min-height: 1450px; }
  .topbar { right: 13px; left: 13px; gap: 8px; }
  .topbar-right { gap: 8px; }
  .language-switcher, .language-item { gap: 6px; }
  .language-switcher { font-size: 0.98rem; }
  .language-switcher button { min-width: 23px; }
  .sound-control, .login-control { width: 44px; min-width: 44px; height: 44px; }
  .frame-control::after { border-width: 10px; border-image-width: 10px; }
  .emblem { width: 78px; height: 78px; margin-top: 82px; }
  #hero-title { margin-top: 8px; font-size: clamp(2.7rem, 14vw, 4.2rem); }
  .subtitle-rule { width: 92vw; margin-top: 20px; }
  .hero-subtitle { max-width: 92vw; font-size: 1.05rem; }
  .hero-lead { max-width: 90vw; font-size: 0.98rem; }
  .hero-actions { top: 540px; }
  .primary-cta { font-size: 1rem; }
  .sector-dock { top: 700px; grid-template-columns: 1fr; width: min(420px, calc(100% - 28px)); }
  .sector-card, .sector-card:last-child { width: 100%; min-height: 112px; grid-column: auto; }
  .bottom-quote { bottom: 24px; font-size: 0.95rem; }
  .cosmos-dialog, .preview-dialog { padding: 32px 24px; }
  .dialog-title { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
