@font-face { font-family: 'Rubik'; font-weight: 700; font-display: swap; src: url(fonts/rubik-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 700; font-display: swap; src: url(fonts/rubik-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-weight: 900; font-display: swap; src: url(fonts/rubik-cyrillic-900-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; font-weight: 900; font-display: swap; src: url(fonts/rubik-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --panel: rgba(32, 52, 30, 0.84);
  --edge: rgba(255, 255, 255, 0.14);
  --gold: #ffd23f;
  --ink: #2c3a24;
  --top: max(10px, env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --bottom: max(10px, env(safe-area-inset-bottom), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
  --left: max(10px, env(safe-area-inset-left), calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px)));
  --right: max(10px, env(safe-area-inset-right), calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px)));
  --common: #9aa6b8;
  --uncommon: #5fcf4a;
  --rare: #3f9fe0;
  --epic: #b45cff;
  --legendary: #ffb020;
  --mythic: #ff4d8d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #6fb04e; color: #fff;
  font-family: 'Rubik', system-ui, sans-serif; font-weight: 700;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none;
}
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.ico, .ico svg, button svg { display: block; }
img { -webkit-user-drag: none; user-select: none; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.topbar { position: absolute; top: var(--top); left: var(--left); right: var(--right); display: flex; gap: 8px; align-items: center; }
.stat {
  display: flex; align-items: center; gap: 6px; padding: 5px 13px 5px 7px; border-radius: 14px; color: #fff;
  background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  font-weight: 900; font-size: clamp(16px, 1.4vw + 10px, 24px); line-height: 1; white-space: nowrap;
}
.stat .ico svg { width: 1.45em; height: 1.45em; }
.stat.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 40% { transform: scale(1.12); } }
button.stat { pointer-events: auto; }
button.stat:active { transform: translateY(2px); }
.basket { background: rgba(110, 66, 26, 0.86); }
.round-btn {
  pointer-events: auto; width: 46px; height: 46px; border-radius: 14px; padding: 0; display: grid; place-items: center; flex: none;
  background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.round-btn svg { width: 26px; height: 26px; }
.round-btn:active { transform: translateY(2px); }
#btn-menu { margin-left: auto; }
#btn-gift { margin-left: auto; position: relative; }
#btn-gift:not([hidden]) + #btn-menu { margin-left: 0; }
#btn-gift svg { width: 28px; height: 28px; }
.level-badge {
  pointer-events: auto; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: conic-gradient(var(--gold) var(--p, 0%), rgba(0, 0, 0, 0.4) 0); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.level-badge b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #3d6a35; font-size: 17px; font-weight: 900; }
.level-badge:active { transform: translateY(2px); }
.round-btn.lang { width: auto; padding: 0 14px 0 10px; display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 16px; }

#weather { position: absolute; top: calc(var(--top) + 54px); left: var(--left); right: var(--right); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 12px; font-size: 15px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.9); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}
.chip svg { width: 26px; height: 26px; }
.chip.weather-storm { background: #4b5767; color: #fff; }
.chip.weather-gold { background: #ffe9a8; }
.chip.weather-stars { background: #2a2f63; color: #fff; }
.chip.weather-rainbow { background: linear-gradient(90deg, #ffe0e0, #fff4c4, #dcffd8, #d8ecff, #ecdcff); }
.chip.weather-aurora { background: #17414a; color: #fff; }
.chip.weather-meteor { background: #4a2030; color: #fff; }
.chip.weather-sandstorm { background: #e8c88a; }
.chip.weather-mirage { background: #fff0c8; }
.chip.weather-mist { background: #dde6e2; }
.chip.weather-fairy { background: #3a2a6a; color: #fff; }
.chip.weather-ash { background: #5a5450; color: #fff; }
.chip.weather-eruption { background: #6a1a0a; color: #fff; }
.chip.weather-chocorain { background: #6a3a28; color: #fff; }
.chip.weather-sugar { background: #ffe8f4; }
#weather .btn.small { padding: 6px 12px; font-size: 14px; }
#commerce { display: flex; gap: 8px; margin-left: auto; max-width: 100%; }
.compact-label, #weather-compact { display: none; }
.commerce-btn {
  pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 12px;
  border: 3px solid #6a3b08; border-radius: 6px; font-size: 16px; line-height: 1; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14), 0 3px 0 rgba(40, 18, 4, 0.4);
}
.commerce-btn svg { width: 25px; height: 25px; flex: none; }
.commerce-btn:active { transform: translateY(2px); }
.commerce-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.stars-entry { background: #ffd369; color: #4a230b; }
.bonuses-entry { background: #8661bb; color: #fff8e4; border-color: #493063; }

.bonus-offer {
  pointer-events: auto; position: absolute; left: var(--left); top: var(--bonus-top, calc(var(--top) + 174px)); width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border: 3px solid #503174; border-radius: 14px;
  background: #8a52c0; color: #fff8e4; box-shadow: 0 4px 0 #503174; font-size: 14px; line-height: 1.1; animation: panel-in 0.22s ease-out;
}
.bonus-offer.preview { background: #657067; border-color: #37443b; box-shadow: 0 4px 0 #37443b; }
.bonus-icons { display: flex; align-items: center; gap: 3px; }
.bonus-icons svg { width: 28px; height: 28px; }
.bonus-play svg { width: 20px; height: 20px; }
.bonus-offer small { font-size: 12px; }
.bonus-offer:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bonus h2 { padding: 0 28px; }
.bonus .stack > .btn { max-width: 100%; }
@media (max-height: 520px) {
  .bonus-offer { top: auto; bottom: calc(var(--bottom) + 76px); width: 106px; padding: 5px; font-size: 13px; }
  .bonus-icons svg { width: 22px; height: 22px; }
  .bonus-play svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .bonus-offer, .bonus .panel { animation: none; }
}

#side { position: absolute; right: var(--right); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.side-btn {
  pointer-events: auto; position: relative; width: 74px; padding: 6px 4px 7px; border-radius: 16px; border: 2px solid var(--edge);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 900;
  background: var(--panel); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}
.side-btn svg { width: 36px; height: 36px; }
.side-btn:active { transform: translateY(3px); }
.dot { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: #ff4d5e; border: 2px solid #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }

/* centered with auto margins: left: 50% would cap the bar at half the screen width */
#seedbar {
  position: absolute; bottom: var(--bottom); left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 20px);
  display: flex; gap: 8px; align-items: center; padding: 6px; min-height: 74px; border-radius: 18px; overflow-x: auto; scrollbar-width: none;
  background: rgba(32, 52, 30, 0.7); pointer-events: auto; touch-action: pan-x;
}
#seedbar::-webkit-scrollbar { display: none; }
.seed-card, .tool {
  position: relative; flex: none; width: 62px; height: 62px; padding: 3px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92); border: 3px solid var(--common); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.seed-card img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tool { border-color: #8a94a6; background: rgba(230, 236, 244, 0.95); }
.tool svg { width: 38px; height: 38px; }
.seed-card.selected, .tool.selected { transform: translateY(-6px); box-shadow: 0 0 0 3px #fff, 0 6px 0 rgba(0, 0, 0, 0.25); }
.seed-card .count { position: absolute; right: -4px; bottom: -4px; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #2c3a24; color: #fff; font-size: 13px; font-weight: 900; }
.rarity-common { border-color: var(--common); }
.rarity-uncommon { border-color: var(--uncommon); }
.rarity-rare { border-color: var(--rare); }
.rarity-epic { border-color: var(--epic); }
.rarity-legendary { border-color: var(--legendary); }
.rarity-mythic { border-color: var(--mythic); }
.buy-seeds { flex: none; }

.tag-slot { position: absolute; left: 0; top: 0; will-change: transform; }
/* the size follows the distance between the spots on screen (--spot, set by the HUD) */
.spot {
  pointer-events: auto; position: absolute; left: 0; top: 0; width: var(--spot, 38px); height: var(--spot, 38px); padding: calc(var(--spot, 38px) * 0.18); border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.9); background: rgba(69, 169, 42, 0.75); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.spot.taken { border-style: solid; background: rgba(255, 210, 63, 0.85); }
.spot svg { width: 100%; height: 100%; }
.tag {
  display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink); font-size: 13px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.tag svg { width: 16px; height: 16px; }
.tag .time, .tag .value, .tag .muts { display: flex; align-items: center; gap: 3px; }
.tag.grow { padding: 2px 7px 2px 4px; font-size: 12px; }
.tag .ring { width: 15px; height: 15px; border-radius: 50%; flex: none; position: relative; background: conic-gradient(#3f9fe0 var(--p), #d6dccb 0); }
.tag .ring::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #fff; }
.tag.thirsty .time svg { animation: drip 1s ease-in-out infinite; }
@keyframes drip { 50% { transform: translateY(-3px); } }
.tag.ready { background: #fff6c8; box-shadow: 0 0 0 2px #ffd23f, 0 3px 0 rgba(0, 0, 0, 0.2); }
.tag.price { background: rgba(60, 60, 60, 0.75); color: #fff; }
.tag.price.ok { background: #45a92a; animation: pulse 1.4s ease-in-out infinite; }
.tag.pest { background: #ff4d5e; color: #fff; padding: 2px 9px; animation: pulse 0.6s ease-in-out infinite; }
.tag .size { padding: 1px 6px; border-radius: 7px; background: linear-gradient(#ffcf4a, #f29a12); color: #5a2a00; font-size: 11px; text-transform: uppercase; }
.tag .size .short { display: none; }

.btn {
  pointer-events: auto; border: 0; border-radius: 16px; padding: 11px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 900; font-size: 19px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28); line-height: 1.05;
  box-shadow: 0 5px 0 var(--shade, #1d4a99), 0 9px 18px rgba(0, 0, 0, 0.2); transition: transform 0.08s, box-shadow 0.08s;
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--shade, #1d4a99), 0 4px 8px rgba(0, 0, 0, 0.2); }
.btn:disabled { filter: grayscale(0.7); opacity: 0.55; }
.btn.big { font-size: 22px; padding: 14px 26px; min-width: min(78vw, 280px); }
.btn.small { font-size: 15px; padding: 8px 12px; border-radius: 13px; gap: 5px; }
.btn.small svg { width: 19px; height: 19px; }
.btn-green { background: linear-gradient(#72d944, #45a92a); --shade: #2c7419; }
.btn-orange { background: linear-gradient(#ffb43c, #f2870f); --shade: #b05a05; }
.btn-blue { background: linear-gradient(#55a0ff, #2f6fd6); --shade: #1d4a99; }
.btn-ad { background: linear-gradient(#a174ff, #6d3fe0); --shade: #4523a3; }

#hint {
  position: absolute; top: calc(var(--top) + 100px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(90vw, 520px);
  padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.96); color: var(--ink);
  font-size: 16px; text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), 0 10px 24px rgba(0, 0, 0, 0.2);
}
#hint.pop { animation: hint-in 0.35s ease-out; }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -10px); } }
#toasts { position: absolute; top: calc(var(--top) + 150px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: 92vw; }
.toast { padding: 8px 18px; border-radius: 12px; background: var(--panel); font-weight: 900; font-size: 18px; text-align: center; animation: toast 2.6s forwards; }
.toast.good { color: #c6ff9d; }
.toast.bad { color: #ff9a9a; }
@keyframes toast { 0% { opacity: 0; transform: scale(0.8); } 10%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
.floater { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: 20px; color: var(--gold); text-shadow: 0 2px 0 #6b4a00, 0 0 6px rgba(0, 0, 0, 0.45); animation: float 1.1s ease-out forwards; white-space: nowrap; }
.floater.big { font-size: 28px; color: #fff3a0; text-shadow: 0 3px 0 #a04a00, 0 0 10px rgba(255, 160, 0, 0.8); }
@keyframes float { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -56px; } }
.flyer { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; transition: transform 0.6s cubic-bezier(0.5, -0.3, 0.7, 1), opacity 0.6s; }
#flash { position: absolute; inset: 0; opacity: 0; }
#flash.on { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

#screens { position: fixed; inset: 0; z-index: 10; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--top) max(12px, var(--right)) var(--bottom) max(12px, var(--left)); }
.screen.modal { background: rgba(14, 22, 12, 0.5); }
.screen .panel {
  position: relative; width: 100%; max-width: min(94vw, 460px); max-height: calc(100% - 8px); display: flex; flex-direction: column;
  padding: 20px 18px 20px; border-radius: 24px; text-align: center;
  background: linear-gradient(#3d6a35, #28472a); border: 3px solid #5f8f4f; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: panel-in 0.22s ease-out;
}
.screen .panel.wide { max-width: min(96vw, 780px); }
@keyframes panel-in { from { opacity: 0; transform: scale(0.93); } }
.screen h2 { margin: 0 0 12px; font-size: clamp(24px, 2vw + 16px, 32px); font-weight: 900; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.screen .sub { margin: 0 0 14px; font-size: 16px; opacity: 0.9; line-height: 1.35; }
.screen .sub.small { font-size: 13px; margin: 10px 0 0; }
.screen .big-line { font-size: 20px; opacity: 1; }
.close-btn { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.3); display: grid; place-items: center; z-index: 1; }
.close-btn svg { width: 22px; height: 22px; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.toggles { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; touch-action: pan-y; padding: 2px 4px 4px; }
.stars-shop h2, .bonuses h2 { padding: 0 32px; }
.store-intro { flex: none; }
.store-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.product-card, .ad-card { border: 2px solid rgba(255, 255, 255, 0.25); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, 0.07); min-width: 0; }
.product-card { display: flex; flex-direction: column; gap: 10px; }
.product-card.featured { grid-column: 1 / -1; border-color: #ffd23f; background: rgba(255, 210, 63, 0.14); }
.product-heading { display: flex; align-items: center; gap: 9px; }
.product-picture { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.product-picture svg, .product-picture img { width: 100%; height: 100%; object-fit: contain; }
.product-heading b { display: block; font-size: 19px; }
.product-heading small { display: block; margin-top: 3px; opacity: 0.85; font-size: 13px; }
.product-description { margin: 0; font-size: 15px; line-height: 1.3; }
.product-buy { margin-top: auto; display: flex; justify-content: flex-start; }
.product-buy .btn { min-height: 44px; }
.product-buy .maxed { display: flex; align-items: center; gap: 5px; }
.product-buy .maxed svg { width: 20px; height: 20px; }
.offer-label { color: #ffe07a; font-size: 14px; }
.store-note { margin: 0; font-size: 13px; line-height: 1.3; }
.bonus-actions { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.ad-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ad-card > svg { width: 34px; height: 34px; }
.ad-card b { display: block; font-size: 17px; }
.ad-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.25; }
.ad-card small { display: block; margin-top: 5px; font-size: 13px; opacity: 0.85; }
.ad-card .btn { min-height: 44px; }
.context-bonuses { margin-top: 10px; align-self: center; flex: none; }
@media (max-width: 560px) {
  .commerce-btn { min-height: 40px; padding: 5px 9px; font-size: 16px; }
  .commerce-btn svg { width: 23px; height: 23px; }
  .store-products { grid-template-columns: minmax(0, 1fr); }
  .product-card, .ad-card { padding: 10px; }
  .ad-card { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
  .ad-card > svg { width: 28px; height: 28px; }
  .ad-card .btn { grid-column: 2; justify-self: start; }
}
@media (max-height: 520px) {
  .commerce-btn { min-height: 35px; padding: 4px 8px; font-size: 14px; }
  .commerce-btn svg { width: 21px; height: 21px; }
  .store-intro { font-size: 13px !important; margin-bottom: 8px !important; }
  .product-card, .ad-card { padding: 8px; }
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.tab { border: 0; border-radius: 12px; padding: 8px 14px; font-size: 15px; font-weight: 900; background: rgba(0, 0, 0, 0.25); }
.tab.on { background: #fff; color: var(--ink); }
.coins-line, .restock { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 10px; font-size: 16px; flex-wrap: wrap; }
.coins-line svg, .restock svg { width: 22px; height: 22px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.guarantee { margin: -4px 0 10px; font-size: 13px; opacity: 0.95; }
.guarantee .rarity-rare { color: #8fd0ff; }
.guarantee .rarity-epic { color: #e0b0ff; }
.guarantee .rarity-legendary { color: #ffd27a; }
.guarantee .rarity-mythic { color: #ff9ac0; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.08); text-align: left; }
.row.out { opacity: 0.55; }
.row[class*='rarity-'] { border-left: 6px solid; }
.row .thumb { width: 54px; height: 54px; flex: none; object-fit: contain; border-radius: 12px; background: rgba(255, 255, 255, 0.85); padding: 2px; }
.row .thumb.icon { display: grid; place-items: center; padding: 9px; }
.row .thumb.icon svg { width: 100%; height: 100%; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.row-text b { font-size: 16px; font-weight: 900; }
.row-text small { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; opacity: 0.85; }
.row-text small svg { width: 15px; height: 15px; }
.rarity { font-style: normal; font-size: 11px; text-transform: uppercase; opacity: 0.9; }
.rarity-uncommon .rarity { color: #9dff7d; }
.rarity-rare .rarity { color: #8fd0ff; }
.rarity-epic .rarity { color: #e0b0ff; }
.rarity-legendary .rarity { color: #ffd27a; }
.rarity-mythic .rarity { color: #ff9ac0; }
.stock { font-size: 15px; font-weight: 900; min-width: 34px; text-align: center; }
.row-buttons { display: flex; gap: 6px; flex: none; align-items: center; }
.maxed { color: var(--gold); font-weight: 900; padding: 0 6px; display: flex; }
.maxed svg { width: 26px; height: 26px; }
.pips { display: flex; gap: 4px; margin-top: 2px; }
.pips i { width: 16px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
.pips i.on { background: var(--gold); }
.row .value, .row .muts { display: flex; align-items: center; gap: 3px; font-weight: 900; }
.row .value svg { width: 20px; height: 20px; }
.row .muts svg, .tag .muts svg { width: 16px; height: 16px; }

.egg-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 12px; border-radius: 18px; background: rgba(255, 210, 63, 0.18); border: 2px solid rgba(255, 210, 63, 0.5); text-align: left; }
.thumb.big { width: 72px; height: 72px; }
.egg-card .thumb { border-radius: 14px; background: rgba(255, 255, 255, 0.85); }
/* on narrow panels the price button moves under the text instead of covering it */
.egg-card { flex-wrap: wrap; }
.egg-card .row-text { flex: 1 1 120px; }
.egg-card .btn { margin-left: auto; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pet-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); }
.pet-card img { width: 84px; height: 84px; object-fit: contain; }
.pet-card small { font-size: 12px; opacity: 0.9; min-height: 2.4em; }
.pet-card.unknown img { filter: brightness(0) opacity(0.4); }

.alm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.alm-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); border: 2px solid; }
.alm-card img { width: 70px; height: 70px; object-fit: contain; }
.alm-card.unknown img { filter: brightness(0) opacity(0.35); }
.alm-card b { font-size: 14px; }
.alm-card small { display: flex; align-items: center; gap: 3px; font-size: 12px; opacity: 0.85; }
.alm-card small svg { width: 15px; height: 15px; }
.badges { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.size-dot { font-style: normal; font-size: 10px; padding: 1px 4px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); opacity: 0.45; }
.size-dot.on { background: linear-gradient(#ffcf4a, #f29a12); color: #5a2a00; opacity: 1; }
.mut { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(0, 0, 0, 0.3); opacity: 0.35; }
.mut svg { width: 17px; height: 17px; }
.mut.on { background: rgba(255, 255, 255, 0.85); opacity: 1; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.land-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 18px; border: 3px solid rgba(255, 255, 255, 0.15); }
.land-card img { width: 84px; height: 84px; object-fit: contain; }
.land-card b { font-size: 16px; }
.land-card .info { font-size: 12px; opacity: 0.9; min-height: 2.4em; }
.land-card.here { border-color: var(--gold); }
.land-card.locked img { filter: grayscale(0.8) brightness(0.75); }
.land-status { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 42px; justify-content: center; }
.land-status small { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.land-status small svg { width: 16px; height: 16px; flex: none; }
.land-status .here { padding: 5px 12px; border-radius: 12px; background: var(--gold); color: #5a3a00; font-size: 14px; }
.land-dacha { background: linear-gradient(#5f9a45, #35602e); }
.land-island { background: linear-gradient(#2fa8b8, #1f6a7a); }
.land-valley { background: linear-gradient(#6a9ac0, #3a5a80); }
.land-moon { background: linear-gradient(#4a3a7a, #1f1a3a); }
.land-oasis { background: linear-gradient(#d89a4a, #9a5a2a); }
.land-forest { background: linear-gradient(#2f6a4a, #163a2a); }
.land-volcano { background: linear-gradient(#8a2a14, #3a120a); }
.land-candy { background: linear-gradient(#f07ab0, #b04a8a); }
.land-greenhouse { background: linear-gradient(#5aa88a, #2f6a52); }
.land-orchard { background: linear-gradient(#8ab84a, #4a7a2a); }
.land-pond { background: linear-gradient(#3a9ad0, #1f5a8a); }
.land-mushroom { background: linear-gradient(#6a4a7a, #2f2038); }
.map .list-title { margin: 4px 0 8px; }
.beauty { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; padding: 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); font-size: 14px; }
.beauty svg { width: 18px; height: 18px; }
.decor .row.chosen { border-color: var(--gold); }
.decor .here-row { margin-bottom: 8px; background: rgba(255, 210, 63, 0.18); }
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 12px; }
.gift-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); border: 2px solid transparent; }
.gift-day:last-child { grid-column: span 2; background: rgba(255, 210, 63, 0.18); }
.gift-day small { font-size: 12px; opacity: 0.85; }
.gift-day b { font-size: 11px; line-height: 1.2; }
.gift-icons { display: flex; gap: 2px; }
.gift-icons svg { width: 26px; height: 26px; }
.gift-day.today { border-color: var(--gold); background: rgba(255, 210, 63, 0.25); animation: pulse 1.4s ease-in-out infinite; }
.gift-day.done { opacity: 0.55; }
.btn .currency { width: 20px; height: 20px; }
.product .maxed { gap: 4px; align-items: center; font-size: 14px; }

.quest .progress { display: block; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.35); overflow: hidden; margin: 3px 0; }
.quest .progress i { display: block; height: 100%; background: linear-gradient(#ffe36a, #ffb020); }
.quest.claimed { opacity: 0.6; }

.record-best { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.record-best img { width: 72px; height: 72px; border-radius: 14px; background: rgba(255, 255, 255, 0.85); }
.record-best span { display: flex; flex-direction: column; text-align: left; }
.record-best b { font-size: 26px; color: var(--gold); }
.level-big { display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(#ffe36a, #f2a20f); color: #5a3a00; font-size: 30px; font-weight: 900; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.level-big.huge { width: 120px; height: 120px; font-size: 56px; animation: hatch 0.6s ease-out; }
.level-progress { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.level-progress .progress { display: block; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.level-progress .progress i { display: block; height: 100%; background: linear-gradient(#ffe36a, #ffb020); }
.list-title { margin: 6px 0 8px; font-size: 18px; }
.level-num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 210, 63, 0.25); border: 2px solid var(--gold); font-size: 18px; font-weight: 900; }
.level-row small svg { width: 18px; height: 18px; }
.board { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 40vh; overflow-y: auto; }
.board-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); text-align: left; }
.board-row.me { background: rgba(255, 210, 63, 0.3); }
.board-row span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help { text-align: left; margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.35; }
.hatch img { width: 150px; height: 150px; animation: hatch 0.6s ease-out; }
@keyframes hatch { 0% { transform: scale(0.2) rotate(-20deg); } 60% { transform: scale(1.15) rotate(6deg); } }

#loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(#7cc35a, #3f7a32); font-size: 20px; }
#boot-error { max-width: min(90vw, 560px); margin: 0; padding: 0 16px; text-align: center; font-size: 18px; line-height: 1.4; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.25); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* portrait phones: the side buttons become a row above the seeds */
@media (orientation: portrait) {
  #side { top: auto; transform: translateX(-50%); left: 50%; right: auto; bottom: calc(var(--bottom) + 84px); flex-direction: row; gap: 8px; }
  .side-btn { width: 70px; }
  /* the strip between the garden and the buttons is free, while the top holds the weather and ad buttons */
  #hint { top: auto; bottom: calc(var(--bottom) + 172px); }
  #hint.pop { animation: none; }
}
@media (max-width: 560px), (max-height: 520px) {
  .stat { padding: 4px 10px 4px 5px; gap: 4px; }
  .round-btn { width: 40px; height: 40px; }
  .level-badge { width: 40px; height: 40px; }
  .level-badge b { width: 31px; height: 31px; font-size: 15px; }
  .round-btn svg { width: 22px; height: 22px; }
  .side-btn { width: 62px; font-size: 11px; padding: 5px 3px 6px; }
  .side-btn svg { width: 30px; height: 30px; }
  .seed-card, .tool { width: 54px; height: 54px; }
  #seedbar { gap: 6px; padding: 5px; min-height: 64px; }
  .row { gap: 8px; padding: 6px 8px; }
  .row .thumb { width: 44px; height: 44px; }
  .row-text b { font-size: 15px; }
  .btn.big { font-size: 19px; padding: 12px 22px; }
  .screen .panel { padding: 16px 12px 16px; }
}
/* narrow phones: the basket shows only how many crops it holds, tags use short size marks */
@media (max-width: 440px) {
  #basket-sum { display: none; }
  .stat { font-size: 16px; }
  .tag { font-size: 12px; padding: 2px 6px; }
  .tag .size .long { display: none; }
  .tag .size .short { display: inline; }
}
@media (orientation: portrait) and (max-width: 560px) {
  #side { bottom: calc(var(--bottom) + 74px); gap: 6px; }
  #hint { bottom: calc(var(--bottom) + 150px); font-size: 15px; }
}
@media (max-height: 520px) {
  #weather { top: calc(var(--top) + 48px); }
  .tag { font-size: 11px; padding: 2px 6px; gap: 3px; }
  .tag svg { width: 13px; height: 13px; }
  .seed-card, .tool { width: 48px; height: 48px; }
  #seedbar { min-height: 58px; }
  #hint { top: auto; bottom: calc(var(--bottom) + 80px); left: 10px; transform: none; max-width: 30vw; font-size: 13px; padding: 7px 11px; text-align: left; }
  #hint.pop { animation: none; }
  #toasts { top: calc(var(--top) + 96px); }
  .toast { font-size: 15px; padding: 6px 14px; }
  .side-btn { flex-direction: row; width: auto; padding: 4px 8px; gap: 4px; }
  .side-btn svg { width: 24px; height: 24px; }
  #side { gap: 6px; }
  .screen .panel { padding: 12px 12px 12px; }
  .screen h2 { margin-bottom: 6px; font-size: 22px; }
  /* the big picture of a window gives way to its text and button on a low screen */
  .hatch img { width: 96px; height: 96px; }
  .level-big.huge { width: 76px; height: 76px; font-size: 36px; }
  /* a smaller close button keeps clear of the first line under the title */
  .close-btn { width: 32px; height: 32px; top: 6px; right: 6px; }
  .close-btn svg { width: 18px; height: 18px; }
}
@media (max-width: 560px), (max-height: 520px) {
  #weather { flex-wrap: nowrap; }
  #weather > #btn-rain, #weather > #btn-boost { display: none !important; }
  .commerce-btn { min-height: 40px; white-space: nowrap; }
}
@media (max-width: 560px) {
  #weather { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: stretch; }
  #weather-chip { min-width: 0; min-height: 40px; padding: 4px 6px; gap: 4px; justify-content: center; font-size: 16px; overflow: hidden; }
  #weather-chip svg { width: 22px; height: 22px; flex: none; }
  #weather-text, #btn-store .full-label { display: none; }
  #weather-compact, #btn-store .compact-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #commerce { margin-left: 0; gap: 6px; }
  .commerce-btn { gap: 4px; padding: 5px 7px; font-size: 16px; }
  .commerce-btn svg { width: 22px; height: 22px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #weather { right: calc(var(--right) + 110px); }
}
