:root {
  --bg: #12110f;
  --pine: #1c2e1a;
  --amber: #d97706;
  --wool: #d6cbb8;
  --soot: #0c0b0a;
  --text: #efe6d4;
  --muted: #b7aa90;
  --bark: #2a2218;
  --ember: rgba(217, 119, 6, 0.42);
  --header-h: 72px;
  --radius: 12px;
  --font-head: "Literata", "Georgia", serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --wood:
    repeating-linear-gradient(
      90deg,
      rgba(80, 52, 28, 0.22) 0 2px,
      rgba(42, 34, 24, 0.05) 2px 5px,
      rgba(120, 78, 36, 0.12) 5px 6px,
      transparent 6px 11px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(12, 11, 10, 0.18) 0 1px,
      transparent 1px 14px
    ),
    linear-gradient(180deg, #3a2c1e, #221910);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(720px 380px at 50% 8%, rgba(217, 119, 6, 0.16), transparent 58%),
    radial-gradient(640px 420px at 50% 100%, rgba(28, 46, 26, 0.55), transparent 62%),
    var(--bg);
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  color: var(--wool);
}

h1,
h2,
h3,
.wordmark {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  margin: 0 0 0.7rem;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  margin: 0 0 0.5rem;
}

h3 {
  font-size: 1.18rem;
  margin: 0 0 0.35rem;
}

p {
  margin: 0 0 0.85rem;
}

.muted {
  color: var(--muted);
}

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 120;
  background: var(--amber);
  color: var(--soot);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
}

/* Wool header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background-color: #1a1712;
  background-image:
    repeating-linear-gradient(90deg, rgba(214, 203, 184, 0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(214, 203, 184, 0.05) 0 1px, transparent 1px 4px);
  border-bottom: 1px solid rgba(214, 203, 184, 0.2);
}

.header-row {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  flex-shrink: 0;
}

.brand img {
  width: 44px;
  height: 44px;
}

.wordmark {
  font-size: 1.22rem;
  color: var(--wool);
}

#nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid rgba(214, 203, 184, 0.22);
  background: var(--soot);
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

#nav-toggle span {
  display: block;
  height: 2px;
  background: var(--wool);
  border-radius: 2px;
}

#nav-toggle.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

#nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#site-nav {
  margin-left: 1.2rem;
  display: flex;
  gap: 0.15rem;
}

#site-nav a {
  color: var(--muted);
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

#site-nav a:hover,
#site-nav a[aria-current="page"] {
  color: var(--wool);
  background: rgba(28, 46, 26, 0.7);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#guest-actions,
#player-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#player-actions[hidden],
#guest-actions[hidden] {
  display: none;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  border-radius: var(--radius);
  background: var(--pine);
  color: var(--wool);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  padding: 0.7rem 1.15rem;
  color: var(--soot);
  background: var(--amber);
  box-shadow: 0 0 18px var(--ember), 0 0 36px rgba(217, 119, 6, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  color: var(--soot);
  box-shadow: 0 0 26px rgba(217, 119, 6, 0.62), 0 0 48px rgba(217, 119, 6, 0.28);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--wool);
  border: 1px solid rgba(214, 203, 184, 0.32);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--amber);
  box-shadow: 0 0 16px var(--ember);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.8rem;
  justify-content: center;
}

.kicker span {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
  background: rgba(28, 46, 26, 0.55);
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 38rem;
  margin-inline: auto;
}

/* Fireplace-centered hero */
.hero {
  padding: 3.4rem 0 2.4rem;
  text-align: center;
}

.hearth-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-copy {
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.fireplace {
  width: min(760px, 100%);
  margin-top: 2.1rem;
  filter: drop-shadow(0 18px 40px rgba(12, 11, 10, 0.55));
}

.mantel {
  height: 16px;
  background: linear-gradient(180deg, #4a3a28, var(--pine));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 10px 28px var(--ember);
}

.opening {
  position: relative;
  border: 12px solid var(--pine);
  border-top: 0;
  background: var(--soot);
  overflow: hidden;
}

.opening img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.ember-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 70px rgba(217, 119, 6, 0.28),
    inset 0 -30px 40px rgba(12, 11, 10, 0.55);
  animation: ember-pulse 4.5s ease-in-out infinite;
}

.hearth-stone {
  height: 26px;
  background:
    repeating-linear-gradient(
      90deg,
      #2c2418 0 52px,
      #1a1610 52px 55px,
      #3a2c1e 55px 108px
    );
  border-radius: 0 0 8px 8px;
}

.ember-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  width: min(760px, 100%);
  margin-top: 1.2rem;
}

.ember-stat {
  border-radius: var(--radius);
  padding: 0.9rem 0.85rem;
  background: var(--soot);
  border: 1px solid rgba(217, 119, 6, 0.28);
}

.ember-stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--amber);
}

.ember-stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section {
  padding: 4rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 1.8rem;
  max-width: 38rem;
  margin-inline: auto;
}

.section-head .kicker {
  justify-content: center;
}

/* Stacked-log game cards */
.woodpile {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 720px;
  margin: 0 auto;
}

.log-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 1rem;
  align-items: center;
  border-radius: var(--radius);
  padding: 14px;
  background: var(--wood);
  border: 1px solid rgba(214, 203, 184, 0.16);
  box-shadow: 0 10px 22px rgba(12, 11, 10, 0.4);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.log-card:nth-child(1) {
  transform: rotate(-0.7deg);
}

.log-card:nth-child(2) {
  margin-left: 7%;
  transform: rotate(0.85deg);
}

.log-card:nth-child(3) {
  margin-right: 8%;
  transform: rotate(-0.45deg);
}

.log-card img {
  width: 100%;
  height: 124px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(12, 11, 10, 0.4);
}

.log-body {
  background: rgba(214, 203, 184, 0.1);
  border-radius: 8px;
  padding: 0.75rem 0.9rem 0.9rem;
}

.log-body p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.7rem;
}

.log-card:hover {
  border-color: var(--amber);
  box-shadow: 0 0 28px var(--ember), 0 12px 28px rgba(12, 11, 10, 0.5);
  z-index: 1;
}

.log-card:nth-child(1):hover,
.log-card:nth-child(2):hover,
.log-card:nth-child(3):hover {
  transform: translateY(-4px);
}

/* Feature */
.feature-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.2rem;
  align-items: center;
}

.birch-frame {
  position: relative;
  border-radius: var(--radius);
  padding: 10px;
  background: var(--wood);
}

.birch-frame img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(12, 11, 10, 0.45);
}

.check-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.check-list li {
  display: flex;
  gap: 0.65rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.ember-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--ember);
}

/* Kindling rows */
.kindling {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 820px;
  margin: 0 auto;
}

.kindle-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.15rem;
  border-radius: 6px 48px 10px 4px;
  background: var(--wood);
  border: 1px solid rgba(214, 203, 184, 0.14);
}

.kindle-row:nth-child(2) {
  margin-left: 1.4rem;
  width: calc(100% - 1.4rem);
}

.kindle-row:nth-child(3) {
  margin-left: 0.55rem;
  width: calc(100% - 2.2rem);
}

.kindle-n {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--amber);
}

.kindle-row h3 {
  margin-bottom: 0.15rem;
}

.kindle-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Four hearth tiles */
.hearth-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 840px;
  margin: 0 auto;
}

.hearth-tile {
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem;
  min-height: 168px;
  background: var(--pine);
  border: 1px solid rgba(214, 203, 184, 0.18);
  box-shadow: inset 0 0 0 1px rgba(12, 11, 10, 0.25);
}

.hearth-tile:nth-child(1) {
  border-radius: 12px 8px 4px 10px;
}

.hearth-tile:nth-child(2) {
  border-radius: 8px 12px 10px 4px;
}

.hearth-tile:nth-child(3) {
  border-radius: 10px 4px 12px 8px;
}

.hearth-tile:nth-child(4) {
  border-radius: 4px 10px 8px 12px;
}

.hearth-tile p {
  margin: 0;
  color: var(--wool);
  opacity: 0.88;
}

/* CTA */
.cta-band {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1.3rem;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 11, 10, 0.72), rgba(18, 17, 15, 0.55) 45%, rgba(12, 11, 10, 0.82)),
    var(--cta) center/cover no-repeat;
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.cta-inner h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
}

/* Footer */
.site-footer {
  padding: 2.8rem 0 2rem;
  border-top: 1px solid rgba(214, 203, 184, 0.16);
  background: var(--soot);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr auto;
  gap: 1.5rem;
  align-items: start;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.footer-legal a {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-legal a:hover {
  color: var(--wool);
}

.badge-18 {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: var(--font-head);
  font-weight: 700;
}

.footer-note {
  margin-top: 1.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Inner pages */
.page-hero {
  padding: 3.2rem 0 1.2rem;
  text-align: center;
}

.page-hero .lead {
  margin-inline: auto;
}

.legal-stack {
  display: grid;
  gap: 0.85rem;
  padding-bottom: 4rem;
}

.legal-card {
  border-radius: var(--radius);
  padding: 1.45rem 1.5rem 1.2rem;
  background: var(--wood);
  border: 1px solid rgba(214, 203, 184, 0.14);
}

.legal-card h2 {
  font-size: 1.22rem;
}

.legal-card ul {
  color: var(--muted);
  padding-left: 1.15rem;
}

/* Contact */
.form-card {
  border-radius: var(--radius);
  padding: 1.45rem;
  background: var(--wood);
  border: 1px solid rgba(214, 203, 184, 0.16);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.9rem;
  color: var(--wool);
}

input,
textarea {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(214, 203, 184, 0.22);
  background: var(--soot);
  color: var(--text);
  font: inherit;
  padding: 0.72rem 0.85rem;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-thanks {
  display: none;
  margin: 0;
  color: var(--wool);
}

.form-card.is-sent form {
  display: none;
}

.form-card.is-sent .form-thanks {
  display: block;
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1rem;
  padding-bottom: 4rem;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 11, 10, 0.78);
}

.overlay.is-open {
  display: flex;
}

.overlay-card {
  width: min(440px, 100%);
  border-radius: var(--radius);
  padding: 1.45rem 1.4rem 1.3rem;
  position: relative;
  background: var(--wood);
  border: 1px solid rgba(217, 119, 6, 0.35);
  box-shadow: 0 0 40px var(--ember);
}

.overlay-card h2 {
  margin-bottom: 0.4rem;
}

#auth-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid rgba(214, 203, 184, 0.25);
  background: var(--soot);
  color: var(--wool);
  cursor: pointer;
  font-size: 1.2rem;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--soot);
  border: 1px solid rgba(214, 203, 184, 0.18);
  margin: 1rem 0 1.05rem;
}

.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 0.52rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.auth-tab.is-on {
  color: var(--soot);
  background: var(--amber);
  box-shadow: 0 0 14px var(--ember);
}

.auth-error {
  min-height: 1.2em;
  color: #e8a070;
  font-size: 0.88rem;
  margin: 0.2rem 0 0.55rem;
}

.auth-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#age-denied {
  color: #e8a070;
  margin-top: 0.8rem;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

#cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  display: none;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  align-items: center;
  gap: 1rem;
  background: #1a1712;
  background-image:
    repeating-linear-gradient(90deg, rgba(214, 203, 184, 0.07) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(214, 203, 184, 0.22);
}

#cookie-banner.is-open {
  display: flex;
}

#cookie-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes ember-pulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .feature-split,
  .footer-grid,
  .contact-grid,
  .ember-stats {
    grid-template-columns: 1fr;
  }

  #nav-toggle {
    display: flex;
  }

  #site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    background: #1a1712;
    border-bottom: 1px solid rgba(214, 203, 184, 0.2);
    flex-direction: column;
  }

  #site-nav.is-open {
    display: flex;
  }

  .site-header {
    position: sticky;
  }

  .header-row {
    position: relative;
  }

  .header-actions .btn {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
  }

  .log-card,
  .log-card:nth-child(1),
  .log-card:nth-child(2),
  .log-card:nth-child(3) {
    margin: 0;
    transform: none;
    grid-template-columns: 120px 1fr;
  }

  .kindle-row:nth-child(2),
  .kindle-row:nth-child(3) {
    margin-left: 0;
    width: 100%;
  }

  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .hearth-tiles {
    grid-template-columns: 1fr;
  }

  .log-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .log-card img {
    height: 160px;
  }

  .kindle-row {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .wordmark {
    font-size: 1.05rem;
  }

  .opening {
    border-width: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
