/* self-hosted fonts (no Google Fonts request) */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/Inter-400.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/Inter-500.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/Inter-600.woff2') format('woff2');}
@font-face{font-family:'Sora';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/Sora-600.woff2') format('woff2');}
@font-face{font-family:'Sora';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/Sora-700.woff2') format('woff2');}
@font-face{font-family:'Sora';font-style:normal;font-weight:800;font-display:swap;src:url('fonts/Sora-800.woff2') format('woff2');}

/* UKODUS — styled to match the book (cream page, dark ink, red cross accent) */
:root {
  --cream:   #f7f7f7;
  --ink:     #202020;
  --accent:  #d6322a;
  --accent2: #585858;
  --muted:   #6b6b6b;
  --panel:   #f0f0f0;
  --line:    #d8d8d8;
  --card:    #ffffff;
  --maxw:    1080px;
  --radius:  14px;
  --shadow:  0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.05);
  --gridgray:#8c8c8c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Sora", system-ui, Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 .4em;
}

p { margin: 0 0 1em; }
a { color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.kicker {
  font-family: "Sora", system-ui, sans-serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .9rem;
}
.kicker.accent { color: var(--accent); }

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: "Sora", system-ui, sans-serif;
  font-weight: 700; font-size: .98rem;
  text-decoration: none; cursor: pointer;
  padding: .8em 1.4em; border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink); color: #fff;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,247,247,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav .logo { height: 18px; display: block; }
.nav nav { display: flex; gap: 26px; align-items: center; }
.nav nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
  opacity: .8;
}
.nav nav a:hover { opacity: 1; color: var(--accent); }
.nav .nav-cta { padding: .55em 1.1em; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ---------- sections ---------- */
section { padding: 84px 0; }
/* offset anchor targets so the sticky header doesn't cover the heading */
section[id], [id] { scroll-margin-top: 80px; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 72px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero .logo-xl { height: 64px; margin: 6px 0 10px; }
.hero .subtitle {
  font-family: "Sora", sans-serif; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; font-size: 1rem; color: var(--ink); margin: 0 0 18px;
}
.hero p.lead { font-size: 1.15rem; color: #3a3a3a; max-width: 460px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-art { display: flex; justify-content: center; }

/* ---------- hitori grid ---------- */
.hgrid {
  display: grid; gap: 0; background: var(--card);
  border: 2px solid var(--ink); border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow); width: max-content;
}
.hcell {
  width: 46px; height: 46px; display: grid; place-items: center; position: relative;
  font-family: "Sora", sans-serif; font-weight: 600; font-size: 1.2rem;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--card); color: var(--ink); user-select: none;
}
.hgrid.clickable .hcell { cursor: pointer; transition: background .1s ease; }
.hgrid.clickable .hcell:hover { background: #faf3f2; }
.hcell.crossed { color: var(--gridgray); }
.hcell.crossed::before, .hcell.crossed::after {
  content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 2.4px;
  background: var(--accent); border-radius: 2px;
}
.hcell.crossed::before { transform: rotate(45deg); }
.hcell.crossed::after  { transform: rotate(-45deg); }
.hcell.flag { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- cards / rules ---------- */
.cards { display: grid; gap: 20px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.rule-card { display: flex; flex-direction: column; gap: 14px; }
.rule-top { display: flex; align-items: center; gap: 12px; }
.badge {
  width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: "Sora", sans-serif; font-weight: 700;
  font-size: .95rem; flex: none;
}
.rule-card h3 { margin: 0; font-size: 1.2rem; }
.rule-card p { margin: 0; color: var(--muted); font-size: .98rem; }
.rule-illu { margin-top: 6px; }

/* mini illustration grids */
.mini { display: inline-grid; gap: 0; border: 1.5px solid var(--ink); border-radius: 5px; overflow: hidden; }
.mini .m {
  width: 30px; height: 30px; display: grid; place-items: center; position: relative;
  font-family: "Sora", sans-serif; font-weight: 700; font-size: .85rem; background: #fff;
  border-right: 1px solid var(--line);
}
.mini .m:last-child { border-right: 0; }
.mini .m.flag { box-shadow: inset 0 0 0 2px var(--accent); }
.mini .m.x { color: var(--gridgray); }
.mini .m.x::before, .mini .m.x::after {
  content: ""; position: absolute; left: 20%; right: 20%; top: 50%; height: 2px;
  background: var(--accent);
}
.mini .m.x::before { transform: rotate(45deg); }
.mini .m.x::after  { transform: rotate(-45deg); }
.mini.flagged { border-color: var(--accent); }
.illu-link { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 0; }
/* the cell above opens into the row (no dividing line under the 2) */
.illu-link .above { margin-bottom: -1.5px; border-bottom: 0; border-radius: 5px 5px 0 0; }
.dot { position: absolute; width: 6px; height: 6px; border-radius: 99px; background: var(--accent2); transform: translate(-50%, -50%); }
/* dots on the shared edges: above<->middle, and within the bottom row */
.illu-link .d-top { left: 50%; top: 30px; }
.illu-link .d-l   { left: 30px; top: 46px; }
.illu-link .d-r   { left: 60px; top: 46px; }

/* ---------- demo ---------- */
.demo-wrap { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.demo-controls .btn { margin: 0 10px 12px 0; }
.demo-msg { min-height: 28px; font-weight: 600; margin-top: 8px; }
.demo-msg.ok { color: #2f6f6a; }
.demo-msg.no { color: var(--accent); }

/* ---------- size index (like the book container) ---------- */
.sizes {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border-radius: var(--radius); overflow: hidden;
}
.sizes .sz { padding: 26px 22px; border-left: 1px solid var(--line); }
.sizes .sz:first-child { border-left: 0; }
.sizes .sz .big { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.7rem; }
.sizes .sz .sub { color: var(--muted); font-size: .9rem; }

/* ---------- gift / newsletter ---------- */
.gift { display: grid; grid-template-columns: 1fr 320px; gap: 56px; align-items: center; }
.gift .qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: grid; place-items: center; }
.gift .qr img { width: 100%; max-width: 260px; display: block; }
.signup { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.signup input[type=email] {
  flex: 1; min-width: 220px; padding: .85em 1.1em; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-size: 1rem; font-family: inherit;
}
.signup input[type=email]:focus { outline: none; border-color: var(--ink); }
.form-note { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.success { color: #2f6f6a; font-weight: 600; }

/* ---------- band / CTA ---------- */
.band { background: var(--ink); color: #fff; border-radius: 22px; padding: 56px 40px; text-align: center; }
.band h2 { color: #fff; }
.band p { color: #d7d7d7; }
.band .btn { background: #fff; color: var(--ink); border-color: #fff; }
.band .btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: .9rem; }
.site-footer .row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; margin-left: 18px; }
.site-footer a:hover { color: var(--ink); }
.site-footer .logo { height: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero .cta-row { justify-content: center; }
  .cards.three { grid-template-columns: 1fr; }
  .demo-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .gift { grid-template-columns: 1fr; }
  .sizes { grid-template-columns: repeat(2, 1fr); }
  .sizes .sz:nth-child(odd) { border-left: 0; }
  .nav nav { display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--cream); border-bottom: 1px solid var(--line); }
  .nav nav.open { display: flex; }
  .nav nav a { padding: 14px 24px; border-top: 1px solid var(--line); width: 100%; }
  .nav .nav-cta { margin: 12px 24px; }
  .menu-btn { display: block; }
}
@media (max-width: 460px) {
  .sizes { grid-template-columns: 1fr; }
  .sizes .sz { border-left: 0; border-top: 1px solid var(--line); }
  .sizes .sz:first-child { border-top: 0; }
  .hcell { width: 40px; height: 40px; font-size: 1.05rem; }
}

/* ============================================================
   Daily game (Wordle-style) + modals
   ============================================================ */
.game-nav { justify-content: space-between; }
.game-nav .logo { height: 18px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font-size: 1.15rem; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
}
.icon-btn:hover { border-color: var(--ink); }

.play { max-width: 560px; margin: 0 auto; padding: 38px 20px 10px; text-align: center; }
.play-head { margin-bottom: 14px; }
.play-title { font-size: clamp(1.5rem, 5vw, 2rem); margin: .1em 0 .35em; }
.play-meta { display: flex; gap: 10px; justify-content: center; align-items: center; }
.pill-badge {
  background: var(--ink); color: #fff; font-family: "Sora", sans-serif; font-weight: 700;
  font-size: .8rem; padding: .25em .7em; border-radius: 999px;
}

.board {
  width: min(92vw, 440px); aspect-ratio: 1; margin: 10px auto 0;
  display: grid; grid-template-columns: repeat(var(--n), 1fr);
  border: 2px solid var(--ink); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
}
.cell {
  appearance: none; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #fff; font-family: "Sora", sans-serif; font-weight: 600; color: var(--ink);
  cursor: pointer; position: relative; display: grid; place-items: center; padding: 0;
  font-size: calc(min(92vw, 440px) / var(--n) * 0.4); transition: background .08s ease;
}
.cell:hover { background: #faf3f2; }
.cell.crossed { color: var(--gridgray); }
.cell.crossed::before, .cell.crossed::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.6px;
  background: var(--accent); border-radius: 2px;
}
.cell.crossed::before { transform: rotate(45deg); }
.cell.crossed::after  { transform: rotate(-45deg); }
.cell.bad { background: #fbe9e7; }
.board.done .cell { cursor: default; }
.board.done { box-shadow: 0 0 0 3px rgba(47,111,106,.55), var(--shadow); }

.status { min-height: 24px; margin: 16px 0 4px; font-weight: 600; color: var(--muted); }
.play-controls { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }

.promo { padding: 26px 0 72px; }
.promo-card {
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  background: var(--panel); border-radius: var(--radius); padding: 24px 28px; flex-wrap: wrap;
}
.promo-card h2 { font-size: 1.2rem; margin: .2em 0; }
.promo-card .btn { flex: none; }

/* modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,20,20,.5);
  display: grid; place-items: center; padding: 20px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--cream); border-radius: 18px; max-width: 440px; width: 100%;
  padding: 30px 28px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-height: 90vh; overflow: auto;
}
.modal.center { text-align: center; }
.modal-close {
  position: absolute; top: 12px; right: 14px; background: none; border: 0;
  font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal h2 { font-size: 1.5rem; margin: .1em 0 .3em; }
.block { display: flex; width: 100%; justify-content: center; margin-top: 22px; }

.rules-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.rules-list li { display: flex; gap: 14px; align-items: flex-start; }
.rules-list strong { font-family: "Sora", sans-serif; }
.rules-list p { margin: .2em 0 .55em; color: var(--muted); font-size: .95rem; }

.stats-row { display: flex; gap: 12px; justify-content: center; margin: 22px 0; }
.stat { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 6px; }
.stat-num { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.5rem; }
.stat-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.win-cta { background: var(--ink); color: #fff; border-radius: 14px; padding: 22px 20px; margin-top: 8px; }
.win-cta .kicker { color: #bdbdbd; }
.win-cta h3 { color: #fff; margin: .1em 0 .3em; font-size: 1.2rem; }
.win-cta .small { font-size: .9rem; color: #cfcfcf; }
.win-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.win-cta .btn.secondary { background: transparent; color: #fff; border-color: #fff; }
.win-cta .btn.secondary:hover { background: #fff; color: var(--ink); }

@media (max-width: 560px) {
  .promo-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .promo-card .btn { width: 100%; justify-content: center; }
}

/* win cascade animation */
@keyframes tileWin {
  0%   { transform: scale(1);    background: #fff; }
  35%  { transform: scale(1.18); background: #e7f1f0; }
  60%  { transform: scale(0.96); }
  100% { transform: scale(1);    background: #fff; }
}
.cell.pop { animation: tileWin .5s ease var(--d, 0ms) both; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .cell.pop { animation: none; }
}

.icon-btn svg { display: block; }

/* newsletter on the main game page */
.newsletter { padding: 4px 0 72px; }
.news-card {
  background: var(--panel); border-radius: var(--radius);
  padding: 34px 28px; text-align: center; max-width: 620px; margin: 0 auto;
}
.news-card h2 { font-size: 1.4rem; margin: .15em 0 .3em; }
.news-card .signup { justify-content: center; }

/* refuse-and-shake when a cross would touch another cross (rule 2) */
@keyframes cellShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.cell.shake { animation: cellShake .38s ease; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .cell.shake { animation: none; } }

/* brief rule-violation note below the board */
.status.warn { color: var(--accent); font-weight: 700; }

/* legal pages (Impressum / Datenschutz) */
.legal { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.legal h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: .2em; }
.legal h2 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.legal p, .legal li { color: #3a3a3a; font-size: .98rem; }
.legal a { color: var(--accent); }
.legal .updated { color: var(--muted); font-size: .85rem; margin-bottom: 1.5em; }
.legal address { font-style: normal; line-height: 1.7; }
