:root{
  --enamel:#183025;--gold:#e9c46a;--gold-hi:#fff0b8;--gold-lo:#a87a28;
  --cream:#fff7e0;--cream-dim:#e8dcc0;--ink:#2c3a2b;--muted:#6d6a52;
  --ui-scale:1;--safe-bottom:max(16px,env(safe-area-inset-bottom));
  --surface:linear-gradient(160deg,#23422fe8,#132a1fe0);--surface-solid:linear-gradient(160deg,#23422f,#132a1f);
  --gem-common:linear-gradient(135deg,#d9f0b8,#6f9a46);--gem-uncommon:linear-gradient(135deg,#c7f1ff,#2f86a8);--gem-rare:linear-gradient(135deg,#ecd8ff,#7a4fc0);--gem-epic:linear-gradient(135deg,#ffd6de,#c0476a);--gem-legendary:linear-gradient(135deg,#fff3b0,#d08f12);
  font-family:Georgia,'Times New Roman',serif;color:var(--ink);background:#e4ecdc;color-scheme:light;font-synthesis:none;
}
html{font-size:calc(16px * var(--ui-scale))}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;overflow:hidden}
button,select,input{font:inherit;color:inherit}
button,a,select,input{touch-action:manipulation}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
kbd{display:inline-flex;align-items:center;justify-content:center;min-width:1.7em;height:1.7em;padding:0 .45em;border-radius:.45em;background:linear-gradient(#fff6d6,#e9c46a);border:1px solid #fff3c4;box-shadow:0 2px 0 #9b7224,inset 0 1px 0 #fff;font:700 .75rem/1 system-ui,sans-serif;color:#3a2a08}
.eyebrow{font:700 .6rem/1.3 system-ui,sans-serif;letter-spacing:.16em;text-transform:uppercase;color:var(--gold)}
#game{position:relative;width:100vw;height:100svh;overflow:hidden}
#garden{display:block;width:100%;height:100%;touch-action:none;outline:none}

/* top HUD: enamel and gold */
.hud-top{position:absolute;inset:0 0 auto;display:flex;align-items:flex-start;gap:14px;padding:16px 20px;pointer-events:none;background:linear-gradient(#0b1a1233,transparent)}
.hud-top>*{pointer-events:auto}
.back,.level-card,.gold-pill,.chip,.menu-buttons button{background:var(--surface);border:1.5px solid #e9c46acc;box-shadow:0 10px 28px #0b1a1247,inset 0 1px 0 #fff4c433;color:var(--cream);backdrop-filter:blur(8px)}
.back{flex-shrink:0;text-decoration:none;border-radius:40px;padding:.5rem 1rem;font-size:1.05rem;white-space:nowrap}
.back span{font-style:italic;font-size:1.3rem;color:var(--gold-hi)}
.level-card{display:flex;gap:14px;align-items:center;padding:.5rem 1.2rem .5rem .5rem;border-radius:999px 26px 26px 999px;max-width:min(460px,46vw)}
.orb{position:relative;width:4rem;height:4rem;flex-shrink:0}
.orb svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.ring-bg{fill:none;stroke:#0b1a1299;stroke-width:6}
.ring{fill:none;stroke:url(#xp-gold);stroke-width:6;stroke-linecap:round;stroke-dasharray:175.9;stroke-dashoffset:175.9;transition:stroke-dashoffset .6s cubic-bezier(.3,1.4,.5,1);filter:drop-shadow(0 0 3px #ffd76a)}
.orb-core{position:absolute;inset:7px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#fff9d8,#f2c95a 38%,#b17a1f 75%,#6e4810);box-shadow:inset 0 -4px 8px #5a3a0a88,inset 0 3px 6px #fffbe6aa,0 0 18px #ffd76a66}
.orb-core span{font:700 1.45rem/1 Georgia,serif;color:#3b2606;text-shadow:0 1px 0 #fff3c4}
.orb-leaf{position:absolute;width:16px;height:9px;border-radius:0 100% 0 100%;background:linear-gradient(135deg,#bfe08f,#5d8a3c);box-shadow:0 1px 2px #0005}
.orb-leaf.l1{left:-4px;bottom:6px;transform:rotate(-35deg)}.orb-leaf.l2{right:-5px;top:4px;transform:rotate(145deg)}
.level-card.flash .orb-core{animation:orbflash 1.4s ease-out}
@keyframes orbflash{30%{box-shadow:0 0 40px 14px #ffe58acc}}
.dot-sep{color:var(--gold-lo);margin:0 .2em}
#xp-text{color:var(--cream-dim)}
.objective-ribbon{display:flex;align-items:center;gap:.5rem;margin-top:.25rem}
.objective-ribbon img{width:2.1rem;height:2.1rem;object-fit:contain;filter:drop-shadow(0 2px 3px #0008)}
.objective{margin:0;font-size:1.05rem;line-height:1.2;color:#fffbe9;text-shadow:0 1px 2px #0008}
.hint{margin:.25rem 0 0;font:.74rem/1.35 system-ui,sans-serif;color:#d9d0b4}
.hint:empty{display:none}
.hud-right{margin-left:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;max-width:54vw}
.gold-pill,.chip,.menu-buttons button{display:flex;align-items:center;gap:.5rem;min-height:2.9rem;padding:0 1rem;border-radius:2rem;font:.85rem system-ui,sans-serif}
.menu-buttons button:hover,.chip:hover{border-color:var(--gold-hi);box-shadow:0 8px 24px #0b1a1240,0 0 0 3px #e9c46a44}
.gold-pill{padding:0 1.1rem 0 .35rem;font:700 1.25rem Georgia,serif;color:var(--gold-hi);text-shadow:0 1px 0 #6b4a10,0 0 10px #ffd76a55}
.coin3d{width:2.3rem;height:2.3rem;object-fit:contain;filter:drop-shadow(0 2px 3px #0009)}
.gold-pill.bump{animation:bump .5s}
.gold-pill.bump .coin3d{animation:coinspin .6s}
@keyframes bump{35%{transform:scale(1.12)}}
@keyframes coinspin{50%{transform:rotateY(180deg) scale(1.15)}}
.chip{padding-left:.35rem;gap:.55rem}
.dial{position:relative;width:2.3rem;height:2.3rem;flex-shrink:0}
.dial svg{position:absolute;inset:0;width:100%;height:100%}
.dial-track{fill:#0b1a1266;stroke:#e9c46a77;stroke-width:1.5}
.dial-night{fill:#3b4a86aa}
.dial-sun{fill:#ffd76a;stroke:#fff6d0;stroke-width:1;filter:drop-shadow(0 0 3px #ffd76a)}
.dial-sun.moon{fill:#e8ecff;stroke:#fff;filter:drop-shadow(0 0 3px #b7c4ff)}
#weather-icon{position:absolute;inset:0;display:grid;place-items:center;font-size:.95rem;text-shadow:0 1px 2px #000a}
.chip-copy{display:flex;flex-direction:column;line-height:1.15;text-align:left}
#weather-name{font-weight:600}
.chip .clock{color:var(--cream-dim);font-size:.72rem}
.menu-buttons{display:flex;gap:6px}
.btn-icon{width:1.9rem;height:1.9rem;object-fit:contain;margin-left:-.4rem;filter:drop-shadow(0 2px 2px #0008)}
.book{width:1.3rem;height:1.6rem;border-radius:2px 5px 5px 2px;background:linear-gradient(90deg,#4b2f6b,#7a52a8);box-shadow:inset 3px 0 0 #2d1a44,inset -2px 0 0 #e9c46a,0 0 10px #b48cff66;position:relative}
.book::after{content:'✦';position:absolute;inset:0;display:grid;place-items:center;font-size:.7rem;color:var(--gold-hi)}
.gear{font-size:1.2rem;color:var(--gold-hi)}
.count{background:linear-gradient(#fff3c4,#e9c46a);color:#3a2a08;border-radius:1rem;padding:.08rem .5rem;font-size:.72rem;font-weight:700}
.save-status{margin-left:auto;font:700 .66rem system-ui,sans-serif;color:#2c3a14;background:linear-gradient(#e9f7c9,#a9d07a);border-radius:1rem;padding:.15rem .6rem .15rem .45rem;box-shadow:0 2px 6px #0004}
.save-status::before{content:'✓ '}
.save-status.error{color:#fff;background:linear-gradient(#e9907a,#b4553c)}
.save-status.error::before{content:'! '}

/* floating numbers over the beds */
.floaters{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
.floater{position:absolute;transform:translate(-50%,-50%);font:700 1.15rem Georgia,serif;white-space:nowrap;color:#fff8d6;text-shadow:0 2px 0 #3a2a08,0 0 3px #3a2a08,0 0 14px #ffd76a;animation:floatup 1.7s ease-out forwards;display:flex;align-items:center;gap:.3rem}
.floater img{width:2rem;height:2rem;filter:drop-shadow(0 2px 2px #0008)}
.floater.xp{color:#d9f7b0;font-size:.95rem;text-shadow:0 2px 0 #1c3a12,0 0 3px #1c3a12,0 0 12px #9fe36a}
.floater.gold{color:#ffe27a;font-size:1.45rem}
.floater.rare{font-size:1.5rem;color:#fff1a8;text-shadow:0 2px 0 #3a2a08,0 0 4px #3a2a08,0 0 18px #ff9bd0,0 0 30px #ffd257;animation:floatup 2.3s ease-out forwards}
@keyframes floatup{0%{opacity:0;transform:translate(-50%,-30%) scale(.6)}15%{opacity:1;transform:translate(-50%,-80%) scale(1.15)}30%{transform:translate(-50%,-95%) scale(1)}100%{opacity:0;transform:translate(-50%,-260%)}}
@keyframes shimmer{to{background-position:200% 0}}

/* toasts and banner */
.toasts{position:absolute;top:124px;right:20px;display:flex;flex-direction:column;align-items:flex-end;gap:8px;pointer-events:none;width:min(400px,92vw);z-index:4}
body:has(.panel:not([hidden])) .toasts{right:auto;left:20px;align-items:flex-start;top:150px}
.toast{display:flex;align-items:center;gap:.8rem;border-radius:18px;padding:.55rem 1.1rem;font-size:.98rem;text-align:left;animation:rise .4s cubic-bezier(.2,1.4,.4,1);background:var(--surface-solid);border:1.5px solid #e9c46acc;box-shadow:0 14px 34px #0b1a1255;color:var(--cream)}
.toast.has-icon{padding-left:.55rem}
.toast img{width:3rem;height:3rem;object-fit:contain;flex-shrink:0;filter:drop-shadow(0 3px 4px #000a)}
.toast b{color:var(--gold-hi)}
.toast small{display:block;font:.74rem/1.35 system-ui,sans-serif;color:#d9d0b4;margin-top:2px}
.toast.gold{border-color:#ffd76a}
.toast.rare{border:2px solid transparent;background:linear-gradient(160deg,#2c2347f5,#1a2a3af2) padding-box,linear-gradient(90deg,#ffd257,#ff8ec8,#9fd0ff,#b8f28a,#ffd257) border-box;background-size:100% 100%,300% 100%;animation:rise .4s cubic-bezier(.2,1.4,.4,1),rainbowborder 3s linear infinite}
@keyframes rainbowborder{to{background-position:0 0,300% 0}}
.toast.out{opacity:0;transform:translateY(-8px);transition:.4s}
@keyframes rise{from{opacity:0;transform:translateY(14px) scale(.92)}}
.banner{position:absolute;top:40%;left:50%;transform:translate(-50%,-50%);text-align:center;z-index:5;pointer-events:none;width:min(540px,92vw);padding:2.4rem 1rem 1rem}
.banner .rays{position:absolute;left:50%;top:55%;width:600px;height:600px;margin:-300px;border-radius:50%;background:repeating-conic-gradient(from 0deg,#ffe58a66 0 7deg,transparent 7deg 18deg);-webkit-mask:radial-gradient(circle,#000 12%,transparent 62%);mask:radial-gradient(circle,#000 12%,transparent 62%);animation:spin 14s linear infinite;z-index:-1}
.banner .plate{position:relative;display:inline-block;padding:1rem 2.2rem 1.1rem;border-radius:22px;background:var(--surface-solid);border:2px solid #e9c46a;box-shadow:0 22px 60px #0b1a1270,inset 0 1px 0 #fff4c455;animation:pop .6s cubic-bezier(.2,1.6,.4,1)}
.banner img{width:5.5rem;height:5.5rem;object-fit:contain;margin:-3.6rem auto .1rem;display:block;filter:drop-shadow(0 6px 8px #000a)}
.banner h3{margin:.25rem 0;font-size:2.3rem;font-weight:400;letter-spacing:-.02em;background:linear-gradient(#fff6c8,#f0c45a 60%,#c08a28);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 2px 0 #3a2a08)}
.banner p{margin:.3rem auto 0;font:.86rem/1.45 system-ui,sans-serif;color:#e6dcc0;max-width:380px}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pop{from{opacity:0;transform:scale(.6)}}

/* bottom: prompt + jewelled seed plaques */
.bottom{position:absolute;left:50%;bottom:var(--safe-bottom);transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:9px;width:min(760px,calc(100% - 32px));pointer-events:none}
.bottom>*{pointer-events:auto}
.message{margin:0;min-height:1.2em;font:600 .86rem system-ui,sans-serif;color:#fff;text-shadow:0 1px 3px #000c,0 0 12px #000a;text-align:center}
.prompt{display:flex;align-items:center;gap:.65rem;border-radius:2rem;padding:.4rem 1.2rem .4rem .45rem;font-size:1.02rem;background:var(--surface-solid);border:1.5px solid #e9c46acc;color:var(--cream);box-shadow:0 10px 26px #0b1a1250}
.prompt img{width:2rem;height:2rem;object-fit:contain;margin:-.3rem -.15rem;filter:drop-shadow(0 2px 2px #0008)}
.prompt.blocked{border-color:#c98f7a;background:linear-gradient(160deg,#4a3329f0,#2e2019ee)}
.hotbar{display:flex;gap:7px;padding:7px;border-radius:22px;max-width:100%;overflow-x:auto;scrollbar-width:none;background:var(--surface);border:1.5px solid #e9c46aaa;box-shadow:0 14px 34px #0b1a1250,inset 0 1px 0 #fff4c433}
.hotbar::-webkit-scrollbar{display:none}
.hotbar.overflowing{-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent)}
.seed{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:4.9rem;height:5.2rem;border-radius:15px;border:1.5px solid #e9c46a55;background:radial-gradient(circle at 50% 38%,#3b6a4a,#1a3326 72%);font:600 .66rem/1.1 system-ui,sans-serif;color:var(--cream);padding:4px 6px 7px;overflow:hidden;transition:transform .15s,border-color .15s}
.seed:hover{transform:translateY(-3px);border-color:#e9c46a}
.seed img{position:absolute;left:50%;top:1px;width:3.9rem;height:3.9rem;transform:translateX(-50%);object-fit:contain;filter:drop-shadow(0 3px 3px #000a);transition:transform .2s}
.seed:hover img,.seed[aria-pressed=true] img{transform:translateX(-50%) scale(1.08) translateY(-2px)}
.seed .name{position:relative;text-shadow:0 1px 2px #000}
.seed .n{position:absolute;top:4px;right:5px;min-width:1.35rem;height:1.35rem;border-radius:1rem;display:grid;place-items:center;font-size:.7rem;background:linear-gradient(#fff3c4,#e9c46a);color:#3a2a08;box-shadow:0 1px 0 #8a6420}
.seed .k{position:absolute;top:5px;left:7px;color:#e9c46aaa;font-size:.62rem}
.seed .gem{position:absolute;left:50%;bottom:0;width:60%;height:3px;transform:translateX(-50%);border-radius:3px 3px 0 0}
@property --a{syntax:'<angle>';inherits:false;initial-value:0deg}
.seed[aria-pressed=true]{border:2px solid transparent;background:radial-gradient(circle at 50% 38%,#4f8a5f,#1f3d2c 72%) padding-box,conic-gradient(from var(--a),#fff3c4,#e9c46a,#a87a28,#e9c46a,#fff3c4) border-box;animation:ring 3s linear infinite;box-shadow:0 0 18px #ffd76a66}
@keyframes ring{to{--a:360deg}}
.seed.empty{min-width:14rem;height:3.4rem;justify-content:center;color:var(--cream-dim);font-size:.78rem;cursor:default}

/* touch controls */
.joystick{position:absolute;left:22px;bottom:calc(var(--safe-bottom) + 118px);width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,#18302555,#18302599);border:2px solid #e9c46aaa;display:none;touch-action:none;box-shadow:inset 0 0 20px #0006}
.joy-label{position:absolute;left:50%;bottom:-1.4rem;transform:translateX(-50%);font:700 .62rem system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#fffbe9;text-shadow:0 1px 3px #000c}
.joystick .knob{position:absolute;left:50%;top:50%;width:54px;height:54px;margin:-27px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff6d0,#e9c46a 60%,#a87a28);box-shadow:0 4px 12px #0007}
.action-button{position:absolute;right:20px;bottom:calc(var(--safe-bottom) + 118px);width:100px;height:100px;border-radius:50%;border:2.5px solid #fff0b8;background:radial-gradient(circle at 35% 28%,#6fa26c,#2a5238 65%,#183025);color:var(--cream);font:.95rem Georgia,serif;box-shadow:0 12px 30px #0b1a1270,0 0 0 5px #e9c46a55,inset 0 2px 0 #ffffff33;padding:8px;line-height:1.1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.action-button img{width:2.7rem;height:2.7rem;object-fit:contain;filter:drop-shadow(0 2px 3px #000a)}
.action-button.blocked{background:radial-gradient(circle at 35% 28%,#9a8473,#5a4638 70%);border-color:#d8c4b0}
body.touch .joystick{display:block}
body:not(.touch) .action-button{display:none}

/* panels: parchment under an enamel header with a 3D hero */
.panel{position:absolute;top:92px;right:18px;max-height:calc(100% - 110px);width:min(470px,calc(100% - 36px));display:flex;flex-direction:column;border-radius:26px;z-index:6;animation:slide .3s cubic-bezier(.2,1.2,.4,1);overflow:hidden;background:linear-gradient(#fbf4de,#f3e6c4);border:2px solid #e9c46a;box-shadow:0 30px 80px #0b1a1266,inset 0 0 0 5px #fff8e6,inset 0 0 0 6px #e9c46a66}
@keyframes slide{from{opacity:0;transform:translateX(24px) scale(.97)}}
.panel-head{position:relative;display:flex;align-items:flex-end;gap:12px;min-height:7rem;padding:1rem 3.6rem .9rem 1.2rem;background:radial-gradient(circle at 16% 62%,#4a8460,#183025 70%);border-bottom:2px solid #e9c46a;color:var(--cream);overflow:hidden}
.panel-head::before{content:'';position:absolute;inset:0;background:repeating-conic-gradient(from 0deg at 16% 62%,#ffe58a1c 0 6deg,transparent 6deg 16deg);pointer-events:none}
.panel-hero{position:relative;width:6.6rem;height:6.6rem;margin:-1rem -.2rem -1.1rem -.5rem;flex-shrink:0;display:grid;place-items:center}
.panel-hero img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 6px 8px #000b)}
.panel-hero:empty{display:none}
.panel-titles{position:relative;flex:1;padding-bottom:.2rem}
.panel-head h2{margin:.2rem 0 0;font-weight:400;font-size:1.9rem;letter-spacing:-.02em;background:linear-gradient(#fff6c8,#f0c45a);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 2px 0 #0b1a12)}
#panel-close{position:absolute;right:.9rem;top:.9rem;width:2.4rem;height:2.4rem;border-radius:50%;border:1.5px solid #e9c46a;background:#0b1a1266;color:var(--gold-hi);font-size:1.4rem;line-height:1}
.panel-body{overflow-y:auto;padding:.9rem 1.15rem 3rem;-webkit-mask-image:linear-gradient(#000 calc(100% - 28px),transparent);mask-image:linear-gradient(#000 calc(100% - 28px),transparent);font:.88rem/1.45 system-ui,sans-serif;color:var(--ink)}
.panel-body h3{font:1.15rem Georgia,serif;margin:1.1rem 0 .45rem;color:#3d4a2c;display:flex;align-items:center;gap:.5rem}
.panel-body h3::after{content:'';flex:1;height:1px;background:linear-gradient(90deg,#c9b27a,transparent)}
.panel-body p{margin:.3rem 0}
.lede{color:var(--muted);font-style:italic;font-family:Georgia,serif}
.card{position:relative;border:1.5px solid #e2cf9b;border-radius:18px;padding:.55rem .8rem .65rem .55rem;margin:.65rem 0;background:linear-gradient(#fffaf0,#fbf1d8);display:grid;grid-template-columns:auto 1fr auto;gap:.15rem .8rem;align-items:center;box-shadow:0 3px 0 #e6d3a3,0 8px 18px #6b551f14;transition:transform .15s,box-shadow .15s}
.card:hover{transform:translateY(-2px);box-shadow:0 5px 0 #e6d3a3,0 14px 26px #6b551f22}
.card.special{border-color:#e9b84a;background:linear-gradient(#fff7e0,#fbe6b4);box-shadow:0 3px 0 #e6c56a,0 0 0 3px #f2cf6a55}
.nowrap{white-space:nowrap}

.card.locked{filter:saturate(.35);opacity:.72}
.card.selected{border-color:#6f9a46;box-shadow:0 3px 0 #b9d39a,0 0 0 3px #8fb36d55}
.card .title{font:1.05rem Georgia,serif;display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.card .meta{grid-column:2/4;color:var(--muted);font-size:.78rem;display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.15rem}
.fact{display:inline-flex;align-items:center;gap:.2rem;padding:.08rem .45rem;border-radius:1rem;background:#fff8e4;box-shadow:inset 0 0 0 1.2px #e6d6aa;font:700 .74rem system-ui,sans-serif;color:var(--ink);white-space:nowrap}
.fact.own{background:#eef6df;box-shadow:inset 0 0 0 1.5px #8fb36d}
.facts{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.45rem}
.facts.big .fact{font-size:.82rem;padding:.15rem .55rem}
.gstats img.mini{width:1.35rem;height:1.35rem;object-fit:contain;vertical-align:middle}
.fact img.mini{width:1.15rem;height:1.15rem;object-fit:contain}
.fact s{color:var(--muted);font-weight:600}
.card.offer{border-color:#f0a8c4;background:linear-gradient(#fff6fa,#fde6ef);box-shadow:0 3px 0 #f2bfd3,0 0 0 3px #f7c6d966}
.card.offer .thumb{background:radial-gradient(circle,#fff,#fbdbe7)}
.card .actions{display:flex;gap:6px;align-items:center;justify-content:flex-end}
.thumb{grid-row:span 2;width:4.4rem;height:4.4rem;border-radius:14px;display:grid;place-items:center;position:relative;background:radial-gradient(circle at 50% 40%,#ffffff,#efe2bf 70%);box-shadow:inset 0 -3px 6px #c9b27a66}
.thumb img{width:4.3rem;height:4.3rem;object-fit:contain;filter:drop-shadow(0 3px 3px #5a4a1f66)}
.thumb .gem{position:absolute;right:-4px;top:-4px;width:1.1rem;height:1.1rem;transform:rotate(45deg);border-radius:3px;border:1.5px solid #fff;box-shadow:0 1px 3px #0005}
.gem.common{background:var(--gem-common)}.gem.uncommon{background:var(--gem-uncommon)}.gem.rare{background:var(--gem-rare)}.gem.epic{background:var(--gem-epic)}.gem.legendary{background:var(--gem-legendary)}
.rarity-label{font:700 .6rem system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;padding:.1rem .45rem;border-radius:1rem;color:#fff;text-shadow:0 1px 1px #0006}
.rarity-label.common{background:#6f9a46}.rarity-label.uncommon{background:#2f86a8}.rarity-label.rare{background:#7a4fc0}.rarity-label.epic{background:#c0476a}.rarity-label.legendary{background:#c98a12}
.btn{border:1.5px solid #d6bf85;background:linear-gradient(#fffdf4,#f6e9c6);border-radius:2rem;padding:.42rem .9rem;font:700 .78rem system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 0 #c9ad6a;color:#3d4a2c;display:inline-flex;align-items:center;gap:.25rem}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn.primary,.primary{border:1.5px solid #fff0b8;background:linear-gradient(#3f7a52,#1f4a32);color:#fff8de;box-shadow:0 3px 0 #10261a,0 0 0 2px #e9c46a66}
.coinmini{width:1.15rem;height:1.15rem;object-fit:contain}
.btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.btn.lock[aria-pressed=true]{background:linear-gradient(#fff3c4,#e9c46a);border-color:#c99a2e}
.tag{display:inline-block;border-radius:1rem;padding:.1rem .5rem;font:700 .66rem system-ui,sans-serif;background:#e8efd8;color:#3d5a2c;margin-right:4px}
.tag.deal{background:linear-gradient(#ffd877,#e3a42d);color:#3a2a08}
.mut{display:inline-block;border-radius:1rem;padding:.12rem .55rem;font:700 .66rem system-ui,sans-serif;margin:0 4px 2px 0;color:#2b2208;background-size:200% 100%;animation:shimmer 2.4s linear infinite}
.mut.silver{background-image:linear-gradient(90deg,#c9ced8,#ffffff,#aeb6c4,#ffffff,#c9ced8)}
.mut.golden{background-image:linear-gradient(90deg,#f2c14e,#fff3b0,#d99a1e,#fff3b0,#f2c14e)}
.mut.giant{background-image:linear-gradient(90deg,#b9e08a,#e9ffc9,#8fc25a,#e9ffc9,#b9e08a)}
.mut.frozen{background-image:linear-gradient(90deg,#9fdcf5,#effbff,#6ec2e8,#effbff,#9fdcf5)}
.mut.rainbow{background-image:linear-gradient(90deg,#ff9bd0,#ffd257,#8ff5b0,#9fd0ff,#c98bff,#ff9bd0)}
.mut.shadow{background-image:linear-gradient(90deg,#4a3470,#8a5ad6,#33224f,#8a5ad6,#4a3470);color:#f3e8ff}
.mut.celestial{background-image:linear-gradient(90deg,#fff1c2,#ffffff,#ffd27a,#ffffff,#fff1c2);box-shadow:0 0 8px #ffd98a}
.sell-all{position:sticky;bottom:-3rem;margin:.8rem -1.15rem -3rem;padding-bottom:3rem!important;padding:.9rem 1.15rem;background:linear-gradient(#f3e6c400,#f3e6c4 30%);display:flex;flex-direction:column;gap:6px}
.sell-all .btn{padding:.8rem;font-size:.95rem;justify-content:center}
.stage-wrap{display:grid;grid-template-columns:9.5rem 1fr;gap:.9rem;align-items:center;margin:.2rem 0 .6rem;padding:.6rem;border-radius:20px;background:radial-gradient(circle at 25% 50%,#fffef6,#f1e3bd 75%);border:1.5px solid #e2cf9b}
.stage-wrap canvas{width:9.5rem;height:9.5rem}
.stage-copy h4{margin:0;font:1.25rem Georgia,serif}
.stage-copy .stage-name{font:700 .68rem system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:#8a6a2a}
.stage-pips{display:flex;gap:4px;margin:.45rem 0}
.stage-pips i{flex:1;height:5px;border-radius:3px;background:#e6d6aa}
.stage-pips i.on{background:linear-gradient(90deg,#8fb36d,#4f7a3a)}
.stage-label{font:700 .7rem system-ui,sans-serif;color:#4f7a3a;margin-bottom:.3rem}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(6.6rem,1fr));gap:.6rem;margin-top:.5rem}
.tile{position:relative;border-radius:16px;padding:.4rem .4rem .5rem;text-align:center;background:linear-gradient(#fffaf0,#f8ecd0);border:1.5px solid #e2cf9b;box-shadow:0 3px 0 #e6d3a3}
.tile img{width:4.6rem;height:4.6rem;object-fit:contain;filter:drop-shadow(0 3px 3px #5a4a1f55)}
.tile .q{position:absolute;right:.4rem;top:.4rem;font:700 .72rem system-ui,sans-serif;background:#2c3a2b;color:#fff3c4;border-radius:1rem;padding:.05rem .45rem}
.tile .nm{font:.78rem/1.2 Georgia,serif;min-height:2em}
.tile .v{font:700 .7rem system-ui,sans-serif;color:#8a6a2a}
.tile.locked{border-color:#e3b84a;background:linear-gradient(#fff6dc,#f8e3a8)}
.grid{display:grid;grid-template-columns:minmax(7.4rem,1.5fr) repeat(8,1fr);gap:4px;align-items:center;font-size:.72rem;margin-top:.6rem}
.grid .h{font-weight:700;color:var(--muted);text-align:center;font-size:.75rem;justify-self:center;align-self:end;padding-bottom:2px}
.hchip{display:inline-grid;place-items:center;min-width:1.7rem;height:1.6rem;margin:0;padding:0 .3rem;border-radius:.8rem;font:800 .7rem system-ui,sans-serif;box-shadow:0 1px 0 #0003}
.hchip.grown{background:linear-gradient(#d9f0b8,#8fb36d);color:#1f3a14}
.hchip.mut{animation:none;margin:0;padding:0 .2rem;font-size:.95rem;line-height:1;min-width:1.9rem;height:1.9rem;border-radius:50%}
.hchip.mut.celestial{box-shadow:inset 0 0 0 1.5px #d9a53c,0 0 8px #ffd98a}
.grid .hchip{font-size:1rem;min-width:1.9rem;height:1.9rem;border-radius:50%;padding:0}
.gstats{display:flex;flex-wrap:wrap;gap:.4rem;margin:.1rem 0 .45rem}
.gstats>span{display:inline-flex;align-items:center;gap:.3rem;padding:.25rem .65rem;border-radius:1rem;background:#fff8e4;box-shadow:inset 0 0 0 1.5px #e6d6aa;font:600 .8rem system-ui,sans-serif;color:var(--muted)}
.gstats b{color:var(--ink);font-size:.95rem}
.grid .lock{font:700 .78rem system-ui,sans-serif;color:#9a8a62;font-style:normal}
h3.ih{font-size:1.25rem;margin:.9rem 0 .35rem;line-height:1}
.mtiles,.wtiles{display:grid;gap:.4rem}
.mtiles{grid-template-columns:repeat(auto-fill,minmax(4.6rem,1fr))}
.mtile{position:relative;display:flex;align-items:center;gap:.35rem;padding:.3rem .45rem;border-radius:1rem;background:#fff8e4;box-shadow:inset 0 0 0 1.5px #e6d6aa}
.mtile b{font:800 .8rem system-ui,sans-serif;color:var(--ink)}
.mtile i,.wtile .perk{font-style:normal;font-size:.75rem}
.mtile .up{position:absolute;top:-.35rem;right:-.2rem;display:grid;place-items:center;width:1.1rem;height:1.1rem;border-radius:50%;background:#6f9a46;color:#fff;font-size:.7rem;box-shadow:0 1px 0 #0003}
.mtile i:not(.up){position:absolute;bottom:-.3rem;right:-.15rem;font-size:.8rem}
.mtile.boost{box-shadow:inset 0 0 0 2px #8fb36d,0 0 10px #b9e08a99;background:#f4fbe8}
.wtiles{grid-template-columns:repeat(auto-fill,minmax(4.4rem,1fr))}
.wtile{position:relative;display:grid;justify-items:center;gap:.15rem;padding:.45rem .2rem .4rem;border-radius:1rem;background:#fff8e4;box-shadow:inset 0 0 0 1.5px #e6d6aa;text-align:center}
.wtile .big{font-size:1.7rem;line-height:1}
.wtile .fav{font-size:.85rem;min-height:1.1rem;letter-spacing:.05em;color:#9a8a62;font-weight:700}
.wtile .perk{position:absolute;top:.2rem;right:.3rem}
.wtile.now{background:linear-gradient(#fffbe9,#f1f8de);box-shadow:inset 0 0 0 2px #8fb36d,0 0 12px #b9e08aaa}
.wtile.now::after{content:'';position:absolute;top:.3rem;left:.35rem;width:.5rem;height:.5rem;border-radius:50%;background:#6f9a46;box-shadow:0 0 0 2px #fff}
.wtile.locked{opacity:.55;filter:grayscale(.6)}
.legend{display:flex;flex-wrap:wrap;gap:.35rem .8rem;margin:.6rem 0 .2rem;font:.72rem system-ui,sans-serif;color:var(--muted)}
.legend>span{display:inline-flex;align-items:center;gap:.3rem}
.cell-demo{display:inline-grid;place-items:center;width:1.4rem;height:1.4rem;border-radius:6px;background:#e6d6aa;color:#9a8a62;font-weight:700}
.grid .h.species{justify-self:start;font:700 .6rem system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase}
.grid .name{display:flex;align-items:center;gap:.3rem;font:.82rem Georgia,serif;line-height:1.1}
.grid .name img{width:2.1rem;height:2.1rem;object-fit:contain;flex-shrink:0}
.grid .name.unknown{color:#8e8a6e;font-style:italic}
.grid .name small{display:block;font:.6rem system-ui,sans-serif;color:var(--muted);font-style:normal}
.grid .c{aspect-ratio:1;border-radius:9px;background:radial-gradient(circle,#f3e9cc,#e6d6aa);display:grid;place-items:center;font-weight:700;color:#b3a27a;overflow:hidden;box-shadow:inset 0 -2px 3px #c9b27a66}
.grid .c img{width:100%;height:100%;object-fit:contain}
.grid .c.y{background:radial-gradient(circle,#ffffff,#e6f2d2);color:var(--ink);box-shadow:inset 0 0 0 1.5px #8fb36d,0 0 8px #b9e08a88}
.progress{position:relative;height:.8rem;border-radius:1rem;background:#e6d6aa;overflow:hidden;margin:.4rem 0;box-shadow:inset 0 1px 2px #0002}
.progress span{display:block;height:100%;background:linear-gradient(90deg,#8fb36d,#e9c46a);border-radius:1rem;box-shadow:0 0 10px #e9c46a}
.req{list-style:none;padding:0;margin:.4rem 0}
.req li{padding:.22rem 0}
.req li::before{content:'○ ';color:#b07a5c}
.req li.ok::before{content:'✓ ';color:#4f7a3a;font-weight:700}
.picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(5.6rem,1fr));gap:.55rem;margin:.4rem 0 .6rem}
.picker.pups{grid-template-columns:repeat(auto-fill,minmax(4.9rem,1fr))}
.pick{position:relative;display:flex;flex-direction:column;align-items:center;gap:.15rem;padding:.35rem .3rem .45rem;border-radius:16px;border:1.5px solid #e2cf9b;background:radial-gradient(circle at 50% 42%,#ffffff,#f1e3bd 75%);box-shadow:0 3px 0 #e6d3a3;font:700 .74rem system-ui,sans-serif;color:#3d4a2c;transition:transform .15s,box-shadow .15s}
.pick:hover{transform:translateY(-2px);box-shadow:0 5px 0 #e6d3a3,0 10px 20px #6b551f22}
.pick img{width:100%;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 4px 4px #5a4a1f55)}
.pick.on{border-color:transparent;background:radial-gradient(circle at 50% 42%,#ffffff,#e8f2d2 75%) padding-box,conic-gradient(from var(--a),#fff3c4,#e9c46a,#a87a28,#e9c46a,#fff3c4) border-box;border:2.5px solid transparent;animation:ring 3s linear infinite;box-shadow:0 0 0 3px #e9c46a44,0 6px 16px #a87a2840}
.pick.on::after{content:'✓';position:absolute;top:.3rem;right:.35rem;width:1.3rem;height:1.3rem;border-radius:50%;display:grid;place-items:center;background:linear-gradient(#5f9a62,#2f6a40);color:#fff;font-size:.7rem;box-shadow:0 1px 0 #10261a}
.pick .talent{position:absolute;left:.3rem;top:.3rem;font-style:normal;font-size:.8rem;background:#fffbe9;border-radius:1rem;padding:0 .2rem;box-shadow:0 1px 2px #0003}
.setting{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid #e6d6aa}
.setting select,.setting input[type=range]{max-width:55%}
.setting select{padding:.35rem;border-radius:.6rem;border:1.5px solid #d6bf85;background:#fffdf4}
.setting input[type=range]{accent-color:#4f7a3a}
.odds{font-size:.76rem;color:var(--muted)}
.danger{border-color:#d9a08d;color:#94412a}

/* intro */
.intro{position:absolute;inset:0;display:grid;place-items:center;background:radial-gradient(circle,#0b1a1222,#0b1a1266);z-index:8;padding:16px}
.intro-card{position:relative;border-radius:30px;padding:2rem 2.2rem;max-width:450px;text-align:center;background:linear-gradient(#fbf4de,#f3e6c4);border:2px solid #e9c46a;box-shadow:0 30px 90px #0b1a1288,inset 0 0 0 6px #fff8e6,inset 0 0 0 7px #e9c46a66}
.intro-card .eyebrow{color:#a8792a}
.intro-card h1{font-weight:400;font-size:3.1rem;letter-spacing:-.04em;margin:.4rem 0 .6rem}
.intro-card h1 em{color:#c0644f}
.intro-card p{font-size:1rem;line-height:1.55;margin:.4rem 0}
.intro-crops{display:flex;justify-content:center;gap:.2rem;margin:.4rem 0 0;min-height:4.4rem}
.intro-crops img{width:4.6rem;height:4.6rem;object-fit:contain;filter:drop-shadow(0 4px 4px #5a4a1f55);animation:bob 3s ease-in-out infinite}
.intro-crops img:nth-child(2){animation-delay:-1s}.intro-crops img:nth-child(3){animation-delay:-2s}
@keyframes bob{50%{transform:translateY(-6px)}}
.intro-steps{text-align:left;font:.85rem/1.5 system-ui,sans-serif;color:var(--muted);padding-left:1.2rem;margin:1rem auto;max-width:330px}
.intro .primary{border-radius:2rem;padding:.95rem 1.7rem;font-size:1rem;margin-top:.6rem}
.intro .small{font:.72rem system-ui,sans-serif;color:var(--muted);margin-top:.9rem}
.loading{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);padding:1.2rem 1.7rem;border-radius:24px;z-index:9;background:var(--surface-solid);border:1.5px solid #e9c46a;color:var(--cream)}

/* accessibility modes */
body.contrast{--cream-dim:#ffffff;--muted:#3a3a2a}
body.contrast .hint,body.contrast .toast small,body.contrast .chip .clock{color:#fff}
body.contrast .message{background:#0b1a12e6;border-radius:1rem;padding:.2rem .7rem;text-shadow:none}
body.reduced *{animation:none!important;transition:none!important}

/* phones */
@media (max-width:760px){
  .hud-top{padding:10px 10px 0;gap:8px;flex-wrap:wrap}
  .back{padding:.35rem .7rem;font-size:1rem}.back span{display:none}
  .level-card{order:3;max-width:none;width:100%;padding:.35rem .8rem .35rem .35rem}
  .orb{width:3.2rem;height:3.2rem}.orb-core span{font-size:1.15rem}
  .objective{font-size:.92rem}.hint{font-size:.7rem}
  .objective-ribbon img{width:1.7rem;height:1.7rem}
  .hud-right{max-width:none;gap:4px;flex:1;flex-wrap:nowrap}
  .menu-buttons{gap:4px}
  .gold-pill,.chip,.menu-buttons button{min-height:2.4rem;padding:0 .45rem;font-size:.75rem}
  .chip-copy{display:none}
  #open-basket{position:relative}
  #open-basket .count{position:absolute;top:-6px;right:-6px;padding:.02rem .35rem;font-size:.6rem}
  .chip{padding:0 .2rem}
  .gold-pill{font-size:1rem;padding-left:.2rem}.coin3d{width:1.9rem;height:1.9rem}
  .chip{padding-left:.25rem}.dial{width:1.9rem;height:1.9rem}
  #weather-name,.menu-buttons .label{display:none}
  .btn-icon{margin-left:0;width:1.7rem;height:1.7rem}
  .save-status{position:absolute;top:56px;right:10px;font-size:0;padding:.15rem .4rem}
  .save-status::before{content:'✓';font-size:.7rem}
  .save-status.error::before{content:'!'}
  .toasts,body:has(.panel:not([hidden])) .toasts{top:150px;left:50%;right:auto;transform:translateX(-50%);align-items:center}
  .panel{top:auto;left:8px;right:8px;bottom:8px;width:auto;max-height:80svh;border-radius:22px}
  .grid{grid-template-columns:minmax(6rem,1.4fr) repeat(8,1fr);gap:3px}.grid .hchip{min-width:1.4rem;height:1.4rem;font-size:.78rem}
  .panel-head{min-height:5.6rem}.panel-hero{width:5rem;height:5rem}
  .bottom{width:calc(100% - 16px);bottom:max(10px,env(safe-area-inset-bottom))}
  .hotbar{gap:4px;padding:5px}
  .seed{min-width:3.45rem;height:4.3rem;font-size:.56rem;padding:3px 3px 6px}.seed img{width:3rem;height:3rem}.seed .n{min-width:1.15rem;height:1.15rem;font-size:.6rem;top:2px;right:2px}
  .seed .k{display:none}
  .banner h3{font-size:1.7rem}
  .stage-wrap{grid-template-columns:7.5rem 1fr}.stage-wrap canvas{width:7.5rem;height:7.5rem}
}
@media (max-height:560px) and (min-width:600px){
  .hud-top{padding:8px 12px}
  .hint{display:none}
  .joystick{bottom:20px;width:104px;height:104px}
  .action-button{bottom:20px;width:86px;height:86px}
  .panel{top:12px;bottom:12px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* the puppy's emotes and neighbours' speech bubbles */
.pup-emote{position:absolute;transform:translate(-50%,-100%);z-index:3;pointer-events:none;display:grid;place-items:center;min-width:2.2rem;height:2.2rem;padding:0 .35rem;border-radius:1.2rem;background:#fffdf4;border:1.5px solid #e9c46a;box-shadow:0 6px 14px #0b1a1240;font:700 1.1rem system-ui,sans-serif;animation:pop .35s cubic-bezier(.2,1.6,.4,1)}
.pup-emote::after{content:'';position:absolute;bottom:-6px;left:50%;margin-left:-5px;border:5px solid transparent;border-top-color:#e9c46a;border-bottom:0}
.pup-emote img{width:1.8rem;height:1.8rem}
.pup-emote .heart{color:#e8487f}.pup-emote .bang{color:#c98a12}
.speech-layer{position:absolute;inset:0;pointer-events:none;z-index:3;overflow:hidden}
.speech{position:absolute;transform:translate(-50%,-100%);max-width:15rem;padding:.45rem .75rem;border-radius:16px;background:#fffdf4;border:1.5px solid #e9c46a;box-shadow:0 8px 20px #0b1a1240;font:.82rem/1.35 Georgia,serif;color:#2c3a2b;text-align:center;animation:pop .35s cubic-bezier(.2,1.6,.4,1)}
.speech b{display:block;font:700 .6rem system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#a8792a}
.speech .heart{color:#e8487f}
.speech::after{content:'';position:absolute;bottom:-7px;left:50%;margin-left:-6px;border:6px solid transparent;border-top-color:#e9c46a;border-bottom:0}
@media (max-width:760px){.speech{max-width:11rem;font-size:.74rem}}

/* Online play: the connection screen and the "open elsewhere" overlay. */
.loading .connect{display:grid;gap:.6rem;justify-items:center;text-align:center;max-width:26rem;padding:1.2rem 1.4rem;border-radius:18px;background:#fffaf0;color:#3d3420;box-shadow:0 12px 40px #0b1a1240;font:1rem Georgia,serif}
.loading .connect small{font:.85rem system-ui,sans-serif;color:#7a6e52}
.loading .connect span{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}
.conflict{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:#0b1a1266;backdrop-filter:blur(3px)}
.conflict[hidden]{display:none}
.conflict>div{display:grid;gap:.6rem;justify-items:center;text-align:center;max-width:24rem;padding:1.3rem 1.5rem;border-radius:18px;background:#fffaf0;color:#3d3420;box-shadow:0 12px 40px #0b1a1260;font:1.05rem Georgia,serif}
.conflict small{font:.85rem system-ui,sans-serif;color:#7a6e52}

/* Friends: name tags, the visiting banner and the Friends panel. */
.speech.nametag{padding:.2rem .6rem;font:700 .72rem system-ui,sans-serif;color:#3d3420;white-space:nowrap;background:#fffaf0ee}
.speech.nametag::after{display:none}
.visit-banner{position:absolute;left:50%;top:6.4rem;transform:translateX(-50%);z-index:6;display:flex;align-items:center;gap:.7rem;padding:.35rem .45rem .35rem .9rem;border-radius:2rem;background:linear-gradient(#fff6fa,#fde6ef);border:1.5px solid #f0a8c4;box-shadow:0 6px 18px #0b1a1230;font:.9rem Georgia,serif;color:#5a3a48}
.friend-code{font:800 .95rem ui-monospace,monospace;letter-spacing:.08em;color:var(--ink);margin-left:.3rem}
ul.here{list-style:none;padding:0;margin:.4rem 0;display:grid;gap:.35rem}
ul.here li{display:flex;align-items:center;gap:.5rem}
ul.here img{width:2.2rem;height:2.2rem;object-fit:contain;border-radius:50%;background:#fff8e4;box-shadow:inset 0 0 0 1.5px #e6d6aa}
#open-friends .friends-icon{font-size:1.1rem}
@media (max-width:760px){.visit-banner{top:8.9rem;bottom:auto;padding:.2rem .25rem .2rem .7rem;gap:.4rem;font-size:.78rem;white-space:nowrap;max-width:calc(100vw - 2rem)}.visit-banner .vb-long{display:none}.visit-banner .btn{padding:.3rem .6rem;font-size:.75rem}}
/* Friends & Clan panel. */
.tabs,.seg{display:flex;gap:.35rem;margin:.1rem 0 .7rem;flex-wrap:wrap}
.tabs .btn,.seg .btn{position:relative;flex:1;min-width:0;padding:.45rem .5rem;font-size:.82rem}
.badge{position:absolute;top:-.35rem;right:-.3rem;min-width:1.1rem;height:1.1rem;padding:0 .25rem;border-radius:.6rem;background:#e8487f;color:#fff;font:800 .65rem/1.1rem system-ui,sans-serif;text-align:center;font-style:normal;box-shadow:0 1px 0 #0003}
.badge[hidden]{display:none}
#open-friends{position:relative}
ul.rows,ol.rows{list-style:none;padding:0;margin:.3rem 0 .6rem;display:grid;gap:.35rem}
.row{display:flex;align-items:center;gap:.5rem;padding:.35rem .45rem;border-radius:14px;background:#fff8e4;box-shadow:inset 0 0 0 1.2px #e6d6aa}
.row .who{flex:1;min-width:0;display:grid;line-height:1.15}
.row .who b{font:1rem Georgia,serif;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .who small{font:.7rem system-ui,sans-serif;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row .acts{display:flex;gap:.25rem;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.row .acts.col{flex-direction:column;align-items:flex-end;gap:.15rem}
.row .acts.col small{font:.68rem system-ui,sans-serif;color:var(--muted)}
.btn.icon{position:relative;min-width:2.1rem;padding:.3rem .45rem;font-size:.95rem}
img.sp{width:2.3rem;height:2.3rem;object-fit:contain;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 1.5px #e6d6aa;flex-shrink:0}
.dot{width:.6rem;height:.6rem;border-radius:50%;background:#cfc6ad;flex-shrink:0}
.dot.on{background:#6fc35a;box-shadow:0 0 0 3px #6fc35a33}
.chip-clan{margin-left:.3rem;font-size:.85rem}
.cbadge{display:grid;place-items:center;width:2.3rem;height:2.3rem;border-radius:12px;background:linear-gradient(#fffaf0,#f3e3b8);box-shadow:inset 0 0 0 1.5px #e2c87e;font-size:1.25rem;flex-shrink:0}
.cbadge.big{width:3.2rem;height:3.2rem;font-size:1.8rem;border-radius:16px}
.clan-head{display:flex;gap:.6rem;align-items:center;margin-bottom:.35rem}
.clan-head .who{display:grid;line-height:1.2}
.clan-head b{font:1.15rem Georgia,serif}
.clan-head small{font:.72rem system-ui,sans-serif;color:var(--muted)}
.progress.slim{height:.45rem}
.week{display:grid;gap:.25rem;margin:.6rem 0;padding:.5rem .6rem;border-radius:14px;background:linear-gradient(#f6fbe9,#e9f4d6);box-shadow:inset 0 0 0 1.5px #b9d39a}
.week small{font:.75rem system-ui,sans-serif;color:#4f6b3a}
.chatlog{max-height:15rem;overflow-y:auto;display:grid;gap:.3rem;padding:.4rem;border-radius:14px;background:#fffdf6;box-shadow:inset 0 0 0 1.2px #eadcb4;overscroll-behavior:contain}
.msg{justify-self:start;max-width:85%;display:grid;padding:.3rem .6rem;border-radius:14px 14px 14px 4px;background:#f1ead2;font:.85rem system-ui,sans-serif;color:var(--ink);word-break:break-word}
.msg.mine{justify-self:end;border-radius:14px 14px 4px 14px;background:#dff0c8}
.msg b{font:700 .68rem system-ui,sans-serif;color:#a8792a;cursor:pointer}
.msg b i{font-style:normal;color:#b7a77d;font-weight:600}
.msg small{font:.6rem system-ui,sans-serif;color:#a69a78;justify-self:end}
.sys{justify-self:center;text-align:center;font:.72rem system-ui,sans-serif;color:#8c7f5c;padding:.1rem .4rem}
form.say{display:flex;gap:.35rem;margin:.4rem 0 .7rem}
form.say input{flex:1;min-width:0}
.setting.find .btn{flex-shrink:0}
.setting input:not([type=number]),.setting select{width:100%;min-width:0}
.dm-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}
.dm-head .who{display:grid;line-height:1.15}
.badges{display:flex;flex-wrap:wrap;gap:.25rem;margin:.3rem 0 .5rem}
.badges .btn.on{box-shadow:inset 0 0 0 2px #6f9a46,0 0 8px #b9e08a99;background:#f4fbe8}
ol.ranks .rank{width:1.6rem;text-align:center;font:800 .9rem system-ui,sans-serif;color:#a8792a}
ol.ranks li:nth-child(1) .rank{color:#d9a53c;font-size:1.05rem}
.role{font-weight:700}
.role.leader{color:#c9862a}.role.coLeader{color:#7a4fc0}.role.elder{color:#2f86a8}
details.clan-settings{margin:.5rem 0}
details.clan-settings summary{cursor:pointer;font:700 .8rem system-ui,sans-serif;color:var(--muted)}
.card-pop>div img.sp{width:4rem;height:4rem}
.card-pop .acts{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:center}
.ask-row{display:flex;gap:.35rem;align-items:center;margin:.3rem 0 .6rem}.ask-row #req-plant{flex:1;min-width:0}.ask-row #req-qty{width:3.6rem}
.thumb.decor-thumb{font-size:2.3rem;display:grid;place-items:center;background:radial-gradient(circle,#fffaf0,#f3e3b8)}
.perks{margin:.35rem 0 0;font:.74rem system-ui,sans-serif;color:#8a6a2a}

/* Daily panel. */
.streak{display:grid;gap:.45rem;padding:.6rem .7rem;margin-bottom:.4rem;border-radius:16px;background:linear-gradient(#fff6e8,#ffe9c9);box-shadow:inset 0 0 0 1.5px #f0c98a}
.streak-head{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;flex-wrap:wrap}
.streak-head b{font:1.05rem Georgia,serif}.streak-head small{font:.72rem system-ui,sans-serif;color:#8a6a2a}
ol.days{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(7,1fr);gap:.25rem}
ol.days li{display:grid;justify-items:center;gap:.1rem;padding:.35rem 0;border-radius:12px;background:#fffaf0;box-shadow:inset 0 0 0 1.2px #eadcb4;font-size:1.2rem;opacity:.65}
ol.days li small{font:.6rem system-ui,sans-serif;color:var(--muted)}
ol.days li.got{opacity:1;background:#eef6df;box-shadow:inset 0 0 0 1.5px #8fb36d}
ol.days li.got span::after{content:'✓';font-size:.65rem;color:#4f7b33;margin-left:.1rem}
ol.days li.today{opacity:1;background:#fff;box-shadow:inset 0 0 0 2px #e9b84a,0 0 10px #f2cf6a88;transform:scale(1.06)}
.btn.big{padding:.6rem;font-size:.95rem}
ul.quests{list-style:none;padding:0;margin:.3rem 0 .6rem;display:grid;gap:.35rem}
ul.quests li,.chest{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;border-radius:14px;background:#fff8e4;box-shadow:inset 0 0 0 1.2px #e6d6aa}
ul.quests li.done{background:#f4fbe8;box-shadow:inset 0 0 0 2px #8fb36d,0 0 8px #b9e08a77}
ul.quests li.claimed{opacity:.6}
.qe{font-size:1.4rem;width:2rem;text-align:center;flex-shrink:0}
.qt{flex:1;min-width:0;display:grid;gap:.15rem}
.qt b{font:.9rem Georgia,serif}.qt small{font:.68rem system-ui,sans-serif;color:var(--muted)}
.chest{background:linear-gradient(#fff6e8,#fdebd0)}
.push-prompt{position:absolute;left:50%;bottom:7.2rem;transform:translateX(-50%);z-index:7;display:flex;align-items:center;gap:.5rem;padding:.4rem .45rem .4rem .9rem;border-radius:2rem;background:#fffaf0;border:1.5px solid #e9c46a;box-shadow:0 8px 22px #0b1a1240;font:.88rem system-ui,sans-serif;color:var(--ink);max-width:calc(100vw - 2rem)}
@media (max-width:760px){.push-prompt{bottom:9.5rem;font-size:.78rem;flex-wrap:wrap;justify-content:center}}
#open-daily{position:relative}

/* Choosing online or offline play. */
.mode-choice{gap:.7rem;max-width:30rem}
.mode-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:.7rem;align-items:center;text-align:left;width:100%;padding:.75rem .9rem;border-radius:16px;border:1.5px solid #e2cf9b;background:linear-gradient(#fffaf0,#fbf1d8);cursor:pointer;color:var(--ink);font:inherit;box-shadow:0 3px 0 #e6d3a3}
.mode-card:hover,.mode-card:focus-visible{border-color:#6f9a46;box-shadow:0 3px 0 #b9d39a,0 0 0 3px #8fb36d55;outline:none}
.mode-card span{grid-row:span 2;font-size:2rem}
.mode-card b{font:1.1rem Georgia,serif}
.mode-card small{font:.8rem system-ui,sans-serif;color:#7a6e52}

/* ---------- Plants & Posy vs. Pests ---------- */
body.in-battle .hud-top,body.in-battle .bottom,body.in-battle #prompt,body.in-battle #hotbar,body.in-battle #joystick,body.in-battle #action,body.in-battle #floaters,body.in-battle #banner{display:none!important}
.raid-town{border-radius:16px;padding:.8rem 1rem;margin:.2rem 0 .6rem;background:linear-gradient(135deg,var(--town),#2c1f3a);color:#fff;box-shadow:inset 0 0 0 2px #fff3}
.raid-town b{display:block;font:800 1.15rem system-ui,sans-serif;letter-spacing:.02em}.raid-town small{opacity:.9;font:600 .78rem system-ui,sans-serif}
.raid-styles{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.raid-style{display:flex;flex-direction:column;align-items:center;gap:.15rem;padding:.6rem .4rem;border-radius:16px;border:2px solid #d6bf85;background:linear-gradient(#fffdf4,#f3e6c4);text-align:center;transition:transform .15s}
.raid-style .re{font-size:2rem;line-height:1.1}.raid-style b{font:800 .82rem system-ui,sans-serif}.raid-style small{font:500 .68rem/1.25 system-ui,sans-serif;color:var(--muted)}.raid-style em{font:700 .66rem system-ui,sans-serif;color:#7a3aa8;font-style:normal}
.raid-style.sel{border-color:#7a3aa8;background:linear-gradient(#f7ecff,#e6d2ff);transform:translateY(-2px);box-shadow:0 6px 0 #5a2a88,0 0 0 3px #c79aff88}
.raid-army{display:flex;flex-wrap:wrap;gap:.3rem}.raid-army img{width:2.6rem;height:2.6rem;border-radius:12px;background:#fff7e0;box-shadow:inset 0 0 0 1.5px #d6bf85}
@media (max-width:520px){.raid-styles{grid-template-columns:1fr}.raid-style{flex-direction:row;text-align:left;flex-wrap:wrap}.raid-style .re{font-size:1.6rem}}

.battle-hud{position:absolute;inset:0;pointer-events:none;font-family:system-ui,sans-serif;color:#fff;user-select:none;-webkit-user-select:none;z-index:5}
.battle-hud button{pointer-events:auto}
.bh-top{position:absolute;inset:10px 12px auto;display:flex;align-items:flex-start;gap:12px}
.bh-sun{display:flex;align-items:center;gap:.35rem;padding:.35rem .9rem .35rem .45rem;border-radius:999px;background:linear-gradient(#fff3b0,#f5c84a);color:#5a3a10;font:900 1.35rem system-ui;box-shadow:0 4px 0 #b88a20,0 8px 18px #0004;border:2px solid #fffbe0}
.bh-sun-ico{font-size:1.5rem;filter:drop-shadow(0 0 6px #ffd23f)}
.bh-sun.pulse{animation:bhPulse .35s}
@keyframes bhPulse{50%{transform:scale(1.18)}}
.bh-wave{flex:1;max-width:520px;margin:0 auto;text-align:center}
.bh-town{display:inline-block;padding:.15rem .9rem;border-radius:999px;background:linear-gradient(var(--town),#3a2a4a);font:900 .9rem system-ui;letter-spacing:.04em;text-shadow:0 2px 0 #0005;box-shadow:0 3px 0 #0004;border:2px solid #fff6}
.bh-track{position:relative;height:14px;margin:.35rem 0 .15rem;border-radius:999px;background:#2a1d2ecc;border:2px solid #fff8;overflow:visible}
.bh-track span{position:absolute;inset:0 auto 0 0;border-radius:999px;background:linear-gradient(90deg,#8fd16a,#f5c84a,#ff6a5a)}
.bh-track i{position:absolute;top:50%;width:6px;height:6px;margin:-3px;border-radius:50%;background:#fff;font-style:normal;font-size:1.1rem;line-height:0;display:flex;align-items:center;justify-content:center}
.bh-track i:last-child{width:auto;height:auto;background:none;margin:0 0 0 -.6rem}
.bh-wave small{font:800 .78rem system-ui;text-shadow:0 1px 3px #000a}
.bh-hearts{display:flex;gap:2px;font-size:1.45rem;filter:drop-shadow(0 3px 2px #0005)}
.bh-hearts .lost{filter:grayscale(1) brightness(.5);opacity:.5;transform:scale(.85)}
.bh-pause{width:2.6rem;height:2.6rem;border-radius:50%;border:2px solid #fff8;background:#2a1d2ecc;color:#fff;font-size:1.05rem}
.bh-bottom{position:absolute;inset:auto 10px max(10px,env(safe-area-inset-bottom));display:flex;align-items:flex-end;gap:10px;justify-content:space-between}
.bh-cards{display:flex;gap:6px;flex-wrap:wrap;max-width:64vw}
.bh-card{position:relative;width:4.6rem;height:5.7rem;border-radius:14px;border:2.5px solid #fff3c4;background:linear-gradient(#fffdf4,#ead7a8);box-shadow:0 5px 0 #a87a28,0 10px 18px #0005;color:#3a2a10;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:.2rem;overflow:hidden;transition:transform .12s}
.bh-card img{width:3.4rem;height:3.4rem;object-fit:contain;margin-top:.05rem}
.bh-emoji{font-size:2.3rem;line-height:3.4rem}
.bh-cost{font:900 .78rem system-ui;background:#fff3b0;border-radius:999px;padding:0 .4rem;box-shadow:inset 0 0 0 1.5px #e9c46a}
.bh-name{position:absolute;inset:auto 0 100% 0;display:none}
.bh-key{position:absolute;top:3px;left:5px;font:800 .62rem system-ui;color:#a87a28}
.bh-cd{position:absolute;inset:auto 0 0 0;height:0;background:#1d1b26aa;pointer-events:none;transition:height .2s linear}
.bh-card.poor img,.bh-card.poor .bh-cost{filter:grayscale(.8) brightness(.8)}
.bh-card.poor .bh-cost{color:#a83a3a}
.bh-card.sel{transform:translateY(-10px);border-color:#ffd23f;box-shadow:0 5px 0 #a87a28,0 0 0 4px #ffd23f,0 0 26px #ffd23faa}
.bh-moves{display:flex;align-items:flex-end;gap:10px}
.bh-ammo{display:flex;flex-direction:column-reverse;gap:3px;padding:.3rem;border-radius:12px;background:#2a1d2e99}
.bh-ammo i{width:16px;height:19px;border-radius:50% 50% 45% 45%;background:#ffffff33;border:1.5px solid #fff6}
.bh-ammo i.full{background:radial-gradient(circle at 35% 30%,#fff 0 12%,#ff8fc8 25%,#ff4fa0);border-color:#fff}
.bh-move{position:relative;width:4.6rem;height:4.6rem;border-radius:50%;border:3px solid #fff;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;color:#fff;box-shadow:0 5px 0 #0006,0 10px 20px #0005}
.bh-move span{font-size:1.9rem;line-height:1}.bh-move small{font:900 .58rem system-ui;text-transform:uppercase;letter-spacing:.05em;text-shadow:0 1px 2px #000a}
.bh-pup{background:radial-gradient(circle at 40% 30%,#ffd08a,#d98a3a)}
.bh-pup .bh-cd{border-radius:0}
.bh-pup.ready{animation:bhReady 1.2s infinite}
.bh-ult{width:5.6rem;height:5.6rem;background:radial-gradient(circle at 40% 30%,#c9a0ff,#5a2ab8)}
.bh-ult .bh-meter{position:absolute;inset:-3px;border-radius:50%;background:conic-gradient(#ffd23f var(--fill,0%),transparent 0);-webkit-mask:radial-gradient(circle,transparent 62%,#000 64%);mask:radial-gradient(circle,transparent 62%,#000 64%)}
.bh-ult.ready{animation:bhReady .8s infinite;background:radial-gradient(circle at 40% 30%,#ffe8a0,#ff6fb5 55%,#7a2ab8)}
@keyframes bhReady{50%{transform:scale(1.08);box-shadow:0 5px 0 #0006,0 0 30px #ffd23f}}
.bh-banner{position:absolute;left:50%;top:26%;transform:translate(-50%,-50%);text-align:center;animation:bhBanner 2s ease both;filter:drop-shadow(0 6px 0 #0004)}
.bh-banner b{display:block;font:900 clamp(2.2rem,7vw,4.6rem)/1 system-ui;letter-spacing:.04em;color:#fff;-webkit-text-stroke:2px #3a1d4a;text-shadow:0 5px 0 #3a1d4a,0 0 30px #ff6fb588}
.bh-banner small{display:inline-block;margin-top:.4rem;padding:.2rem .9rem;border-radius:999px;background:#3a1d4acc;font:800 clamp(.9rem,2.4vw,1.3rem) system-ui}
.bh-banner.boss b{color:#ffd23f;font-size:clamp(2.4rem,8vw,5.2rem);text-shadow:0 5px 0 #5a1010,0 0 40px #ff4a3d}
.bh-banner.gold b{color:#ffd23f}
.bh-banner.ult b{background:linear-gradient(#fff,#bfe8ff);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-stroke:2px #1d3a8a}
.bh-banner.intro b{font-size:clamp(2rem,6vw,4rem)}
@keyframes bhBanner{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}12%{transform:translate(-50%,-50%) scale(1.12);opacity:1}20%{transform:translate(-50%,-50%) scale(1)}85%{opacity:1}100%{opacity:0;transform:translate(-50%,-60%)}}
.bh-combo{position:absolute;right:7%;top:38%;font:900 clamp(1.4rem,4vw,2.4rem) system-ui;color:#7fe0ff;-webkit-text-stroke:1.5px #0d2a5a;text-shadow:0 4px 0 #0d2a5a;transform:rotate(-6deg);animation:bhCombo 1.2s ease both}
.bh-combo.hot{color:#ffd23f;-webkit-text-stroke-color:#7a1d1d;text-shadow:0 4px 0 #7a1d1d,0 0 24px #ff6a3a}
@keyframes bhCombo{0%{transform:rotate(-6deg) scale(.4)}15%{transform:rotate(-6deg) scale(1.25)}25%{transform:rotate(-6deg) scale(1)}100%{opacity:0}}
.bh-vignette{position:absolute;inset:0;pointer-events:none;opacity:0;box-shadow:inset 0 0 120px 40px #ff2a3a}
.bh-vignette.hurt{animation:bhHurt .7s}
@keyframes bhHurt{20%{opacity:.9}100%{opacity:0}}
.bh-numbers{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.bh-num{position:absolute;transform:translate(-50%,-50%);font:900 1.05rem system-ui;color:#fff;-webkit-text-stroke:1px #1d3a8a;text-shadow:0 2px 0 #1d3a8a;animation:bhNum 1s ease-out forwards}
.bh-num.big{font-size:1.6rem;color:#ffd23f;-webkit-text-stroke-color:#7a1d1d;text-shadow:0 2px 0 #7a1d1d}
.bh-num.warn{color:#ff6a7a;-webkit-text-stroke-color:#3a0a12;text-shadow:0 2px 0 #3a0a12}
@keyframes bhNum{0%{opacity:0;margin-top:0}15%{opacity:1}100%{opacity:0;margin-top:-50px}}
.bh-sunfly{position:fixed;z-index:30;transform:translate(-50%,-50%) scale(1.3);font-size:1.6rem;pointer-events:none;transition:left .6s cubic-bezier(.5,0,.8,.4),top .6s cubic-bezier(.2,.6,.4,1),transform .6s,opacity .6s;filter:drop-shadow(0 0 8px #ffd23f)}
.bh-help{position:absolute;left:50%;bottom:calc(7.2rem + env(safe-area-inset-bottom));transform:translateX(-50%);padding:.3rem .9rem;border-radius:999px;background:#1d1b26aa;font:700 .78rem system-ui;white-space:nowrap;animation:bhFade 9s 5s forwards}
@keyframes bhFade{to{opacity:0}}
.bh-menu{position:absolute;inset:0;display:grid;place-items:center;background:#1d1b26a8;pointer-events:auto;backdrop-filter:blur(2px)}
.bh-boss{position:absolute;left:50%;top:5.4rem;transform:translateX(-50%);width:min(560px,70vw);text-align:center}
.bh-boss b{font:900 1rem system-ui;color:#ffd23f;-webkit-text-stroke:1px #5a1010;text-shadow:0 2px 0 #5a1010}
.bh-bossbar{height:16px;margin-top:3px;border-radius:999px;background:#2a1d2edd;border:2.5px solid #ffd23f;overflow:hidden;box-shadow:0 0 18px #ff4a3d88}
.bh-bossbar span{display:block;height:100%;background:linear-gradient(#ff8a6a,#d8283c);transition:width .25s}
body.in-battle #toasts{display:none}
.bh-panel{width:min(420px,92vw);padding:1.4rem 1.4rem 1.2rem;border-radius:26px;text-align:center;background:linear-gradient(#fffdf4,#f3e3bc);color:var(--ink);border:3px solid #fff3c4;box-shadow:0 12px 0 #a87a28,0 30px 60px #0007;display:flex;flex-direction:column;gap:.6rem}
.bh-panel h2{margin:0;font:900 1.8rem system-ui;color:#3a1d4a}
.bh-panel p{margin:0;font:600 .9rem/1.35 system-ui;color:var(--muted)}
.bh-panel .btn{font-size:.95rem;padding:.6rem 1rem}
.bh-panel .btn.danger{background:linear-gradient(#fff2f0,#f6d0c8);border-color:#e0a090}
.bh-end.won h2{color:#7a3aa8}
.bh-stars{display:flex;justify-content:center;gap:.4rem;font-size:3.2rem;line-height:1}
.bh-stars span{color:#d8cfc0;-webkit-text-stroke:2px #a87a28}
.bh-stars span.on{color:#ffd23f;animation:bhStar .5s both;text-shadow:0 0 20px #ffd23f}
@keyframes bhStar{0%{transform:scale(0) rotate(-40deg)}70%{transform:scale(1.3)}100%{transform:scale(1)}}
.bh-stats,.bh-reward{display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem}
.bh-stats span{font:700 .75rem system-ui;padding:.2rem .6rem;border-radius:999px;background:#fff;box-shadow:inset 0 0 0 1px #e8dcc0}
.bh-reward span{display:inline-flex;align-items:center;gap:.2rem;font:900 1.05rem system-ui;padding:.3rem .8rem;border-radius:14px;background:linear-gradient(#fff3b0,#f5d870);color:#5a3a10;box-shadow:0 3px 0 #c8a040}
.bh-reward img{width:1.8rem;height:1.8rem}
.battle-hud.done .bh-help,.battle-hud.done .bh-bottom{opacity:.35}
@media (orientation:portrait){
  .bh-bottom{flex-direction:column-reverse;align-items:stretch;gap:6px}
  .bh-cards{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-top:12px;scrollbar-width:none}
  .bh-moves{justify-content:flex-end}
  .bh-boss{top:6.6rem;width:86vw}
}
@media (max-width:700px){
  .bh-card{flex-shrink:0;width:3.7rem;height:4.7rem;border-radius:12px}.bh-card img{width:2.7rem;height:2.7rem}.bh-key{display:none}
  .bh-move{width:3.8rem;height:3.8rem}.bh-ult{width:4.6rem;height:4.6rem}.bh-move span{font-size:1.5rem}
  .bh-cards{max-width:70vw}.bh-top{gap:6px}.bh-hearts{font-size:1.05rem}.bh-sun{font-size:1.05rem}.bh-help{display:none}
  .bh-ammo i{width:12px;height:14px}
}
