@font-face {
  font-family: 'Monocraft';
  src: url('./assets/Monocraft.ttf') format('truetype');
  font-display: swap;
  font-weight: 400;
}
:root {
  color-scheme: light;
  --ink: #414b36; --muted: #7b8066; --paper: #fff9e6;
  --edge: #5b6548; --green: #7f9862; --green-dark: #5b7448;
  font-family: 'Monocraft', monospace;
  color: var(--ink); background: #ede8d2;
  font-synthesis: none; font-weight: 400;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; transition: background .1s; }
button:disabled { cursor: default; opacity: .45; }
button, input, textarea { border-radius: 0; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #bd8666; outline-offset: 4px; }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
svg { display: block; }
img { image-rendering: pixelated; object-fit: contain; }
.pixel-world { position: fixed; inset: 0; background: url('./assets/garden.svg') center bottom / cover no-repeat; z-index: -2; pointer-events: none; overflow: hidden; }
.sky-layer, .pollen-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Leave 24px above the garden’s highest treetop (y=342 of 1000), including
   background-cover cropping. The 200px cap also keeps clouds above Keiko’s hill. */
.sky-layer { height: max(0px, min(200px, calc(34.2% - 24px), calc(100% - 41.125vw - 24px))); overflow: hidden; }
.cloud-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sky-cloud { position: absolute; width: clamp(90px, 12vw, 180px); height: auto; shape-rendering: crispEdges; animation: cloud-drift 32s steps(100, end) infinite alternate; }
.cloud-one { left: 3%; top: 12%; --drift: 45px; animation-delay: -18s; }
.cloud-two { left: 24%; top: 4%; width: clamp(70px, 8vw, 120px); --drift: -35px; animation-duration: 40s; animation-delay: -43s; }
.cloud-three { right: 4%; top: 20%; --drift: -50px; animation-duration: 48s; animation-delay: -29s; }
.cloud-four { left: 26%; top: 55%; width: clamp(75px, 9vw, 135px); --drift: 35px; animation-duration: 30s; animation-delay: -36s; }
.cloud-seven { right: 2%; top: 60%; width: clamp(80px, 10vw, 150px); --drift: -40px; animation-duration: 38s; animation-delay: -37s; }
.pollen-layer i { position: absolute; width: 8px; height: 8px; filter: drop-shadow(0 0 1px #b5aa6a90) drop-shadow(0 0 3px #fff8c280); animation: pollen-float 14s steps(50, end) infinite alternate; }
.pollen-layer i::before { content: ''; position: absolute; inset: 0; background: #fff6b8; clip-path: polygon(37.5% 0, 62.5% 0, 62.5% 37.5%, 100% 37.5%, 100% 62.5%, 62.5% 62.5%, 62.5% 100%, 37.5% 100%, 37.5% 62.5%, 0 62.5%, 0 37.5%, 37.5% 37.5%); }
.pollen-layer i:nth-child(even)::before { background: #fffef0; }
.pollen-layer i:nth-child(3n) { width: 6px; height: 6px; }
.pollen-layer i:nth-child(5n) { width: 9px; height: 9px; }
.pollen-layer i:nth-child(1) { left: 12%; top: 68%; animation-delay: -3s; }
.pollen-layer i:nth-child(2) { left: 23%; top: 40%; animation-delay: -10s; animation-duration: 18s; }
.pollen-layer i:nth-child(3) { left: 85%; top: 58%; animation-delay: -6s; animation-duration: 16s; }
.pollen-layer i:nth-child(4) { left: 91%; top: 82%; animation-delay: -13s; animation-duration: 21s; }
.pollen-layer i:nth-child(5) { left: 16%; top: 91%; animation-delay: -7s; animation-duration: 19s; }
.pollen-layer i:nth-child(6) { left: 66%; top: 88%; animation-delay: -2s; animation-duration: 17s; }
.pollen-layer i:nth-child(7) { left: 83%; top: 23%; animation-delay: -11s; animation-duration: 20s; }
.pollen-layer i:nth-child(8) { left: 8%; top: 32%; animation-delay: -5s; animation-duration: 22s; }
.pollen-layer i:nth-child(9) { left: 18%; top: 22%; animation-delay: -4s; animation-duration: 13s; }
.pollen-layer i:nth-child(10) { left: 74%; top: 16%; animation-delay: -8s; animation-duration: 15s; }
.pollen-layer i:nth-child(11) { left: 94%; top: 48%; animation-delay: -6s; animation-duration: 12s; }
.pollen-layer i:nth-child(12) { left: 28%; top: 84%; animation-delay: -10s; animation-duration: 18s; }
.pollen-layer i:nth-child(13) { left: 7%; top: 58%; animation-delay: -2s; animation-duration: 16s; }
.pollen-layer i:nth-child(14) { left: 88%; top: 28%; animation-delay: -12s; animation-duration: 17s; }
.pollen-layer i:nth-child(15) { left: 37%; top: 71%; animation-delay: -7s; animation-duration: 14s; }
.pollen-layer i:nth-child(16) { left: 72%; top: 96%; animation-delay: -5s; animation-duration: 19s; }
.pollen-layer i:nth-child(17) { left: 9%; top: 14%; animation-delay: -9s; animation-duration: 16s; }
.pollen-layer i:nth-child(18) { left: 38%; top: 8%; animation-delay: -3s; animation-duration: 12s; }
.pollen-layer i:nth-child(19) { left: 68%; top: 27%; animation-delay: -11s; animation-duration: 17s; }
.pollen-layer i:nth-child(20) { left: 5%; top: 83%; animation-delay: -6s; animation-duration: 14s; }
.pollen-layer i:nth-child(21) { left: 92%; top: 92%; animation-delay: -4s; animation-duration: 15s; }
.pollen-layer i:nth-child(22) { left: 32%; top: 96%; animation-delay: -13s; animation-duration: 20s; }
.pollen-layer i:nth-child(23) { left: 46%; top: 87%; animation-delay: -8s; animation-duration: 18s; }
.pollen-layer i:nth-child(24) { left: 81%; top: 77%; animation-delay: -2s; animation-duration: 13s; }
.pollen-layer i:nth-child(25) { left: 2%; top: 38%; animation-delay: -7s; animation-duration: 16s; }
.pollen-layer i:nth-child(26) { left: 97%; top: 63%; animation-delay: -10s; animation-duration: 19s; }
.pollen-layer i:nth-child(27) { left: 53%; top: 35%; animation-delay: -5s; animation-duration: 14s; }
.pollen-layer i:nth-child(28) { left: 58%; top: 15%; animation-delay: -12s; animation-duration: 21s; }
@keyframes cloud-drift { from { transform: translateX(0); } to { transform: translateX(var(--drift)); } }
@keyframes pollen-float {
  0% { transform: translate(-12px, 24px); opacity: .55; }
  35% { transform: translate(18px, -10px); opacity: .9; }
  70% { transform: translate(-6px, -40px); opacity: 1; }
  100% { transform: translate(22px, -84px); opacity: .65; }
}
body::after { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath fill='%235b6548' opacity='.035' d='M0 0h1v1H0zM4 4h1v1H4z'/%3E%3C/svg%3E"); z-index: -1; pointer-events: none; }
.page-shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 24px 36px; zoom: 1.5; }
.toolbar { height: 57px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.archive-button { height: 31px; padding: 0 10px; font-size: 10px; }
.archive-button:hover { background: #e4e9cb; }
.archive-context { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 12px; font-size: 10px; color: var(--muted); }
.archive-context[hidden] { display: none; }
.archive-context .text-button { font-size: inherit; white-space: nowrap; }
.archive-list { display: grid; gap: 9px; }
.archive-entry { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 12px; text-align: left; border: 2px solid #b5b997; background: #f4efd9; color: var(--ink); font-size: 12px; }
.archive-entry:hover { background: #e4e9cb; border-color: var(--edge); }
.archive-entry[aria-current="date"] { border-color: var(--edge); box-shadow: inset 3px 0 0 #7c9163; }
.archive-entry small { display: block; margin-top: 6px; font-size: 9px; color: var(--muted); }
.archive-status { font-size: 10px; color: #567046; white-space: nowrap; }
@media (max-width: 600px) {
  .archive-entry { padding: 11px 8px; font-size: 11px; gap: 6px; }
  .archive-entry small, .archive-status { font-size: 8px; }
}
.pixel-button { background: var(--paper); border: 2px solid var(--edge); box-shadow: 2px 2px 0 #a6ad8b; }
.help-button { width: 31px; height: 31px; font-size: 18px; padding: 0; display: grid; place-items: center; line-height: 1; }
.help-button:hover { background: #e4e9cb; }
.game-title { text-align: center; margin: 8px 0 24px; }
h1 { font-size: clamp(25px, 5.4vw, 39px); font-weight: 400; letter-spacing: -1.7px; margin: 0; text-shadow: 2px 3px 0 #c7c9a6; line-height: 1.3; white-space: nowrap; }
.keiko-scene { width: 220px; max-width: 100%; height: 150px; position: relative; margin: 8px auto 0; display: flex; justify-content: center; align-items: flex-end; }
.keiko-scene img { position: relative; top: calc(10px / 1.5); z-index: 1; margin-bottom: 12px; width: 128px; height: 128px; transform-origin: 50% 98%; }
.keiko-scene img.keiko-hopping { animation: keiko-hop 400ms ease-in-out both; }
.keiko-scene img.keiko-curious { animation: keiko-curious 900ms ease-in-out both; }
.keiko-scene img.keiko-celebrating { animation: keiko-celebrate 1200ms ease-in-out both; }
@keyframes keiko-hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes keiko-curious {
  0%, 100% { transform: rotate(0deg); }
  25%, 55% { transform: rotate(-1.2deg); }
  80% { transform: rotate(.3deg); }
}
@keyframes keiko-celebrate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  12% { transform: translateY(-6px) rotate(-2deg); }
  24% { transform: translateY(0) rotate(1deg); }
  38% { transform: translateY(-9px) rotate(2deg); }
  52% { transform: translateY(0) rotate(-1deg); }
  65% { transform: translateY(0) rotate(-2deg); }
  78% { transform: translateY(0) rotate(2deg); }
  90% { transform: translateY(0) rotate(-1deg); }
}
.grass-platform { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: url('./assets/keiko-hill.svg') center bottom / 100% 100% no-repeat; }
.game-title p { font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.daily-game { max-width: 548px; margin: 0 auto; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.category-card { position: relative; background: #f4efdb; border: 2px solid #92997a; min-width: 0; padding: 12px 8px; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; box-shadow: 0 3px 0 #c4c6a9; white-space: nowrap; }
.category-card:hover { background: #e5e9ca; }
.category-card.active { background: #d3dfb7; border-color: var(--edge); box-shadow: 0 3px 0 #89966f; }
.category-indicator { position: absolute; right: 4px; top: 3px; font-size: 8px; line-height: 1; color: var(--green-dark); }
.category-card.missed .category-indicator { color: #ad7757; }
.game-card { border: 3px solid var(--edge); background: var(--paper); padding: 23px 25px 20px; box-shadow: 4px 5px 0 #6b74513d, inset 0 0 0 3px #f0e8ca; position: relative; }
.game-card::before, .game-card::after { content: ''; position: absolute; width: 5px; height: 5px; background: #c6c5a4; top: 9px; }
.game-card::before { left: 9px; }.game-card::after { right: 9px; }
.current-clue { padding: 25px 0 31px; text-align: center; }
.clue-word { font-size: clamp(20px, 4.3vw, 28px); font-weight: 400; line-height: 1.3; margin: 0; letter-spacing: -1px; overflow-wrap: anywhere; }
.long-clue { font-size: clamp(16px, 3.7vw, 25px); }
.hint-0 { color: #b74656; }
.hint-1 { color: #a85b1b; }
.hint-2 { color: #87720b; }
.hint-3 { color: #3f754d; }
.hint-4 { color: #3d6fa4; }
.clue-history { text-align: center; display: flex; flex-wrap: wrap; gap: 7px 12px; justify-content: center; font-size: 10px; line-height: 1.7; color: var(--muted); margin: -3px 0 19px; }
.clue-history span + span::before { content: '·'; margin-right: 12px; }
.guess-row { display: flex; gap: 9px; }
.guess-row input { min-width: 0; flex: 1; width: 100%; padding: 13px 12px; border: 2px solid #9ca080; background: #fffdf2; font-size: 12px; box-shadow: inset 2px 2px 0 #e5e0c6; }
.guess-row input::placeholder { color: #92947b; }
.primary-button { border: 2px solid #4f6541; color: #fffee8; background: #7e9860; box-shadow: inset 2px 2px 0 #9fb47e, inset -2px -2px 0 #68804f, 0 3px 0 #4f6541; padding: 12px 17px; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; }
.primary-button:hover { background: #6b8750; }
.guess-feedback { color: var(--muted); min-height: 15px; margin: 10px 0 3px; text-align: center; font-size: 9px; line-height: 1.7; }
.guess-feedback.caution { color: #a06847; }
.card-bottom { display: flex; justify-content: center; }
.text-button { font-size: 10px; border: 0; padding: 7px 12px; background: transparent; color: #697a52; }
.text-button:hover:not(:disabled) { color: var(--ink); background: #edeed7; }
.daily-meta { display: flex; justify-content: space-between; gap: 12px; margin: 17px 2px 0; font-size: 9px; color: #6b7658; line-height: 1.6; }
.reset-controls { display: flex; justify-content: center; margin-top: 10px; }
.developer-credit { position: relative; align-self: flex-start; margin: auto 14px calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 2; display: flex; align-items: center; gap: 9px; max-width: calc(100% - 28px); padding: 5px 7px; font-size: 10px; line-height: 1.5; color: #46573c; background: #ede8d2d9; }
.developer-credit span { color: #35482f; }
.keiko-info { width: 32px; height: 32px; flex: 0 0 32px; padding: 0; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.keiko-info:hover { background: #e4e9cb; }
#petal-burst { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#petal-burst i { position: absolute; width: 9px; height: 13px; background: var(--petal-colour); clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); animation: petal-flight 1900ms ease-out both; }
@keyframes petal-flight {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  48% { transform: translate(var(--petal-mid-x), var(--petal-rise)) rotate(var(--petal-spin)); opacity: 1; }
  100% { transform: translate(var(--petal-x), var(--petal-y)) rotate(calc(var(--petal-spin) * 2)); opacity: 0; }
}
#reset-countdown { font-variant-numeric: tabular-nums; }
.storage-note { font-size: 10px; text-align: center; color: #9a6748; }
.previous-guesses { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 9px; padding-top: 13px; border-top: 2px dotted #d6d6b8; }
.guess-chip { font-size: 9px; color: #8d8e72; padding: 3px 5px; text-decoration: line-through; overflow-wrap: anywhere; max-width: 100%; }
.result-heading { text-align: center; font-size: 12px; color: var(--green-dark); margin: 21px 0 9px; }
.result-heading.missed { color: #aa7755; }
.answer-reveal { text-align: center; padding: 4px 0 24px; }
.answer-reveal strong { font-size: 26px; font-weight: 400; overflow-wrap: anywhere; }
.result-score { font-size: 10px; color: var(--muted); margin: 13px 0 0; }
.full-width { width: 100%; }
.summary-intro { text-align: center; padding: 8px 0 18px; }
.summary-intro h2 { font-size: 22px; font-weight: 400; margin: 0 0 12px; }
.summary-intro p { font-size: 11px; margin: 0; color: var(--muted); }
.summary-rows { margin: 0 0 23px; border-top: 2px dotted #d6d6b8; }
.summary-row { width: 100%; border: 0; border-bottom: 2px dotted #d6d6b8; background: transparent; display: flex; align-items: center; gap: 9px; padding: 15px 0; text-align: left; font-size: 10px; }
.summary-row:hover { background: #f1efd8; }
.summary-category { color: var(--muted); width: 80px; }
.summary-row strong { font-weight: 400; font-size: 12px; overflow-wrap: anywhere; }
.result-badge { margin-left: auto; color: #64804a; font-size: 10px; white-space: nowrap; }
.result-badge.missed { color: #aa7755; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
dialog { zoom: 1.5; width: min(548px, calc((100vw - 32px) / 1.5)); max-width: none; max-height: calc((100dvh - 32px) / 1.5); padding: 29px 27px 26px; border: 3px solid var(--edge); background: var(--paper); box-shadow: 6px 6px 0 #36432d45, inset 0 0 0 3px #f0e8ca; color: var(--ink); overflow: auto; }
dialog::backdrop { background: #38472c66; }
.close-dialog { position: absolute; right: 11px; top: 10px; font-size: 19px; width: 26px; height: 26px; line-height: 1; padding: 0; }
dialog h2 { font-weight: 400; font-size: 20px; margin: 5px 0 24px; }
.keiko-dialog { padding-bottom: 24px; }
.keiko-dialog h2 { padding-right: 24px; }
.polaroid-stack { display: flex; align-items: center; justify-content: center; padding: 28px 12px 32px; }
.polaroid { position: relative; flex: 0 0 37%; margin: 0; padding: 7px 7px 27px; background: #fffdf7; border: 1px solid #d9d3bf; box-shadow: 3px 5px 0 #454b3529, 0 2px 8px #454b3526; transform: rotate(-8deg); }
.polaroid + .polaroid { margin-left: -32px; }
.polaroid:nth-child(2) { transform: translateY(-9px) rotate(3deg); z-index: 1; }
.polaroid:nth-child(3) { transform: translateY(12px) rotate(9deg); z-index: 2; }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; image-rendering: auto; object-fit: cover; }
@media (max-width: 600px) {
  .keiko-dialog h2 { font-size: 18px; }
  .polaroid-stack { flex-direction: column; padding: 12px 10px 20px; }
  .polaroid { flex: none; width: min(80%, 190px); padding: 5px 5px 20px; transform: translateX(-7px) rotate(-6deg); }
  .polaroid + .polaroid { margin-left: 0; margin-top: -28px; }
  .polaroid:nth-child(2) { transform: translateX(7px) rotate(5deg); }
  .polaroid:nth-child(3) { transform: translateX(-3px) rotate(-4deg); }
}
.rules { padding-left: 23px; margin: 0; font-size: 11px; line-height: 1.9; }
.rules li { margin-bottom: 16px; padding-left: 5px; }
.help-footnote { font-size: 9px; line-height: 1.9; color: var(--muted); margin: 25px 0; }
#share-text { resize: none; background: #f1efd8; border: 2px solid #a2a688; padding: 14px 10px; width: 100%; font-size: 10px; line-height: 1.9; margin-bottom: 18px; }
.copy-feedback { min-height: 16px; font-size: 9px; line-height: 1.7; text-align: center; margin: 13px 0 0; color: var(--muted); }
@media (min-width: 1500px) { .page-shell { padding-top: 25px; }.game-title { margin-top: 16px; } }
@media (max-width: 600px) {
  dialog { padding: 24px 16px 20px; }
  .developer-credit { font-size: 11px; }
  .keiko-info { width: 44px; height: 44px; flex-basis: 44px; }
  .rules { padding-left: 17px; line-height: 1.65; }
  .rules li { padding-left: 2px; margin-bottom: 12px; }
  .cloud-one { left: -3%; top: 11%; width: 85px; }
  .cloud-two { left: 32%; top: 3%; width: 65px; }
  .cloud-three { right: -2%; top: 22%; width: 95px; }
  .cloud-four { left: 13%; top: 31%; width: 65px; }
  .cloud-seven { right: -4%; top: 65%; width: 90px; }
  .page-shell { padding: 0 21px 28px; }
  .toolbar { height: 52px; font-size: 10px; }
  .game-title { margin: 13px 0 23px; }
  h1 { letter-spacing: -1.3px; }
  .game-card { padding: 21px 18px 17px; }
  .category-card { gap: 4px; font-size: 10px; padding: 12px 2px; }
  .category-grid { gap: 7px; }
  .guess-row { flex-direction: column; gap: 9px; }
  .guess-row input { flex: none; font-size: 11px; padding: 13px 10px; }
  .guess-row .primary-button { width: 100%; }
  .primary-button { font-size: 11px; padding: 12px; }
  .daily-meta { font-size: 8px; }
  .current-clue { padding-top: 26px; }
  .summary-row { gap: 6px; }
  .summary-category { width: 57px; font-size: 9px; }
  .summary-row strong { font-size: 10px; }
  .summary-intro h2 { font-size: 19px; }
  .result-badge { font-size: 9px; }
}
@media (max-width: 350px) {
  h1 { font-size: 22px; }
  .category-card { gap: 4px; font-size: 9px; padding-left: 3px; padding-right: 3px; }
  .page-shell { padding-left: 13px; padding-right: 13px; }
  .daily-meta { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pollen-layer { display: none; }
  #keiko { content: url('./assets/keiko-256.png?v=pink-tongue'); }
}
