/* ============ Tokens: a real classroom ============ */
:root {
  --paper: #fffdf7;
  --bg: #f6f1e4;              /* manila / craft paper */
  --ink: #2b2a33;             /* pencil */
  --text: #3a3843;
  --muted: #6e6a73;
  --line: #e6dcc6;
  --rule: #cfe1f3;            /* notebook ruled line */
  --margin: #f0a7a0;          /* notebook margin line */
  --board: #2b4636;           /* chalkboard green */
  --board-2: #33523f;
  --chalk: #f4f1e8;
  --wood: #b5793f;
  --wood-dark: #8a5528;
  --cork: #c9955c;
  --red: #e4572e;
  --yellow: #ffc93c;
  --green: #4f9d4a;
  --blue: #3a7bd5;
  --radius: 16px;
  --shadow-sm: 0 1px 1px rgba(60,40,10,.06), 0 3px 8px rgba(60,40,10,.07);
  --shadow: 0 2px 3px rgba(60,40,10,.08), 0 14px 28px -10px rgba(60,40,10,.25);
  --shadow-lg: 0 30px 50px -20px rgba(30,20,5,.45);
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
  --chalk-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* Crayon color themes (construction paper) */
.t-violet { --c: #8e6bbf; --c-soft: #efe7fa; --c-ink: #5b3d8a; }
.t-orange { --c: #f28c28; --c-soft: #fff0df; --c-ink: #a8550a; }
.t-pink   { --c: #ec6f9c; --c-soft: #fde8f0; --c-ink: #a8305c; }
.t-teal   { --c: #2fa58e; --c-soft: #e0f4ef; --c-ink: #1b6f5f; }
.t-sky    { --c: #3a8fd9; --c-soft: #e3f0fc; --c-ink: #1d5f9e; }
.t-yellow { --c: #f2b705; --c-soft: #fff5d1; --c-ink: #8a6500; }
.t-green  { --c: #4f9d4a; --c-soft: #e6f3e2; --c-ink: #2f6a2b; }
.t-red    { --c: #e4572e; --c-soft: #fde6de; --c-ink: #9e3415; }
.t-blue   { --c: #3a7bd5; --c-soft: #e3edfb; --c-ink: #1f4f94; }

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--bg) var(--paper-texture); color: var(--text); font: 17px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); margin: .1em 0 .35em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.15rem); margin: 0 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .35em; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.small { font-size: .88rem; color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 44em; }
.center { text-align: center; margin-top: 30px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* Washi tape */
.tape { position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px), rgba(242,183,5,.55); box-shadow: 0 1px 2px rgba(0,0,0,.1); z-index: 2; pointer-events: none; }

/* ============ Buttons ============ */
.btn, button { font: 700 .97rem/1 var(--font-body); border-radius: 12px; padding: 12px 20px; border: 2px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover, button:hover { transform: translateY(-2px); }
.btn:active, button:active { transform: translateY(1px); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 #2f6a2b; }
.btn-green:hover { box-shadow: 0 6px 0 #2f6a2b; }
.btn-yellow { background: var(--yellow); color: #3b2a00; box-shadow: 0 4px 0 #c99500; }
.btn-yellow:hover { box-shadow: 0 6px 0 #c99500; }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn-chalk { background: var(--chalk); color: var(--board); box-shadow: 0 4px 0 #c9c3b2; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

/* ============ Header ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,253,247,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 3px solid var(--line); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; background: repeating-linear-gradient(90deg, var(--red) 0 40px, var(--yellow) 40px 80px, var(--green) 80px 120px, var(--blue) 120px 160px); opacity: .9; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 70px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 700 1.35rem/1 var(--font-display); }
.logo em { font-style: normal; color: var(--red); }
.logo .apple { width: 38px; height: 38px; transform: rotate(-8deg); transition: transform .3s ease; }
.logo:hover .apple { transform: rotate(8deg) scale(1.08); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: .96rem; padding: 8px 12px; border-radius: 10px; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--c-soft, #fff5d1); color: var(--ink); }
.header-actions { display: flex; gap: 8px; }
.hbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; text-decoration: none; font-weight: 800; font-size: .92rem; color: var(--ink); background: #fff; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.hbtn:hover { transform: translateY(-1px); }
.hbtn-star { background: #fff5d1; border-color: #f2d27a; box-shadow: 0 3px 0 #f2d27a; }
.hbtn-star > span:first-child { color: #e2a400; font-size: 1.05rem; }
.hbtn .count { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .75rem; display: grid; place-items: center; }
@media (max-width: 960px) {
  .header-inner { flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; padding-bottom: 8px; }
  .main-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 520px) { .hide-sm { display: none; } .logo { font-size: 1.15rem; } .logo .apple { width: 32px; height: 32px; } }

/* ============ Chalkboard + wood frame ============ */
.board-frame { position: relative; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #c98a4b 0%, #a96a33 40%, #c48443 60%, #94592a 100%); box-shadow: var(--shadow-lg), inset 0 2px 0 rgba(255,255,255,.25), inset 0 -3px 0 rgba(0,0,0,.2); }
.board-frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(100deg, rgba(0,0,0,.05) 0 2px, transparent 2px 9px); pointer-events: none; }
.chalkboard { position: relative; border-radius: 8px; background: var(--chalk-texture), radial-gradient(ellipse at 30% 20%, #3b5e48, transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(255,255,255,.05), transparent 50%), var(--board); color: var(--chalk); box-shadow: inset 0 0 40px rgba(0,0,0,.45); overflow: hidden; }
.board-ledge { position: relative; height: 18px; margin: 10px -26px -26px; background: linear-gradient(#b97c41, #7d4a20); border-radius: 0 0 12px 12px; box-shadow: 0 10px 20px -8px rgba(0,0,0,.4); }
.chalk { position: absolute; top: -7px; height: 9px; width: 46px; border-radius: 4px; background: #f7f4ea; box-shadow: 0 2px 2px rgba(0,0,0,.25); }
.chalk.c1 { left: 18%; transform: rotate(-4deg); }
.chalk.c2 { left: 24%; width: 30px; background: #ffd25e; transform: rotate(6deg); }
.chalk.c3 { left: 60%; width: 36px; background: #9bd3ff; }
.eraser { position: absolute; top: -16px; right: 14%; width: 92px; height: 20px; border-radius: 5px; background: linear-gradient(#4a5568 0 55%, #e8e2d0 55%); box-shadow: 0 3px 4px rgba(0,0,0,.3); }

/* ============ Home hero ============ */
.hero { padding: 40px 0 10px; }
.hero .chalkboard { display: grid; grid-template-columns: 1.2fr .8fr; gap: 36px; padding: 52px 52px 56px; }
.chalk-date { font: 700 1.35rem/1.2 var(--font-hand); color: rgba(244,241,232,.65); margin: 0 0 6px; }
.hero h1 { color: var(--chalk); font-size: clamp(2.3rem, 5vw, 3.9rem); line-height: 1.05; margin: 0 0 18px; text-shadow: 0 0 1px rgba(255,255,255,.4); }
.chalk-hl { position: relative; color: #ffd25e; white-space: nowrap; }
.chalk-hl svg { position: absolute; left: -2%; width: 104%; bottom: -.2em; height: .4em; overflow: visible; }
.chalk-hl path { fill: none; stroke: #ffd25e; stroke-width: 5; stroke-linecap: round; opacity: .85; stroke-dasharray: 230; stroke-dashoffset: 230; animation: draw 1.2s .4s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lead { color: rgba(244,241,232,.82); }
.hero-search { display: flex; gap: 8px; background: var(--paper); padding: 7px; border-radius: 14px; max-width: 560px; margin-top: 26px; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.hero-search input { flex: 1; border: 0; background: transparent; font: 600 1.02rem var(--font-body); padding: 0 14px; color: var(--ink); min-width: 0; }
.hero-search input:focus { outline: none; }
.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; font: 700 1.25rem var(--font-hand); color: rgba(244,241,232,.65); }
.hero-quick a { font: 700 .88rem var(--font-body); color: var(--chalk); text-decoration: none; padding: 6px 12px; border-radius: 10px; border: 2px dashed rgba(244,241,232,.35); }
.hero-quick a:hover { border-style: solid; background: rgba(255,255,255,.08); }
.hero-notes { position: relative; display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.sticky { position: relative; display: block; text-decoration: none; color: #3b3320; padding: 22px 22px 18px; border-radius: 2px 2px 14px 2px; box-shadow: 0 12px 18px -8px rgba(0,0,0,.5); transform: rotate(var(--r, -2deg)); transition: transform .2s ease; font-size: .92rem; }
.sticky:hover { transform: rotate(0deg) scale(1.03); }
.sticky small { display: block; font: 700 1.2rem/1 var(--font-hand); opacity: .75; margin-bottom: 6px; }
.sticky b { display: block; font: 600 1.3rem/1.2 var(--font-display); color: #2b2a33; }
.sticky-meta { display: block; margin-top: 4px; opacity: .75; font-weight: 600; }
.sticky-cta { display: inline-block; margin-top: 10px; font-weight: 800; color: var(--red); }
.sticky-yellow { background: linear-gradient(#fff2a8, #ffe57a); --r: -3deg; }
.sticky-pink { background: linear-gradient(#ffd3e2, #ffbcd3); --r: 2.5deg; margin-left: 30px; }
.sticky-blue { background: linear-gradient(#d4ecff, #b9dfff); --r: -1.5deg; margin-right: 24px; }
.sticky .tape { width: 70px; height: 22px; }
.sticky-pink .tape { background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px), rgba(58,143,217,.45); }
.sticky-blue .tape { background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px), rgba(79,157,74,.5); }
.doodle { position: absolute; pointer-events: none; }
.doodle-star { width: 44px; right: 38%; top: 30px; fill: none; stroke: rgba(255,210,94,.6); stroke-width: 2; stroke-linejoin: round; transform: rotate(12deg); }
.doodle-math { width: 150px; left: 52px; bottom: 6px; }
.doodle-math text { font: 700 26px var(--font-hand); fill: rgba(244,241,232,.28); }
.stats { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats li { position: relative; background: var(--paper); border: 2px solid var(--line); border-left: 8px solid var(--c); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow-sm); }
.stats b { display: block; font: 700 1.9rem/1.1 var(--font-display); color: var(--c-ink); }
.stats span { color: var(--muted); font-size: .92rem; font-weight: 600; }
@media (max-width: 960px) {
  .hero .chalkboard { grid-template-columns: 1fr; padding: 34px 26px 40px; }
  .hero-notes { flex-direction: row; flex-wrap: wrap; gap: 18px; }
  .hero-notes .sticky { flex: 1 1 200px; margin: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 32px; }
  .doodle-star { right: 20px; top: 16px; }
  .doodle-math { display: none; }
}
@media (max-width: 520px) {
  .hero { padding-top: 20px; }
  .board-frame { padding: 10px; }
  .board-ledge { margin: 8px -20px -20px; }
  .hero .chalkboard { padding: 26px 18px 32px; }
  .hero-search { flex-direction: column; }
  .hero-search input { padding: 12px; }
  .hero-search .btn { justify-content: center; }
  .sticky-blue { display: none; }
}

/* ============ Sections ============ */
.section { padding: 76px 0 0; }
.section-tight { padding-top: 36px; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.eyebrow { display: inline-block; margin: 0 0 4px; font: 700 1.45rem/1 var(--font-hand); color: var(--c-ink, var(--red)); transform: rotate(-1.5deg); }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 0; } .two-col > div + div { padding-top: 48px; } .section { padding-top: 56px; } }
.h-sub { font-size: 1.5rem; }

/* ============ Game cards: index cards ============ */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 24px 20px; }
.game-card { position: relative; background: var(--paper); border-radius: 6px 6px 14px 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.game-card:nth-child(3n+1):hover { transform: translateY(-4px) rotate(-1deg); }
.game-card:nth-child(3n+2):hover { transform: translateY(-4px) rotate(.8deg); }
.game-card:nth-child(3n):hover { transform: translateY(-4px) rotate(-.5deg); }
.game-card:hover { box-shadow: var(--shadow); }
.game-card-top { position: relative; height: 104px; border-radius: 6px 6px 0 0; background: var(--c); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.game-card-top::before { content: ""; position: absolute; inset: 0; background: var(--paper-texture), radial-gradient(circle at 15% 25%, rgba(255,255,255,.28), transparent 40%); }
.game-card-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px; background: radial-gradient(circle at 6px 0, transparent 6px, var(--paper) 6.5px) -6px 0 / 12px 10px repeat-x; }
.game-emoji { position: relative; font-size: 3rem; line-height: 1; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .25s ease; }
.game-card:hover .game-emoji { transform: rotate(-10deg) scale(1.06); }
.game-card .tag { position: absolute; left: 12px; top: 12px; z-index: 1; background: rgba(255,255,255,.92); color: var(--c-ink); font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 8px; }
.game-card-body { position: relative; padding: 14px 20px 18px; display: flex; flex-direction: column; flex: 1; background: linear-gradient(transparent 0 33px, var(--rule) 33px 34px, transparent 34px) 0 6px / 100% 34px; border-radius: 0 0 14px 14px; }
.game-card-body::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: var(--margin); opacity: .55; }
.game-card h3 { font-size: 1.22rem; margin: 0 0 4px; }
.game-card h3 a { color: var(--ink); text-decoration: none; }
.game-card h3 a::after { content: ""; position: absolute; inset: 0; }
.game-card p { color: var(--muted); font-size: .94rem; line-height: 34px; line-height: 1.6; flex: 1; margin: 0 0 14px; }
.meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.meta li { font-size: .8rem; font-weight: 700; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px 9px; }
.meta li.hot { background: #e6f3e2; border-color: #c4e2bd; color: #2f6a2b; }

/* Favorite star */
.fav { position: absolute; z-index: 2; right: 10px; top: 10px; width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; color: #c9bfa6; font-size: 1.3rem; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.fav:hover { color: #e2a400; transform: scale(1.1); }
.fav.on { color: #f2b705; background: #fff; }
.fav.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35) rotate(15deg); } }
.fav-big { position: static; width: auto; height: auto; padding: 12px 18px; border-radius: 12px; font-size: .97rem; gap: 8px; color: var(--ink); background: #fff5d1; border: 2px solid #f2d27a; box-shadow: 0 3px 0 #f2d27a; }
.fav-big .fav-icon { color: #c9a640; font-size: 1.2rem; }
.fav-big.on { background: var(--yellow); border-color: #d9a200; box-shadow: 0 3px 0 #c99500; }
.fav-big.on .fav-icon { color: #fff; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: var(--board); color: var(--chalk); padding: 12px 20px; border-radius: 12px; font-weight: 800; box-shadow: var(--shadow-lg); z-index: 300; transition: all .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Recently viewed (home) */
.recent-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.recent-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--paper); border: 2px dashed var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.recent-card:hover { border-style: solid; border-color: var(--yellow); }
.recent-emoji { font-size: 2rem; }
.recent-card b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.recent-card small { color: var(--muted); font-weight: 600; }

/* ============ Category tiles: construction paper ============ */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-tile { position: relative; display: flex; flex-direction: column; gap: 0; padding: 20px; min-height: 140px; border-radius: 6px; text-decoration: none; background: var(--c-soft) var(--paper-texture); color: var(--c-ink); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); box-shadow: 4px 4px 0 color-mix(in srgb, var(--c) 45%, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.cat-tile:nth-child(odd) { transform: rotate(-.6deg); }
.cat-tile:nth-child(even) { transform: rotate(.6deg); }
.cat-tile:hover { transform: translate(-2px, -2px) rotate(0); box-shadow: 7px 7px 0 var(--c); }
.cat-emoji { font-size: 2.2rem; line-height: 1; margin-bottom: auto; padding-bottom: 16px; }
.cat-name { font: 600 1.25rem/1.2 var(--font-display); color: var(--ink); }
.cat-count { font: 700 1.15rem var(--font-hand); }

/* ============ Corkboard + pinned tool cards ============ */
.corkboard { margin-top: 84px; padding: 72px 0 80px; background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.07) 0 2px, transparent 3px) 0 0 / 22px 22px, radial-gradient(circle at 70% 60%, rgba(80,40,0,.18) 0 2px, transparent 3px) 0 0 / 17px 17px, var(--paper-texture), var(--cork); border-top: 14px solid var(--wood); border-bottom: 14px solid var(--wood); box-shadow: inset 0 0 60px rgba(60,30,0,.35); }
.corkboard h2 { color: #2b1d0e; }
.corkboard .section-sub { color: #3f2a12; font-weight: 600; }
.corkboard .eyebrow { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.corkboard + .section, .corkboard + .wrap > .section { padding-top: 72px; }
.corkboard-flush { margin-top: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 22px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 26px 22px 20px; background: var(--paper); text-decoration: none; color: var(--muted); font-size: .94rem; border-radius: 3px; box-shadow: 0 10px 18px -8px rgba(40,20,0,.55); transform: rotate(var(--tilt, 0deg)); transition: transform .2s ease; }
.tool-card:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); }
.tool-card strong { color: var(--ink); font: 600 1.18rem var(--font-display); }
.pin { position: absolute; top: 8px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 2px, var(--c) 3px); box-shadow: 0 3px 3px rgba(0,0,0,.35); }
.tool-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: var(--c-soft); margin: 6px 0 8px; }
.tool-go { margin-top: auto; padding-top: 10px; color: var(--c-ink); font: 700 1.25rem var(--font-hand); }

/* ============ Notebook guide ============ */
.notebook { position: relative; background: var(--paper); border-radius: 6px 14px 14px 6px; padding: 30px 34px 30px 92px; box-shadow: var(--shadow); background-image: linear-gradient(90deg, transparent 70px, var(--margin) 70px 72px, transparent 72px), linear-gradient(transparent 0 35px, var(--rule) 35px 36px); background-size: 100% 100%, 100% 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; }
.notebook::before { content: ""; position: absolute; left: 22px; top: 24px; bottom: 24px; width: 22px; background: radial-gradient(circle, var(--bg) 0 8px, transparent 9px) 0 0 / 22px 64px repeat-y; }
.nb-item { display: flex; gap: 14px; }
.nb-num { flex: none; font: 700 2.4rem/1 var(--font-hand); color: var(--red); width: 30px; }
.nb-item p { color: var(--text); margin: 0; }
@media (max-width: 760px) { .notebook { grid-template-columns: 1fr; padding: 24px 20px 24px 64px; background-image: linear-gradient(90deg, transparent 48px, var(--margin) 48px 50px, transparent 50px), linear-gradient(transparent 0 35px, var(--rule) 35px 36px); } .notebook::before { left: 14px; } }

/* ============ FAQ ============ */
.faq-list { display: grid; gap: 12px; max-width: 860px; }
.faq details { background: var(--paper); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 3px 0 var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; font: 600 1.08rem var(--font-display); color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #fff5d1; color: #8a6500; font-weight: 800; transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 22px 18px; margin: 0; color: var(--muted); }

/* ============ Page hero (inner pages) ============ */
.page-hero { position: relative; background: var(--c-soft, #e6f3e2) var(--paper-texture); padding: 24px 0 52px; border-bottom: 2px dashed color-mix(in srgb, var(--c, #4f9d4a) 40%, transparent); }
.page-hero-inner { display: flex; gap: 30px; align-items: flex-start; margin-top: 22px; }
.page-hero-emoji { position: relative; flex: none; width: 112px; height: 112px; border-radius: 8px; display: grid; place-items: center; font-size: 3.6rem; background: var(--paper); border: 2px solid var(--line); box-shadow: 5px 5px 0 var(--c); transform: rotate(-4deg); }
.page-hero-emoji .tape { width: 64px; height: 20px; top: -10px; }
.page-hero h1 { margin-top: 0; }
.page-hero .lead { margin-bottom: 0; color: var(--text); }
.crumbs { font-size: .88rem; font-weight: 600; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.hero-chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips li { background: var(--paper); border: 2px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: .9rem; font-weight: 700; color: var(--ink); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 640px) {
  .page-hero-inner { flex-direction: column; gap: 18px; }
  .page-hero-emoji { width: 80px; height: 80px; font-size: 2.5rem; }
}

/* ============ Filters ============ */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; align-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); position: sticky; top: 84px; z-index: 10; }
@media (max-width: 1000px) { .filters { grid-template-columns: repeat(2, 1fr); position: static; } .f-search { grid-column: 1 / -1; } }
.filters input[type=search], .filters select { width: 100%; font: 700 .95rem var(--font-body); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 10px 14px; appearance: none; -webkit-appearance: none; }
.filters select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236e6a73' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.filters input[type=search] { padding-left: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236e6a73' stroke-width='2.2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
.toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: .93rem; white-space: nowrap; }
.toggle span::before { content: "✏️"; }
.toggle input:checked + span { background: var(--green); color: #fff; border-color: #2f6a2b; }
.toggle input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.f-count { color: var(--muted); font: 700 1.3rem var(--font-hand); margin: 16px 4px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ============ Pills ============ */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; background: var(--paper); border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 700; transition: all .15s ease; }
.pill:hover { border-color: var(--yellow); background: #fff5d1; transform: translateY(-1px); }

/* ============ Paper blocks / game detail ============ */
.paper { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 30px 32px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.paper.ruled { background-image: linear-gradient(90deg, transparent 18px, var(--margin) 18px 20px, transparent 20px), linear-gradient(transparent 0 74px, var(--rule) 74px 76px, transparent 76px); padding-left: 44px; }
.paper.ruled h2 { margin-bottom: 1em; }
.paper h2 { font-size: 1.55rem; }
.sticky-paper { background: linear-gradient(#fff6c4, #ffeea0); border-color: #f2d27a; transform: rotate(-.4deg); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; margin-top: 36px; }
@media (max-width: 960px) { .game-layout { grid-template-columns: 1fr; } }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 52px; min-height: 40px; line-height: 1.7; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -4px; width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--red); color: var(--red); display: grid; place-items: center; font: 700 1.6rem/1 var(--font-hand); transform: rotate(-6deg); background: var(--paper); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: -2px; font: 700 1.6rem/1 var(--font-hand); color: var(--green); }
.sticky-paper .ticks li::before { content: "★"; font-size: 1.1rem; top: 3px; color: #c99500; }
.sticky-paper .tape { left: 28px; transform: rotate(-6deg); }
.next-up { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border: 2px dashed var(--line); border-radius: 14px; }
.next-up span { font: 700 1.4rem var(--font-hand); color: var(--muted); }
.next-up a { font: 600 1.2rem var(--font-display); color: var(--ink); text-decoration: none; }
.next-up a:hover { color: var(--blue); }
.game-side { position: sticky; top: 92px; display: grid; gap: 18px; }
@media (max-width: 960px) { .game-side { position: static; } }
.side-card { background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 3px 0 var(--line); }
.side-card h2 { font-size: 1.1rem; margin-bottom: 12px; }
.facts { margin: 0; display: grid; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1.5px dashed var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: .92rem; font-weight: 600; }
.facts dd { margin: 0; font-weight: 800; text-align: right; font-size: .93rem; }
.side-tool { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; }
.side-tool:hover { background: var(--c-soft); }
.side-tool span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--c-soft); }
.side-tool b { margin-left: auto; color: var(--c-ink); }

/* Mini timer: a tiny chalkboard */
.mini-timer { position: relative; border-radius: 14px; padding: 16px 18px 18px; color: var(--chalk); background: var(--chalk-texture), var(--board); border: 10px solid var(--wood); box-shadow: var(--shadow), inset 0 0 20px rgba(0,0,0,.4); text-align: center; }
.mini-label { margin: 0; font: 700 1.3rem var(--font-hand); opacity: .8; }
.mini-display { font: 700 3.6rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mini-timer.done .mini-display { color: #ff8a7a; animation: flash 1s steps(2) 4; }
.mini-presets { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.mini-presets button { padding: 5px 10px; font-size: .8rem; border-radius: 8px; color: var(--chalk); background: rgba(255,255,255,.08); border: 1.5px dashed rgba(244,241,232,.4); }
.mini-btns { display: flex; justify-content: center; gap: 8px; }
.mini-btns .btn { padding: 9px 14px; }
.mini-btns .btn-ghost { color: var(--chalk); border-color: rgba(244,241,232,.45); }

/* ============ Quick picks ============ */
.quick-picks { display: grid; grid-template-columns: 1fr 1.6fr; gap: 36px; padding: 36px 40px 36px 56px; }
@media (max-width: 860px) { .quick-picks { grid-template-columns: 1fr; gap: 0; padding: 26px 20px 26px 44px; } }
.quick-picks ol { list-style: none; counter-reset: q; padding: 0; margin: 0; }
.quick-picks li { counter-increment: q; display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; padding: 8px 0; }
.quick-picks li::before { content: counter(q) "."; grid-row: span 2; font: 700 1.8rem/1 var(--font-hand); color: var(--red); }
.quick-picks a { font: 600 1.1rem var(--font-display); color: var(--ink); text-decoration: none; }
.quick-picks a:hover { color: var(--blue); }
.quick-picks span { color: var(--muted); font-size: .93rem; }

/* ============ Prose / empty states ============ */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: .4em; }
.empty-note { max-width: 560px; text-align: center; padding: 34px 28px 28px; background: linear-gradient(#fff6c4, #ffeea0); border-color: #f2d27a; transform: rotate(-.8deg); }
.count-inline { color: var(--muted); font-size: 1.1rem; }

/* ============ Footer: chalkboard ============ */
.site-footer { position: relative; margin-top: 110px; padding: 0 0 46px; color: rgba(244,241,232,.75); background: var(--chalk-texture), var(--board); border-top: 16px solid var(--wood); }
.footer-note { position: relative; top: -60px; margin-bottom: -20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 34px 40px; background: linear-gradient(#fff6c4, #ffeea0); color: #3b3320; border-radius: 4px 4px 18px 4px; box-shadow: var(--shadow-lg); transform: rotate(-.6deg); }
.footer-note .tape { left: 80px; }
.footer-note h2 { margin: 0 0 4px; }
.footer-note p { margin: 0; max-width: 560px; }
.footer-note-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-note .btn-chalk { background: var(--board); color: var(--chalk); box-shadow: 0 4px 0 #1a2c21; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-brand { grid-column: 1 / -1; } .footer-note { padding: 28px 22px; } }
.footer-brand p { margin-top: 12px; max-width: 290px; font-size: .95rem; }
.logo-chalk { color: var(--chalk); }
.logo-chalk em { color: #ffd25e; }
.footer-grid h3 { font: 700 1.4rem/1 var(--font-hand); color: #ffd25e; margin: 6px 0 12px; }
.footer-grid a:not(.logo) { display: block; color: rgba(244,241,232,.82); text-decoration: none; font-size: .95rem; padding: 3px 0; }
.footer-grid a:not(.logo):hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 2px dashed rgba(244,241,232,.2); font-size: .9rem; }
.footer-bottom a { color: rgba(244,241,232,.75); text-decoration: none; margin-left: 18px; }
.site-footer .chalk-tray { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: linear-gradient(#b97c41, #7d4a20); }

/* ============ Tools: chalkboard stage ============ */
.tool-stage-wrap { margin-top: -30px; position: relative; z-index: 2; }
.board-frame-tool { padding: 14px; }
.board-frame-tool::before { display: none; }
.tool-panel { --s-line: rgba(244,241,232,.22); position: relative; background: var(--chalk-texture), radial-gradient(ellipse at 30% 20%, #3b5e48, transparent 60%), var(--board); color: var(--chalk); border-radius: 8px; padding: 26px; box-shadow: inset 0 0 40px rgba(0,0,0,.45); }
.tool-panel:fullscreen { overflow: auto; padding: 4vh 4vw; border-radius: 0; border: 18px solid var(--wood); }
.tool-panel button { background: rgba(255,255,255,.07); color: var(--chalk); border: 2px dashed var(--s-line); padding: 10px 16px; border-radius: 10px; }
.tool-panel button:hover { background: rgba(255,255,255,.14); border-style: solid; }
.tool-panel button.primary { background: var(--yellow); color: #3b2a00; border: 2px solid var(--yellow); box-shadow: 0 4px 0 #c99500; }
.tool-panel input, .tool-panel select, .tool-panel textarea { font: 600 .96rem var(--font-body); color: var(--chalk); background: rgba(0,0,0,.18); border: 2px solid var(--s-line); border-radius: 10px; padding: 8px 12px; }
.tool-panel select option { color: #111; }
.tool-panel code { background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 6px; }
.tool-panel .small { color: rgba(244,241,232,.65); }
.tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.tool-row label { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 600; color: rgba(244,241,232,.85); }
.tool-row input[type=number] { width: 84px; }
.tool-row input[type=text] { width: 220px; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: 18px; height: 18px; accent-color: var(--yellow); }
label.block { display: block; margin-top: 16px; font: 700 1.25rem var(--font-hand); color: rgba(244,241,232,.75); }
label.block textarea { display: block; width: 100%; margin-top: 6px; font: 600 1.05rem/1.5 var(--font-body); resize: vertical; }
.timer-display { font: 700 clamp(4.5rem, 19vw, 13rem)/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: center; padding: 20px 0; color: var(--chalk); text-shadow: 0 0 2px rgba(255,255,255,.35); }
.tool-panel:fullscreen .timer-display { font-size: 30vw; }
.timer-display.done { color: #ff8a7a; animation: flash 1s steps(2) 4; }
@keyframes flash { 50% { opacity: .25; } }
#timer-app .tool-row, #picker-app .tool-row { justify-content: center; }
.picker-display { text-align: center; font: 700 clamp(3rem, 10vw, 6.5rem)/1.1 var(--font-display); padding: 36px 0; min-height: 1.7em; word-break: break-word; color: #ffd25e; }
.tool-panel:fullscreen .picker-display { font-size: 14vw; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 8px 0; }
.teams-grid .team { background: linear-gradient(#fff2a8, #ffe57a); color: #3b3320; border-radius: 2px 2px 12px 2px; padding: 16px 18px; box-shadow: 0 10px 14px -8px rgba(0,0,0,.5); transform: rotate(-1deg); }
.teams-grid .team:nth-child(4n+2) { background: linear-gradient(#ffd3e2, #ffbcd3); transform: rotate(1deg); }
.teams-grid .team:nth-child(4n+3) { background: linear-gradient(#d4ecff, #b9dfff); transform: rotate(-.5deg); }
.teams-grid .team:nth-child(4n+4) { background: linear-gradient(#d8f5cf, #bfeab2); transform: rotate(1.5deg); }
.teams-grid h3 { color: #2b2a33; margin: 0 0 6px; font-size: 1.3rem; }
.teams-grid ul { margin: 0; padding-left: 1.1em; font-weight: 600; }
.tool-panel:fullscreen .teams-grid { font-size: 1.5rem; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.score-team { background: rgba(0,0,0,.15); border: 2px dashed var(--s-line); border-radius: 14px; padding: 18px; text-align: center; }
.score-team input { width: 100%; text-align: center; font: 700 1.6rem var(--font-hand); background: transparent; border-color: transparent; }
.score-team input:hover, .score-team input:focus { border-color: var(--s-line); }
.score-num { font: 700 clamp(3.2rem, 9vw, 6rem)/1.05 var(--font-display); font-variant-numeric: tabular-nums; color: #ffd25e; }
.tool-panel:fullscreen .score-num { font-size: 10vw; }
.score-btns { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.score-btns button { min-width: 56px; font-size: 1.3rem; justify-content: center; }
.score-team .remove { font-size: .78rem; margin-top: 10px; padding: 4px 12px; color: rgba(244,241,232,.55); background: transparent; border: 0; }
.jep-board { display: grid; gap: 8px; margin: 12px 0; }
.jep-board .cat { background: #1f5fae; color: #fff; font: 600 1rem var(--font-display); text-align: center; padding: 12px 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center; min-height: 58px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.tool-panel .jep-board button { justify-content: center; font: 700 1.8rem var(--font-display); padding: 16px 4px; color: #ffd25e; background: #173d8a; border: 0; border-radius: 6px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.tool-panel .jep-board button:hover:not(:disabled) { background: #1f4fa8; }
.jep-board button.used { opacity: .15; }
.jep-scores { display: flex; flex-wrap: wrap; gap: 10px; }
.jep-scores div { background: rgba(0,0,0,.18); border: 2px dashed var(--s-line); border-radius: 10px; padding: 8px 16px; font-weight: 800; }
.jep-modal { position: fixed; inset: 0; background: rgba(20,30,24,.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 200; }
.jep-card { background: #173d8a; color: #fff; border: 12px solid var(--wood); border-radius: 18px; padding: 40px 32px; max-width: 920px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); }
.jep-q { font: 600 clamp(1.5rem, 4vw, 2.8rem)/1.25 var(--font-display); }
.jep-a { font: 700 clamp(1.6rem, 4vw, 2.6rem) var(--font-hand); color: #ffd25e; margin-top: 20px; }
.jep-card .tool-row { justify-content: center; margin-top: 26px; }
.hang-wrap { display: grid; grid-template-columns: minmax(140px, 230px) 1fr; gap: 28px; align-items: center; }
@media (max-width: 640px) { .hang-wrap { grid-template-columns: 1fr; } .hang-svg { max-width: 170px; margin: 0 auto; } }
.hang-svg { width: 100%; height: auto; }
.hang-svg * { stroke: var(--chalk); stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hang-word { font: 700 clamp(1.8rem, 5vw, 3.3rem)/1.2 var(--font-display); letter-spacing: .22em; word-break: break-word; }
.hang-msg { min-height: 1.5em; font: 700 1.5rem var(--font-hand); color: #ffd25e; }
.hang-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-panel .hang-keys button { width: 44px; padding: 10px 0; justify-content: center; font-family: var(--font-display); font-size: 1.05rem; }
.hang-keys button:disabled { opacity: .2; cursor: default; transform: none; }
.bingo-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.bingo-card { border-radius: 6px; padding: 14px; background: var(--paper); color: #111; break-inside: avoid; }
.bingo-card h3 { text-align: center; margin: 0 0 10px; }
.bingo-card table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bingo-card td { border: 2px solid #b9cde4; height: 60px; text-align: center; vertical-align: middle; font-size: .88rem; font-weight: 700; padding: 2px; word-break: break-word; }
.bingo-card td.free { background: #ffe57a; font: 700 1.3rem var(--font-hand); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* ============ Print ============ */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .no-print, .faq, .corkboard, .section-head, .crumbs, .page-hero-emoji, .fav, .toast { display: none !important; }
  .page-hero { background: none; border: 0; padding: 0; }
  .game-layout { display: block; margin: 0; }
  .paper { box-shadow: none; break-inside: avoid; }
  .sticky-paper { transform: none; }
  /* Bingo: print only the cards */
  .tool-bingo main > :not(.tool-stage-wrap) { display: none !important; }
  .tool-bingo .board-frame { background: none; box-shadow: none; padding: 0; }
  .tool-bingo .tool-panel { background: #fff; color: #000; box-shadow: none; padding: 0; }
  .tool-bingo .tool-row, .tool-bingo label.block { display: none !important; }
  .tool-bingo .bingo-out { display: block; }
  .tool-bingo .bingo-card { page-break-inside: avoid; margin-bottom: 24px; border: 2px solid #000; }
}

/* ============ Wheel / noise meter / dice ============ */
.wheel-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: center; }
@media (max-width: 860px) { .wheel-wrap { grid-template-columns: 1fr; } }
.wheel-box { position: relative; max-width: 500px; width: 100%; margin: 0 auto; }
.wheel-box canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.wheel-pointer { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 34px solid var(--chalk); z-index: 2; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.tool-panel .wheel-spin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%; justify-content: center; font: 700 1.1rem var(--font-display); padding: 0; z-index: 2; }
.tool-panel .wheel-spin:hover { transform: translate(-50%, -52%); }
.wheel-result { font: 700 clamp(2rem, 5vw, 3.4rem)/1.15 var(--font-display); color: #ffd25e; min-height: 1.3em; word-break: break-word; }
.tool-panel:fullscreen .wheel-box { max-width: 80vh; }
.noise-face { font-size: clamp(5rem, 16vw, 10rem); text-align: center; line-height: 1.1; }
.noise-bar { position: relative; height: 46px; border-radius: 999px; background: rgba(0,0,0,.25); border: 3px solid var(--s-line); overflow: hidden; margin: 18px 0 10px; }
.noise-fill { height: 100%; width: 0; background: #6fcf6a; transition: background .3s ease; }
.noise-fill.warn { background: #ffc93c; }
.noise-fill.loud { background: #ff6b5a; }
.noise-limit { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--chalk); }
.noise-status { text-align: center; font: 700 1.8rem var(--font-hand); color: var(--chalk); margin: 0; }
.noise-row { justify-content: center; }
.noise-row input[type=range] { width: 120px; padding: 0; accent-color: var(--yellow); }
.tool-panel:fullscreen .noise-face { font-size: 30vh; }
.dice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; padding: 30px 0 10px; min-height: 180px; }
.die { width: 130px; height: 130px; border-radius: 22px; background: var(--paper); box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 0 12px 20px -8px rgba(0,0,0,.5); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 18px; }
.die .pip { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); place-self: center; }
.die-num { display: grid; place-items: center; grid-template-columns: 1fr; grid-template-rows: 1fr; font: 700 3.4rem var(--font-display); color: var(--ink); }
.die.rolling { animation: roll .5s ease; }
@keyframes roll { 0% { transform: rotate(-200deg) scale(.6); } 70% { transform: rotate(15deg) scale(1.05); } 100% { transform: none; } }
.dice-total { text-align: center; font: 700 2.2rem var(--font-hand); color: #ffd25e; min-height: 1.3em; margin: 0; }
.dice-controls { justify-content: center; }
.tool-panel:fullscreen .die { width: 22vh; height: 22vh; }
.tool-panel:fullscreen .die .pip { width: 4vh; height: 4vh; }

/* ============ Seasonal tiles ============ */
.season-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 900px) { .season-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .season-row { grid-template-columns: repeat(2, 1fr); } }
.season-tile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 12px 18px; border-radius: 14px; background: var(--c-soft); color: var(--c-ink); border: 2px dashed var(--c); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.season-tile:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 10px 18px -10px rgba(0,0,0,.35); }
.season-tile .cat-emoji { font-size: 2.4rem; }
.season-tile .cat-name { font: 700 1.1rem var(--font-display); }
.season-tile .cat-count { font-size: .85rem; opacity: .8; }
.season-now { display: none; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg); background: var(--red); color: #fff; font: 700 1.05rem var(--font-hand); padding: 1px 12px; border-radius: 6px; white-space: nowrap; }
.season-tile.is-now { border-style: solid; background: var(--paper); box-shadow: 0 10px 20px -10px rgba(0,0,0,.4); }
.season-tile.is-now .season-now { display: block; }

/* ============ Online game tiles (home, hub, sidebars) ============ */
.play-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .play-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .play-grid { gap: 12px; } }
.play-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 18px 16px; border-radius: 16px; text-decoration: none; color: rgba(255,255,255,.9); font-size: .92rem; background: radial-gradient(circle at 85% 0%, rgba(255,255,255,.28), transparent 45%), var(--c); box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 12px 20px -12px rgba(0,0,0,.5); transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.play-tile:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 18px 24px -12px rgba(0,0,0,.55); }
.play-tile-icon { font-size: 2.4rem; line-height: 1; width: 64px; height: 64px; display: grid; place-items: center; background: rgba(255,255,255,.92); border-radius: 18px; margin-bottom: 8px; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.play-tile strong { font: 700 1.25rem var(--font-display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.play-tile-desc { line-height: 1.4; }
.play-tile-go { margin-top: auto; padding-top: 12px; font: 700 1rem var(--font-display); color: #fff; }
.play-tile-go::before { content: ''; }
.t-yellow.play-tile, .t-yellow .play-tile { color: #4a3600; }
.t-yellow.play-tile strong, .t-yellow.play-tile .play-tile-go { color: #3b2a00; text-shadow: none; }
@media (max-width: 520px) { .play-tile { padding: 14px 12px; } .play-tile-desc { display: none; } .play-tile-icon { width: 52px; height: 52px; font-size: 2rem; } .play-tile strong { font-size: 1.08rem; } }
.footer-grid { grid-template-columns: repeat(6, 1fr); }
.footer-grid .footer-brand { grid-column: 1 / -1; max-width: 520px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ Live room banner (home, /play/) ============ */
.live-banner { display: flex; align-items: center; gap: 16px; margin: 0 0 22px; padding: 18px 22px; border-radius: 16px; text-decoration: none; color: var(--chalk); background: var(--chalk-texture), radial-gradient(ellipse at 20% 0%, #3b5e48, transparent 60%), var(--board); border: 6px solid var(--wood); box-shadow: 0 14px 24px -14px rgba(0,0,0,.55); transition: transform .15s ease; }
.live-banner:hover { transform: translateY(-3px); }
.live-banner > span:nth-of-type(3) { display: flex; flex-direction: column; gap: 2px; flex: 1; color: rgba(244,241,232,.8); font-size: .95rem; }
.live-banner strong { font: 700 1.3rem var(--font-display); color: #fff; }
.live-banner b { font: 700 1.5rem var(--font-hand); color: #ffd25e; white-space: nowrap; }
.live-emoji { font-size: 2.4rem; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff5a4e; box-shadow: 0 0 0 0 rgba(255,90,78,.7); animation: livepulse 1.6s infinite; flex: none; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 12px rgba(255,90,78,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,78,0); } }
@media (max-width: 640px) { .live-banner { flex-wrap: wrap; padding: 14px 16px; } .live-banner b { width: 100%; } .live-emoji { display: none; } }

/* ============ SEO guides ============ */
.explore { background: var(--paper); border: 2px dashed var(--line); border-radius: 14px; padding: 18px 22px; }
.explore h2 { font-size: 1.15rem; margin: 0 0 10px; }
.explore ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.explore a { color: var(--ink); font-weight: 700; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.seo-intro { padding: 28px 32px; }
.seo-intro h2 { margin-top: 0; }
.seo-intro p { font-size: 1.05rem; line-height: 1.7; margin: 0; }
.best-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.best-item { display: grid; grid-template-columns: auto auto 1fr; gap: 16px; align-items: start; background: var(--paper); border: 2px solid var(--line); border-left: 8px solid var(--c); border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow-sm); }
.best-rank { font: 700 1.8rem/1 var(--font-display); color: var(--c-ink); min-width: 1.6em; padding-top: 6px; }
.best-emoji { font-size: 2.2rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: var(--c-soft); }
.best-item h2 { font-size: 1.3rem; margin: 2px 0 4px; }
.best-item h2 a { color: var(--ink); text-decoration: none; }
.best-item h2 a:hover { text-decoration: underline; }
.best-item p { margin: 0 0 4px; }
.best-meta { color: var(--muted); font-size: .9rem; font-weight: 600; }
.best-meta a { color: var(--c-ink); }
@media (max-width: 560px) { .best-item { grid-template-columns: auto 1fr; } .best-emoji { display: none; } }

/* ============ Chinese pages ============ */
:root:lang(zh) {
  --font-display: "Fredoka", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Zen Hei", sans-serif;
  --font-body: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Zen Hei", sans-serif;
  --font-hand: "Caveat", "Kaiti SC", "STKaiti", "KaiTi", "AR PL UKai CN", "PingFang SC", "Microsoft YaHei", cursive;
}
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { letter-spacing: .01em; }
:lang(zh) body { line-height: 1.75; }
.hbtn-lang { font-weight: 800; padding: 9px 11px; }
/* Slightly rotated tiles can poke 1px past a phone screen; never let that become sideways scrolling. */
html, body { overflow-x: clip; }
