:root {
  --wood: #b07444;
  --wood-dark: #6e3f1d;
  --wood-light: #d39a62;
  --cream: #fff7e3;
  --cream-2: #fcebc4;
  --panel: #fbe7bd;
  --ink: #3b2a1a;
  --muted: #8a7458;
  --barn: #c8442e;
  --gold: #f5b21b;
  --green-btn: #4fa83d;
  --blue: #3c8fd6;
  --shadow: 0 3px 0 rgba(0,0,0,.18), 0 8px 20px rgba(60,40,10,.15);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background: #fdf3dc;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
svg { display: block; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 600;
  background: var(--cream-2); box-shadow: 0 3px 0 rgba(0,0,0,.2);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--green-btn); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.danger { background: #e2654c; color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); }
.btn.small { padding: 5px 10px; font-size: 14px; border-radius: 10px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 12px 20px; font-size: 18px; width: 100%; }

/* ---------- wooden logo ---------- */
.logo-plank { display: inline-block; font-weight: 700; color: #fff7d6; font-size: 34px; padding: 4px 20px 6px; border-radius: 14px;
  background: linear-gradient(#c98652, #8e5128); border: 3px solid #5a2e12; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 #4a250e;
  text-shadow: 0 2px 0 #5a2e12, 0 0 1px #5a2e12; letter-spacing: .5px; transform: rotate(-2deg); }
.logo-plank.small { font-size: 22px; padding: 2px 14px 4px; border-width: 2px; }

/* ---------- auth ---------- */
#auth { min-height: 100vh; position: relative; overflow: hidden; display: grid; place-items: center; padding: 24px 16px; }
.auth-bg { position: absolute; inset: 0; z-index: -1; }
.auth-bg svg { width: 100%; height: 100%; }
.auth-card { width: min(420px, 100%); background: var(--cream); border-radius: 22px; padding: 26px 24px 22px;
  box-shadow: 0 6px 0 var(--wood-dark), 0 18px 40px rgba(0,0,0,.25); border: 4px solid var(--wood); }
.logo { margin: 0 0 4px; text-align: center; }
.tag { text-align: center; color: var(--muted); margin: 10px 0 18px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--cream-2); padding: 5px; border-radius: 14px; margin-bottom: 14px; }
.auth-tab { border: 0; background: transparent; padding: 8px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
#auth-form label { display: block; font-weight: 500; margin-bottom: 12px; }
#auth-form input, .field input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--cream-2); background: #fff; outline: none; }
#auth-form input:focus, .field input:focus { border-color: var(--gold); }
.auth-error { color: var(--barn); min-height: 1.2em; margin: 10px 0 0; text-align: center; }

/* ---------- top nav ---------- */
.nav { display: flex; align-items: center; gap: 16px; padding: 5px 14px; flex: none; background: linear-gradient(#fff6dd, #f6e6bd); border-bottom: 3px solid #d9b47a; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links button { border: 0; background: transparent; color: #2a5f9e; font-weight: 600; padding: 6px 10px; border-radius: 10px; display: flex; align-items: center; gap: 6px; }
.nav-links button:hover { background: rgba(60,143,214,.1); }
.nav-links .ni { width: 22px; height: 22px; }
.nav-links .logout { color: var(--muted); }

/* ---------- stage & scene ---------- */
#game { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.main { flex: 1; min-height: 0; display: flex; }
.scene-wrap { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.scene { position: relative; overflow: hidden; background: #7cc84f; user-select: none; touch-action: manipulation; width: 100%; }
.scene-bg { position: absolute; inset: 0; }
.board { position: absolute; z-index: 1; }
.ground { position: absolute; left: 0; top: 0; overflow: visible; }
.ground .hit { fill: rgba(255,255,255,0); cursor: pointer; }
.ground .tile:hover .hit, .ground .tile.hover .hit { fill: rgba(255,255,255,.22); stroke: #fff; stroke-width: 2.5; }
.ground .tile.sel .hit { fill: rgba(255,214,77,.3); stroke: #ffd34d; stroke-width: 3; stroke-dasharray: 6 4; }
.ground .tile.stealable .hit { stroke: #ff6fb0; stroke-width: 3; animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { stroke-opacity: .35; } }
.sprites { position: absolute; left: 0; top: 0; pointer-events: none; }
.sprite { position: absolute; pointer-events: none; }
.sprite .art { position: absolute; inset: 0; transform-origin: 50% 92%; }
.sprite .art > svg { width: 100%; height: 100%; }
.sprite .art svg * { pointer-events: visiblePainted; }
.sprite .art.ripe { animation: wind 2.2s ease-in-out infinite; }
.sprite .art.pop { animation: pop-in .35s ease-out; }
@keyframes sway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
@keyframes pop-in { from { transform: scale(.3); } }
.sprite .deco { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; line-height: 1; filter: drop-shadow(0 4px 2px rgba(0,0,0,.25)); }
.sprite .deco span { pointer-events: auto; display: inline-block; }
.sprite .weed, .sprite .bug, .sprite .drop, .sprite .sparkle { position: absolute; }
.sprite .badge-drop { position: absolute; animation: bob 1.4s ease-in-out infinite; }
.sprite .badge-spark { position: absolute; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes twinkle { 50% { transform: scale(.7) rotate(20deg); opacity: .7; } }
.sprite .bugwrap { position: absolute; animation: crawl 3s ease-in-out infinite; }
@keyframes crawl { 50% { transform: translateX(5px); } }
.sprite .prog { position: absolute; height: 6px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; border: 1px solid rgba(255,255,255,.5); }
.sprite .prog i { display: block; height: 100%; background: linear-gradient(#b6f07a, #6cc644); }
.sprite .prog.dry i { background: linear-gradient(#ffd27a, #e8a23a); }

.farm-sign { position: absolute; z-index: 1; transform: translateX(-50%); text-align: center; pointer-events: none; }
.farm-sign::before { content: ''; position: absolute; left: 50%; top: 18px; width: 9px; height: var(--post, 70px); margin-left: -4px; background: linear-gradient(90deg, #6e3f1d, #9a6034, #6e3f1d); border-radius: 3px; z-index: -1; }
.farm-sign span { display: inline-block; max-width: 180px; padding: 6px 12px; font-weight: 700; color: #fff8dc; font-size: 15px; line-height: 1.15;
  background: linear-gradient(#a8693a, #7d4722); border: 3px solid #4f2810; border-radius: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.25); text-shadow: 0 1px 0 #3a1c08; }

.tip { position: absolute; z-index: 30; transform: translate(-50%, -100%); background: rgba(40,26,12,.92); color: #fff; padding: 6px 10px; border-radius: 10px;
  font-size: 13px; max-width: 280px; pointer-events: none; text-align: center; line-height: 1.3; }
.tip::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(40,26,12,.92); }

/* HUD: player card */
.hud-player { position: absolute; left: 12px; top: 12px; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; cursor: pointer;
  background: linear-gradient(#fff3cf, #f6dc9c); border: 3px solid #b07a3a; border-radius: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.hud-avatar { width: 58px; height: 58px; border-radius: 10px; background: #bfe6ff; border: 3px solid #fff; box-shadow: 0 0 0 2px #b07a3a; display: grid; place-items: center; font-size: 38px; }
.hud-stats { min-width: 170px; }
.hud-level { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.hud-star { position: relative; width: 28px; height: 28px; flex: none; }
.hud-star .lvnum { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 3px; font-size: 11px; font-weight: 700; color: #7a4a00; }
.xpbar { position: relative; flex: 1; height: 14px; background: #7a5428; border-radius: 10px; overflow: hidden; box-shadow: inset 0 2px 2px rgba(0,0,0,.3); min-width: 70px; }
.xpfill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#ffd27a, #f08a24); transition: width .5s; }
.xptext { position: absolute; inset: 0; font-size: 10px; line-height: 14px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.hud-coins { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; }
.hud-coin { width: 22px; height: 22px; }
.hud-coins b { font-size: 16px; }
.hud-coins.bump b { animation: bump .4s; display: inline-block; }
@keyframes bump { 40% { transform: scale(1.3); } }
.hud-name { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* HUD: buttons */
.hud-buttons { position: absolute; right: 12px; top: 12px; z-index: 20; display: flex; gap: 6px; padding: 6px; background: linear-gradient(#fff3cf, #f6dc9c); border: 3px solid #b07a3a; border-radius: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.hud-btn { position: relative; width: 64px; height: 64px; border: 0; border-radius: 12px; background: linear-gradient(#ffe6a8, #f2c66a); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); padding: 6px 6px 14px; }
.hud-btn:hover { filter: brightness(1.06); }
.hud-btn:active { transform: translateY(2px); }
.hud-btn span { display: block; width: 100%; height: 100%; }
.hud-btn i { position: absolute; left: 0; right: 0; bottom: 2px; font-style: normal; font-size: 10px; font-weight: 600; color: var(--wood-dark); }
.hud-btn .badge { position: absolute; top: -6px; right: -6px; }
.badge { background: var(--barn); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; line-height: 18px; min-width: 18px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.3); }

.visit-ribbon { position: absolute; z-index: 21; left: 50%; transform: translateX(-50%); top: 12px; text-align: center; padding: 8px 14px; max-width: min(420px, 60%);
  background: #fff3c4; border: 3px solid #e7b94a; border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.18); font-size: 14px; }
.visit-ribbon .visit-stats { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }

/* bottom toolbar */
.toolbar { position: absolute; z-index: 20; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px 8px;
  background: linear-gradient(#f9e4b0, #e9c27a); border: 3px solid #a46a32; border-radius: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.25); max-width: calc(100% - 16px); }
.tool { position: relative; width: 58px; height: 58px; border: 0; border-radius: 12px; padding: 5px; background: linear-gradient(#fffaf0, #f3dfb4);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.6); flex: none; }
.tool:hover { background: #fff; }
.tool.active { background: linear-gradient(#fff6c2, #ffd75a); box-shadow: 0 0 0 3px #e08a1a, inset 0 -3px 0 rgba(0,0,0,.12); }
.tool svg { width: 100%; height: 100%; }
.tool .tl { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: rgba(40,26,12,.9); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.tool:hover .tl, .tool:focus-visible .tl { opacity: 1; }
.tool .sub { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.35); padding: 2px; }
.tool .sub svg { width: 100%; height: 100%; }
.tool .sub.emoji { display: grid; place-items: center; font-size: 16px; }

/* friends' farms column */
.friends-col { flex: none; width: 112px; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; background: linear-gradient(90deg, #e9c27a, #f9e4b0); border-left: 4px solid #a46a32; min-height: 0; }
.fc-label { font-weight: 700; color: var(--wood-dark); font-size: 14px; text-align: center; line-height: 1.15; }
.fc-arrow { border: 0; height: 24px; border-radius: 8px; background: linear-gradient(#7cc4f0, #3c8fd6); color: #fff; font-size: 11px; flex: none; }
.fc-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px; }
.fc-list::-webkit-scrollbar { display: none; }
.fs-card { position: relative; flex: none; width: 100%; border: 0; border-radius: 12px; background: #fff8e6; padding: 6px 4px 4px; text-align: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.fs-card:hover { background: #fff; }
.fs-card.here { background: #d8f5c2; box-shadow: 0 0 0 3px var(--green-btn); }
.fs-card .fa { font-size: 34px; line-height: 46px; height: 46px; background: #bfe6ff; border-radius: 8px; margin: 0 6px; }
.fs-card .fn { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.fs-card .fl { font-size: 10px; color: var(--muted); }
.fs-card .rk { position: absolute; top: -4px; left: -2px; width: 20px; height: 20px; border-radius: 50%; background: #f08a24; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.fs-card.add .fa { background: #e9f7df; color: var(--green-btn); font-size: 30px; }
.fs-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 4px; }
.fc-more { position: relative; flex: none; height: 52px; border: 0; border-radius: 12px; background: linear-gradient(#7cc4f0, #3c8fd6); color: #fff; font-weight: 700; font-size: 13px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.fc-more .badge { position: absolute; top: -6px; right: -6px; }

/* sky, clouds, butterflies */
.sky-layer { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; left: 0; animation: drift linear infinite; opacity: .95; }
.cloud svg { width: 100%; height: 100%; }
@keyframes drift { from { transform: translateX(-260px); } to { transform: translateX(var(--sky-w, 1600px)); } }
.butterfly { position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 6; animation: flutter var(--dur, 14s) ease-in-out infinite; }
.butterfly svg { width: 100%; height: 100%; }
.butterfly .wing { transform-box: fill-box; animation: flap .18s ease-in-out infinite alternate; }
.butterfly .wing.l { transform-origin: 100% 50%; }
.butterfly .wing.r { transform-origin: 0% 50%; }
@keyframes flap { to { transform: scaleX(.25); } }
@keyframes flutter { 0% { transform: translate(0, 0); } 20% { transform: translate(60px, -30px); } 40% { transform: translate(120px, 10px); } 60% { transform: translate(70px, 40px); } 80% { transform: translate(-30px, 15px); } 100% { transform: translate(0, 0); } }

/* barnyard animals and the dog */
.animals, .critters { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.pen-front { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.pen-front svg { position: absolute; left: 0; top: 0; }
.animals { z-index: 2; }
.critters { z-index: 4; }
.beast { position: absolute; cursor: pointer; will-change: left, top; }
.beast .body { width: 100%; height: 100%; }
.beast.flip .body { transform: scaleX(-1); }
.beast svg { width: 100%; height: 100%; overflow: visible; }
.beast svg * { pointer-events: visiblePainted; }
.beast .leg { transform-box: fill-box; transform-origin: 50% 0; }
.beast.walking .leg.a { animation: stride .36s ease-in-out infinite alternate; }
.beast.walking .leg.b { animation: stride .36s ease-in-out infinite alternate-reverse; }
.beast.walking .bodybob { animation: trot .18s ease-in-out infinite alternate; }
@keyframes stride { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes trot { to { transform: translateY(-1.5px); } }
.beast .head { transform-box: fill-box; transform-origin: 20% 80%; }
.beast.idle .a-chicken .head, .beast.idle .a-duck .head { animation: peck 3.2s ease-in-out infinite; }
.beast.idle .a-sheep .head, .beast.idle .a-cow .head { animation: graze 6s ease-in-out infinite; }
.beast.idle .a-pig .head { animation: sniff 2.4s ease-in-out infinite; }
@keyframes peck { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(35deg); } 80% { transform: rotate(5deg); } 88% { transform: rotate(35deg); } }
@keyframes graze { 0%, 50%, 100% { transform: rotate(0); } 60%, 85% { transform: rotate(28deg); } }
@keyframes sniff { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }
.beast .tail { transform-box: fill-box; transform-origin: 100% 100%; }
.beast.dog .tail { animation: wag .22s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
.beast.dog .ear { transform-box: fill-box; transform-origin: 50% 0; }
.beast.dog.walking .ear { animation: wag .3s ease-in-out infinite alternate; }
.beast .bubble { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid #b07a3a;
  box-shadow: 0 2px 4px rgba(0,0,0,.25); display: grid; place-items: center; padding: 4px; animation: bob 1.4s ease-in-out infinite; pointer-events: none; }
.beast .bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #b07a3a; }
.beast .bubble svg { width: 100%; height: 100%; }
.beast .bubble.hungry { border-color: #e2654c; }
.beast .bubble.ring { width: 26px; height: 26px; padding: 0; animation: none; background: conic-gradient(#6cc644 var(--p, 0%), #eee 0); border-color: #fff; }
.beast .bubble.ring::after { display: none; }
.beast .nametag { position: absolute; left: 50%; top: 92%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #5a2e12; background: rgba(255,248,224,.92); border: 1.5px solid #b07a3a; border-radius: 8px; padding: 0 6px; white-space: nowrap; pointer-events: none; z-index: 2; }
.beast.say::before { content: attr(data-say); position: absolute; left: 60%; bottom: 95%; background: #fff; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,.25); white-space: nowrap; }

/* plants and decorations sway in the wind */
.sprite .art { animation: wind 4.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes wind { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.6deg) skewX(-1deg); } }
.decor-svg .canopy { transform-box: fill-box; transform-origin: 50% 100%; animation: wind 6s ease-in-out infinite; }
.decor-svg .sway { transform-box: fill-box; animation: wind 3.5s ease-in-out infinite; }
.decor-svg .spray { transform-box: fill-box; transform-origin: 50% 100%; animation: spray 1.2s ease-in-out infinite alternate; }
@keyframes spray { from { transform: scaleY(.85); opacity: .7; } to { transform: scaleY(1.08); opacity: 1; } }
.decor-svg .ripple { animation: twinkle 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.decor-svg .pupils { animation: look 5s ease-in-out infinite; }
@keyframes look { 0%, 40%, 100% { transform: translateX(0); } 50%, 70% { transform: translateX(2px); } 80%, 90% { transform: translateX(-2px); } }
.sprite.deco .art { animation: none; }

.audio-btns { position: absolute; right: 12px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.aud { width: 40px; height: 40px; border: 3px solid #a46a32; border-radius: 10px; background: linear-gradient(#f9e4b0, #e9c27a); font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.aud.off { opacity: .55; filter: grayscale(1); }

/* ---------- drawer ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(40,25,10,.3); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 41; background: var(--cream); border-left: 4px solid var(--wood);
  box-shadow: -10px 0 30px rgba(0,0,0,.2); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-end; gap: 6px; padding: 10px 10px 0; background: linear-gradient(#d39a62, #b07444); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { flex: 1; border: 0; padding: 9px 4px; border-radius: 12px 12px 0 0; background: rgba(255,255,255,.25); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab.active { background: var(--cream); color: var(--ink); }
.drawer-x { border: 0; background: rgba(0,0,0,.2); color: #fff; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 6px; flex: none; }
.panel { padding: 14px; overflow-y: auto; flex: 1; }
.subtabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.subtab { border: 0; padding: 5px 12px; border-radius: 20px; background: var(--cream-2); font-size: 14px; font-weight: 500; }
.subtab.active { background: var(--wood); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.card { border: 2px solid var(--cream-2); background: #fff; border-radius: 12px; padding: 8px; text-align: center; position: relative; cursor: pointer; transition: transform .1s, border-color .15s; }
.card:hover { border-color: var(--gold); transform: translateY(-2px); }
.card.selected { border-color: var(--green-btn); background: #effbe8; }
.card.locked { opacity: .55; cursor: not-allowed; filter: grayscale(.7); }
.card.locked:hover { transform: none; border-color: var(--cream-2); }
.card .ce { font-size: 34px; line-height: 1.15; height: 56px; display: grid; place-items: center; }
.card .ce svg { width: 60px; height: 60px; }
.card .cn { font-weight: 600; font-size: 15px; }
.card .cm { font-size: 12px; color: var(--muted); line-height: 1.35; }
.card .cp { font-weight: 600; margin-top: 3px; }
.card .lock { position: absolute; top: 5px; right: 6px; font-size: 11px; background: var(--ink); color: #fff; border-radius: 8px; padding: 1px 6px; z-index: 1; }
.panel h4 { margin: 14px 0 8px; color: var(--wood-dark); }
.panel h4:first-child { margin-top: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: #fff; margin-bottom: 6px; }
.row .re { font-size: 26px; width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.row .re svg { width: 42px; height: 42px; }
.row .rb { flex: 1; min-width: 0; }
.row .rt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .rs { font-size: 13px; color: var(--muted); }
.row .ra { display: flex; gap: 4px; flex-shrink: 0; }
.row.unread { background: #fff7cf; }
.empty { color: var(--muted); text-align: center; padding: 16px 8px; }
.field { display: flex; gap: 6px; }
.field input { margin: 0; flex: 1; }
.barn-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.news-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(40,25,10,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--cream); border-radius: 20px; padding: 22px; width: min(480px, 100%); max-height: 90vh; overflow-y: auto; position: relative; border: 4px solid var(--wood); box-shadow: 0 6px 0 var(--wood-dark); animation: modal-pop .25s; }
@keyframes modal-pop { from { transform: scale(.9); opacity: 0; } }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 20px; }
.modal-card h2 { margin: 0 0 10px; color: var(--wood-dark); }
.modal-card .center { text-align: center; }
.big-emoji { font-size: 64px; text-align: center; line-height: 1.2; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.avatar-pick button { font-size: 26px; width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--cream-2); background: #fff; }
.avatar-pick button.sel { border-color: var(--green-btn); background: #effbe8; }
.help-list { padding-left: 20px; line-height: 1.55; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ---------- toasts & floaters ---------- */
.toasts { position: fixed; bottom: 112px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 60; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 30px; box-shadow: 0 4px 14px rgba(0,0,0,.25); animation: toast-in .2s; font-weight: 500; max-width: 90vw; text-align: center; }
.toast.err { background: var(--barn); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.floater { position: fixed; z-index: 70; font-weight: 700; pointer-events: none; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 6px rgba(0,0,0,.3); animation: float-up 1.1s ease-out forwards; font-size: 17px; white-space: nowrap; }
@keyframes float-up { to { transform: translateY(-46px); opacity: 0; } }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .nav { padding: 6px 10px; gap: 8px; }
  .nav-links button { font-size: 13px; padding: 5px 6px; }
  .nav-links .ni { display: none; }
  .hud-player { left: 6px; top: 6px; padding: 5px 8px 5px 5px; gap: 6px; border-width: 2px; }
  .hud-avatar { width: 40px; height: 40px; font-size: 26px; }
  .hud-stats { min-width: 0; width: 104px; }
  .hud-level { font-size: 12px; gap: 4px; }
  .hud-level b, .hud-name, .hud-coins .cw { display: none; }
  .xpbar { min-width: 0; }
  .hud-coins b { font-size: 15px; }
  .farm-sign span { font-size: 12px; max-width: 110px; padding: 4px 8px; border-width: 2px; }
  .hud-buttons { right: 6px; top: 6px; gap: 3px; padding: 4px; border-width: 2px; }
  .hud-btn { width: 42px; height: 42px; padding: 4px 4px 11px; }
  .hud-btn i { font-size: 8px; }
  .visit-ribbon { top: 58px; max-width: 92%; font-size: 12px; padding: 4px 10px; }
  .scene-wrap { overflow-y: auto; }
  .toolbar { position: fixed; bottom: 6px; left: 6px !important; right: 78px; transform: none; width: auto; max-width: none; }
  .audio-btns { right: 6px; bottom: auto; top: 62px; flex-direction: column; }
  .hud-btn { width: 38px; height: 38px; }
  #harvest-all { display: none; }
  .nav { gap: 6px; padding: 4px 8px; }
  .nav .logo-plank.small { font-size: 15px; padding: 1px 8px 2px; }
  .nav-links { gap: 0; }
  .nav-links button { font-size: 12px; padding: 4px 5px; }
  .aud { width: 32px; height: 32px; font-size: 14px; border-width: 2px; }
  .friends-col { width: 72px; padding: 6px 4px; gap: 4px; }
  .fc-label { font-size: 11px; }
  .fs-card .fa { font-size: 24px; line-height: 34px; height: 34px; margin: 0 2px; }
  .fs-card .fn { font-size: 10px; }
  .fc-more { font-size: 11px; height: 44px; }
  .toolbar { flex-wrap: wrap; justify-content: center; gap: 3px; padding: 4px; }
  .tool { width: 44px; height: 44px; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hud-star > [data-hud] { position: absolute; inset: 0; }
.hud-star svg, .hud-coin svg, .nav-links .ni svg { width: 100%; height: 100%; }

.big-art { width: 150px; height: 120px; margin: 0 auto; }
.big-art svg { width: 100%; height: 100%; }

/* ---------- v3 additions: tabs, kitchen, quests, prices, gifts ---------- */
.drawer { width: min(440px, 100%); }
.tab { font-size: 12.5px; padding: 8px 2px; }
.linkish { border: 0; background: none; color: #2a5f9e; text-decoration: underline; font-size: 14px; padding: 0; }
.auth-forgot { text-align: center; margin: 6px 0 0; }
.nav-links .admin-link { color: #c8442e; font-weight: 700; padding: 6px 10px; text-decoration: none; align-self: center; }
.hud-btn .badge { position: absolute; top: -6px; right: -6px; }
.recipe { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 8px; border: 2px solid var(--cream-2); }
.recipe.locked { opacity: .55; filter: grayscale(.6); }
.recipe .rp { width: 54px; height: 54px; flex: none; }
.recipe .rp svg { width: 100%; height: 100%; }
.recipe .rb { flex: 1; min-width: 0; }
.recipe .rt { font-weight: 600; }
.ings { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.ing { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; background: #f6efe0; border-radius: 8px; padding: 1px 6px 1px 2px; }
.ing.short { background: #fde3dc; color: #a8301c; }
.ing i { width: 20px; height: 20px; display: inline-block; }
.ing i svg { width: 100%; height: 100%; }
.recipe .ra { display: flex; flex-direction: column; gap: 4px; }
.quest { background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 8px; border: 2px solid var(--cream-2); }
.quest.done { border-color: var(--green-btn); background: #f2fbea; }
.quest .qt { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.quest .qr { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.qbar { height: 10px; border-radius: 6px; background: #eee3cc; overflow: hidden; margin: 6px 0; }
.qbar i { display: block; height: 100%; background: linear-gradient(#b6f07a, #4fa83d); }
.quest .qa { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.ach { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 6px; }
.ach .medals { display: flex; gap: 0; flex: none; }
.ach .medals span { width: 26px; height: 26px; }
.ach .medals svg { width: 100%; height: 100%; }
.ach .rb { flex: 1; min-width: 0; }
.ach .rt { font-weight: 600; font-size: 14px; }
.ach .rs { font-size: 12px; color: var(--muted); }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px 0 14px; }
.streak div { background: #fff; border-radius: 10px; padding: 6px 2px; text-align: center; font-size: 12px; border: 2px solid var(--cream-2); }
.streak div b { display: block; font-size: 14px; }
.streak div.past { background: #e6f6d8; border-color: #b6e09a; }
.streak div.now { background: #fff3b0; border-color: var(--gold); transform: scale(1.08); }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table td { padding: 5px 4px; border-bottom: 1px solid #f0e2c4; }
.price-table td:first-child { width: 30px; }
.price-table td:first-child svg { width: 26px; height: 26px; }
.price-table .num { text-align: right; font-weight: 600; white-space: nowrap; }
.trend { font-size: 12px; font-weight: 700; }
.trend.up { color: #2e8a1e; }
.trend.down { color: #c8442e; }
.trend.flat { color: var(--muted); }
.hot { background: #fff7cf; }
.seed-pack { display: inline-flex; align-items: center; gap: 4px; }
.card .owned { position: absolute; top: 5px; left: 6px; font-size: 11px; background: var(--green-btn); color: #fff; border-radius: 8px; padding: 1px 6px; }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.gift-grid button { border: 2px solid var(--cream-2); background: #fff; border-radius: 10px; padding: 4px; font-size: 11px; }
.gift-grid button:hover { border-color: var(--gold); }
.gift-grid button:disabled { opacity: .4; }
.gift-grid svg { width: 100%; height: 44px; }
.fs-card .on { position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #4fd84f; box-shadow: 0 0 0 2px #fff; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4fd84f; margin-left: 4px; vertical-align: middle; }
@media (max-width: 760px) { .hide-sm { display: none !important; } .tab { font-size: 11px; } .nav-links .admin-link { font-size: 12px; padding: 4px 5px; } .toasts { bottom: 150px; } }

/* ---------- v4: fertilizer, damage, help, loot, chat, profiles, guide ---------- */
.tool .sub.cnt { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: #4fa83d; }
.tool .sub.cnt.zero { background: #b8ac94; }
.tool .sub.cnt.lock { background: #fff; font-size: 12px; }
.sprite .art.hurt1 { filter: saturate(.75) sepia(.15); }
.sprite .art.hurt2 { filter: saturate(.55) sepia(.3) brightness(.95); }
.sprite .art.hurt3 { filter: saturate(.35) sepia(.45) brightness(.9); }
.sprite .art.fert > svg { filter: drop-shadow(0 0 4px rgba(140, 255, 90, .9)); }
.dmg { position: absolute; background: #d8402e; color: #fff; font-weight: 700; border-radius: 8px; padding: 0 5px; line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,.35); border: 1.5px solid #fff; white-space: nowrap; }
.dmg.inline { position: static; display: inline-block; font-size: 12px; }
.tip-dmg { color: #ffb3a3; }
#ground .tile.flash .hit { fill: rgba(255, 80, 60, .35); stroke: #ff5a3c; stroke-width: 3; animation: glow .6s ease-in-out infinite; }
.damage-chip { position: absolute; z-index: 19; left: 12px; top: 170px; max-width: 250px; text-align: left; border: 3px solid #fff; border-radius: 14px;
  background: linear-gradient(#ff7a5e, #d8402e); color: #fff; padding: 7px 12px; box-shadow: 0 4px 0 rgba(0,0,0,.2); animation: bob 2s ease-in-out infinite; }
.damage-chip b { display: block; font-size: 14px; }
.damage-chip span { font-size: 12px; opacity: .95; }
.pen-actions { position: absolute; z-index: 5; display: flex; gap: 4px; }
.visit-needs { font-size: 13px; font-weight: 600; color: #6e3f1d; margin: 2px 0; }
.visit-btns { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
#visit-name { cursor: pointer; text-decoration: underline dotted; }
.fs-card .needs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 3px; font-size: 10px; }
.fs-card .needs span { background: #fff3c4; border-radius: 6px; padding: 0 3px; }
.fs-card .needs span.ripe { background: #ffe0f0; }
.subtabs.small .subtab { font-size: 12.5px; padding: 4px 9px; }
.loot-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.loot-sum div { background: #fff; border-radius: 10px; padding: 8px 6px; text-align: center; }
.loot-sum b { display: block; font-size: 20px; color: var(--wood-dark); }
.loot-sum span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.loot-totals { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.row.caught { background: #fff3ef; }
.linkish.plain { color: inherit; text-decoration: none; font: inherit; font-weight: 600; }
.linkish.plain:hover { text-decoration: underline; }
.re.clickable { cursor: pointer; }
.modal-card.wide { width: min(720px, 100%); }
/* profile */
.pf-head { display: flex; gap: 14px; align-items: center; }
.pf-av { width: 84px; height: 84px; flex: none; border-radius: 16px; background: #bfe6ff; border: 3px solid #fff; box-shadow: 0 0 0 3px #b07a3a; display: grid; place-items: center; font-size: 54px; }
.pf-head h2 { margin: 0; }
.pf-level { display: flex; align-items: center; gap: 6px; margin: 6px 0 3px; max-width: 320px; }
.pf-level .hud-star { width: 28px; height: 28px; }
.pf-level .hud-star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-level .qbar { flex: 1; margin: 0; }
.pf-special { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.pf-special span { background: #fff3c4; border: 2px solid #f0d58a; border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pf-badge { background: #fff; border-radius: 12px; padding: 8px 6px; text-align: center; border: 2px solid var(--cream-2); }
.pf-badge.none { opacity: .55; }
.pf-badge span { display: block; width: 44px; height: 44px; margin: 0 auto; }
.pf-badge span svg { width: 100%; height: 100%; }
.pf-badge b { display: block; font-size: 13px; }
.pf-badge i { font-style: normal; font-size: 11px; color: var(--muted); }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.pf-stats div { background: #fff; border-radius: 10px; padding: 6px 8px; }
.pf-stats b { display: block; font-size: 18px; color: var(--wood-dark); }
.pf-stats span { font-size: 12px; color: var(--muted); }
/* chat */
.nav-links .ni { display: inline-grid; place-items: center; }
.nav-links .badge { margin-left: 2px; }
.tab .badge { margin-left: 2px; font-size: 10px; padding: 0 4px; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; padding: 8px 5px; font-size: 12px; }
.thread { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 6px; cursor: pointer; border: 2px solid transparent; }
.thread:hover { border-color: var(--gold); }
.thread.town { background: linear-gradient(#e8f6ff, #d4ecfb); }
.thread .re { position: relative; font-size: 28px; width: 40px; text-align: center; }
.thread .re .on { position: absolute; right: 0; bottom: 2px; width: 10px; height: 10px; border-radius: 50%; background: #4fd84f; box-shadow: 0 0 0 2px #fff; }
.thread .rb { flex: 1; min-width: 0; }
.thread .rt { font-weight: 600; }
.thread .rs { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .ra { display: flex; gap: 4px; }
.badge.req { background: #f08a24; }
#panel-chat { display: flex; flex-direction: column; }
#panel-chat[hidden] { display: none; }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.chat-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--cream-2); flex-wrap: wrap; }
.chat-name { font-size: 15px; }
.chat-msgs { flex: 1; min-height: 160px; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .bubble { position: relative; background: #fff; border-radius: 14px 14px 14px 4px; padding: 7px 11px; box-shadow: 0 1px 2px rgba(0,0,0,.1); word-break: break-word; }
.msg.mine .bubble { background: #d9f5c4; border-radius: 14px 14px 4px 14px; }
.msg-who { font-size: 12px; margin: 0 0 2px 4px; }
.msg-who i { font-style: normal; color: var(--muted); }
.msg-time { font-size: 10.5px; color: var(--muted); margin: 1px 6px 0; }
.msg-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: #e2654c; color: #fff; font-size: 10px; line-height: 18px; padding: 0; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-del { opacity: 1; }
.msg.request .bubble { background: #fff7d6; border: 2px solid #f0d58a; }
.msg.mine.request .bubble { background: #eaf8dc; border-color: #b6e09a; }
.req { display: flex; gap: 8px; align-items: flex-start; }
.req > i { width: 36px; height: 36px; flex: none; }
.req > i svg { width: 100%; height: 100%; }
.req-note { font-style: italic; color: var(--muted); font-size: 13px; margin-top: 2px; }
.req-acts { display: flex; gap: 4px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 12px; }
.req-status { font-weight: 700; font-size: 12px; }
.req-status.sent { color: #2e8a1e; }
.req-status.declined, .req-status.cancelled { color: var(--muted); }
.composer { display: flex; gap: 6px; padding-top: 8px; border-top: 2px solid var(--cream-2); }
.composer input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--cream-2); outline: none; }
.composer input:focus { border-color: var(--gold); }
.sel { display: block; width: 100%; margin: 4px 0 10px; padding: 9px 10px; border-radius: 10px; border: 2px solid var(--cream-2); font: inherit; background: #fff; }
/* guide */
.guide { display: flex; gap: 14px; }
.guide-nav { display: flex; flex-direction: column; gap: 4px; flex: none; width: 190px; }
.guide-nav button { text-align: left; border: 0; border-radius: 10px; padding: 7px 10px; background: transparent; font-weight: 500; font-size: 14px; }
.guide-nav button:hover { background: var(--cream-2); }
.guide-nav button.active { background: var(--wood); color: #fff; }
.guide-body { flex: 1; min-width: 0; line-height: 1.5; }
.guide-body h2 { margin-top: 0; }
.guide-body ul, .guide-steps { padding-left: 20px; }
.guide-body li { margin-bottom: 4px; }
.gi { display: inline-block; width: 24px; height: 24px; vertical-align: -6px; }
.gi.big { width: 44px; height: 44px; float: left; margin: 0 10px 4px 0; }
.gi svg { width: 100%; height: 100%; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.guide-table th { text-align: left; color: var(--wood-dark); border-bottom: 2px solid var(--cream-2); padding: 3px 4px; }
.guide-table td { padding: 3px 4px; border-bottom: 1px solid #f3e6c8; }
.guide-table td .gi { width: 28px; height: 24px; }
@media (max-width: 760px) {
  .guide { flex-direction: column; }
  .guide-nav { flex-direction: row; overflow-x: auto; width: auto; }
  .guide-nav button { white-space: nowrap; }
  .damage-chip { top: 110px; left: 6px; max-width: 200px; padding: 5px 9px; }
  .damage-chip span { display: none; }
  .nav-links .ni { display: none !important; }
  .loot-sum b { font-size: 16px; }
  .pf-av { width: 64px; height: 64px; font-size: 40px; }
}

/* ===================== weather, orchard, notifications ===================== */
.title-chip { display: inline-block; background: #6e3f1d; color: #ffe9a8; font-size: 10px; font-weight: 600; padding: 0 6px; border-radius: 8px; vertical-align: 1px; }
.title-chip.big { font-size: 15px; padding: 3px 12px; border-radius: 12px; }

/* orchard */
.orchard { position: absolute; z-index: 1; }
.orchard .ground .ofloor { fill: #5fa83d; stroke: rgba(40, 80, 20, .45); stroke-width: 1.2; }
.orchard .ground .ofloor.locked { fill: #4d8a32; opacity: .7; }
.orchard .oslot .hit { fill: rgba(255,255,255,0); cursor: pointer; }
.orchard .oslot:hover .hit, .orchard .oslot.hover .hit { fill: rgba(255,255,255,.22); stroke: #fff; stroke-width: 2.5; }
.orchard .oslot.danger .hit { stroke: #ff4a2e; stroke-width: 3; animation: glow 1s ease-in-out infinite; }
.orchard .oslot.stealable .hit { stroke: #ff6fb0; stroke-width: 3; animation: glow 1.4s ease-in-out infinite; }
.orchard-sign { --post: 26px; }
.orchard-sign span { font-size: 12px !important; padding: 3px 9px !important; }
.sprite.tree .art { animation: sway 4s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: 50% 95%; }
.sprite .tcover, .sprite .pcover { position: absolute; inset: 0; pointer-events: none; }
.sprite .tcover svg, .sprite .pcover svg { width: 100%; height: 100%; }
.card .ce.tall { height: 78px; }
.card .ce.tall svg { width: 66px; height: 78px; }
@keyframes sway { 50% { transform: rotate(1.4deg); } }

/* weather damage on plots and trees */
.ground .tile.danger .hit { stroke: #ff4a2e; stroke-width: 3; animation: glow 1s ease-in-out infinite; }
.sprite .hazard { position: absolute; inset: 0; pointer-events: none; }
.sprite .hazard svg { width: 100%; height: 100%; }
.sprite .danger-badge { position: absolute; right: 8%; top: 42%; width: 22%; height: 22%; animation: bob 1s ease-in-out infinite; }
.sprite.tree .danger-badge { width: 20%; height: 17%; top: 8%; right: 12%; }
.sprite .danger-badge svg { width: 100%; height: 100%; }
.sprite .art.haz-frozen { filter: saturate(.3) hue-rotate(160deg) brightness(1.15); }
.sprite .art.haz-scorched { filter: sepia(.8) saturate(.8) brightness(.75); }
.sprite .art.haz-battered { transform: rotate(-24deg) translateY(6%); filter: saturate(.55) brightness(.9); }

.danger-chip { position: absolute; z-index: 19; left: 12px; top: 230px; max-width: 270px; border: 3px solid #fff; border-radius: 14px; cursor: pointer;
  background: linear-gradient(#ff5a5a, #b3261e); color: #fff; padding: 7px 12px; box-shadow: 0 4px 0 rgba(0,0,0,.2); animation: bob 2s ease-in-out infinite; }
.danger-chip b { display: block; font-size: 14px; }
.danger-chip > span { font-size: 12px; opacity: .95; display: block; }
.danger-chip .dc-btns { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.danger-chip .btn { color: var(--ink); }
.damage-chip:not([hidden]) ~ .danger-chip { top: 236px; }

/* weather widget */
.weather-w { position: absolute; z-index: 20; left: 12px; top: 108px; min-width: 190px; max-width: 250px; cursor: pointer; padding: 6px 10px;
  background: rgba(255, 250, 235, .93); border: 3px solid #b07a3a; border-radius: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.18); font-size: 13px; }
.weather-w:hover { background: #fff; }
.wx-season { font-weight: 600; color: var(--wood-dark); font-size: 12px; }
.wx-season span { color: var(--muted); font-weight: 400; }
.wx-now { display: flex; align-items: center; gap: 6px; }
.wx-now .wx-ic { font-size: 24px; line-height: 1.1; }
.wx-now .muted { margin-left: auto; font-size: 11px; }
.wx-next { display: flex; gap: 6px; font-size: 15px; }
.wx-next span.bad { filter: drop-shadow(0 0 3px #ff4a2e); }
.wx-warn { margin-top: 4px; background: #ffe2d6; color: #8a1f12; border-radius: 8px; padding: 3px 6px; font-weight: 600; font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.forecast { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.forecast .fc { background: var(--cream-2); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.forecast .fc.bad { background: #ffe2d6; }
.forecast .fc span { font-size: 30px; }
.forecast .fc i { font-style: normal; color: var(--muted); font-size: 12px; }
.forecast .fc small { font-size: 11px; line-height: 1.25; }
.inseason-list { display: flex; flex-wrap: wrap; gap: 6px; }
.inseason-list span { display: inline-flex; align-items: center; gap: 4px; background: var(--cream-2); border-radius: 10px; padding: 2px 8px 2px 2px; font-size: 13px; }
.inseason-list span .pic, .inseason-list span svg { width: 22px; height: 22px; }
.card .inseason { position: absolute; left: 4px; bottom: 4px; background: #ffe0f0; color: #a0306a; border-radius: 8px; font-size: 10px; padding: 0 5px; font-weight: 600; }
.stars { color: #f0a400; letter-spacing: -1px; }

/* weather effects over the farm */
.wx-layer { position: absolute; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.wx-layer i { position: absolute; display: block; }
.wx-rain i { width: 2px; height: 22px; background: linear-gradient(transparent, rgba(190, 220, 255, .85)); animation: rain linear infinite; }
.wx-snow i { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.9); animation: snow linear infinite; }
.wx-cyclone i.leaf { font-style: normal; font-size: 18px; animation: gust linear infinite; left: -10% !important; }
@keyframes rain { from { transform: translate(0, 0); } to { transform: translate(-60px, 110vh); } }
@keyframes snow { 0% { transform: translate(0, 0); } 50% { transform: translate(24px, 55vh); } 100% { transform: translate(-10px, 110vh); } }
@keyframes gust { from { transform: translate(0, 0) rotate(0); } to { transform: translate(120vw, -60px) rotate(1080deg); } }
.wx-layer .cloud { position: absolute; top: -40px; width: 340px; height: 120px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.85), rgba(255,255,255,0) 70%); animation: drift 60s linear infinite; }
.wx-rain .cloud, .wx-cyclone .cloud { background: radial-gradient(ellipse, rgba(110,120,135,.8), rgba(110,120,135,0) 70%); }
.wx-layer .cloud.c1 { left: -10%; } .wx-layer .cloud.c2 { left: 35%; top: -60px; animation-duration: 80s; } .wx-layer .cloud.c3 { left: 70%; animation-duration: 70s; }
@keyframes drift { 50% { transform: translateX(80px); } }
.wx-layer.wx-cloudy, .wx-layer.wx-rain { background: rgba(60, 80, 110, .14); }
.wx-layer.wx-snow { background: rgba(220, 235, 255, .2); }
.wx-layer.wx-cyclone { background: rgba(70, 70, 60, .18); }
.wx-layer.wx-heatwave { background: radial-gradient(circle at 85% 0%, rgba(255, 200, 60, .45), rgba(255, 120, 30, .14) 55%, rgba(255, 120, 30, .06)); }
.wx-layer .haze { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,0) 0 14px, rgba(255,220,150,.08) 14px 18px); animation: haze 3s ease-in-out infinite; }
@keyframes haze { 50% { transform: translateY(-6px) skewX(1deg); } }
.scene[data-weather="cyclone"] .sprite .art { animation: windy .8s ease-in-out infinite alternate; }
@keyframes windy { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
.scene[data-season="winter"] .scene-bg { filter: saturate(.75) brightness(1.05) hue-rotate(-8deg); }
.scene[data-season="autumn"] .scene-bg { filter: sepia(.25) saturate(1.15); }
.scene[data-season="summer"] .scene-bg { filter: saturate(1.1) brightness(1.03); }

/* notifications */
.toast.news-toast { pointer-events: auto; cursor: pointer; background: #fffaf0; color: var(--ink); border: 3px solid #b07a3a; border-radius: 16px; text-align: left; }
.toast.news-toast.cat-weather { border-color: #3d7fd6; background: #eef6ff; }
.toast.news-toast.cat-friends { border-color: #4caf50; background: #f1fbef; }
.news-head { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.news-head .subtab i { font-style: normal; font-size: 11px; opacity: .7; }
#panel-news .row.cat-weather .re { background: #e3efff; border-radius: 10px; }
.np-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #f3e6c8; cursor: pointer; }
.np-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: #6cb848; }
.np-row span { display: flex; flex-direction: column; }
.np-row small { color: var(--muted); }
.np-status { margin-top: 10px; background: var(--cream-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.fs-card .needs span.sos { background: #ff5a5a; color: #fff; animation: glow 1s ease-in-out infinite; }
.pf-mastery { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-mastery span { display: inline-flex; align-items: center; gap: 4px; background: var(--cream-2); border-radius: 10px; padding: 2px 8px 2px 2px; font-size: 13px; }
.pf-mastery span svg, .pf-mastery span .pic { width: 22px; height: 22px; }
.pf-mastery i { color: #f0a400; font-style: normal; }
.beast.still { animation: none; }

@media (max-width: 760px) {
  .weather-w { top: auto; bottom: 150px; left: 6px; min-width: 0; max-width: 160px; padding: 4px 7px; font-size: 11px; }
  .weather-w .wx-next, .weather-w .wx-season span { display: none; }
  .wx-now .wx-ic { font-size: 18px; }
  .danger-chip { top: 150px; left: 6px; max-width: 220px; padding: 5px 9px; }
  .danger-chip > span { display: none; }
  .damage-chip:not([hidden]) ~ .danger-chip { top: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .wx-layer i, .wx-layer .cloud, .wx-layer .haze, .sprite.tree .art, .danger-chip { animation: none !important; }
  .wx-layer i { display: none; }
}
.damage-chip { top: 214px; }
.danger-chip { top: 214px; }
.damage-chip:not([hidden]) ~ .danger-chip { top: 286px; }
@media (max-width: 760px) { .damage-chip { top: 110px; } .danger-chip { top: 110px; } .damage-chip:not([hidden]) ~ .danger-chip { top: 160px; } }
/* alert chips sit in the open sky between the player card and the big buttons */
@media (min-width: 1200px) {
  .damage-chip, .danger-chip { left: 292px; top: 64px; }
  .damage-chip:not([hidden]) ~ .danger-chip { left: 292px; top: 136px; }
}
@media (max-width: 760px) {
  .weather-w { top: 64px; bottom: auto; left: 6px; max-width: 150px; }
  .weather-w .wx-season, .weather-w .wx-warn { display: none; }
  .damage-chip, .danger-chip { top: 112px; }
  .damage-chip:not([hidden]) ~ .danger-chip { top: 160px; }
}
/* sprinkler & compost bin */
.sprite .spray { animation: spray 1.1s ease-in-out infinite; transform-origin: 50% 40%; }
.sprite .spin { animation: spin 1.6s linear infinite; transform-origin: 50px 40px; transform-box: view-box; }
.sprite .steam { animation: steam 2.4s ease-in-out infinite; }
@keyframes spray { 0% { opacity: .2; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.05); } 100% { opacity: .2; transform: scale(.85); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes steam { 0%, 100% { opacity: 0; transform: translateY(4px); } 50% { opacity: .8; transform: translateY(-3px); } }
.ground .tile.reach .hit { fill: rgba(120, 200, 255, .3); stroke: #7cc4ff; stroke-width: 2.5; stroke-dasharray: 5 3; }
@media (prefers-reduced-motion: reduce) { .sprite .spray, .sprite .spin, .sprite .steam { animation: none; } }
