:root {
  color-scheme: dark;
  --ink: #f5f1e8;
  --muted: #a79f92;
  --dim: #161311;
  --panel: rgba(10, 10, 10, 0.78);
  --line: rgba(245, 241, 232, 0.16);
  --ember: #d99a3f;
  --ember-strong: #ffbf5a;
  --oxide: #b95134;
  --cold: #77b9c9;
  --black: #050505;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050505;
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.game-page {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(217, 154, 63, 0.2), transparent 32%),
    linear-gradient(245deg, rgba(119, 185, 201, 0.18), transparent 35%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 74px),
    #070604;
}

.game-page::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 6px, 6px 100%;
  mix-blend-mode: soft-light;
  opacity: 0.42;
}

.stage {
  position: absolute;
  inset: clamp(10px, 1.7vw, 22px);
  overflow: hidden;
  border: 1px solid rgba(255, 191, 90, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.topbar,
.statusbar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px clamp(12px, 2vw, 22px);
  background: var(--panel);
  backdrop-filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.topbar {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.statusbar {
  bottom: 0;
  min-height: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chrome-hidden .topbar {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.chrome-hidden .statusbar {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 191, 90, 0.65);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 44%, #050505 44% 56%, transparent 56%),
    linear-gradient(180deg, rgba(255, 191, 90, 0.95), rgba(185, 81, 52, 0.9));
  box-shadow: 0 0 28px rgba(255, 191, 90, 0.28);
}

.brand strong {
  display: block;
  overflow: hidden;
  max-width: min(42vw, 430px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.page-links a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.page-links a:hover,
.page-links a:focus-visible {
  color: var(--ember-strong);
  outline: none;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 8px;
  background: rgba(245, 241, 232, 0.08);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(255, 191, 90, 0.8);
  background: rgba(255, 191, 90, 0.15);
  color: var(--ember-strong);
  outline: none;
  transform: translateY(-1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.tooltip {
  position: absolute;
  right: 50%;
  bottom: -34px;
  z-index: 10;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 5, 5, 0.92);
  color: var(--ink);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(50%) translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.icon-button:hover .tooltip,
.icon-button:focus-visible .tooltip {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.frame-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 191, 90, 0.1), transparent 22%),
    #000;
}

#gameFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #000;
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.64), rgba(5, 5, 5, 0.92)),
    #000;
  color: var(--ink);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loader.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loader p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loader-mark {
  display: grid;
  grid-template-columns: repeat(3, 16px);
  gap: 8px;
  align-items: end;
  height: 40px;
}

.loader-mark span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--ember);
  animation: pulse 900ms ease-in-out infinite;
}

.loader-mark span:nth-child(2) {
  background: var(--oxide);
  animation-delay: 120ms;
}

.loader-mark span:nth-child(3) {
  background: var(--cold);
  animation-delay: 240ms;
}

.frame-error {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92%, 560px);
  padding: 14px;
  border: 1px solid rgba(255, 191, 90, 0.36);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.9);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.frame-error[hidden] {
  display: none;
}

.frame-error button,
.frame-error a {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(245, 241, 232, 0.2);
  border-radius: 6px;
  background: rgba(245, 241, 232, 0.09);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.seo-content {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #070604 0%, #11100d 22%, #f4efe5 22%, #f4efe5 100%);
  color: #181410;
}

.seo-content::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 520px;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, rgba(217, 154, 63, 0.25), transparent 40%),
    linear-gradient(245deg, rgba(119, 185, 201, 0.18), transparent 42%);
}

.content-hero,
.content-grid,
.longform,
.faq-section {
  position: relative;
  width: min(1120px, calc(100% - 36px));
  margin-right: auto;
  margin-left: auto;
}

.content-hero {
  padding: clamp(58px, 8vw, 108px) 0 clamp(34px, 5vw, 64px);
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--ember-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.content-hero h1 {
  max-width: 980px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 780px;
  margin: 24px 0 0;
  color: #d9d0c3;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 191, 90, 0.26);
  border-radius: 8px;
  background: rgba(255, 191, 90, 0.26);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

.content-grid div {
  min-height: 142px;
  padding: 22px;
  background: #17120e;
  color: var(--ink);
}

.content-grid strong {
  display: block;
  margin-bottom: 14px;
  color: var(--ember-strong);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.content-grid span {
  display: block;
  color: #d9d0c3;
  font-size: 16px;
  line-height: 1.45;
}

.longform {
  padding: clamp(48px, 7vw, 88px) 0 30px;
  column-gap: 56px;
}

.longform h2,
.faq-section h2 {
  max-width: 780px;
  margin: 46px 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.longform h2:first-child {
  margin-top: 0;
}

.longform p {
  max-width: 820px;
  margin: 0 0 20px;
  color: #2a241f;
  font-size: 18px;
  line-height: 1.78;
}

.longform p + h2 {
  padding-top: 12px;
}

.faq-section {
  padding: 28px 0 clamp(64px, 9vw, 120px);
}

.faq-section .eyebrow {
  color: #9b5622;
}

.faq-section h2 {
  margin-top: 0;
}

details {
  max-width: 900px;
  border-top: 1px solid rgba(24, 20, 16, 0.18);
}

details:last-child {
  border-bottom: 1px solid rgba(24, 20, 16, 0.18);
}

summary {
  min-height: 64px;
  padding: 20px 0;
  color: #181410;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.25;
}

details p {
  max-width: 780px;
  margin: 0;
  padding: 0 0 24px;
  color: #3a322b;
  font-size: 17px;
  line-height: 1.7;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }

  50% {
    transform: translateY(-14px);
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .game-page {
    min-height: 100dvh;
  }

  .stage {
    inset: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .topbar {
    min-height: 54px;
    padding: 8px 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand strong {
    max-width: 44vw;
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .actions {
    gap: 6px;
  }

  .page-links {
    display: none;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .statusbar {
    display: none;
  }

  .frame-error {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .seo-content {
    background:
      linear-gradient(180deg, #070604 0%, #11100d 16%, #f4efe5 16%, #f4efe5 100%);
  }

  .content-hero,
  .content-grid,
  .longform,
  .faq-section {
    width: min(100% - 28px, 1120px);
  }

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

  .content-grid div {
    min-height: 0;
  }

  .longform p {
    font-size: 16px;
    line-height: 1.72;
  }

  summary {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
