
  /* Layout concept: a sunny zoo pond framed by chunky wooden-sign UI with glossy candy buttons. */
  :root {
    --ink:#3a2412; --ink-soft:#7b5c42;
    --cream:#fff8ea; --cream-2:#fbe9c3;
    --wood:#5f3a1d; --wood-2:#9b6531;
    --leaf:#46c466; --leaf-d:#1d7f38;
    --sun:#ffb62e; --sun-d:#bf7108;
    --berry:#ff5b6b; --berry-d:#a82636;
    --sky:#3fb0ee; --sky-d:#1769a3;
    --f-body:ui-rounded,'Trebuchet MS','Segoe UI',system-ui,sans-serif;
    --f-head:ui-rounded,'Trebuchet MS','Segoe UI',system-ui,sans-serif;
  }
  * { box-sizing: border-box; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  button { font-family: var(--f-body); }
  button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--sky-d); }
  body {
    margin: 0; padding: 0;
    background: radial-gradient(ellipse at 50% 30%, #1b6f86 0%, #0b3444 70%, #072431 100%);
    font-family: var(--f-body);
    display: flex; justify-content: center; align-items: center;
    width: 100vw; height: 100vh; height: 100dvh;
    overflow: hidden; touch-action: none; color: var(--ink);
  }
  #game-wrapper {
    position: relative;
    width: min(100vw, 1120px);
    height: min(100vh, 100dvh, 740px);
    border-radius: 24px; overflow: hidden;
    background: #105066;
    box-shadow: 0 0 0 5px #fff3d6, 0 0 0 9px var(--wood), 0 24px 60px rgba(0,0,0,.6);
  }
  canvas { width: 100%; height: 100%; display: block; cursor: pointer; }

  /* HUD */
  #hud {
    position: absolute; top: 12px; left: 12px; right: 12px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
    pointer-events: none; z-index: 5;
  }
  .hud-pill {
    background: linear-gradient(#fffdf6, var(--cream-2));
    border: 3px solid var(--wood); border-radius: 999px;
    padding: 5px 14px; font-weight: 700; font-size: 13px; color: var(--ink);
    box-shadow: 0 4px 0 rgba(60,30,10,.4), inset 0 2px 0 #fff;
    display: flex; align-items: center; gap: 8px; pointer-events: auto;
  }
  #hud-lives { letter-spacing: 1px; }
  .progress-pill .bar { width: 84px; height: 12px; border-radius: 99px; background: rgba(95,58,29,.22); overflow: hidden; box-shadow: inset 0 2px 3px rgba(60,30,10,.35); }
  .progress-pill .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(#9af28a, var(--leaf)); transition: width .35s cubic-bezier(.3,1.4,.5,1); }
  .hud-btn {
    background: linear-gradient(#ffd25e, #ffa51f);
    border: 3px solid var(--wood); border-radius: 999px;
    padding: 6px 12px; font-weight: 700; font-size: 12px; color: #fff;
    text-shadow: 0 1px 2px rgba(60,30,0,.55);
    cursor: pointer; box-shadow: 0 4px 0 var(--wood), inset 0 2px 0 rgba(255,255,255,.55);
    transition: transform .1s, filter .15s; pointer-events: auto;
  }
  .hud-btn:hover { filter: brightness(1.07); }
  .hud-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood), inset 0 2px 0 rgba(255,255,255,.55); }
  .lang-toggle-btn { background: linear-gradient(#6fcaf7, var(--sky)); border-color: #14527d; box-shadow: 0 4px 0 #14527d, inset 0 2px 0 rgba(255,255,255,.55); }
  .exit-btn { background: linear-gradient(#ff8b8b, var(--berry)); border-color: var(--berry-d); box-shadow: 0 4px 0 var(--berry-d), inset 0 2px 0 rgba(255,255,255,.55); }

  /* Fruit tray */
  #fruit-bar {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(rgba(255,253,246,.96), rgba(251,233,195,.96));
    border: 4px solid var(--wood); border-radius: 28px;
    padding: 8px 16px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 7px 0 rgba(50,25,8,.45), 0 18px 36px rgba(0,0,0,.35), inset 0 2px 0 #fff;
    z-index: 5; max-width: 96vw; backdrop-filter: blur(6px);
  }
  .fruit-slot {
    position: relative; width: 60px; height: 60px; border-radius: 18px;
    border: 3px solid #e2cba3; background: linear-gradient(#fff, #fff1d6);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; flex-shrink: 0;
    transition: transform .14s cubic-bezier(.3,1.5,.5,1), border-color .14s, box-shadow .14s;
    box-shadow: 0 3px 0 #e2cba3;
  }
  .fruit-slot:hover { transform: translateY(-3px); }
  .fruit-slot.selected {
    border-color: var(--sun-d); background: linear-gradient(#fffbe0, #ffe9a0);
    transform: translateY(-7px) scale(1.08);
    box-shadow: 0 5px 0 var(--sun-d), 0 0 0 4px rgba(255,182,46,.45), 0 12px 22px rgba(255,150,0,.35);
  }
  .fruit-slot .emoji { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 1px rgba(60,30,0,.25)); }
  .fruit-slot.selected .emoji { animation: bob 1.1s ease-in-out infinite; }
  .fruit-slot .key-hint {
    position: absolute; top: -7px; left: -7px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--wood); color: #fff; font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 rgba(0,0,0,.25);
  }
  .controls-hint { font-size: 11px; font-weight: 700; color: var(--ink-soft); max-width: 170px; line-height: 1.35; }

  /* Modals */
  .modal-overlay {
    position: absolute; inset: 0; z-index: 20; padding: 16px;
    display: flex; justify-content: center; align-items: center;
    background: radial-gradient(ellipse at center, rgba(8,60,80,.35), rgba(4,24,34,.8));
    backdrop-filter: blur(4px);
  }
  .modal-card {
    position: relative;
    background: linear-gradient(180deg, #fffdf6, #fdefd0);
    border: 5px solid var(--wood); border-radius: 30px;
    padding: 22px 26px 20px; width: 540px; max-width: 100%; max-height: 94vh; overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 0 5px rgba(255,255,255,.4), 0 22px 54px rgba(0,0,0,.55), inset 0 3px 0 #fff;
    animation: popIn .34s cubic-bezier(.18,.89,.32,1.28);
  }
  .modal-title {
    margin: 0 0 4px; font-family: var(--f-head); font-weight: 800; font-size: 28px; line-height: 1.15;
    color: #c2410c; text-shadow: 0 3px 0 #ffe2a8, 0 6px 10px rgba(120,60,0,.18);
  }
  .bounce-emoji { display: inline-block; animation: floaty 2.4s ease-in-out infinite; }
  .modal-sub { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); font-weight: 700; line-height: 1.45; }
  .section-label {
    display: inline-block; font-family: var(--f-head); font-size: 12px; font-weight: 600; letter-spacing: .6px;
    color: #fff; background: var(--wood-2); border-radius: 99px; padding: 3px 14px; margin: 10px 0 7px;
    box-shadow: 0 2px 0 var(--wood);
  }
  .btn-group { display: grid; gap: 8px; margin-bottom: 8px; }
  #mission-group { grid-template-columns: repeat(2, 1fr); }
  #speed-group { grid-template-columns: repeat(3, 1fr); }
  .choice-btn {
    padding: 9px 8px; border-radius: 16px; border: 3px solid #e2cba3;
    background: linear-gradient(#fff, #fff4dc); font-weight: 700; font-size: 14px; color: var(--ink);
    cursor: pointer; box-shadow: 0 4px 0 #e2cba3; transition: transform .12s, box-shadow .12s, border-color .12s;
  }
  .choice-btn:hover { transform: translateY(-2px); }
  .choice-btn small { display: block; font-weight: 600; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
  .choice-btn.active {
    border-color: var(--leaf-d); background: linear-gradient(#eaffe9, #bff0c4); color: #124d22;
    transform: translateY(-2px); box-shadow: 0 5px 0 var(--leaf-d), 0 8px 16px rgba(40,160,70,.25);
  }
  .choice-btn.active small { color: #2c6a3a; }
  .meme-btn { background: linear-gradient(#fff1d6, #ffd9a1); border-color: #e0a13a; box-shadow: 0 4px 0 #e0a13a; }
  .meme-btn.active { border-color: #c2410c; background: linear-gradient(#ffe6c4, #ffbf80); color: #7a2308; box-shadow: 0 5px 0 #c2410c, 0 8px 16px rgba(220,90,20,.3); }
  .benefit-box {
    background: rgba(255,255,255,.65); border: 2px dashed var(--wood-2); border-radius: 16px;
    padding: 9px 12px; margin: 12px 0 14px; font-size: 12px; font-weight: 700; color: var(--wood);
    text-align: left; display: flex; align-items: center; gap: 10px;
  }
  .benefit-box span { font-size: 24px; }
  .primary-btn {
    background: linear-gradient(#7bea7a, var(--leaf)); color: #fff; text-shadow: 0 2px 0 rgba(20,90,40,.5);
    border: 3px solid var(--leaf-d); padding: 11px 26px; border-radius: 999px;
    font-family: var(--f-head); font-size: 16px; font-weight: 800; cursor: pointer;
    box-shadow: 0 5px 0 var(--leaf-d), 0 12px 20px rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.5);
    margin: 4px 3px 0; transition: transform .1s, filter .15s;
  }
  .primary-btn:hover { filter: brightness(1.06); }
  .primary-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--leaf-d), inset 0 2px 0 rgba(255,255,255,.5); }
  .secondary-btn { background: linear-gradient(#ffd25e, #ffa51f); border-color: var(--sun-d); text-shadow: 0 2px 0 rgba(120,60,0,.45); box-shadow: 0 5px 0 var(--sun-d), 0 12px 20px rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.5); }
  .primary-btn.exit-btn { background: linear-gradient(#ff8b8b, var(--berry)); border-color: var(--berry-d); text-shadow: 0 2px 0 rgba(110,20,30,.45); box-shadow: 0 5px 0 var(--berry-d), 0 12px 20px rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.5); }
  .stars-row { font-size: 46px; margin: 6px 0; letter-spacing: 6px; animation: starPop .6s cubic-bezier(.18,.89,.32,1.4) both .1s; filter: drop-shadow(0 4px 4px rgba(150,90,0,.3)); }
  .hidden { display: none !important; }

  @keyframes popIn { from { transform: scale(.8) translateY(14px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
  @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  @keyframes floaty { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
  @keyframes starPop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

  @media (max-width: 960px) {
    #game-wrapper { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
    #fruit-bar { bottom: 10px; padding: 7px 12px; gap: 9px; }
    .fruit-slot { width: 54px; height: 54px; }
    .fruit-slot .emoji { font-size: 27px; }
    .controls-hint { display: none; }
    .modal-card { padding: 16px; }
    .modal-title { font-size: 22px; }
    .hud-pill { font-size: 12px; padding: 4px 10px; }
  }

/* Pompond edition: fresh cream, mint and berry around a sunny animated pond. */
body{background:radial-gradient(ellipse at 50% 30%,#2b8e8f,#123f55 75%)}#game-wrapper{border-radius:26px}.modal-card{background:linear-gradient(145deg,#fffdf3,#f8edce);border-color:#53664b;max-height:94dvh;overflow:auto;touch-action:pan-y}.modal-title{color:#20584c;font-size:38px;letter-spacing:-.04em}.edition{font-size:10px;letter-spacing:.22em;font-weight:800;color:#8e653e;margin:0 0 14px}.source-credit{font-size:9px;line-height:1.5;color:#806d53;margin:10px auto 14px}.fruit-slot{font:inherit;padding:0;cursor:pointer}.fruit-slot img{width:45px;height:45px;object-fit:contain;filter:drop-shadow(0 3px 2px #572a2025)}.benefit-box{background:#ecf2d8;border-color:#98b27e}.primary-btn{background:linear-gradient(#77ce9d,#3e9d77);border-color:#27674f;box-shadow:0 5px 0 #27674f;color:#fff}.primary-btn:hover{filter:brightness(1.04)}.choice-btn.active{border-color:#388b67;background:#d7f1d8;color:#24543d}.controls-hint{font-size:11px}.modal-sub{font-weight:550}.hud-btn{font-family:inherit}.fruit-slot[aria-pressed=true]{outline:2px solid #fff9da;outline-offset:1px}
@media(max-width:600px){#game-wrapper{border-radius:0;box-shadow:none}.modal-card{width:min(94vw,480px);padding:18px 16px;max-height:96dvh}.modal-title{font-size:28px}.modal-sub{font-size:12px;line-height:1.45}.edition{margin-bottom:10px}.source-credit{font-size:8px}.section-label{margin:10px 0 6px}.benefit-box{font-size:11px;padding:8px;margin:9px 0}.primary-btn{font-size:15px;padding:11px 15px}.fruit-slot img{width:38px;height:38px}#fruit-bar{gap:7px;max-width:calc(100% - 16px);padding:10px}.controls-hint{display:none}.fruit-slot{width:54px;height:60px}.hud-pill{font-size:11px;padding:4px 8px}.hud-btn{font-size:10px;padding:6px 9px}#hud{gap:6px;top:10px;left:9px;right:9px}.progress-pill{order:3}.btn-group{gap:6px}.choice-btn{padding:8px 5px;font-size:12px}.choice-btn small{font-size:10px}}
@media(prefers-reduced-motion:reduce){.bounce-emoji,.stars-row{animation:none!important}button{transition:none!important}}
