/* cookiekeep.com: the game's own look. Wood floor, a checked rug, toy blocks, cream cards with a pressed-down
   shadow, the same rounded type and colours as game/index.html. The road (site.js) runs down the rug's sides past
   the walls of blocks, from the toy box to the cookie jar, and a wind-up toy walks it as the page scrolls. */
/* Nunito (SIL Open Font License), a rounded face for browsers without the system's rounded one (Safari has it) */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 900; font-display: swap; src: url("fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #3a2a1e; --ink-2: #6b5442; --cream: #fff6e3; --cream-2: #f6e6c6;
  --wood: #c68c55; --wood-hi: #d09862; --wood-lo: #b97f49; --wood-mid: #c99159; --seam: rgba(84, 50, 22, .45);
  --rug: #7cc5ca; --rug-2: #6db9bf; --rug-edge: #4a97a1;
  --red: #e8524a; --orange: #f08a32; --yellow: #f2b632; --green: #4cb860; --blue: #3d8fd6; --purple: #9a5cc6;
  --drop: 0 4px 0 rgba(40, 26, 16, .32);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Hiragino Maru Gothic ProN", "Yuanti SC", "M PLUS Rounded 1c", system-ui, sans-serif;
  --gutter: 30px; --blk: 22px; --lane: 24px; --dot: 6px;
}
@media (min-width: 760px) { :root { --gutter: 48px; --blk: 30px; --lane: 30px; --dot: 7px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 600 17px/1.5 var(--font); color: var(--ink);
  background-color: var(--wood);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .55' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .19 0 0 0 0 .08 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='.42'/%3E%3C/svg%3E"),
    linear-gradient(90deg,
      var(--wood) 0 94px, var(--seam) 94px 96px,
      var(--wood-hi) 96px 190px, var(--seam) 190px 192px,
      var(--wood-lo) 192px 286px, var(--seam) 286px 288px,
      var(--wood-mid) 288px 382px, var(--seam) 382px 384px);
  background-size: 300px 300px, 384px 100%;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; }

/* the bar on top: the way home, and the three languages */
.top { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
.langs { display: flex; gap: 6px; margin-left: auto; }
.langs a, .pill { background: var(--cream); border-radius: 999px; padding: 6px 12px; font-size: 14px; line-height: 1.2; text-decoration: none; box-shadow: 0 3px 0 rgba(40, 26, 16, .3); }
.langs a[aria-current] { background: var(--yellow); }
.mini { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; color: var(--cream); text-shadow: 0 2px 0 rgba(40, 26, 16, .35); }

/* the game's logo: letters on tipped toy blocks */
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.logo .word { display: flex; gap: 5px; }
.logo b { width: 46px; height: 50px; border-radius: 10px; display: grid; place-items: center; font-size: 34px; line-height: 1; font-weight: 800; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .28); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .3), 0 4px 0 rgba(40, 26, 16, .45); }
.logo .word b:nth-child(6n+1) { background: var(--red); transform: rotate(-4deg); }
.logo .word b:nth-child(6n+2) { background: var(--orange); transform: translateY(-3px) rotate(3deg); }
.logo .word b:nth-child(6n+3) { background: var(--yellow); transform: rotate(-2deg); }
.logo .word b:nth-child(6n+4) { background: var(--green); transform: translateY(-2px) rotate(4deg); }
.logo .word b:nth-child(6n+5) { background: var(--blue); transform: rotate(-3deg); }
.logo .word b:nth-child(6n+6) { background: var(--purple); transform: translateY(-3px) rotate(2deg); }
.logo .word + .word b:nth-child(1) { background: var(--blue); }
.logo .word + .word b:nth-child(2) { background: var(--purple); }
.logo .word + .word b:nth-child(3) { background: var(--red); }
.logo .word + .word b:nth-child(4) { background: var(--green); }
.mini .logo { flex-direction: row; gap: 3px; }
.mini .logo .word { gap: 2px; }
.mini .logo .word + .word { display: none; }
.mini .logo b { width: 17px; height: 19px; border-radius: 5px; font-size: 12px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 2px 0 rgba(40, 26, 16, .45); }
.mini .logo b:nth-child(n+2) { display: none; }
@media (min-width: 760px) {
  .logo.big b { width: 66px; height: 72px; border-radius: 14px; font-size: 50px; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18), inset 0 4px 0 rgba(255, 255, 255, .3), 0 6px 0 rgba(40, 26, 16, .45); }
  .logo.big .word { gap: 7px; }
}

/* the rug the whole page is played on */
.board {
  position: relative; max-width: 1100px; margin: 4px 10px 0; padding: 0 0 26px;
  background-color: var(--rug);
  background-image: conic-gradient(var(--rug-2) 25%, transparent 0 50%, var(--rug-2) 0 75%, transparent 0);
  background-size: 52px 52px;
  border: 10px solid var(--rug-edge); border-radius: 8px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .45), 0 10px 0 rgba(40, 26, 16, .2), 0 22px 40px rgba(40, 26, 16, .28);
}
@media (min-width: 1140px) { .board { margin-inline: auto; } }
.board > section { position: relative; z-index: 1; margin: calc(var(--lane) * 2 + 10px) calc(var(--gutter) + 6px) 0; }

/* the road: dots like the game's, drawn by site.js */
.road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.road path { fill: none; stroke: rgba(255, 246, 227, .85); stroke-width: var(--dot); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .01 calc(var(--dot) * 2.5); }
.walker { position: absolute; left: 0; top: 0; width: 58px; height: 58px; z-index: 3; pointer-events: none; will-change: transform; transform: translate(-200px, -200px); }
@media (min-width: 760px) { .walker { width: 72px; height: 72px; } }
.toybox { display: block; width: 150px; height: auto; margin: 4px auto 0; position: relative; z-index: 2; }
.jar { display: block; width: 150px; height: auto; margin: calc(var(--lane) * 2 + 6px) auto 0; position: relative; z-index: 2; }
@media (min-width: 760px) { .toybox { width: 210px; } .jar { width: 200px; } }

/* walls of blocks: from one edge of the rug, leaving the road its gap at the other */
.wall { position: relative; z-index: 1; display: flex; gap: 4px; height: calc(var(--blk) + 5px); overflow: hidden; margin-top: 46px; width: calc(100% - var(--gutter) - 10px); }
.wall[data-gap="left"] { margin-left: auto; justify-content: flex-end; }
.wall i { flex: none; width: var(--blk); height: var(--blk); border-radius: calc(var(--blk) * .22); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .17), inset 0 2px 0 rgba(255, 255, 255, .3), 0 3px 0 rgba(40, 26, 16, .42); }
.c1 { background: var(--red); } .c2 { background: var(--orange); } .c3 { background: var(--yellow); }
.c4 { background: var(--green); } .c5 { background: var(--blue); } .c6 { background: var(--purple); }

/* cards and labels, as in the game */
.card, .blurb, .how .text, .room, .facts, .sheet { background: var(--cream); border-radius: 22px; box-shadow: var(--drop); }
.kind { display: inline-block; margin: 14px 0 0; background: var(--cream); border-radius: 999px; padding: 6px 16px; font-size: 14px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; box-shadow: 0 3px 0 rgba(40, 26, 16, .4); }
.soon { display: inline-block; margin: 18px 0 0; background: var(--yellow); border-radius: 18px; padding: 12px 22px; font-size: 18px; font-weight: 800; line-height: 1.25; box-shadow: 0 4px 0 rgba(40, 26, 16, .35); }
h2 { font-size: 26px; font-weight: 800; }
@media (min-width: 760px) { h2 { font-size: 34px; } }

/* hero */
.hero { text-align: center; }
.hero h1 { display: block; }
.blurb { max-width: 560px; margin: 16px auto 0; padding: 14px 18px; font-size: 17px; line-height: 1.45; text-align: center; }
.pair { position: relative; display: flex; justify-content: center; margin: 30px auto 0; height: calc(176px * 852 / 393 + 22px); }
.phone { margin: 0; width: 176px; aspect-ratio: 393 / 852; padding: 7px; border-radius: 34px; background: #2a1f17; box-shadow: inset 0 0 0 2px #4a3a2e, 0 8px 0 rgba(40, 26, 16, .22), 0 18px 30px rgba(40, 26, 16, .3); }
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 27px; background: #3b3027; }
.pair .back { position: absolute; transform: translateX(-52px) rotate(-7deg); }
.pair .front { position: absolute; transform: translateX(54px) translateY(18px) rotate(5deg); }
@media (min-width: 760px) {
  .phone { width: 230px; border-radius: 40px; padding: 8px; }
  .phone img { border-radius: 32px; }
  .pair { height: calc(230px * 852 / 393 + 26px); }
  .pair .back { transform: translateX(-96px) rotate(-7deg); }
  .pair .front { transform: translateX(96px) translateY(22px) rotate(5deg); }
}

/* how to play */
.how .text { max-width: 760px; margin: 0 auto; padding: 22px 20px 20px; }
.how h2 { text-align: center; }
.how p { margin: 12px 0 0; }
.how h3 { margin: 22px 0 6px; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.guns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
@media (min-width: 640px) { .guns { grid-template-columns: repeat(6, 1fr); } }
.guns li { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; line-height: 1.25; }
.guns img { width: 86px; height: 86px; object-fit: contain; }

/* the three rooms */
.rooms > h2, .toys > h2 { text-align: center; color: var(--cream); text-shadow: 0 3px 0 rgba(40, 26, 16, .35); }
.room-list { display: grid; grid-auto-flow: column; grid-auto-columns: min(82%, 330px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 18px calc(-1 * var(--gutter) - 6px) 0; padding: 4px calc(var(--gutter) + 6px) 14px; scrollbar-width: none; }
.room-list::-webkit-scrollbar { display: none; }
@media (min-width: 980px) { .room-list { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin-inline: 0; padding-inline: 0; } }
.room { scroll-snap-align: center; padding: 16px 16px 18px; display: flex; flex-direction: column; }
.room .phone { width: 150px; margin: 0 auto 14px; border-radius: 28px; padding: 6px; }
.room .phone img { border-radius: 22px; }
.room h3 { font-size: 22px; font-weight: 800; }
.room p { margin: 6px 0 12px; font-size: 16px; line-height: 1.45; }
.levels { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: lv; }
.levels li { counter-increment: lv; display: inline-flex; align-items: center; gap: 5px; background: var(--cream-2); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 13px; line-height: 1.2; }
.levels li::before { content: counter(lv); width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

/* the toys, standing on the rug */
.toys > p { margin: 8px auto 0; text-align: center; color: var(--cream); text-shadow: 0 2px 0 rgba(40, 26, 16, .35); }
.cast { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }
@media (min-width: 560px) { .cast { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cast { grid-template-columns: repeat(5, 1fr); } }
.cast li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cast img { width: 130px; height: 130px; object-fit: contain; }
.cast span { margin-top: -4px; background: var(--cream); border-radius: 999px; padding: 4px 12px; font-size: 14px; line-height: 1.25; box-shadow: 0 3px 0 rgba(40, 26, 16, .3); }

/* the plain facts */
.board > section.facts { width: min(640px, calc(100% - 2 * (var(--gutter) + 6px))); margin-left: auto; margin-right: auto; padding: 18px 20px; }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.facts li { position: relative; padding-left: 30px; }
.facts li::before { content: ""; position: absolute; left: 0; top: .28em; width: 18px; height: 18px; border-radius: 5px; background: var(--green); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .17), 0 2px 0 rgba(40, 26, 16, .4); }
.facts li:nth-child(2)::before { background: var(--yellow); } .facts li:nth-child(3)::before { background: var(--red); }
.facts li:nth-child(4)::before { background: var(--blue); } .facts li:nth-child(5)::before { background: var(--purple); }

/* support and privacy */
.board.plain { padding: 26px 0; }
.sheet { max-width: 720px; margin: 0 auto; padding: 26px 22px; }
@media (min-width: 760px) { .board.plain { padding: 44px 0; } .sheet { padding: 36px 40px; } }
.sheet h1 { font-size: 32px; font-weight: 800; }
.sheet h2 { margin: 26px 0 0; font-size: 20px; }
.sheet p { margin: 8px 0 0; font-weight: 500; line-height: 1.6; }
.sheet .lead { font-weight: 700; font-size: 18px; margin-top: 12px; }
.sheet a { color: #2a6fb0; }
.sheet .date { margin-top: 28px; font-size: 14px; color: var(--ink-2); }
.sheet .more { margin-top: 24px; }
details { margin-top: 12px; background: var(--cream-2); border-radius: 16px; padding: 12px 16px; }
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; font-weight: 800; list-style: none; padding-right: 26px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: -1px; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }

/* footer, on the floor */
.foot { text-align: center; padding: 26px 16px max(30px, env(safe-area-inset-bottom)); color: var(--cream); }
.foot .soon { margin: 0; color: var(--ink); }
.foot nav { display: flex; justify-content: center; gap: 10px; margin: 18px 0 10px; }
.foot nav a { background: var(--cream); color: var(--ink); text-decoration: none; border-radius: 999px; padding: 7px 16px; font-size: 15px; box-shadow: 0 3px 0 rgba(40, 26, 16, .3); }
.foot small { display: block; font-size: 13px; text-shadow: 0 1px 0 rgba(40, 26, 16, .4); }

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