:root {
  --bg-paper: #f3eadc;
  --paper-card: #fffaf1;
  --paper-warm: #faf1e2;
  --paper-sage: #eaf2e7;
  --wood-border: rgba(139, 98, 66, 0.25);
  --wood-shadow: rgba(139, 98, 66, 0.17);
  --terracotta: #c86443;
  --terracotta-edge: #963f24;
  --sage: #5e8067;
  --sage-edge: #3a5642;
  --ink: #3c2b1e;
  --ink-muted: #725a48;
  --radius-card: 2px 3px 15px 2px;
  --radius-tag: 2px 3px 8px 2px;
  --book-shadow:
    inset 5px 0 0 rgba(160, 120, 82, 0.14),
    0 2px 0 #fffaf1,
    0 3px 0 rgba(139, 98, 66, 0.22),
    0 6px 0 #f2e7d6,
    0 7px 0 rgba(139, 98, 66, 0.18),
    0 12px 22px rgba(74, 48, 28, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.56;
  background-color: var(--bg-paper);
  background-image: url("/arena/sprites/ui_paper_bg.webp");
  background-size: 384px 384px;
  background-repeat: repeat;
}

h1, h2, h3, .brand, .ribbon-heading, .btn {
  font-family: "Fredoka", "Nunito", -apple-system, sans-serif;
}

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Single-line compact origami header (50px, never wraps on 390px mobile) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 50px;
  background-color: rgba(251, 245, 236, 0.96);
  background-image: url("/arena/sprites/ui_paper_bg.webp");
  background-size: 256px 256px;
  border-bottom: 1.5px solid var(--wood-border);
  box-shadow: 0 2px 0 rgba(139, 98, 66, 0.12);
}
.header-inner {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-avatar {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 2px 3px rgba(74, 48, 28, 0.2));
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.nav-desktop { display: inline-flex; }
.nav-mobile { display: none; }

/* Real handmade origami paper-craft buttons (WebP assets with optical safe padding) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 22px 14px 16px;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  border: none;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.03); }
.btn:active { transform: translateY(1.5px) scale(0.985); }

.btn-block { width: 100%; }
.btn-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-primary {
  background: transparent url("/arena/sprites/ui_btn_terracotta.webp") center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  color: #fffaf3;
  text-shadow: 0 1px 1px rgba(105, 38, 18, 0.35);
  filter: drop-shadow(0 3px 3px rgba(96, 46, 26, 0.22));
}
.btn-primary:hover {
  color: #fffaf3;
  filter: drop-shadow(0 3px 4px rgba(96, 46, 26, 0.28)) brightness(1.04);
}

.btn-paper {
  background: transparent url("/arena/sprites/ui_btn_cream.webp") center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  color: #4b3322;
  filter: drop-shadow(0 2px 2px rgba(96, 62, 36, 0.16));
}
.btn-paper:hover {
  color: #3c2b1e;
  filter: drop-shadow(0 3px 3px rgba(96, 62, 36, 0.22)) brightness(1.02);
}

.btn-sage {
  background: transparent url("/arena/sprites/ui_btn_sage.webp") center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  color: #2f5234;
  filter: drop-shadow(0 2px 2px rgba(56, 86, 60, 0.18));
}
.btn-sage:hover {
  color: #244028;
  filter: drop-shadow(0 3px 3px rgba(56, 86, 60, 0.24)) brightness(1.03);
}

.btn-sm {
  padding: 6px 16px 9px 12px;
  font-size: 13px;
  line-height: 1.15;
}

/* Origami Ribbon Banner Headings (safe 58% center zone, clear of 21% swallowtail folds) */
.ribbon-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(360px, 100%);
  min-height: 58px;
  margin: 0 auto 16px;
  padding: 11px 23% 14px;
  background-image: url("/arena/sprites/ui_ribbon_banner.webp");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  color: #fffdf9;
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 1px 2px rgba(92, 32, 14, 0.45);
  filter: drop-shadow(0 4px 6px rgba(74, 48, 28, 0.16));
}

/* First-screen instant-play origami stage */
.stage-band {
  padding: 16px 0 10px;
}
.stage-grid {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 22px;
  align-items: start;
}
.arena-shell {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--paper-card);
  border: 1.5px solid var(--wood-border);
  border-radius: var(--radius-card);
  box-shadow: var(--book-shadow);
  overflow: hidden;
}
.arena-frame {
  width: 100%;
  height: min(740px, calc(100svh - 84px));
  min-height: 580px;
  border: 0;
  display: block;
  background: #fbf6ee;
}
.stage-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 100% AIGC 9-slice handmade layered book-page paper card */
.paper-card {
  position: relative;
  background: transparent;
  border: 14px solid transparent;
  border-image: url("/arena/sprites/ui_frame_card_9slice.webp") 56 fill / 22px stretch;
  border-radius: 0;
  padding: 8px 10px 10px 12px;
  box-shadow: none;
  filter: drop-shadow(0 6px 12px rgba(66, 42, 24, 0.12));
  overflow: visible;
}

.paper-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 15px 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent url("/arena/sprites/ui_btn_cream.webp") center / 100% 100% no-repeat;
  color: #5b412e;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: none;
  filter: drop-shadow(0 2px 2px rgba(96, 62, 36, 0.14));
  margin-bottom: 10px;
}
.tag-free {
  display: inline-block;
  padding: 5px 14px 8px 12px;
  border: none;
  border-radius: 0;
  font-size: 0.74rem;
  font-weight: 800;
  background: transparent url("/arena/sprites/ui_btn_sage.webp") center / 100% 100% no-repeat;
  color: #2f5234;
  filter: drop-shadow(0 2px 2px rgba(56, 86, 60, 0.14));
}
.tag-pro {
  display: inline-block;
  padding: 5px 14px 8px 12px;
  border: none;
  border-radius: 0;
  font-size: 0.74rem;
  font-weight: 800;
  background: transparent url("/arena/sprites/ui_btn_terracotta.webp") center / 100% 100% no-repeat;
  color: #fffaf3;
  text-shadow: 0 1px 1px rgba(105, 38, 18, 0.35);
  filter: drop-shadow(0 2px 2px rgba(96, 46, 26, 0.18));
}

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.breadcrumbs a { color: var(--ink-muted); }

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.36rem, 2.5vw, 1.92rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}
h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
}
.lead {
  margin: 0 0 14px;
  color: var(--ink-muted);
  font-size: 0.93rem;
}

.section {
  padding: 18px 0 22px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* Media layouts for generated 3D origami books & pass seal */
.media-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.book-art {
  width: 78px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(74, 48, 28, 0.2));
}
.seal-art {
  width: 76px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(74, 48, 28, 0.18));
}
.sprite-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 6px rgba(74, 48, 28, 0.2));
  flex-shrink: 0;
}

/* 100% AIGC 9-slice Study Term Cards */
.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.term-card {
  position: relative;
  background: transparent;
  border: 10px solid transparent;
  border-image: url("/arena/sprites/ui_frame_card_9slice.webp") 56 fill / 16px stretch;
  border-radius: 0;
  padding: 8px 10px 10px 12px;
  box-shadow: none;
  filter: drop-shadow(0 4px 8px rgba(66, 42, 24, 0.1));
}
.term-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.term-title {
  font-weight: 900;
  font-size: 1rem;
  color: var(--terracotta-edge);
  line-height: 1.3;
}
.term-answer {
  display: inline-block;
  padding: 5px 14px 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent url("/arena/sprites/ui_btn_sage.webp") center / 100% 100% no-repeat;
  color: #2f5234;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  max-width: 62%;
  filter: drop-shadow(0 2px 2px rgba(56, 86, 60, 0.14));
}
.term-hook {
  margin: 0;
  font-size: 0.91rem;
  color: var(--ink);
  line-height: 1.5;
  padding-top: 7px;
  border-top: 1px dashed rgba(139, 98, 66, 0.24);
}

/* Uniform 2-column chapter navigation grid */
.chapter-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.chapter-nav-grid .btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  padding: 8px 20px 13px 14px;
}

/* FAQ accordion cards */
.faq-list {
  display: grid;
  gap: 12px;
}
.faq-item {
  background: transparent;
  border: 10px solid transparent;
  border-image: url("/arena/sprites/ui_frame_card_9slice.webp") 56 fill / 16px stretch;
  border-radius: 0;
  padding: 8px 10px 10px 12px;
  box-shadow: none;
  filter: drop-shadow(0 4px 8px rgba(66, 42, 24, 0.1));
}
.faq-item summary {
  font-weight: 800;
  cursor: pointer;
}
.faq-item p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* Unlock Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(60, 43, 30, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  max-width: 440px;
  width: 100%;
}
.price-big {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--terracotta);
  margin: 4px 0 8px;
}
.check-list {
  margin: 10px 0 16px;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.check-list li { margin-bottom: 5px; }

/* OrigamiCram 5-Promise Strip & Competitor Comparison Board */
.promise-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.promise-chip {
  background: var(--paper-sage);
  border: 1.5px solid rgba(94, 128, 103, 0.34);
  border-radius: var(--radius-tag);
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #2f4b37;
  box-shadow: 0 2px 0 rgba(58, 86, 66, 0.14);
}
.promise-chip small {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.78rem;
}
.vs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.vs-card {
  background: var(--paper-card);
  border: 1.5px solid var(--wood-border);
  border-radius: var(--radius-card);
  padding: 15px 16px;
  box-shadow: var(--book-shadow);
}
.vs-card-ours {
  background: #f4f9f1;
  border-color: rgba(94, 128, 103, 0.52);
}
.vs-name {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vs-badge-bad {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fbe7df;
  color: #9e3d21;
}
.vs-badge-good {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #dff0db;
  color: #2e593a;
}
.vs-pain {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #8c3f27;
  line-height: 1.45;
}
.vs-fix {
  margin: 0;
  font-size: 0.86rem;
  color: #2f543a;
  font-weight: 700;
  line-height: 1.45;
}
.paste-banner {
  background: linear-gradient(180deg, #fffdf8 0%, #f8eedf 100%);
  border: 1.5px dashed rgba(200, 100, 67, 0.45);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.tag-soon {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  background: #efe6d8;
  color: #6b5340;
}

/* Footer */
.site-footer {
  border-top: 1.5px solid var(--wood-border);
  background: rgba(251, 245, 236, 0.88);
  margin-top: 28px;
  padding: 24px 0 34px;
  color: var(--ink-muted);
  font-size: 0.86rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
}
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Mobile 390x844: single-line header + full-bleed first-screen playable origami game */
@media (max-width: 820px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: inline-flex; }
  .stage-band { padding: 0; }
  .stage-band > .wrap { padding: 0; max-width: 100%; }
  .stage-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .arena-shell {
    max-width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: 0 4px 0 var(--wood-shadow);
  }
  .arena-frame {
    height: min(740px, calc(100svh - 52px));
    min-height: 560px;
  }
  .stage-aside {
    padding: 0 14px;
  }
  .paper-card {
    padding: 16px;
  }
  .book-art { width: 72px; }
  .seal-art { width: 68px; }
  .term-grid { grid-template-columns: 1fr; }
  .chapter-nav-grid { grid-template-columns: 1fr 1fr; }
}
