:root {
  color-scheme: light;
  --ink: #45352a;
  --muted: #887666;
  --cream: #fff8ec;
  --paper: #fffdf8;
  --coral: #f27658;
  --tomato: #e75f47;
  --teal: #338d84;
  --mint: #d9eee1;
  --sun: #f8c84f;
  --line: #eddfcb;
  font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 9% 12%, rgba(251, 211, 121, .2), transparent 30rem),
    radial-gradient(ellipse at 92% 44%, rgba(132, 196, 169, .14), transparent 27rem),
    var(--cream);
}
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(1280px, 100%); margin: 0 auto; padding: 0 36px 24px; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(137, 105, 72, .13); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; filter: drop-shadow(0 3px 2px rgba(71, 46, 30, .12)); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 16px; font-weight: 900; letter-spacing: -.035em; }
.brand-tagline { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .035em; }
.topbar-note { display: flex; align-items: center; gap: 9px; color: #746455; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sparkle-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(51, 141, 132, .12); }
.intro { min-height: 126px; padding: 26px 2px 21px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 5px; color: var(--tomato); font-size: 10px; line-height: 1.2; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 35px); line-height: 1.05; letter-spacing: -.055em; }
h1 span { color: var(--coral); }
.intro-copy { margin: 7px 0 0; color: #766758; font-size: 13px; font-weight: 600; }
.recipe-stamp { width: 73px; height: 73px; transform: rotate(8deg); border: 2px dashed #e9a949; border-radius: 50%; color: #b4772b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 11px; line-height: 1.05; font-weight: 900; text-align: center; }
.recipe-stamp b { font-size: 9px; letter-spacing: .03em; text-transform: uppercase; }
.stamp-icon { color: #eaa34b; font-size: 15px; line-height: 1; }
.game-frame { overflow: hidden; border: 1px solid #e6d4bb; border-radius: 19px; background: var(--paper); box-shadow: 0 20px 48px rgba(93, 63, 32, .11), 0 3px 9px rgba(93, 63, 32, .05); }
.hud { height: 72px; display: grid; grid-template-columns: 140px minmax(180px, 1fr) 140px; align-items: center; gap: 12px; padding: 10px 18px; background: #fffdf8; border-bottom: 1px solid #f0e6d8; }
.hud-card { min-width: 0; display: flex; align-items: center; }
.score-card, .lives-card { flex-direction: column; align-items: flex-start; gap: 1px; }
.lives-card { align-items: flex-end; }
.hud-label { color: #a28c75; font-size: 9px; line-height: 1.2; letter-spacing: .15em; font-weight: 900; }
.score-value { color: #dc674a; font-size: 24px; line-height: 1.1; font-weight: 1000; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.progress-card { flex-direction: column; align-items: stretch; gap: 8px; }
.progress-track { position: relative; height: 9px; border-radius: 10px; background: #f1e8da; box-shadow: inset 0 1px 2px rgba(75, 53, 32, .08); }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f3c858, #ee8659); transition: width .1s linear; }
.progress-potato { position: absolute; top: 50%; left: 0; z-index: 1; width: 17px; height: 17px; display: grid; place-items: center; color: #77502f; background: #e8ad65; border: 2px solid #fffaf1; border-radius: 52% 48% 46% 54%; box-shadow: 0 2px 5px rgba(66, 44, 23, .18); font-size: 0; transform: translate(-15%, -50%); transition: left .1s linear; }
.progress-potato::after { content: ""; position: absolute; width: 3px; height: 3px; left: 5px; top: 5px; background: #563b2c; border-radius: 50%; box-shadow: 5px 0 #563b2c; }
.life-row { display: flex; gap: 5px; margin-top: 2px; color: #ed7157; font-size: 20px; line-height: 1; text-shadow: 0 1px #fff; }
.life-icon { transition: opacity .2s, transform .2s; }
.life-icon.lost { opacity: .2; transform: scale(.82); filter: grayscale(1); }
.canvas-wrap { position: relative; overflow: hidden; background: #f9d99a; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; outline: none; }
.screen-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(42, 45, 40, .20); backdrop-filter: blur(2.5px); animation: overlay-in .22s ease-out both; }
.screen-overlay.hidden { display: none; }
.overlay-card { width: min(370px, 100%); padding: 26px 30px 21px; border: 1px solid rgba(255, 255, 255, .84); border-radius: 20px; background: rgba(255, 250, 239, .97); box-shadow: 0 14px 40px rgba(43, 38, 28, .24); text-align: center; }
.start-card { position: relative; padding-top: 66px; }
.mini-potato { position: absolute; top: -31px; left: calc(50% - 34px); width: 68px; height: 78px; border: 3px solid #9b693b; border-radius: 48% 52% 45% 51% / 40% 43% 57% 60%; background: linear-gradient(145deg, #f2c27a, #d89a4c); box-shadow: inset -7px -7px 0 rgba(126, 76, 34, .09), 0 5px 0 #fff9ed; transform: rotate(-5deg); }
.mini-potato::before { content: ""; position: absolute; top: 27px; left: 18px; width: 5px; height: 7px; border-radius: 50%; background: #45352a; box-shadow: 17px 0 #45352a; }
.mini-potato::after { content: ""; position: absolute; left: 27px; top: 42px; width: 12px; height: 6px; border-bottom: 2px solid #72452b; border-radius: 50%; }
.mini-potato span { position: absolute; top: 18px; left: 30px; width: 5px; height: 18px; border-radius: 100% 0 100% 0; background: #5d9b58; transform: rotate(-26deg); }
.mini-potato span + span { left: 36px; top: 15px; transform: rotate(34deg); }
.mini-potato i { position: absolute; top: 52px; left: 28px; width: 11px; height: 8px; border-radius: 50%; background: #ef9a7c; opacity: .8; }
.overlay-kicker { margin: 0 0 7px; color: #bc7950; font-size: 9px; font-weight: 1000; letter-spacing: .17em; }
.overlay-card h2 { margin: 0; color: #4a392c; font-size: clamp(27px, 4vw, 35px); line-height: .99; letter-spacing: -.065em; }
.overlay-card h2 em { color: #e96d51; font-style: normal; }
.overlay-copy { max-width: 280px; margin: 12px auto 14px; color: #78695c; font-size: 12px; line-height: 1.5; font-weight: 600; }
.key-guide { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 15px; color: #716252; font-size: 10px; font-weight: 800; }
kbd { display: inline-grid; min-width: 24px; height: 23px; margin-right: 3px; padding: 0 5px; place-items: center; border: 1px solid #e4d4bd; border-bottom-width: 3px; border-radius: 6px; color: #534336; background: #fffef9; font: 800 11px/1 inherit; }
.key-guide span + span kbd { min-width: 48px; font-size: 8px; letter-spacing: .04em; }
.primary-button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 20px; width: min(220px, 100%); padding: 0 18px; border: 0; border-radius: 999px; color: #fffdf8; background: linear-gradient(180deg, #f27d5d, #e56247); box-shadow: 0 4px 0 #c84d38, 0 7px 14px rgba(185, 75, 47, .19); cursor: pointer; font: 900 13px/1 inherit; transition: transform .15s, box-shadow .15s, filter .15s; }
.primary-button span { font-size: 18px; line-height: 1; }
.primary-button:hover { filter: saturate(1.08) brightness(1.04); transform: translateY(-2px); box-shadow: 0 6px 0 #c84d38, 0 10px 18px rgba(185, 75, 47, .22); }
.primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c84d38; }
.primary-button:focus-visible { outline: 3px solid #f4c852; outline-offset: 4px; }
.micro-note { margin: 12px 0 0; color: #a18b75; font-size: 10px; }
.micro-note b { color: #388d85; }
.end-card { padding-top: 25px; }
.end-medal { width: 51px; height: 51px; display: grid; place-items: center; margin: 0 auto 12px; border: 2px dashed #e8b553; border-radius: 50%; color: #e4a93c; background: #fff4cf; font-size: 24px; }
.final-score { width: 142px; display: flex; align-items: center; justify-content: space-between; margin: 13px auto 16px; padding: 8px 12px; border: 1px dashed #e7d1ad; border-radius: 11px; color: #9b856d; background: #fffdf7; }
.final-score span { font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.final-score strong { color: #df694c; font-size: 19px; font-variant-numeric: tabular-nums; }
.game-footer { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-top: 1px solid rgba(89, 61, 33, .08); background: #fffdf8; }
.control-hint { display: flex; align-items: center; gap: 5px; color: #887868; font-size: 10px; font-weight: 700; }
.hint-key { min-width: 19px; height: 20px; display: inline-grid; place-items: center; padding: 0 4px; border: 1px solid #e8dccb; border-radius: 5px; color: #6a5846; background: #fff; font: 800 11px/1 inherit; }
.space-key { min-width: 46px; font-size: 8px; letter-spacing: .05em; }
.hint-divider { height: 17px; margin: 0 7px; border-left: 1px solid #e8dccb; }
.footer-tip { color: #be7656; font-size: 10px; font-weight: 800; }
.footer-tip span { color: #eebd50; margin-right: 4px; }
.below-note { min-height: 57px; display: flex; align-items: center; justify-content: center; gap: 13px; color: #98836d; }
.below-note p { margin: 0; font-size: 11px; }
.below-note b { color: #6e5842; }
.note-doodle { color: #75a79a; font-size: 24px; transform: rotate(-10deg); }
.right-doodle { transform: rotate(190deg); }
.site-footer { padding-top: 4px; color: #b2a08b; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  .app-shell { padding: 0 15px 16px; }
  .topbar { height: 68px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand-name { font-size: 13px; }
  .brand-tagline { font-size: 9px; }
  .topbar-note { font-size: 0; gap: 0; }
  .sparkle-dot { width: 9px; height: 9px; }
  .intro { min-height: 102px; padding: 20px 1px 17px; }
  .intro-copy { max-width: 270px; font-size: 11px; }
  .recipe-stamp { width: 59px; height: 59px; font-size: 9px; }
  .recipe-stamp b { font-size: 8px; }
  .hud { height: 62px; grid-template-columns: 86px minmax(70px, 1fr) 87px; gap: 8px; padding: 8px 10px; }
  .hud-label { font-size: 7px; letter-spacing: .12em; }
  .score-value { font-size: 20px; }
  .life-row { gap: 2px; font-size: 17px; }
  .canvas-wrap { min-height: 0; }
  .screen-overlay { padding: 13px; }
  .overlay-card { width: min(340px, 100%); padding-left: 20px; padding-right: 20px; }
  .start-card { padding-top: 58px; }
  .mini-potato { transform: scale(.82) rotate(-5deg); top: -35px; }
  .overlay-card h2 { font-size: clamp(25px, 7vw, 31px); }
  .overlay-copy { margin: 9px auto 11px; font-size: 11px; }
  .key-guide { margin-bottom: 12px; }
  .primary-button { min-height: 39px; }
  .micro-note { margin-top: 10px; }
  .game-footer { min-height: 41px; padding: 0 10px; }
  .control-hint { font-size: 9px; gap: 3px; }
  .footer-tip { font-size: 9px; }
  .below-note { min-height: 49px; gap: 8px; text-align: center; }
  .below-note p { max-width: 280px; font-size: 10px; line-height: 1.4; }
}
@media (max-width: 420px) {
  .app-shell { padding: 0 9px 14px; }
  .topbar { height: 61px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 12px; }
  .brand-tagline { font-size: 8px; }
  .intro { min-height: 95px; }
  .hud { grid-template-columns: 70px minmax(60px, 1fr) 74px; gap: 6px; padding: 7px; }
  .life-row { font-size: 15px; }
  .game-footer { gap: 4px; }
  .footer-tip { font-size: 8px; }
  .hint-divider { margin: 0 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
