:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --surface: #fffdf7;
  --ink: #252d23;
  --secondary: #545d4d;
  --green: #34583f;
  --line: #e2e0d4;
  --body: "Segoe UI", system-ui, sans-serif;
  --display: Georgia, "Times New Roman", serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid #a16326; outline-offset: 5px; }
.container { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand, .site-nav { display: flex; align-items: center; }
.brand {
  gap: 11px;
  font-size: 1.25rem;
  letter-spacing: -.045em;
  font-weight: 750;
  text-decoration: none;
}
.brand img { border-radius: 10px; }
.site-nav { gap: clamp(15px, 4vw, 36px); color: var(--secondary); }
.site-nav a { font-size: .93rem; font-weight: 600; text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--green); text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(30px, 5.5vw, 76px);
  align-items: center;
  padding-block: clamp(36px, 5vw, 68px) 52px;
}

.game-category {
  margin: 0 0 20px;
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .17em;
}

h1, h2 { font-family: var(--display); font-weight: 500; }
h1 {
  margin: 0;
  font-size: clamp(3.55rem, 6.55vw, 6.45rem);
  line-height: .88;
  letter-spacing: -.08em;
}
h1 span {
  display: block;
  margin-top: .27em;
  color: var(--green);
  font-size: .68em;
  font-style: italic;
  letter-spacing: -.06em;
}

.hero-description {
  margin: 25px 0 30px;
  max-width: 31ch;
  font-size: clamp(1rem, 1.65vw, 1.17rem);
  line-height: 1.65;
  color: var(--secondary);
}

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.hero-note { font-size: .86rem; color: var(--secondary); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 23px;
  border: 1px solid #284531;
  border-radius: 9px;
  background: var(--green);
  color: #fffdf7;
  font: 700 .96rem var(--body);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #284632; }
.play-symbol {
  width: 0;
  height: 0;
  border-block: 6px solid transparent;
  border-inline-start: 9px solid currentColor;
}

.hero-art {
  display: grid;
  position: relative;
  place-items: center end;
  min-width: 0;
  min-height: clamp(325px, 38vw, 458px);
  padding: 18px 11% 18px 18px;
  isolation: isolate;
}

.hero-room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid #c7bca8;
  border-radius: 22px;
  object-fit: cover;
  object-position: center 59%;
  z-index: -2;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(120deg, #f8e9d015, #40271a50);
  z-index: -1;
}
.game-card {
  width: clamp(165px, 18vw, 223px);
  border: 6px solid #fffbeb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 42px #40281b58, 0 0 0 1px #60483565;
  background: #fffbeb;
  transform: rotate(3deg);
}
.game-card img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }

.section { padding-block: 28px 44px; border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 25px;
  flex-wrap: wrap;
  margin-bottom: 23px;
}
.section-heading span { color: var(--secondary); font-size: .89rem; }
h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.045em; }
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.room {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.room img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 48%; }
.room figcaption { padding: 13px 14px; font-weight: 650; font-size: .94rem; }
.instructions ol { margin: 19px 0 20px; padding-left: 24px; line-height: 1.6; color: var(--secondary); }
.instructions li { padding-left: 4px; margin: 8px 0; }
.instructions strong { color: var(--ink); }
.text-link { color: var(--green); font-weight: 700; text-underline-offset: 4px; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
  padding-block: 23px;
  color: var(--secondary);
  font-size: .85rem;
}

.policy {
  padding-block: clamp(35px, 7vw, 74px);
}
.policy article { max-width: 65ch; }
.policy h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; }
.policy h2 { margin-top: 29px; font-size: 1.65rem; }
.policy p { color: var(--secondary); line-height: 1.65; overflow-wrap: anywhere; }
.policy a { color: var(--green); text-underline-offset: 4px; }

.play-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #e8efdf;
}
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(0px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.play-header a { display: inline-flex; align-items: center; gap: 9px; min-height: 50px; }
.back-link { text-decoration: none; font-weight: 750; color: var(--green); }
.back-link:hover { text-decoration: underline; }
.play-label { color: var(--secondary); font-size: .84rem; }
.play-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px;
  position: relative;
}
.game-window {
  position: relative;
  width: auto;
  height: min(100%, 900px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 34px #3047382b, 0 0 0 1px #30473824;
}
.game-window iframe {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  background: #f8f6ef url("media/living-space.webp") center / cover no-repeat;
  color: var(--green);
  text-align: center;
  font-weight: 650;
}
.spinner {
  width: 29px;
  height: 29px;
  border: 2px solid #c3cbbc;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.game-noscript { position: absolute; z-index: 1; top: 25%; color: var(--green); }
@media (max-width: 760px) {
  .container { width: calc(100% - 40px); }
  .header-inner { min-height: 62px; gap: 13px; }
  .brand { font-size: 1.03rem; gap: 7px; }
  .brand img { width: 32px; height: 32px; }
  .site-nav a { font-size: .82rem; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 33px; }
  h1 { font-size: clamp(3.75rem, 12.5vw, 5rem); }
  .hero-description { margin-block: 21px 20px; }
  .hero-art { min-height: 320px; }
  .room-grid { gap: 10px; }
  .room figcaption { padding: 9px; font-size: .8rem; }
  .section { padding-block: 25px 36px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .play-header { padding-inline: max(13px, env(safe-area-inset-left)) max(13px, env(safe-area-inset-right)); }
  .play-header a { min-height: 36px; font-size: .86rem; }
  .play-label { font-size: .77rem; }
  .play-stage { padding: 0 max(0px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0px, env(safe-area-inset-left)); }
  .game-window { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
