:root{
    --bg:#d7ece8; --bg2:#c9e0db; --surface:#fff8ef; --surface2:#f3e6d4;
    --border:#b7d0cb; --ink:#2a1810; --muted:#6a4e38;
    --gold:#d3922e; --gold2:#f0c36a; --goldink:#2a1a05;
    --red:#c24732; --green:#4f9a55;
  }
  *{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  html,body{
    height:100%; width:100%; margin:0; overflow:hidden;
    overscroll-behavior:none;
  }
  body{
    background:var(--bg); color:var(--ink);
    font-family:'Manrope',system-ui,sans-serif;
    touch-action:manipulation;
    -webkit-user-select:none; user-select:none;
  }
  .bgpat{
    position:fixed; inset:0; z-index:0; pointer-events:none; opacity:1;
    background-color:#d7ece8;
    background-image:
      linear-gradient(#c3dbd6 1px, transparent 1px),
      linear-gradient(90deg, #c3dbd6 1px, transparent 1px);
    background-size:28px 28px;
  }
  #app{
    position:relative; z-index:1; max-width:100%; margin:0 auto;
    width:100%;
    height:var(--app-h, 100svh);
    max-height:100%;
    display:flex; flex-direction:column; overflow:hidden;
    background:
      radial-gradient(90% 50% at 50% 8%, rgba(255,248,239,.9) 0%, transparent 58%),
      radial-gradient(80% 40% at 50% 62%, rgba(255,248,239,.35) 0%, transparent 70%),
      transparent;
  }
  @media (min-width:520px){
    #app{ max-width:430px; height:100%; border-left:1px solid var(--border); border-right:1px solid var(--border); }
  }

  /* ---------- header ---------- */
  header{
    display:flex; align-items:center; gap:8px;
    padding:calc(env(safe-area-inset-top) + 12px) max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
    min-width:0;
  }
  .logo{
    font-family:'Unbounded'; font-weight:900; font-size:clamp(12px, 3.8vw, 16px); letter-spacing:.03em;
    color:var(--ink); display:flex; align-items:center; gap:6px;
    min-width:0; flex:0 1 auto; overflow:hidden;
  }
  .logo b{ font:inherit; letter-spacing:inherit; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
  .logo i{ flex:none; width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 10px rgba(139,195,74,.7); }
  .hright{ display:flex; align-items:center; gap:6px; min-width:0; flex:1 1 0; justify-content:flex-end; }
  .user{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--muted); font-weight:600; min-width:0; flex:1 1 auto; justify-content:flex-end; }
  #userName{ font-size:12px; font-weight:700; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
  .ava{
    flex:none; width:26px; height:26px; border-radius:50%; background:var(--gold); color:var(--goldink);
    display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800;
  }
  .iconbtn{
    flex:none; width:44px; height:44px; border-radius:12px; border:1px solid var(--border);
    background:var(--surface); color:var(--muted); display:flex; align-items:center; justify-content:center;
    cursor:pointer; padding:0;
  }
  .iconbtn:active{ transform:scale(.94); }
  button:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }

  /* ---------- HUD ---------- */
  .hud{ padding:6px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .coins{ font-family:'Unbounded'; font-weight:900; font-size:34px; line-height:1.05; display:flex; align-items:baseline; gap:10px; }
  .coins .cur{ font-family:'Manrope'; font-weight:800; font-size:11px; letter-spacing:.22em; color:var(--muted); text-transform:uppercase; }
  .coins.bump #coinsVal{ display:inline-block; animation:bump .14s ease; }
  @keyframes bump{ 50%{ transform:scale(1.07); color:var(--gold2);} }
  .hudsub{ display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:4px; font-size:12px; color:var(--muted); font-weight:600; min-width:0; }
  .hudsub b{ color:var(--gold); font-weight:800; }
  .energy{ margin-top:10px; display:flex; align-items:center; gap:8px; }
  .energy svg{ flex:none; }
  .ebar{ flex:1; height:10px; border-radius:99px; background:var(--surface); border:1px solid var(--border); overflow:hidden; }
  .ebar i{ display:block; height:100%; width:100%; border-radius:99px;
    background:linear-gradient(90deg,var(--gold),var(--gold2)); transition:width .25s ease; }
  .ebar i.low{ background:linear-gradient(90deg,#a3392a,var(--red)); }
  #energyTxt{ font-size:11px; font-weight:800; color:var(--muted); min-width:56px; text-align:right; font-variant-numeric:tabular-nums; }

  /* ---------- screens ---------- */
  main{ flex:1; min-height:0; position:relative; }
  .screen{ display:none; height:100%; }
  .screen.on{ display:flex; flex-direction:column; }

  /* tap screen */
  #scr-tap{ align-items:center; justify-content:flex-start; gap:8px; overflow:hidden; padding:4px 0 8px; touch-action:none; min-height:0; }
  .dailystrip{ width:100%; padding:0 12px; display:flex; gap:8px; flex:none; }
  .dailytile{
    flex:1; min-width:0; min-height:64px;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    background:var(--surface); border:1px solid var(--border); border-radius:14px;
    color:var(--ink); cursor:pointer; padding:8px 4px;
  }
  .dailytile:active{ transform:scale(.97); }
  .dailytile .dico{ font-size:16px; line-height:1; }
  .dailytile .dname{ font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
  .dailytile .dtime{ font-family:'Unbounded'; font-size:12px; color:var(--gold); font-weight:700; }
  .boosts{ display:flex; gap:8px; width:calc(100% - 32px); max-width:100%; flex:none; }
  .hint{ flex:none; }
  .boost{
    flex:1; min-height:44px; border-radius:12px; border:1px solid var(--border);
    background:var(--surface2); color:var(--ink); cursor:pointer;
    font-family:'Unbounded'; font-weight:800; font-size:12px; padding:8px 6px;
  }
  .boost small{ display:block; font-family:'Manrope'; font-weight:600; font-size:10px; color:var(--muted); margin-top:2px; }
  .boost.on{ border-color:var(--gold); color:var(--gold); }
  .boost:disabled{ opacity:.45; cursor:default; }
  .boost:not(:disabled):active{ transform:scale(.97); }
  .combo{
    position:absolute; top:6px; left:50%; transform:translateX(-50%) scale(.6);
    font-family:'Unbounded'; font-weight:700; font-size:13px; letter-spacing:.08em;
    color:var(--gold2); border:1px solid var(--gold); border-radius:99px; padding:5px 14px;
    background:rgba(232,163,61,.08); opacity:0; transition:opacity .15s, transform .15s; pointer-events:none;
  }
  .combo.on{ opacity:1; transform:translateX(-50%) scale(1); }
  .poopwrap{
    position:relative; display:grid; place-items:center;
    width:min(72vw, 280px); max-width:100%;
    flex:1 1 auto; min-height:0;
  }
  .comboring{
    position:absolute; left:50%; top:50%; width:88%; aspect-ratio:1;
    transform:translate(-50%,-50%);
    border-radius:50%; border:2px solid var(--gold);
    opacity:0; pointer-events:none; transition:opacity .2s; z-index:2;
  }
  .poopwrap.hot .comboring{ opacity:1; animation:ring 1.05s ease-out infinite; }
  @keyframes ring{
    0%{ transform:translate(-50%,-50%) scale(.88); opacity:.6; }
    100%{ transform:translate(-50%,-50%) scale(1.28); opacity:0; }
  }
  .bowl, .spot{ display:none; }

  /* alive-v2 */
  #poop{
    position:relative; z-index:1;
    width:min(72vw, 280px, 100%);
    max-height:100%;
    aspect-ratio:1; height:auto;
    background:none; border:none; padding:0; cursor:pointer;
    filter:drop-shadow(0 14px 22px rgba(42,24,16,.28));
    overflow:hidden; border-radius:18px;
  }
  #poop img{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; border-radius:18px; transform-origin:50% 78%; }
  #poop.spawn img{ animation:spawn .55s cubic-bezier(.2,1.6,.3,1); }
  #poop.off img{ filter:grayscale(.28) brightness(.86) saturate(.8); }
  #poop:not(.hit):not(.off) img{ animation:bob 3.1s ease-in-out infinite; }
  #poop.hit img{ animation:squish .32s cubic-bezier(.3,.9,.3,1); }
  #poop.hit::after{
    content:''; position:absolute; inset:10%; border-radius:50%; pointer-events:none;
    background:radial-gradient(circle, rgba(240,195,106,.5), transparent 68%);
    animation:glowpop .34s ease-out;
  }
  @keyframes spawn{ from{ transform:scale(.4); opacity:0;} }
  @keyframes bob{
    0%,100%{ transform:translateY(0) scale(1.04); }
    50%{ transform:translateY(-7px) scale(1.07); }
  }
  @keyframes squish{
    0%  { transform:scale(1,1) rotate(0deg); }
    22% { transform:scale(1.1,.88) rotate(var(--tilt,0deg)); }
    50% { transform:scale(.95,1.07) rotate(calc(var(--tilt,0deg) * -.4)); }
    76% { transform:scale(1.03,.98) rotate(0deg); }
    100%{ transform:scale(1,1) rotate(0deg); }
  }
  @keyframes glowpop{ 0%{ opacity:0; transform:scale(.72);} 28%{ opacity:1; transform:scale(1.04);} 100%{ opacity:0; transform:scale(1.28);} }

  .pbody, .psquish, .pshadow, .eyesq, .pglow, .flyw, .aroma{ transform-box:fill-box; }
  .pbody{ transform-origin:50% 100%; animation:bob 3.6s ease-in-out infinite; }
  .psquish{ transform-origin:50% 100%; }
  .pshadow{ transform-origin:50% 50%; }
  .eyesq{ transform-origin:50% 50%; }
  .pglow{ transform-origin:50% 50%; opacity:0; }
  .m-open{ opacity:0; }
  #poop.hit .psquish{ animation:squish .27s cubic-bezier(.3,.9,.3,1); }
  #poop.hit .pshadow{ animation:shadowpop .27s ease; }
  @keyframes shadowpop{ 24%{ transform:scaleX(1.16); opacity:.6; } 52%{ transform:scaleX(.9); opacity:.28; } }
  #poop.hit .eyesq{ animation:squint .27s ease; }
  @keyframes squint{ 0%,100%{ transform:scaleY(1); } 22%{ transform:scaleY(.42); } 62%{ transform:scaleY(1.1); } }
  #poop.hit .m-smile{ animation:mouthHide .27s ease; }
  #poop.hit .m-open{ animation:mouthShow .27s ease; }
  @keyframes mouthHide{ 0%,100%{ opacity:1; } 8%,62%{ opacity:0; } }
  @keyframes mouthShow{ 0%,100%{ opacity:0; } 8%,62%{ opacity:1; } }
  .eyes{ transform-box:fill-box; transform-origin:50% 50%; animation:blink 5.4s infinite; }
  @keyframes blink{ 0%,95.5%,100%{ transform:scaleY(1);} 97.2%{ transform:scaleY(.08);} }
  .flyorbit{ animation:orbit 7.5s ease-in-out infinite; }
  @keyframes orbit{
    0%,100%{ transform:translate(0,0); }
    20%{ transform:translate(-18px,14px); }
    45%{ transform:translate(-104px,-2px); }
    62%{ transform:translate(-86px,18px); }
    82%{ transform:translate(-22px,-8px); }
  }
  #poop.hit .flydart{ animation:flydart .55s ease-out; }
  @keyframes flydart{ 0%{ transform:translate(0,0);} 26%{ transform:translate(15px,-24px);} 100%{ transform:translate(0,0);} }
  .flyw{ transform-origin:50% 90%; animation:wing .11s linear infinite alternate; }
  @keyframes wing{ from{ transform:scaleY(1);} to{ transform:scaleY(.34);} }
  .aroma{ animation:aroma 4.4s ease-in-out infinite; }
  @keyframes aroma{ 0%{ opacity:0; transform:translateY(8px);} 35%{ opacity:.45;} 70%{ opacity:.28;} 100%{ opacity:0; transform:translateY(-16px);} }
  .zzz{ opacity:0; transition:opacity .3s; }
  #poop.off .zzz{ opacity:.85; animation:zfloat 2.6s ease-in-out infinite; }
  #poop.off .eyes{ animation:none; transform:scaleY(.1); }
  #poop.off .aroma{ animation-play-state:paused; }
  @keyframes zfloat{ 0%,100%{ transform:translate(0,0);} 50%{ transform:translate(4px,-7px);} }

  .life{ position:absolute; inset:6%; pointer-events:none; z-index:3; overflow:hidden; border-radius:16px; }
  .wisp{
    position:absolute; left:50%; bottom:38%; width:12px; height:22px; margin-left:-6px;
    border-radius:50%; background:rgba(139,98,55,.22); filter:blur(3px);
    animation:aroma 4.2s ease-in-out infinite;
  }
  .wisp.b{ left:36%; animation-delay:.7s; width:9px; height:16px; }
  .wisp.c{ left:64%; animation-delay:1.5s; width:8px; height:18px; }
  .zz{
    position:absolute; right:12%; top:14%; opacity:0;
    font-family:'Unbounded'; font-weight:900; font-size:18px; color:var(--muted);
  }
  .zz.z2{ right:6%; top:7%; font-size:14px; }
  .zz.z3{ right:16%; top:3%; font-size:22px; }
  .poopwrap.empty .zz{ opacity:.9; animation:zfloat 2.4s ease-in-out infinite; }
  .poopwrap.empty .zz.z2{ animation-delay:.35s; }
  .poopwrap.empty .zz.z3{ animation-delay:.7s; }
  .poopwrap.empty .wisp{ opacity:0; }
  .poopwrap.crit{ animation:punch .28s ease; }
  @keyframes punch{
    0%,100%{ transform:translate(0,0); }
    25%{ transform:translate(-5px,2px); }
    50%{ transform:translate(5px,-2px); }
    75%{ transform:translate(-3px,1px); }
  }
  .hint{ font-size:13px; color:var(--muted); font-weight:600; min-height:18px; text-align:center; padding:0 24px; }
  .hint.warn{ color:var(--red); font-weight:800; }

  /* fx layer */
  #fx{ position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:30; }
  .fly{
    position:absolute; font-family:'Unbounded'; font-weight:700; font-size:18px; color:#5a2e14;
    text-shadow:0 1px 0 #fff8ef, 0 2px 8px rgba(255,248,239,.9); animation:flyup .8s ease-out forwards; will-change:transform,opacity;
  }
  @keyframes flyup{ to{ transform:translateY(-110px) scale(1.12); opacity:0; } }
  .coinp{
    position:absolute; width:13px; height:13px; border-radius:50%;
    background:radial-gradient(circle at 32% 30%, var(--gold2), var(--gold) 65%, #96702a);
    box-shadow:0 1px 6px rgba(0,0,0,.5); animation:coinfly .65s ease-out forwards; will-change:transform,opacity;
  }
  @keyframes coinfly{ to{ transform:translate(var(--dx), var(--dy)); opacity:0; } }
  .fly.big{ font-size:24px; color:#8a3a12; }
  .fly.crit{ font-size:26px; color:#b86a10; letter-spacing:.04em; }
  .wave{
    position:absolute; width:20px; height:20px; margin:-10px 0 0 -10px; border-radius:50%;
    border:2px solid var(--gold2); animation:wave .46s cubic-bezier(.2,.7,.3,1) forwards; will-change:transform,opacity;
  }
  @keyframes wave{ from{ transform:scale(.35); opacity:.9; } to{ transform:scale(4.6); opacity:0; } }
  .spark{
    position:absolute; width:6px; height:6px; margin:-3px 0 0 -3px; border-radius:2px;
    background:var(--gold2); box-shadow:0 0 8px var(--gold);
    animation:sparkfly .55s ease-out forwards; will-change:transform,opacity;
  }
  @keyframes sparkfly{ to{ transform:translate(var(--dx),var(--dy)) rotate(200deg) scale(.2); opacity:0; } }
  .splat{
    position:absolute; width:9px; height:9px; margin:-4px 0 0 -4px;
    border-radius:50% 40% 50% 45%; background:#6b3a1f;
    animation:splatfall .7s ease-in forwards; will-change:transform,opacity;
  }
  @keyframes splatfall{ to{ transform:translate(var(--dx),var(--dy)) rotate(130deg) scale(.2); opacity:0; } }
  .starbit{
    position:absolute; width:9px; height:9px; margin:-4px;
    background:var(--gold2);
    clip-path:polygon(50% 0,61% 35%,100% 35%,68% 57%,79% 100%,50% 72%,21% 100%,32% 57%,0 35%,39% 35%);
    animation:sparkfly .6s ease-out forwards;
  }

  /* list screens */
  .scr-pad{ flex:1; overflow-y:auto; padding:8px 0 20px; overscroll-behavior:contain; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
  .scr-title{ padding:10px 16px 6px; font-family:'Unbounded'; font-weight:700; font-size:15px; letter-spacing:.06em; }
  .scr-sub{ padding:0 16px 12px; font-size:12.5px; color:var(--muted); }

  /* upgrades */
  .uprow{
    display:flex; align-items:center; gap:12px; padding:14px 16px;
    border-top:1px solid var(--border);
  }
  .uprow:last-child{ border-bottom:1px solid var(--border); }
  .upico{
    flex:none; width:44px; height:44px; border-radius:13px; background:var(--surface);
    border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--gold);
  }
  .upmid{ flex:1; min-width:0; }
  .upmid .t{ font-weight:800; font-size:14.5px; }
  .upmid .d{ font-size:12px; color:var(--muted); margin-top:2px; }
  .upmid .d b{ color:var(--gold); }
  .buy{
    flex:none; display:flex; flex-direction:column; align-items:center; gap:3px;
    border:none; cursor:pointer; background:none; padding:0;
  }
  .buy .cost{
    font-family:'Unbounded'; font-weight:700; font-size:11.5px; color:var(--goldink);
    background:linear-gradient(180deg,var(--gold2),var(--gold)); border-radius:11px; padding:8px 13px;
    box-shadow:0 4px 14px rgba(232,163,61,.25); white-space:nowrap;
  }
  .buy .lvl{ font-size:10.5px; color:var(--muted); font-weight:700; letter-spacing:.06em; }
  .buy:disabled .cost{ background:var(--surface2); color:var(--muted); box-shadow:none; }
  .buy:not(:disabled):active .cost{ transform:scale(.95); }

  /* pack */
  .squad-hero{ padding:8px 16px 4px; display:flex; align-items:baseline; gap:10px; }
  .squad-hero .n{ font-family:'Unbounded'; font-weight:900; font-size:44px; color:var(--gold); }
  .squad-hero .lbl{ font-size:12px; color:var(--muted); font-weight:700; }
  .bonusline{
    margin:8px 16px; padding:10px 14px; border-radius:13px; background:var(--surface);
    border:1px solid var(--border); font-size:12.5px; color:var(--muted);
  }
  .bonusline b{ color:var(--gold); }
  .btn-primary{
    display:flex; align-items:center; justify-content:center; gap:8px; width:calc(100% - 32px);
    margin:10px 16px 0; padding:15px; border:none; border-radius:15px; cursor:pointer;
    font-family:'Unbounded'; font-weight:800; font-size:13.5px; letter-spacing:.04em;
    color:var(--goldink); background:linear-gradient(180deg,var(--gold2),var(--gold));
    box-shadow:0 6px 20px rgba(232,163,61,.3); box-sizing:border-box;
  }
  .btn-primary:active{ transform:scale(.98); }
  .linkrow{
    margin:12px 16px 4px; display:flex; align-items:center; gap:8px;
    background:var(--surface); border:1px dashed var(--border); border-radius:12px; padding:10px 12px;
  }
  .linkrow span{ flex:1; font-family:ui-monospace,monospace; font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .empty{
    margin:16px; padding:22px 18px; border:1.5px dashed var(--border); border-radius:16px;
    text-align:center; font-size:13px; color:var(--muted); line-height:1.55;
  }
  .note{ padding:0 16px; font-size:11.5px; color:var(--muted); opacity:.8; line-height:1.5; }
  .stars-stub{
    margin:16px; padding:14px; width:calc(100% - 32px); border-radius:14px; cursor:pointer;
    background:var(--surface); border:1px solid var(--border); color:var(--muted);
    font-family:'Manrope'; font-weight:800; font-size:13px; text-align:center;
  }
  .stars-stub b{ color:var(--gold); }

  /* ---------- tabbar ---------- */
  .tabbar{
    display:flex; border-top:1px solid var(--border); background:var(--bg2);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .tab{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:10px 0 9px; background:none; border:none; cursor:pointer;
    color:var(--muted); font-family:'Manrope'; font-weight:800; font-size:10.5px; letter-spacing:.06em;
  }
  .tab svg{ width:22px; height:22px; }
  .tab.on{ color:var(--gold); }
  .tab:active{ transform:scale(.95); }
  .tab{ font-size:9.5px; }

  .qrow{
    display:flex; align-items:center; gap:12px; padding:12px 16px;
    border-top:1px solid var(--border);
  }
  .qrow .t{ font-weight:800; font-size:14px; }
  .qrow .d{ font-size:12px; color:var(--muted); margin-top:2px; }
  .qrow .claim{
    flex:none; border:none; cursor:pointer; border-radius:11px; padding:10px 12px;
    font-family:'Unbounded'; font-weight:700; font-size:11px; color:var(--goldink);
    background:linear-gradient(180deg,var(--gold2),var(--gold));
    min-height:44px; min-width:44px;
  }
  .qrow .claim:disabled{ background:var(--surface2); color:var(--muted); }
  .skingrid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:8px 16px 18px; }
  .skin{
    min-height:72px; border:1px solid var(--border); background:var(--surface); color:var(--ink);
    border-radius:14px; cursor:pointer; padding:12px 10px; text-align:left; font-weight:800; font-size:13px;
  }
  .skin small{ display:block; font-weight:600; color:var(--muted); margin-top:4px; font-size:11px; }
  .skin{ display:flex; align-items:center; gap:10px; }
  .skin img{ width:44px; height:44px; border-radius:10px; object-fit:cover; flex:none; background:var(--bg); }
  .skin .skinlab{ flex:1; min-width:0; }
  .skin.on{ border-color:var(--gold); color:var(--gold); }
  .skin:disabled{ opacity:.45; cursor:default; }
  .streak{ margin:8px 16px; padding:10px 14px; border-radius:13px; background:var(--surface); border:1px solid var(--border); font-size:13px; color:var(--muted); }
  .streak b{ color:var(--gold); }
  /* fridge-v1 */
  .fridge{
    display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
    padding:8px 16px 10px;
  }
  .food{
    min-height:72px; border:1px solid var(--border); background:var(--surface); color:var(--ink);
    border-radius:14px; cursor:pointer; padding:8px 6px; text-align:center;
    font-weight:800; font-size:12px;
  }
  .food .fico{ display:block; font-size:22px; line-height:1.15; }
  .food small{ display:block; font-weight:600; color:var(--muted); margin-top:3px; font-size:10px; }
  .food.on{ border-color:var(--gold); color:var(--gold); }
  .food.have{ background:var(--surface2); }
  .food:disabled{ opacity:.45; cursor:default; }
  .plate{
    margin:4px 16px 8px; display:flex; align-items:center; gap:8px;
  }
  .slot{
    flex:1; min-height:52px; border:1.5px dashed var(--border); border-radius:14px;
    background:var(--surface); color:var(--muted); font-weight:800; font-size:12px;
    display:flex; align-items:center; justify-content:center; cursor:pointer; padding:8px;
  }
  .slot.full{ border-style:solid; border-color:var(--gold); color:var(--ink); }
  #mixBtn{
    flex:none; min-width:88px; min-height:52px; border:none; border-radius:14px; cursor:pointer;
    font-family:'Unbounded'; font-weight:800; font-size:11px; color:var(--goldink);
    background:linear-gradient(180deg,var(--gold2),var(--gold)); padding:8px 10px;
  }
  #mixBtn:disabled{ background:var(--surface2); color:var(--muted); }
  .recipe{
    padding:10px 16px; border-top:1px solid var(--border);
  }
  .recipe .t{ font-weight:800; font-size:14px; }
  .recipe .d{ font-size:12px; color:var(--muted); margin-top:2px; }
  .recipe.on .t{ color:var(--gold); }

  /* ---------- poop grown overlay ---------- */
  #openOverlay{
    position:absolute; inset:0; z-index:60; display:none;
    background:#100804; align-items:center; justify-content:center;
  }
  #openOverlay.show{ display:flex; }
  .opencard{
    position:relative; text-align:center; padding:28px 20px 22px; width:min(88vw,340px);
    background:radial-gradient(90% 80% at 50% 30%, #2a1b0c 0%, #140c06 72%);
    border:1px solid var(--border); border-radius:24px;
  }
  .rays{
    position:absolute; left:50%; top:38%; width:420px; height:420px; transform:translate(-50%,-50%);
    background:conic-gradient(from 0deg, transparent 0 14deg, rgba(232,163,61,.14) 14deg 22deg, transparent 22deg 36deg, rgba(232,163,61,.14) 36deg 44deg, transparent 44deg 58deg, rgba(232,163,61,.14) 58deg 66deg, transparent 66deg 80deg, rgba(232,163,61,.14) 80deg 88deg, transparent 88deg 130deg, rgba(232,163,61,.14) 130deg 138deg, transparent 138deg 180deg, rgba(232,163,61,.1) 180deg 190deg, transparent 190deg 260deg, rgba(232,163,61,.12) 260deg 268deg, transparent 268deg 320deg, rgba(232,163,61,.1) 320deg 328deg, transparent 328deg);
    border-radius:50%; animation:spin 14s linear infinite; opacity:0; transition:opacity .4s;
  }
  #openOverlay.show .rays{ opacity:1; }
  #openOverlay.gold .rays{ filter:brightness(1.6); }
  @keyframes spin{ to{ transform:translate(-50%,-50%) rotate(360deg); } }
  .openpoop{ position:relative; width:200px; margin:6px auto 10px; }
  .openpoop img{ width:100%; display:block; border-radius:16px; filter:drop-shadow(0 14px 40px rgba(232,163,61,.35)); }
  .openpoop .rise{ animation:rise .6s cubic-bezier(.2,1.5,.4,1); }
  @keyframes rise{ from{ transform:translateY(30px) scale(.6); opacity:0; } }
  .opentag{ font-family:'Unbounded'; font-weight:700; font-size:12px; letter-spacing:.24em; color:var(--muted); }
  .openrew{ font-family:'Unbounded'; font-weight:900; font-size:38px; color:var(--gold2); margin:8px 0 2px; text-shadow:0 4px 24px rgba(232,163,61,.4); }
  .opensub{ font-size:12.5px; color:var(--muted); margin-bottom:18px; }
  #collectBtn{ width:100%; margin-left:0; margin-right:0; }

  /* golden poop recolor (CSS перекрывает fill-атрибуты) */
  #openOverlay.gold .p1{ fill:url(#o-gd1); }
  #openOverlay.gold .p2{ fill:url(#o-gd2); }
  #openOverlay.gold .p3{ fill:url(#o-gd3); }
  #openOverlay.gold .p4{ fill:url(#o-gd4); }
  #openOverlay.gold .pstroke{ stroke:#78530f; }
  #openOverlay.gold .sheen{ stroke:#ffeab5; }

  /* toast */
  #toast{
    position:absolute; left:50%; bottom:calc(env(safe-area-inset-bottom) + 78px); transform:translateX(-50%) translateY(8px);
    background:var(--surface2); border:1px solid var(--border); color:var(--ink);
    font-size:13px; font-weight:700; padding:10px 18px; border-radius:99px; z-index:90;
    opacity:0; pointer-events:none; transition:.22s ease; max-width:86%; text-align:center;
  }
  #toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

  #dayOverlay{
    position:absolute; inset:0; z-index:70; display:none;
    background:#d7ece8; align-items:center; justify-content:center;
    padding:16px; overflow:auto;
  }
  #dayOverlay.show{ display:flex; }
  .daycard{
    position:relative; width:min(100%,340px); max-height:100%; overflow:auto;
    background:var(--surface); border:1px solid var(--border); border-radius:22px;
    padding:22px 18px 16px; text-align:center;
  }
  .dayx{
    position:absolute; top:8px; right:8px; width:44px; height:44px;
    border:0; background:transparent; color:var(--ink); font-size:28px; cursor:pointer; line-height:1;
  }
  .daytag{ font-family:'Unbounded'; font-weight:700; font-size:11px; letter-spacing:.18em; color:var(--muted); padding:0 44px; }
  .dayscramble{ font-family:'Unbounded'; font-weight:900; font-size:clamp(16px, 5.4vw, 22px); letter-spacing:.12em; color:var(--ink); margin:10px 0 6px; max-width:100%; word-break:break-word; }
  .dayguess{
    min-height:44px; display:flex; gap:6px; justify-content:center; align-items:center; flex-wrap:nowrap;
    margin:8px 0; width:100%;
  }
  .dayguess .slot{
    flex:1 1 0; max-width:40px; min-width:0; width:auto; height:44px; border-radius:10px; border:1px solid var(--border);
    background:var(--surface2); font-family:'Unbounded'; font-weight:800; font-size:clamp(14px, 4vw, 18px);
    display:flex; align-items:center; justify-content:center;
  }
  .daykeys{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:8px 0 12px; }
  .daykeys .key{
    min-width:44px; min-height:44px; border-radius:12px; border:1px solid var(--border);
    background:var(--surface2); color:var(--ink); font-family:'Unbounded'; font-weight:800; font-size:16px; cursor:pointer;
  }
  .daykeys .key:disabled{ opacity:.35; }
  .naborlist{ display:flex; flex-direction:column; gap:8px; margin:12px 0; }
  .nabor-food{
    display:flex; align-items:center; gap:10px; min-height:48px; padding:8px 12px;
    border-radius:14px; border:1px solid var(--border); background:var(--surface2);
    text-align:left; cursor:pointer; color:var(--ink); font-weight:700; width:100%;
  }
  .nabor-food .ico{ font-size:22px; }
  .nabor-food .nm{ flex:1; }
  .nabor-food .st{ font-size:12px; color:var(--muted); }
  .nabor-food.have{ border-color:var(--gold); }
  .daysub{ font-size:12.5px; color:var(--muted); margin-bottom:14px; }
  #dayGo{ width:100%; margin-left:0; margin-right:0; }

  @media (prefers-reduced-motion: reduce){
    *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
  }
