:root {
  color-scheme: light;
  --ink: #151516;
  --muted: #6f7177;
  --line: #dedfe3;
  --soft: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.78);
  --deep: #050507;
  --blue: #0066cc;
  --green: #0f7b5c;
  --rose: #a4455f;
  --gold: #9b6a20;
  --shadow: 0 24px 80px rgba(20, 22, 26, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  letter-spacing: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--deep);
  color: #fff;
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
  color: #33363b;
  font-size: 13px;
}

.nav-links a:hover {
  color: var(--blue);
}

.nav-links .active {
  color: var(--blue);
  font-weight: 700;
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(420px, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(48px, 8vw, 104px) clamp(18px, 6vw, 88px) 64px;
  background: linear-gradient(180deg, #fbfbfd 0%, #fff 48%, #f5f5f7 100%);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(44px, 5.8vw, 76px);
  line-height: 1.02;
  font-weight: 750;
}

.hero-subtitle {
  max-width: 560px;
  color: #3f4247;
  font-size: clamp(19px, 2.3vw, 26px);
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-link,
.secondary-link,
.generate-button,
.copy-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-link,
.generate-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 102, 204, 0.22);
}

.secondary-link,
.copy-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: var(--blue);
}

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

.hero-visual {
  position: relative;
  min-height: 560px;
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: #e8e4dc;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  display: block;
  object-fit: cover;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 30%, rgba(0, 0, 0, 0.48));
}

.hero-visual figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 1;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 650;
}

.studio-section,
.modes-section,
.rules-section {
  padding: clamp(52px, 8vw, 96px) clamp(18px, 6vw, 88px);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading h2,
.rule-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
}

.section-heading p,
.rule-copy p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.workspace {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.input-panel,
.output-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: #2d3035;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle {
  width: fit-content;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #383b40;
}

.toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.generate-button {
  width: 100%;
  border: none;
  font-weight: 700;
}

.output-panel {
  min-height: 720px;
  padding: clamp(22px, 4vw, 34px);
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.output-toolbar h3 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 32px);
}

.copy-button {
  flex: 0 0 auto;
}

.result-stack {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.result-stack article {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.result-stack article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-stack h4 {
  margin-bottom: 8px;
  font-size: 17px;
}

.result-stack p,
.result-stack li,
.result-stack pre {
  color: #33363b;
  font-size: 16px;
  line-height: 1.78;
}

.result-stack ol {
  margin: 0;
  padding-left: 22px;
}

.script-text {
  white-space: pre-line;
}

pre {
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: #f1f2f5;
  white-space: pre-wrap;
}

.modes-section {
  background: var(--deep);
  color: #fff;
}

.modes-section .eyebrow {
  color: #7fb7ff;
}

.modes-section .section-heading p {
  color: #b8bbc2;
}

.compact {
  margin-bottom: 30px;
}

.mode-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  min-height: 190px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(145deg, #1c1d21, #0d0e11);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-card span {
  color: #8fbfff;
  font-size: 13px;
  font-weight: 700;
}

.mode-card h3 {
  margin: 34px 0 10px;
  font-size: 24px;
}

.mode-card p {
  color: #c9cbd1;
  line-height: 1.6;
}

.rules-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  background: #fbfbfd;
}

.rule-copy {
  max-width: 620px;
}

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list p {
  margin: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 18px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(20, 22, 26, 0.08);
  color: #2d3035;
  font-size: 18px;
  font-weight: 650;
}

.rule-list p:nth-child(2) {
  border-left: 5px solid var(--green);
}

.rule-list p:nth-child(3) {
  border-left: 5px solid var(--rose);
}

.rule-list p:nth-child(4) {
  border-left: 5px solid var(--gold);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 6vw, 88px);
  color: var(--muted);
  font-size: 13px;
  background: #f5f5f7;
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .rules-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 430px;
  }

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

@media (max-width: 680px) {
  .topbar {
    height: auto;
    min-height: 48px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 46px;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 340px;
    border-radius: 22px;
  }

  .field-grid,
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .output-toolbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}

.games-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 249, 0.96)),
    url("./assets/wedding-stage.png") center top / cover fixed;
}

.space-topbar {
  background: rgba(255, 255, 255, 0.9);
}

.space-main {
  padding: clamp(22px, 4vw, 52px) clamp(16px, 4vw, 56px) 64px;
}

.game-command {
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(280px, 0.5fr);
  grid-template-areas:
    "copy tip"
    "copy board";
  gap: 18px;
  align-items: end;
  max-width: 1320px;
  margin: 0 auto 28px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.78) 48%, rgba(255, 255, 255, 0.36) 100%),
    url("./assets/wedding-stage.png") center / cover;
  box-shadow: var(--shadow);
}

.game-command-copy {
  grid-area: copy;
  max-width: 760px;
}

.game-command h1 {
  margin-bottom: 16px;
  font-size: clamp(48px, 7vw, 92px);
}

.game-lead {
  max-width: 680px;
  color: #2d3035;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.5;
}

.quest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.host-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 44px rgba(20, 22, 26, 0.1);
}

.hero-host-tip {
  grid-area: tip;
}

.compact-tip {
  box-shadow: none;
}

.host-avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background:
    url("./assets/wang-lei-line-avatar.jpg") center / cover no-repeat,
    #f5f5f7;
  box-shadow: 0 10px 26px rgba(20, 22, 26, 0.12);
  color: transparent;
  font-size: 0;
}

.host-tip p {
  margin: 0;
  color: #33363b;
  font-size: 14px;
  line-height: 1.55;
}

.host-tip .tip-label {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.quest-board {
  grid-area: board;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(20, 22, 26, 0.1);
}

.quest-progress {
  display: grid;
  gap: 8px;
}

.quest-progress span,
.filter-group p,
.search-box span {
  color: #676a70;
  font-size: 13px;
  font-weight: 700;
}

.quest-progress strong {
  font-size: 38px;
  line-height: 1;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef1;
}

.progress-track span {
  width: 20%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #0066cc, #0f7b5c);
  transition: width 180ms ease;
}

.quest-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.quest-badges span,
.game-badge,
.risk-pill,
.slot {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.quest-badges span {
  background: #edf6f2;
  color: #0f7b5c;
}

.quest-list {
  margin: 0;
  padding-left: 20px;
  color: #33363b;
  line-height: 1.7;
}

.space-layout {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}

.game-filter-panel,
.plan-dock {
  position: sticky;
  top: 66px;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 54px rgba(20, 22, 26, 0.1);
}

.panel-heading h2,
.library-toolbar h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.08;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group p {
  flex: 1 0 100%;
  margin: 0 0 2px;
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #33363b;
  padding: 0 12px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: #151516;
  background: #151516;
  color: #fff;
}

.search-box {
  display: grid;
  gap: 8px;
}

.toggle-card {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #33363b;
}

.toggle-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.expertise-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.expertise-stats article {
  min-height: 94px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
}

.expertise-stats strong {
  font-size: 36px;
  line-height: 1;
}

.expertise-stats span {
  color: #676a70;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.rhythm-list {
  display: grid;
  gap: 10px;
}

.rhythm-list article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.rhythm-list span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #151516;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.rhythm-list p {
  margin: 0;
  color: #33363b;
  font-size: 14px;
  line-height: 1.55;
}

.inventory-wall {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
}

.inventory-wall h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
}

.inventory-cloud {
  max-height: 220px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
}

.inventory-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f2f5;
  color: #33363b;
  font-size: 12px;
  font-weight: 750;
}

.inventory-cloud span.strong {
  background: #151516;
  color: #fff;
}

.game-library {
  min-width: 0;
}

.library-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.library-status {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: #33363b;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.08);
}

.library-tip {
  margin-bottom: 14px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.game-card,
.module-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 42px rgba(20, 22, 26, 0.08);
}

.game-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.game-card:hover {
  transform: translateY(-2px);
}

.game-card.selected {
  border-color: rgba(15, 123, 92, 0.55);
  box-shadow: 0 18px 48px rgba(15, 123, 92, 0.14);
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.game-badge {
  background: #edf6f2;
  color: #0f7b5c;
}

.risk-pill.low {
  background: #eef7ff;
  color: #0066cc;
}

.risk-pill.medium {
  background: #fff4e5;
  color: #9b6a20;
}

.risk-pill.high {
  background: #fff0f3;
  color: #a4455f;
}

.game-card h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.game-summary {
  margin: 0;
  color: #33363b;
  font-size: 16px;
  line-height: 1.6;
}

.game-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.game-facts div {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.game-facts dt {
  margin-bottom: 4px;
  color: #777a80;
  font-size: 12px;
  font-weight: 800;
}

.game-facts dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #2d3035;
  font-size: 14px;
  line-height: 1.55;
}

.game-facts dd span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #f1f2f5;
  font-weight: 700;
}

.mini-host-note {
  padding: 12px;
  border-radius: 14px;
  background: #f6f8fa;
}

.mini-host-note strong {
  color: var(--blue);
  font-size: 13px;
}

.mini-host-note p {
  margin: 4px 0 0;
  color: #33363b;
  font-size: 14px;
  line-height: 1.55;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-button,
.dock-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.plan-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-counter strong {
  font-size: 48px;
  line-height: 1;
}

.plan-counter span {
  color: #676a70;
  font-size: 14px;
  font-weight: 700;
}

.plan-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot {
  background: #f1f2f5;
  color: #55585e;
}

.slot.active {
  background: #151516;
  color: #fff;
}

.selected-list {
  display: grid;
  gap: 10px;
}

.empty-state,
.copy-toast {
  margin: 0;
  color: #676a70;
  font-size: 14px;
  line-height: 1.55;
}

.selected-game {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.selected-game div {
  display: grid;
  gap: 4px;
}

.selected-game strong {
  font-size: 14px;
}

.selected-game span {
  color: #676a70;
  font-size: 12px;
}

.selected-game button {
  border: none;
  background: transparent;
  color: #a4455f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.dock-actions {
  display: grid;
  gap: 8px;
}

.dock-button {
  width: 100%;
}

.no-games {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.no-games p {
  margin: 0;
  color: #676a70;
}

.next-modules {
  max-width: 1320px;
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 178px;
  padding: 20px;
}

.module-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.module-card h3 {
  margin: 22px 0 10px;
  font-size: 24px;
}

.module-card p {
  margin: 0;
  color: #55585e;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .space-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .plan-dock {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .game-command {
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "tip"
      "board";
  }

  .space-layout,
  .game-grid,
  .next-modules {
    grid-template-columns: 1fr;
  }

  .game-filter-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .space-main {
    padding: 16px 12px 42px;
  }

  .game-command {
    padding: 20px;
    border-radius: 18px;
  }

  .game-command h1 {
    font-size: 46px;
  }

  .library-toolbar,
  .game-card-top,
  .selected-game {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-status,
  .card-button {
    width: 100%;
  }
}

.apple-style {
  --apple-bg: #f5f5f7;
  --apple-card: #fbfbfd;
  --apple-blue: #0071e3;
  background:
    radial-gradient(circle at 50% 0%, rgba(70, 73, 77, 0.16), transparent 34%),
    var(--apple-bg);
}

.apple-style .space-topbar {
  height: 44px;
  padding: 0 clamp(18px, 6vw, 84px);
  background: rgba(22, 22, 23, 0.86);
  border-bottom: none;
  color: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
}

.apple-style .brand {
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.apple-style .brand-mark {
  width: 22px;
  height: 22px;
  background: #fff;
  color: #111;
  border-radius: 50%;
}

.apple-style .nav-links {
  gap: clamp(22px, 5vw, 54px);
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.apple-style .nav-links a:hover,
.apple-style .nav-links .active {
  color: #fff;
}

.apple-style .space-main {
  padding: 12px 0 42px;
}

.apple-style .game-command {
  max-width: none;
  min-height: calc(100vh - 44px);
  grid-template-columns: minmax(380px, 0.92fr) minmax(320px, 0.68fr);
  grid-template-areas:
    "copy portrait"
    "tip portrait"
    "board portrait";
  align-items: center;
  gap: clamp(18px, 4vw, 68px);
  margin: 0 0 12px;
  padding: clamp(42px, 7vw, 82px) clamp(18px, 6vw, 88px) clamp(26px, 5vw, 52px);
  border: none;
  border-radius: 0;
  background:
    radial-gradient(circle at 74% 38%, rgba(255, 255, 255, 0.16), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(0, 113, 227, 0.22), transparent 30%),
    linear-gradient(135deg, #070708 0%, #17181a 42%, #2b2c2f 100%);
  box-shadow: none;
  text-align: left;
}

.apple-style .game-command-copy {
  grid-area: copy;
  justify-self: start;
  max-width: 760px;
}

.apple-style .game-command h1 {
  margin-bottom: 8px;
  color: #fff;
  font-size: clamp(56px, 7.2vw, 104px);
  line-height: 1.02;
  font-weight: 760;
}

.apple-style .game-lead {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.32;
}

.apple-style .hero-mini-line {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 17px;
}

.apple-style .quest-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.apple-style .game-command .eyebrow {
  color: #8fc2ff;
}

.apple-style .game-command .secondary-link {
  border-color: rgba(255, 255, 255, 0.54);
  color: #fff;
}

.apple-style .hero-portrait {
  grid-area: portrait;
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: min(42vw, 520px);
  min-width: 320px;
  max-height: 780px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #202124;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.52);
}

.apple-style .hero-portrait::before,
.apple-style .hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.apple-style .hero-portrait::before {
  background:
    radial-gradient(circle at 86% 12%, rgba(34, 34, 34, 0.68) 0 18%, rgba(34, 34, 34, 0.34) 29%, transparent 44%),
    linear-gradient(90deg, rgba(7, 7, 8, 0.04) 0%, transparent 48%, rgba(7, 7, 8, 0.42) 100%),
    linear-gradient(180deg, rgba(7, 7, 8, 0.14) 0%, transparent 40%, rgba(7, 7, 8, 0.34) 100%);
}

.apple-style .hero-portrait::after {
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.46));
}

.apple-style .hero-portrait img {
  width: 100%;
  height: 100%;
  min-height: 640px;
  display: block;
  object-fit: cover;
  object-position: 39% center;
  filter: contrast(1.04) brightness(1.16);
}

.apple-style .hero-portrait figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  color: #fff;
}

.apple-style .hero-portrait figcaption span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apple-style .hero-portrait figcaption strong {
  display: block;
  max-width: 300px;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.15;
}

.apple-style .primary-link,
.apple-style .generate-button {
  background: var(--apple-blue);
  box-shadow: none;
}

.apple-style .secondary-link,
.apple-style .copy-button {
  background: transparent;
  border-color: var(--apple-blue);
  color: var(--apple-blue);
  box-shadow: none;
}

.apple-style .hero-host-tip,
.apple-style .quest-board {
  justify-self: start;
  width: min(680px, 100%);
  margin-top: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
  text-align: left;
  backdrop-filter: blur(24px);
}

.apple-style .quest-board {
  margin-top: 0;
}

.apple-style .game-command .host-tip p,
.apple-style .game-command .quest-list,
.apple-style .game-command .quest-progress span {
  color: rgba(255, 255, 255, 0.78);
}

.apple-style .game-command .host-tip .tip-label {
  color: #8fc2ff;
}

.apple-style .game-command .quest-progress strong {
  color: #fff;
}

.apple-style .game-command .quest-badges span {
  background: rgba(255, 255, 255, 0.12);
  color: #dfefff;
}

.apple-style .game-command .progress-track {
  background: rgba(255, 255, 255, 0.16);
}

.apple-style .space-layout {
  max-width: 1600px;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(220px, 260px);
  gap: 12px;
  padding: 0 12px;
}

.apple-style .game-filter-panel,
.apple-style .plan-dock,
.apple-style .game-card,
.apple-style .module-card,
.apple-style .host-tip,
.apple-style .no-games {
  border: none;
  background: var(--apple-card);
  box-shadow: none;
}

.apple-style .game-command .hero-host-tip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.apple-style .game-filter-panel,
.apple-style .plan-dock {
  top: 56px;
  border-radius: 0;
}

.apple-style .plan-dock {
  gap: 14px;
  padding: 16px;
}

.apple-style .plan-dock .panel-heading h2 {
  font-size: clamp(24px, 2.2vw, 30px);
}

.apple-style .plan-dock .plan-counter {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.apple-style .plan-dock .plan-counter strong {
  font-size: 44px;
}

.apple-style .expertise-stats article,
.apple-style .rhythm-list article,
.apple-style .inventory-wall {
  border: none;
  background: #fff;
}

.apple-style .expertise-stats strong {
  color: #1d1d1f;
}

.apple-style .category-map .filter-chip {
  min-height: 38px;
}

.apple-style .library-toolbar,
.apple-style .library-tip {
  padding: 0 8px;
}

.apple-style .game-grid {
  gap: 12px;
}

.apple-style .game-card {
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  text-align: center;
}

.apple-style .game-card:hover {
  transform: none;
}

.apple-style .game-card.selected {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.24);
}

.apple-style .game-visual {
  min-height: 238px;
  display: grid;
  place-items: end center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.9) 0 26%, rgba(255, 255, 255, 0) 27%),
    linear-gradient(145deg, #eaf7ff 0%, #fbfbfd 58%, #eef1f5 100%);
}

.apple-style .game-visual span {
  min-width: 148px;
  min-height: 78px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  color: #1d1d1f;
  font-size: 21px;
  font-weight: 760;
  box-shadow: 0 18px 50px rgba(20, 22, 26, 0.14);
  transform: rotate(-6deg);
}

.apple-style .visual-bingo {
  background:
    linear-gradient(90deg, rgba(255,255,255,.58) 49%, rgba(0,113,227,.08) 50%) 0 0 / 72px 72px,
    linear-gradient(180deg, #f8fbff 0%, #e7f4ff 100%);
}

.apple-style .visual-photo {
  background:
    radial-gradient(circle at 30% 36%, rgba(0, 113, 227, .22), transparent 24%),
    radial-gradient(circle at 72% 70%, rgba(15, 123, 92, .2), transparent 25%),
    linear-gradient(145deg, #f7fbff, #eef1f5);
}

.apple-style .visual-music {
  background:
    linear-gradient(120deg, rgba(0,113,227,.12), transparent 46%),
    radial-gradient(circle at 50% 42%, rgba(0, 113, 227, .24), transparent 26%),
    #fbfbfd;
}

.apple-style .visual-relay {
  background:
    linear-gradient(135deg, rgba(164, 69, 95, .16), transparent 48%),
    linear-gradient(315deg, rgba(0, 113, 227, .16), transparent 48%),
    #fbfbfd;
}

.apple-style .visual-table {
  background:
    radial-gradient(circle at 50% 70%, rgba(15, 123, 92, .2), transparent 34%),
    linear-gradient(180deg, #f7fbf9, #eef6f3);
}

.apple-style .visual-truth {
  background:
    radial-gradient(circle at 42% 40%, rgba(255, 184, 197, .46), transparent 27%),
    linear-gradient(180deg, #fff8fb, #fbfbfd);
}

.apple-style .visual-password {
  background:
    linear-gradient(90deg, rgba(29,29,31,.08) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, #fbfbfd, #eef1f5);
}

.apple-style .visual-mahjong,
.apple-style .visual-dice,
.apple-style .visual-props {
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.78) 0 24%, rgba(255, 255, 255, 0) 25%),
    linear-gradient(145deg, #fff8d8 0%, #fbfbfd 58%, #eef1f5 100%);
}

.apple-style .visual-phone {
  background:
    radial-gradient(circle at 38% 38%, rgba(0, 113, 227, .24), transparent 26%),
    linear-gradient(145deg, #eef7ff, #fbfbfd);
}

.apple-style .visual-paper {
  background:
    linear-gradient(135deg, rgba(15, 123, 92, .16), transparent 45%),
    linear-gradient(180deg, #fbfbfd, #eef6f3);
}

.apple-style .visual-water {
  background:
    radial-gradient(circle at 36% 42%, rgba(0, 174, 255, .24), transparent 28%),
    radial-gradient(circle at 70% 70%, rgba(0, 113, 227, .18), transparent 26%),
    #fbfbfd;
}

.apple-style .game-card-top,
.apple-style .game-card h3,
.apple-style .game-summary,
.apple-style .game-facts,
.apple-style .mini-host-note,
.apple-style .game-actions {
  margin-left: clamp(18px, 3vw, 34px);
  margin-right: clamp(18px, 3vw, 34px);
}

.apple-style .game-card-top {
  justify-content: center;
  margin-top: 22px;
}

.apple-style .game-card h3 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.apple-style .game-summary {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  color: #1d1d1f;
  font-size: 18px;
  line-height: 1.45;
}

.apple-style .game-facts {
  text-align: left;
}

.apple-style .mini-host-note {
  text-align: left;
}

.apple-style .game-actions {
  justify-content: center;
  margin-bottom: 28px;
}

.apple-style .next-modules {
  max-width: 1600px;
  gap: 12px;
  padding: 0 12px;
}

@media (max-width: 1180px) {
  .apple-style .space-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .apple-style .game-command {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "portrait"
      "tip"
      "board";
    text-align: center;
  }

  .apple-style .game-command-copy,
  .apple-style .hero-host-tip,
  .apple-style .quest-board {
    justify-self: center;
  }

  .apple-style .game-lead {
    margin: 0 auto;
  }

  .apple-style .quest-actions {
    justify-content: center;
  }

  .apple-style .hero-portrait {
    width: min(560px, 100%);
    min-width: 0;
    height: 560px;
    align-self: auto;
  }

  .apple-style .hero-portrait img {
    min-height: 560px;
    object-position: 42% center;
  }

  .apple-style .space-layout,
  .apple-style .game-grid,
  .apple-style .next-modules {
    grid-template-columns: 1fr;
  }

  .apple-style .game-filter-panel,
  .apple-style .plan-dock {
    border-radius: 0;
  }
}

@media (max-width: 680px) {
  .apple-style .space-topbar {
    min-height: 44px;
    height: 44px;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding: 0 14px;
    overflow: hidden;
  }

  .apple-style .brand span:last-child {
    display: none;
  }

  .apple-style .nav-links {
    flex: 1;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
  }

  .apple-style .game-command {
    min-height: auto;
    padding: 44px 24px 18px;
    background:
      radial-gradient(circle at 50% 18%, rgba(0, 113, 227, 0.18), transparent 34%),
      linear-gradient(180deg, #080809 0%, #17181a 62%, #25262a 100%);
  }

  .apple-style .game-command h1 {
    font-size: 48px;
  }

  .apple-style .game-lead {
    font-size: 22px;
  }

  .apple-style .hero-mini-line {
    font-size: 14px;
  }

  .apple-style .hero-portrait {
    height: 520px;
    margin-top: 10px;
  }

  .apple-style .hero-portrait img {
    min-height: 520px;
    object-position: 39% center;
  }

  .apple-style .hero-portrait figcaption {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .apple-style .hero-host-tip {
    margin-top: 0;
  }

  .apple-style .space-layout {
    padding: 0;
  }

  .apple-style .library-toolbar {
    align-items: center;
    flex-direction: row;
    padding: 24px 24px 8px;
  }

  .apple-style .library-status {
    width: auto;
  }

  .apple-style .library-tip {
    margin: 0 12px 12px;
  }

  .apple-style .game-card {
    border-radius: 0;
  }

  .apple-style .game-visual {
    min-height: 210px;
  }

  .apple-style .game-card h3 {
    font-size: 34px;
  }

  .apple-style .game-card-top,
  .apple-style .selected-game {
    align-items: center;
    flex-direction: row;
  }
}

.gifts-page .gift-command {
  background:
    radial-gradient(circle at 74% 38%, rgba(255, 255, 255, 0.12), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(0, 113, 227, 0.2), transparent 30%),
    linear-gradient(135deg, #080809 0%, #17181a 43%, #313236 100%);
}

.gift-hero-visual img {
  object-position: center;
}

.table-control,
.gift-search {
  display: grid;
  gap: 8px;
}

.table-control span,
.table-control small,
.gift-search span,
.selected-lottery span,
.budget-summary span {
  color: #676a70;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.table-control input,
.gift-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #1d1d1f;
  padding: 0 13px;
  outline: none;
}

.table-control input:focus,
.gift-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.gift-stats article {
  min-height: 108px;
}

.gift-major-board,
.gift-ref-lab {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 8px;
}

.major-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.major-heading h2,
.ref-lab-copy h2 {
  margin-bottom: 0;
  color: #1d1d1f;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.major-heading > p,
.ref-lab-copy > p {
  max-width: 520px;
  margin: 0;
  color: #676a70;
  font-size: 14px;
  line-height: 1.55;
}

.gift-major-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gift-major-card {
  min-height: 360px;
  display: grid;
  gap: 10px;
  align-content: end;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: #fbfbfd;
  color: #1d1d1f;
  padding: 0 22px 22px;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.gift-major-card img {
  width: calc(100% + 44px);
  height: 230px;
  display: block;
  object-fit: cover;
  object-position: center;
  margin: 0 -22px 8px;
}

.gift-major-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.gift-major-card strong {
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.03;
}

.gift-major-card p,
.gift-major-card small {
  margin: 0;
  color: #55585e;
  font-size: 14px;
  line-height: 1.55;
}

.gift-major-card small {
  color: #7a7d83;
  font-weight: 700;
}

.gift-major-card.active {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.28);
}

.gift-ref-lab {
  grid-template-columns: minmax(220px, 0.86fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.gift-ref-lab.game-mode {
  grid-template-columns: minmax(120px, 0.38fr) minmax(420px, 1.45fr) minmax(240px, 0.8fr);
}

.ref-lab-copy,
.ref-lab-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  background: #fbfbfd;
}

.ref-lab-copy .eyebrow {
  margin-bottom: 0;
}

.gift-ref-lab.game-mode .ref-lab-copy {
  padding: 18px 14px;
}

.gift-ref-lab.game-mode .ref-lab-copy h2 {
  font-size: clamp(22px, 2.2vw, 30px);
}

.gift-ref-lab.game-mode .ref-lab-copy > p {
  font-size: 13px;
}

.ref-panel-heading {
  display: grid;
  gap: 4px;
}

.ref-panel-heading strong {
  color: #1d1d1f;
  font-size: 17px;
}

.ref-panel-heading span {
  color: #676a70;
  font-size: 13px;
  line-height: 1.45;
}

.reference-tier-grid {
  display: grid;
  gap: 8px;
}

.reference-tier-grid article,
.quantity-preview-grid article {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}

.reference-tier-grid span,
.quantity-preview-grid span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.reference-tier-grid p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.reference-tier-grid b,
.game-reference-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #f1f2f5;
  color: #33363b;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.future-chip-grid,
.game-reference-strip,
.quantity-preview-grid {
  display: grid;
  gap: 8px;
}

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

.future-chip-grid button {
  min-height: 38px;
  border: none;
  border-radius: 999px;
  background: #151516;
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.future-search-button {
  min-height: 42px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

.game-reference-strip span {
  justify-content: center;
  min-height: 54px;
  border-radius: 16px;
  background: #fff0f3;
  color: #a4455f;
  font-size: 15px;
}

.game-quantity-table {
  display: grid;
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 16px;
  background: #dedfe3;
}

.game-quantity-row {
  min-width: 430px;
  display: grid;
  grid-template-columns: minmax(110px, 1.15fr) repeat(3, minmax(86px, 0.95fr));
  gap: 1px;
}

.game-quantity-row span,
.game-quantity-row strong,
.game-quantity-row b {
  min-height: 48px;
  display: grid;
  align-content: center;
  background: #fff;
  color: #1d1d1f;
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.25;
}

.game-quantity-row small {
  display: block;
  margin-top: 3px;
  color: #777a80;
  font-size: 11px;
  font-weight: 700;
}

.game-quantity-row b {
  text-align: center;
  font-size: 17px;
}

.game-quantity-head span,
.game-quantity-head strong {
  background: #151516;
  color: #fff;
  font-weight: 800;
}

.game-quantity-row .active {
  background: #eef7ff;
  color: var(--blue);
  font-weight: 900;
}

.game-quantity-head .active {
  background: var(--blue);
  color: #fff;
}

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

.quantity-preview-grid strong {
  color: #1d1d1f;
  font-size: 24px;
  line-height: 1;
}

.quantity-preview-grid p {
  margin: 0;
  color: #676a70;
  font-size: 12px;
  line-height: 1.45;
}

.gift-grid {
  align-items: start;
}

.gift-image-button {
  position: relative;
  width: 100%;
  min-height: 250px;
  display: block;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: #eef1f5;
  padding: 0;
  cursor: pointer;
}

.gift-image-button img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.gift-image-button span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.gift-card:hover .gift-image-button img {
  transform: scale(1.025);
}

.budget-summary {
  display: grid;
  gap: 8px;
}

.budget-summary article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff;
}

.budget-summary strong {
  color: #1d1d1f;
  font-size: 20px;
}

.selected-gift {
  align-items: center;
}

.selected-gift img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: #eef1f5;
}

.selected-lottery {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
}

.selected-lottery .eyebrow {
  margin-bottom: 0;
}

.selected-lottery div {
  display: grid;
  gap: 5px;
}

.selected-lottery strong {
  color: #1d1d1f;
  font-size: 16px;
}

.lottery-library {
  margin-top: 18px;
  padding-top: 18px;
}

.lottery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lottery-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: none;
  background: var(--apple-card);
  box-shadow: none;
}

.lottery-card.selected {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.24);
}

.lottery-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.gift-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gift-modal.open {
  display: flex;
}

.gift-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.gift-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  overflow: auto;
  border-radius: 18px;
  background: #fbfbfd;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.34);
}

.gift-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.gift-modal-image {
  min-height: 520px;
  background: #eef1f5;
}

.gift-modal-image img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: block;
  object-fit: cover;
}

.gift-modal-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(26px, 4vw, 44px);
}

.gift-modal-copy h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
}

.gift-modal-copy p {
  margin: 0;
  color: #33363b;
  font-size: 17px;
  line-height: 1.6;
}

.modal-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.modal-facts div {
  padding: 12px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-facts dt {
  margin-bottom: 5px;
  color: #777a80;
  font-size: 12px;
  font-weight: 800;
}

.modal-facts dd {
  margin: 0;
  color: #2d3035;
  font-size: 15px;
  line-height: 1.55;
}

.modal-add-button {
  width: fit-content;
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .gift-ref-lab.game-mode,
  .gift-ref-lab {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .major-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .gift-major-grid {
    grid-template-columns: 1fr;
  }

  .gift-modal-panel {
    grid-template-columns: 1fr;
  }

  .gift-modal-image,
  .gift-modal-image img {
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .gift-major-board,
  .gift-ref-lab {
    padding: 0 12px;
  }

  .gift-major-card {
    min-height: auto;
  }

  .future-chip-grid,
  .game-reference-strip,
  .quantity-preview-grid {
    grid-template-columns: 1fr;
  }

  .gift-image-button,
  .gift-image-button img {
    min-height: 210px;
    height: 220px;
  }

  .budget-summary article,
  .selected-gift {
    align-items: flex-start;
  }

  .gift-modal {
    padding: 10px;
  }

  .gift-modal-panel {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }
}

.modal-open {
  overflow: hidden;
}

.speeches-page .speech-command {
  background:
    radial-gradient(circle at 74% 32%, rgba(238, 230, 203, 0.2), transparent 28%),
    radial-gradient(circle at 16% 18%, rgba(0, 113, 227, 0.18), transparent 30%),
    linear-gradient(135deg, #070708 0%, #18191b 44%, #30312f 100%);
}

.speeches-page .game-command h1 {
  max-width: 820px;
  font-size: clamp(52px, 6vw, 86px);
}

.apple-style .speech-hero-visual {
  grid-area: portrait;
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: min(42vw, 520px);
  min-width: 320px;
  max-height: 780px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111214;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.52);
}

.speech-hero-visual figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  color: #fff;
}

.speech-hero-visual figcaption span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.speech-hero-visual figcaption strong {
  display: block;
  max-width: 310px;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.15;
}

.folder-stage {
  position: absolute;
  inset: 0;
  min-height: 640px;
  overflow: hidden;
  background:
    radial-gradient(circle at 62% 52%, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #111214 0%, #1e1f20 52%, #111214 100%);
}

.folder-shadow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0 18%, transparent 38%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.62) 100%);
  z-index: 4;
  pointer-events: none;
}

.folder-spine {
  position: absolute;
  left: clamp(34px, 8vw, 72px);
  top: 42px;
  bottom: 54px;
  width: 82px;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0e6c8, #d8cda9);
  color: #2d2a22;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.24);
  animation: folderSpineIn 780ms ease-out both;
}

.folder-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.folder-paper,
.folder-cover {
  position: absolute;
  top: 54px;
  bottom: 72px;
  left: clamp(94px, 16vw, 142px);
  width: min(72%, 360px);
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.folder-paper {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 34px 22px;
  color: #1d1d1f;
  transform: translateX(-42px);
  opacity: 0;
  animation: folderPaperSlide 920ms cubic-bezier(.2, .8, .2, 1) both;
}

.folder-paper strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

.folder-paper span {
  color: #676a70;
  font-size: 14px;
  font-weight: 800;
}

.paper-one {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px) 0 0 / 34px 34px,
    #f2ebcf;
  animation-delay: 280ms;
}

.paper-two {
  z-index: 1;
  top: 72px;
  left: clamp(122px, 19vw, 176px);
  background:
    radial-gradient(circle at 78% 22%, rgba(0, 113, 227, 0.18), transparent 24%),
    #e9edf1;
  animation-delay: 520ms;
}

.paper-three {
  z-index: 1;
  top: 92px;
  left: clamp(150px, 22vw, 214px);
  background:
    radial-gradient(circle at 28% 30%, rgba(164, 69, 95, 0.18), transparent 28%),
    #f4edf2;
  animation-delay: 760ms;
}

.paper-four {
  z-index: 1;
  top: 112px;
  left: clamp(178px, 25vw, 252px);
  background:
    radial-gradient(circle at 70% 42%, rgba(15, 123, 92, 0.18), transparent 28%),
    #eaf2ed;
  animation-delay: 1000ms;
}

.folder-cover {
  z-index: 2;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 26px;
  color: #202124;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #efe7c7, #d6c9a2);
  transform-origin: left center;
  animation: folderCoverOpen 1100ms cubic-bezier(.2, .8, .2, 1) 380ms both;
}

.folder-cover span {
  color: #6f6544;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.folder-cover strong {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  white-space: nowrap;
}

@keyframes folderSpineIn {
  from {
    transform: translateX(-32px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes folderPaperSlide {
  from {
    transform: translateX(-48px) scaleX(0.96);
    opacity: 0;
  }
  to {
    transform: translateX(0) scaleX(1);
    opacity: 1;
  }
}

@keyframes folderCoverOpen {
  from {
    transform: perspective(900px) rotateY(0deg) translateX(-18px);
    opacity: 0.98;
  }
  to {
    transform: perspective(900px) rotateY(-19deg) translateX(-54px);
    opacity: 0.92;
  }
}

.speech-folder-list {
  display: grid;
  gap: 10px;
}

.speech-folder-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px 12px;
  align-items: center;
  border: none;
  border-radius: 0;
  background: #fff;
  color: #1d1d1f;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.speech-folder-button span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f1f2f5;
  color: #676a70;
  font-size: 13px;
  font-weight: 900;
}

.speech-folder-button strong {
  font-size: 16px;
  line-height: 1.2;
}

.speech-folder-button small {
  color: #777a80;
  font-size: 12px;
  font-weight: 800;
}

.speech-folder-button.active {
  background: #151516;
  color: #fff;
}

.speech-folder-button.active span {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.speech-folder-button.active small {
  color: rgba(255, 255, 255, 0.64);
}

.speech-search input {
  min-height: 42px;
}

.folder-open-board {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 0 8px;
}

.open-folder-cover,
.open-folder-copy {
  background: #fbfbfd;
}

.open-folder-cover {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  color: #1d1d1f;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(145deg, #efe6c8 0%, #fbfbfd 82%);
}

.open-folder-cover span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #151516;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.open-folder-cover strong {
  align-self: end;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
}

.open-folder-copy {
  display: grid;
  align-content: center;
  padding: clamp(20px, 3vw, 30px);
}

.open-folder-copy h2 {
  margin-bottom: 8px;
  color: #1d1d1f;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.06;
}

.open-folder-copy p:last-child {
  margin: 0;
  color: #55585e;
  font-size: 15px;
  line-height: 1.55;
}

.speech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.speech-file-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #fbfbfd;
  box-shadow: none;
}

.speech-file-card.saved {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.24);
}

.speech-file-open {
  width: 100%;
  display: grid;
  gap: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.speech-file-tab {
  width: fit-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  margin: 18px 18px 0;
  border-radius: 14px 14px 0 0;
  background: #ece3c4;
  color: #423a22;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 900;
}

.speech-file-sheet {
  position: relative;
  min-height: 380px;
  display: grid;
  align-content: start;
  gap: 14px;
  margin: 0 18px 18px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.055) 0 1px, transparent 1px) 0 0 / 34px 34px,
    #fff;
  color: #1d1d1f;
}

.speech-file-sheet::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  border-top: 34px solid #dfe3e8;
  border-left: 34px solid transparent;
}

.speech-file-sheet h3 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.04;
}

.speech-file-sheet > p {
  margin: 0;
  color: #33363b;
  font-size: 16px;
  line-height: 1.55;
}

.speech-file-facts {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
}

.speech-file-facts div {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.speech-file-facts dt {
  margin-bottom: 4px;
  color: #777a80;
  font-size: 12px;
  font-weight: 900;
}

.speech-file-facts dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #2d3035;
  font-size: 14px;
  line-height: 1.45;
}

.speech-file-facts dd span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #f1f2f5;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.speech-card-actions {
  justify-content: center;
  padding: 0 18px 20px;
}

.selected-speech {
  align-items: center;
}

.selected-speech-actions {
  display: flex;
  gap: 8px;
}

.selected-speech-actions button {
  padding: 0;
}

.speech-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.speech-modal.open {
  display: flex;
}

.speech-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.speech-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: minmax(280px, 0.64fr) minmax(360px, 1fr);
  overflow: auto;
  border-radius: 18px;
  background: #fbfbfd;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.34);
}

.speech-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1d1d1f;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.speech-modal-folder {
  min-height: 620px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(26px, 4vw, 44px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, #efe6c8 0%, #d9cda9 100%);
  color: #1d1d1f;
}

.speech-modal-folder > span {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #151516;
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.speech-modal-folder > strong {
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.02;
}

.speech-modal-folder > p {
  margin: 0;
  color: #4f4a38;
  font-size: 17px;
  line-height: 1.6;
}

.speech-modal-facts div {
  border-color: rgba(0, 0, 0, 0.12);
}

.speech-modal-copy {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(24px, 4vw, 42px);
}

.speech-text {
  display: grid;
  gap: 14px;
  padding-right: 8px;
}

.speech-text p {
  margin: 0;
  color: #25282d;
  font-size: 17px;
  line-height: 1.86;
}

.speech-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 16px 0 0;
  background: linear-gradient(180deg, rgba(251, 251, 253, 0), #fbfbfd 28%);
}

.speech-empty {
  background: #fbfbfd;
}

@media (prefers-reduced-motion: reduce) {
  .folder-spine,
  .folder-paper,
  .folder-cover {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .speech-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .apple-style .speech-hero-visual {
    width: min(560px, 100%);
    min-width: 0;
    height: 560px;
    align-self: auto;
  }

  .folder-stage {
    min-height: 560px;
  }

  .folder-open-board,
  .speech-modal-panel {
    grid-template-columns: 1fr;
  }

  .speech-modal-folder {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .speeches-page .game-command h1 {
    font-size: 44px;
  }

  .apple-style .speech-hero-visual {
    height: 520px;
    margin-top: 10px;
  }

  .folder-stage {
    min-height: 520px;
  }

  .folder-spine {
    left: 28px;
    width: 68px;
  }

  .folder-spine span {
    font-size: 18px;
  }

  .folder-paper,
  .folder-cover {
    left: 92px;
    width: 72%;
  }

  .paper-two {
    left: 116px;
  }

  .paper-three {
    left: 140px;
  }

  .paper-four {
    left: 164px;
  }

  .folder-open-board {
    padding: 0 12px;
  }

  .speech-file-sheet {
    min-height: auto;
  }

  .speech-modal {
    padding: 10px;
  }

  .speech-modal-panel {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .speech-modal-copy {
    padding-bottom: 28px;
  }

  .speech-modal-actions .primary-link,
  .speech-modal-actions .secondary-link {
    width: 100%;
    min-height: 42px;
  }
}

.flow-page .flow-command {
  background:
    radial-gradient(circle at 72% 36%, rgba(255, 255, 255, 0.12), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.2), transparent 30%),
    linear-gradient(135deg, #070708 0%, #17181a 46%, #2d3034 100%);
}

.flow-page .game-command h1 {
  max-width: 840px;
  font-size: clamp(52px, 6.4vw, 92px);
}

.apple-style .flow-hero-visual {
  grid-area: portrait;
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: min(42vw, 520px);
  min-width: 320px;
  max-height: 780px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111214;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.52);
}

.flow-hero-visual figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  color: #fff;
}

.flow-hero-visual figcaption span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-hero-visual figcaption strong {
  display: block;
  max-width: 310px;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.15;
}

.flow-stage {
  position: absolute;
  inset: 0;
  min-height: 640px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #101113 0%, #1b1c1f 56%, #101113 100%);
}

.flow-orbit {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.flow-orbit::before,
.flow-orbit::after {
  content: "";
  position: absolute;
  inset: 54px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: inherit;
}

.flow-orbit::after {
  inset: 108px;
}

.flow-piece,
.flow-center-card {
  position: absolute;
  display: grid;
  gap: 6px;
  border-radius: 28px;
  background: rgba(251, 251, 253, 0.92);
  color: #1d1d1f;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.flow-piece {
  width: 190px;
  min-height: 118px;
  padding: 18px;
  animation: flowPieceIn 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.flow-piece span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #151516;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.flow-piece strong {
  font-size: 24px;
  line-height: 1.05;
}

.flow-piece small {
  color: #676a70;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.piece-warmup {
  left: 42px;
  top: 76px;
  animation-delay: 120ms;
}

.piece-entry {
  right: 34px;
  top: 116px;
  animation-delay: 240ms;
}

.piece-vow {
  left: 56px;
  top: 292px;
  animation-delay: 360ms;
}

.piece-family {
  right: 42px;
  top: 350px;
  animation-delay: 480ms;
}

.piece-party {
  left: 128px;
  bottom: 86px;
  animation-delay: 600ms;
}

.flow-center-card {
  left: 50%;
  top: 48%;
  width: 230px;
  min-height: 150px;
  align-content: end;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #0071e3 0%, #151516 78%);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.flow-center-card span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-center-card strong {
  font-size: 26px;
  line-height: 1.12;
}

@keyframes flowPieceIn {
  from {
    transform: translateY(18px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.flow-progress-bar {
  width: 72%;
}

.flow-stage-list {
  display: grid;
  gap: 10px;
}

.flow-stage-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 12px;
  align-items: center;
  border: none;
  background: #fff;
  color: #1d1d1f;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.flow-stage-button span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f1f2f5;
  color: #676a70;
  font-size: 13px;
  font-weight: 900;
}

.flow-stage-button strong {
  font-size: 16px;
  line-height: 1.2;
}

.flow-stage-button small {
  color: #777a80;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.flow-stage-button.active {
  background: #151516;
  color: #fff;
}

.flow-stage-button.active span {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.flow-stage-button.active small {
  color: rgba(255, 255, 255, 0.64);
}

.flow-principle-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
  padding: 24px;
  background:
    radial-gradient(circle at 84% 18%, rgba(0, 113, 227, 0.12), transparent 26%),
    #fbfbfd;
}

.flow-principle-board h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.05;
}

.flow-principle-board p {
  margin: 0;
  color: #55585e;
  font-size: 16px;
  line-height: 1.65;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fbfbfd;
  color: #1d1d1f;
  box-shadow: none;
}

.flow-card.selected {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.24);
}

.flow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.flow-card-head span,
.flow-card-head small {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.flow-card-head span {
  background: #eef7ff;
  color: #0071e3;
}

.flow-card-head small {
  background: #f1f2f5;
  color: #55585e;
}

.flow-card h3 {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 44px);
  line-height: 1.04;
}

.flow-meaning {
  margin: 0;
  color: #25282d;
  font-size: 17px;
  line-height: 1.58;
}

.flow-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.flow-facts div {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.flow-facts dt {
  margin-bottom: 5px;
  color: #777a80;
  font-size: 12px;
  font-weight: 900;
}

.flow-facts dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #2d3035;
  font-size: 14px;
  line-height: 1.5;
}

.flow-facts dd span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  background: #f1f2f5;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.selected-flow {
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .flow-piece {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .flow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .apple-style .flow-hero-visual {
    width: min(560px, 100%);
    min-width: 0;
    height: 560px;
    align-self: auto;
  }

  .flow-stage {
    min-height: 560px;
  }

  .flow-principle-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .flow-page .game-command h1 {
    font-size: 44px;
  }

  .apple-style .flow-hero-visual {
    height: 520px;
    margin-top: 10px;
  }

  .flow-stage {
    min-height: 520px;
  }

  .flow-orbit {
    width: 280px;
    height: 280px;
  }

  .flow-piece {
    width: 148px;
    min-height: 104px;
    padding: 14px;
    border-radius: 22px;
  }

  .flow-piece strong {
    font-size: 20px;
  }

  .flow-piece small {
    font-size: 12px;
  }

  .piece-warmup {
    left: 20px;
    top: 54px;
  }

  .piece-entry {
    right: 18px;
    top: 98px;
  }

  .piece-vow {
    left: 24px;
    top: 254px;
  }

  .piece-family {
    right: 18px;
    top: 306px;
  }

  .piece-party {
    left: 96px;
    bottom: 72px;
  }

  .flow-center-card {
    width: 184px;
    min-height: 132px;
    padding: 18px;
  }

  .flow-center-card strong {
    font-size: 22px;
  }

  .flow-principle-board {
    margin: 0 12px 14px;
  }

  .flow-card {
    padding: 22px 20px;
  }
}

.home-page .home-command {
  background:
    radial-gradient(circle at 74% 36%, rgba(255, 255, 255, 0.12), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(0, 113, 227, 0.22), transparent 30%),
    linear-gradient(135deg, #070708 0%, #17181a 44%, #2e3034 100%);
}

.home-page .game-command h1 {
  max-width: 820px;
  font-size: clamp(56px, 7vw, 102px);
}

.apple-style .home-space-visual {
  grid-area: portrait;
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: min(42vw, 520px);
  min-width: 320px;
  max-height: 780px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #111214;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.52);
}

.home-space-visual figcaption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  color: #fff;
}

.home-space-visual figcaption span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-space-visual figcaption strong {
  display: block;
  max-width: 310px;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.15;
}

.home-module-board {
  position: absolute;
  inset: 0;
  min-height: 640px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #101113 0%, #1d1e21 55%, #101113 100%);
}

.home-module-board::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.76));
  pointer-events: none;
}

.home-module-tile,
.home-center-badge {
  position: absolute;
  display: grid;
  gap: 7px;
  border-radius: 28px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.home-module-tile {
  width: 202px;
  min-height: 136px;
  padding: 18px;
  background: rgba(251, 251, 253, 0.92);
  color: #1d1d1f;
  transition: transform 180ms ease;
}

.home-module-tile:hover {
  transform: translateY(-3px);
}

.home-module-tile span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #151516;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.home-module-tile strong {
  font-size: 24px;
  line-height: 1.08;
}

.home-module-tile small {
  color: #676a70;
  font-size: 13px;
  font-weight: 800;
}

.tile-game {
  left: 42px;
  top: 70px;
}

.tile-gift {
  right: 34px;
  top: 130px;
}

.tile-speech {
  left: 54px;
  top: 318px;
}

.tile-flow {
  right: 42px;
  bottom: 110px;
}

.home-center-badge {
  left: 50%;
  top: 49%;
  z-index: 3;
  width: 246px;
  min-height: 160px;
  align-content: end;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, #0071e3 0%, #151516 78%);
  transform: translate(-50%, -50%);
}

.home-center-badge span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-center-badge strong {
  font-size: 26px;
  line-height: 1.12;
}

.home-progress-bar {
  width: 100%;
}

.home-module-section {
  max-width: 1600px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px auto 0;
  padding: 0 12px;
}

.home-feature-card {
  min-height: 360px;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 28px;
  background: #fbfbfd;
  color: #1d1d1f;
}

.home-feature-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-feature-card h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.home-feature-card p {
  margin: 0;
  color: #55585e;
  font-size: 16px;
  line-height: 1.6;
}

.home-feature-card .primary-link {
  width: fit-content;
}

@media (max-width: 1180px) {
  .home-module-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .apple-style .home-space-visual {
    width: min(560px, 100%);
    min-width: 0;
    height: 560px;
    align-self: auto;
  }

  .home-module-board {
    min-height: 560px;
  }
}

@media (max-width: 680px) {
  .home-page .game-command h1 {
    font-size: 48px;
  }

  .apple-style .home-space-visual {
    height: 520px;
    margin-top: 10px;
  }

  .home-module-board {
    min-height: 520px;
  }

  .home-module-tile {
    width: 156px;
    min-height: 116px;
    padding: 14px;
    border-radius: 22px;
  }

  .home-module-tile strong {
    font-size: 20px;
  }

  .tile-game {
    left: 18px;
    top: 54px;
  }

  .tile-gift {
    right: 18px;
    top: 112px;
  }

  .tile-speech {
    left: 20px;
    top: 268px;
  }

  .tile-flow {
    right: 18px;
    bottom: 94px;
  }

  .home-center-badge {
    width: 202px;
    min-height: 140px;
    padding: 18px;
  }

  .home-center-badge strong {
    font-size: 22px;
  }

  .home-module-section {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .home-feature-card {
    min-height: 260px;
  }
}
