:root {
  --navy: #1c2f66;
  --light: #f5f5f5;
  --light-blue: #eef4ff;
  --red: #dc2626;
  --white: #ffffff;
  --ink: #122047;
  --muted: #68718a;
  --line: rgba(28, 47, 102, 0.14);
  --shadow: 0 28px 80px rgba(18, 32, 71, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  /* Optional background swap: add url("assets/your-background.jpg") as the first background layer. */
  background:
    linear-gradient(180deg, rgba(238, 244, 255, 0.92), rgba(245, 245, 245, 0.98)),
    var(--light);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

.game-shell {
  width: min(1080px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 18px;
}

.hero-band,
.game-stage {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-band {
  min-height: 240px;
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: min(44vw, 300px);
  aspect-ratio: 1;
  border: 1px solid rgba(28, 47, 102, 0.2);
  border-radius: 50%;
  opacity: 0.45;
}

.brand-row,
.progress-meta,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 150px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.edition,
.eyebrow,
.card-kicker,
.progress-meta,
.copy-note {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-kicker {
  margin: 0 0 12px;
  color: var(--red);
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 5.4vw, 4.15rem);
  line-height: 1;
  max-width: 680px;
  overflow-wrap: normal;
  word-break: normal;
}

.subtitle {
  max-width: 560px;
  margin: clamp(10px, 2vw, 18px) 0 0;
  color: #283a70;
  font-size: clamp(0.96rem, 2vw, 1.16rem);
  line-height: 1.55;
}

.game-stage {
  padding: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(28, 47, 102, 0.1);
}

.progress-fill {
  width: 10%;
  height: 100%;
  background: var(--red);
  transition: width 280ms ease;
}

.decision-card,
.result-card {
  height: 100%;
  min-height: clamp(360px, 52svh, 470px);
  padding: clamp(22px, 5vw, 48px);
  display: grid;
  gap: 28px;
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.95), rgba(255, 255, 255, 0.98)),
    var(--white);
  border: 1px solid var(--line);
}

.decision-card {
  align-content: center;
  transition:
    transform 220ms ease,
    opacity 220ms ease;
}

.decision-card.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

h2 {
  max-width: 760px;
  font-size: clamp(1.75rem, 4.8vw, 3.35rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-button,
.primary-button,
.founder-button,
.secondary-button,
.text-button {
  min-height: 56px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.choice-button {
  width: 100%;
  padding: 17px 18px;
  color: var(--navy);
  background: var(--white);
  text-align: left;
  font-weight: 800;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: rgba(220, 38, 38, 0.46);
  transform: translateY(-1px);
}

.result-card {
  min-height: 0;
  align-content: start;
  overflow: auto;
  text-align: left;
}

.result-description {
  max-width: 690px;
  margin: 0;
  color: #273456;
  font-size: 1.06rem;
  line-height: 1.7;
}

.share-line {
  margin: 0;
  padding-left: 14px;
  color: var(--navy);
  border-left: 3px solid var(--red);
  font-weight: 800;
  line-height: 1.5;
}

.ranking-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.ranking-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-heading strong {
  color: var(--red);
}

.ranking-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  counter-reset: ranking;
}

.ranking-item {
  counter-increment: ranking;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  color: #31405f;
  border: 1px solid transparent;
}

.ranking-item::before {
  content: counter(ranking);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--light-blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.ranking-item.is-current {
  color: var(--navy);
  background: var(--light-blue);
  border-color: rgba(28, 47, 102, 0.2);
}

.ranking-item.is-current::before {
  color: var(--white);
  background: var(--red);
}

.ranking-title {
  display: block;
  grid-column: 2;
  font-weight: 900;
}

.ranking-description {
  display: block;
  grid-column: 2;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
}

.primary-button,
.founder-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.primary-button {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.founder-button {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.secondary-button {
  color: var(--navy);
  background: var(--white);
}

.text-button {
  color: var(--navy);
  background: transparent;
}

.primary-button:hover,
.founder-button:hover,
.secondary-button:hover,
.text-button:hover,
.primary-button:focus-visible,
.founder-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--red);
}

.copy-note {
  min-height: 18px;
  margin: 0;
  color: var(--red);
}

.is-hidden {
  display: none;
}

@media (min-width: 760px) {
  .game-shell {
    padding: 28px;
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
    align-items: stretch;
  }

  .hero-band {
    min-height: calc(100vh - 56px);
    min-height: calc(100svh - 56px);
    position: sticky;
    top: 28px;
  }

  .game-stage {
    min-height: calc(100vh - 56px);
    min-height: calc(100svh - 56px);
    max-height: calc(100vh - 56px);
    max-height: calc(100svh - 56px);
    overflow: auto;
  }

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

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

@media (min-width: 760px) and (max-width: 1024px) {
  .game-shell {
    gap: 14px;
    padding: 18px;
    grid-template-columns: minmax(300px, 0.9fr) minmax(390px, 1.1fr);
  }

  .hero-band {
    min-height: calc(100vh - 36px);
    min-height: calc(100svh - 36px);
    top: 18px;
  }

  h1 {
    font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  }

  h2 {
    font-size: clamp(1.7rem, 3.7vw, 2.8rem);
  }

  .decision-card,
  .result-card {
    min-height: clamp(340px, 58svh, 460px);
    padding: clamp(22px, 4vw, 38px);
  }
}

@media (max-width: 759px) {
  .game-shell {
    min-height: 100svh;
    grid-template-rows: minmax(154px, 23svh) 1fr;
    gap: 10px;
    padding: 10px;
  }

  .hero-band {
    min-height: 0;
    padding: 14px;
  }

  .hero-band::after {
    width: 160px;
    opacity: 0.28;
  }

  .brand-logo {
    max-width: 128px;
    height: 30px;
  }

  .brand-mark,
  .edition,
  .eyebrow,
  .card-kicker,
  .progress-meta,
  .copy-note {
    font-size: 0.68rem;
  }

  .eyebrow,
  .card-kicker {
    margin-bottom: 8px;
  }

  h1 {
    font-size: clamp(1.55rem, 8.2vw, 2.48rem);
    line-height: 1.02;
  }

  .subtitle {
    max-width: 34rem;
    font-size: 0.94rem;
    line-height: 1.35;
  }

  .game-stage {
    min-height: 0;
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 12px;
  }

  .decision-card {
    min-height: 0;
    padding: clamp(16px, 5vw, 24px);
    gap: 16px;
    align-content: center;
  }

  .result-card {
    min-height: 0;
    padding: 18px;
    gap: 16px;
    align-content: start;
    overflow: auto;
  }

  h2 {
    font-size: clamp(1.38rem, 7.4vw, 2.35rem);
    line-height: 1.12;
  }

  .choices {
    gap: 9px;
  }

  .choice-button {
    min-height: 50px;
    padding: 13px 14px;
  }
}

@media (max-width: 420px) {
  .game-shell {
    grid-template-rows: minmax(128px, 20svh) 1fr;
    padding: 8px;
  }

  .hero-band,
  .game-stage {
    box-shadow: none;
  }

  .brand-row,
  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .subtitle {
    display: none;
  }

  h1 {
    font-size: clamp(1.42rem, 7.6vw, 2.12rem);
  }

  .game-stage {
    padding: 10px;
  }

  .decision-card {
    gap: 14px;
    padding: 14px;
  }

  .primary-button,
  .founder-button,
  .secondary-button,
  .text-button {
    width: 100%;
  }
}
