@font-face { font-family: 'Outfit'; font-weight: 400; font-display: swap; src: url('../fonts/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; font-display: swap; src: url('../fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-display: swap; src: url('../fonts/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url('../fonts/outfit-latin-700-normal.woff2') format('woff2'); }

/* Meadowcomb — "cozy premium": deep bark panels, glowing honey accents, glass HUD over the meadow.
   Single committed dark UI over a painted scene (no light/dark switching by design). */
:root {
  color-scheme: dark;
  --bark: #1A110A; --bark-2: #241810; --card: #2C1E12; --card-2: #36261A;
  --line: rgba(255, 214, 150, .12); --line-2: rgba(255, 214, 150, .22);
  --text: #FFF3DF; --text-2: #D8C1A0; --text-3: #A38A6A;
  --honey: #F6A91B; --honey-hi: #FFC94A; --honey-lo: #C97D0A; --honey-ink: #2A1705;
  --cream: #F6DCC4; --danger: #F06A55; --ok: #9BD37F;
  --glass: rgba(24, 15, 8, .66);
  --r: 14px;
  --font: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bark); color: var(--text); font-family: var(--font); font-weight: 500; }
body { overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--honey-hi); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.ico { display: inline-block; width: 1.4em; height: 1.4em; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }

#app { position: fixed; inset: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }

/* ---------- HUD (glass over the scene) ---------- */
#hud { position: absolute; left: 0; top: 0; right: 0; padding: max(8px, env(safe-area-inset-top)) 12px 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 5; }
#hud > * { pointer-events: auto; }
.landscape #hud { right: var(--panel-w); }
.hud-top { width: 100%; max-width: 560px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px; background: var(--glass); border: 1px solid var(--line-2); border-radius: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(20, 10, 2, .25); }
.honey-wrap { text-align: center; min-width: 0; }
.honey-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.honey-ico { width: clamp(22px, 4.6vw, 28px); height: clamp(22px, 4.6vw, 28px); }
#honey { font-weight: 700; font-size: clamp(26px, 6.6vw, 38px); line-height: 1; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.sub { font-size: clamp(12px, 3.1vw, 14px); color: var(--text-2); font-weight: 500; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub #hps { color: var(--honey-hi); font-weight: 600; }
.dotsep { margin: 0 6px; opacity: .5; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 48px; padding: 4px 12px 4px 7px; background: rgba(255, 220, 160, .07); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--cream); }
.chip .ico { width: 24px; height: 24px; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255, 220, 160, .07); border: 1px solid var(--line); border-radius: 12px; }
.icon-btn .ico { width: 24px; height: 24px; }

.goal { width: 100%; max-width: 460px; display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; row-gap: 5px; align-items: center; padding: 7px 12px 8px; background: var(--glass); border: 1px solid var(--line-2); border-radius: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: left; }
.goal-label { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--honey-ink); background: var(--honey-hi); padding: 2px 7px; border-radius: 6px; }
.goal-text { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.goal-reward { font-size: 12px; font-weight: 600; color: var(--honey-hi); white-space: nowrap; }
.goal-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: rgba(255, 220, 160, .12); overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--honey), var(--honey-hi)); border-radius: inherit; transition: width .25s ease-out; }
.goal.flash { animation: goalFlash .7s ease-out; }
@keyframes goalFlash { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 74, .8); transform: scale(1); } 30% { transform: scale(1.03); } 100% { box-shadow: 0 0 0 14px rgba(255, 201, 74, 0); transform: scale(1); } }

.boosts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.boost { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13px; padding: 5px 11px 5px 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line-2); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.boost .ico { width: 22px; height: 22px; }
.boost.rush { background: linear-gradient(90deg, var(--honey-hi), var(--honey)); color: var(--honey-ink); border-color: transparent; animation: pulse .8s ease-in-out infinite alternate; }
.boost.ad { color: var(--ok); }
.boost.ad-btn { cursor: pointer; min-height: 48px; border-color: var(--honey); }
@keyframes pulse { to { transform: scale(1.05); } }

.tap-hint { position: absolute; transform: translate(-50%, 0); padding: 7px 14px; background: var(--glass); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 15px; border-radius: 999px; pointer-events: none; white-space: nowrap; z-index: 4; animation: bob 1s ease-in-out infinite alternate; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@keyframes bob { to { transform: translate(-50%, -6px); } }
.combo { position: absolute; transform: translate(-50%, -50%); min-width: 116px; padding: 5px 14px; border-radius: 999px; overflow: hidden; background: var(--glass); border: 1px solid var(--line-2); text-align: center; font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--text); pointer-events: none; z-index: 4; opacity: 0; transition: opacity .2s; white-space: nowrap; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.combo i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(246, 169, 27, .35), rgba(255, 201, 74, .55)); transition: width .12s; }
.combo span { position: relative; }
.combo.on { opacity: 1; }
.combo.max { background: linear-gradient(90deg, #FFE27A, var(--honey-hi), var(--honey)); color: var(--honey-ink); border-color: #FFF1B8; animation: maxGlow .45s ease-in-out infinite alternate; }
.combo.max i { display: none; }
@keyframes maxGlow { from { box-shadow: 0 0 0 0 rgba(255, 210, 80, .7); transform: translate(-50%, -50%) scale(1); } to { box-shadow: 0 0 22px 4px rgba(255, 210, 80, .55); transform: translate(-50%, -50%) scale(1.07); } }

/* ---------- shop panel ---------- */
#panel { position: absolute; left: 0; right: 0; bottom: 0; height: var(--panel-h); background: var(--bark); border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 30px rgba(20, 10, 2, .35); display: flex; flex-direction: column; z-index: 6; padding-bottom: env(safe-area-inset-bottom); }
.landscape #panel { left: auto; top: 0; width: var(--panel-w); height: auto; border-top: 0; border-left: 1px solid var(--line-2); border-radius: 20px 0 0 20px; box-shadow: -12px 0 30px rgba(20, 10, 2, .35); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 10px 0; padding: 4px; background: var(--bark-2); border: 1px solid var(--line); border-radius: 14px; }
.tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-3); }
.tab .ico { width: 22px; height: 22px; opacity: .7; }
.tab[aria-selected="true"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tab[aria-selected="true"] .ico { opacity: 1; }
.tab .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--honey-hi); box-shadow: 0 0 8px var(--honey-hi); display: none; }
.tab.has-dot .dot { display: block; }
.buymode { display: flex; gap: 4px; padding: 8px 10px 2px; }
.buymode button { flex: 1; min-height: 44px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--text-3); border: 1px solid var(--line); }
.buymode button[aria-pressed="true"] { background: var(--honey); color: var(--honey-ink); border-color: transparent; }
.list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 7px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--card-2) transparent; }

/* producer / upgrade card */
.card { position: relative; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 11px; width: 100%; padding: 8px 9px 8px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-align: left; transition: transform .08s, background .15s; }
.card:active { transform: scale(.985); }
.card .icon { width: 50px; height: 50px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #54391F, #3A2716); display: grid; place-items: center; position: relative; }
.card .icon svg { width: 40px; height: 40px; }
.card .icon .badge { position: absolute; right: -5px; bottom: -5px; background: var(--honey-hi); color: var(--honey-ink); font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 7px; }
.card .info { min-width: 0; }
.card .name { font-weight: 600; font-size: 15px; line-height: 1.15; display: flex; align-items: baseline; gap: 7px; color: var(--text); }
.card .name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .owned { font-size: 14px; color: var(--honey-hi); font-weight: 700; }
.card .desc { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ms { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.card .ms .bar { flex: 1; height: 4px; border-radius: 99px; background: rgba(255, 220, 160, .1); overflow: hidden; }
.card .ms .bar i { display: block; height: 100%; width: 0; background: var(--honey); border-radius: inherit; }
.card .price { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 80px; min-height: 48px; padding: 4px 10px; border-radius: 11px; background: #3A2A1B; color: #BCA483; font-weight: 700; }
.card .price .qty { font-size: 11px; font-weight: 600; opacity: .85; }
.card .price .cost { font-size: 15px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.card .price .cost .ico { width: 15px; height: 15px; }
.card.can .price { background: linear-gradient(180deg, var(--honey-hi), var(--honey)); color: var(--honey-ink); box-shadow: 0 2px 10px rgba(246, 169, 27, .25); }
.card.can { border-color: var(--line-2); }
.card.locked { background: transparent; border-style: dashed; cursor: default; }
.card.locked .icon { background: var(--bark-2); }
.card.locked .icon svg { filter: brightness(0) invert(1); opacity: .12; }
.card.locked .price { visibility: hidden; }
.card.pop .icon { animation: iconPop .35s cubic-bezier(.3, 1.6, .5, 1); }
.card.flash { animation: cardFlash .45s ease-out; }
.card.shake { animation: shake .3s; }
@keyframes iconPop { 0% { transform: scale(1); } 40% { transform: scale(1.2) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes cardFlash { 0% { background: #5A3E1E; } 100% { background: var(--card); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.empty { text-align: center; color: var(--text-2); font-weight: 500; padding: 24px 12px; }
.list-note { text-align: center; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 2px 0 2px; }

/* swarm tab */
.sw-hero { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sw-hero .ico { width: 50px; height: 50px; }
.sw-hero b { font-size: 20px; font-weight: 700; display: block; }
.sw-hero span { color: var(--text-2); font-weight: 500; font-size: 13px; }
.sw-box { padding: 12px; background: var(--bark-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; }
.sw-box p { margin: 0; font-weight: 500; font-size: 13.5px; color: var(--text-2); line-height: 1.35; }
.sw-gain { font-size: 19px !important; font-weight: 700 !important; color: var(--honey-hi) !important; }
.pbar { height: 6px; border-radius: 99px; background: rgba(255, 220, 160, .1); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--honey), var(--honey-hi)); border-radius: inherit; }
.big-btn { min-height: 50px; border-radius: 13px; font-weight: 700; font-size: 17px; background: linear-gradient(180deg, var(--honey-hi), var(--honey)); color: var(--honey-ink); box-shadow: 0 4px 16px rgba(246, 169, 27, .3); }
.big-btn:disabled { background: #3A2A1B; color: #BCA483; box-shadow: none; cursor: default; }
.big-btn.glow { animation: glow 1.1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 5px rgba(255, 201, 74, .25), 0 4px 22px rgba(246, 169, 27, .5); } }
.meadows { display: flex; flex-direction: column; gap: 6px; }
.meadow { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px 7px 7px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; }
.meadow .sw { width: 54px; height: 38px; border-radius: 8px; overflow: hidden; }
.meadow .sw svg, .meadow-art svg { display: block; width: 100%; height: 100%; }
.meadow b { font-size: 14px; font-weight: 600; display: block; color: var(--text); }
.meadow span { color: var(--text-2); font-weight: 500; }
.meadow .st { font-weight: 600; font-size: 12px; color: var(--text-3); text-align: right; }
.meadow.cur { border-color: var(--honey); box-shadow: 0 0 0 1px var(--honey) inset; }
.meadow.cur .st { color: var(--honey-hi); }
.meadow.lock { opacity: .55; }
.meadow.next-ready { opacity: 1; border-color: var(--honey-hi); }
.meadow.next-ready .st { color: var(--honey-hi); }
.sw-box.ready { border-color: var(--honey); box-shadow: 0 0 0 1px var(--honey) inset, 0 0 24px rgba(246, 169, 27, .18); }
.sw-ready { color: var(--text) !important; }
.boost.test { color: #FFB4A6; border-color: #F06A55; }
.boost.meadow-btn { cursor: pointer; min-height: 48px; background: linear-gradient(90deg, var(--honey-hi), var(--honey)); color: var(--honey-ink); border-color: transparent; animation: pulse .9s ease-in-out infinite alternate; }
.meadow-art { width: 180px; height: 128px; margin: 0 auto 6px; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px var(--line-2); }

/* banners */
#banners { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; }
.landscape #banners { right: var(--panel-w); }
.banner { max-width: calc(100% - 32px); text-align: center; white-space: normal !important; line-height: 1.25; padding: 8px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: bannerIn .35s cubic-bezier(.3, 1.5, .5, 1) both; white-space: nowrap; }
.banner.gold { background: linear-gradient(90deg, #FFE27A, var(--honey-hi), var(--honey)); color: var(--honey-ink); border-color: transparent; font-weight: 700; }
.banner.out { animation: bannerOut .3s ease-in both; }
@keyframes bannerIn { from { transform: translateY(-14px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bannerOut { to { transform: translateY(-10px); opacity: 0; } }

/* modals */
#modals { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.modal-back { position: absolute; inset: 0; background: rgba(10, 6, 2, .6); display: grid; place-items: center; padding: 16px; pointer-events: auto; animation: fadeIn .2s both; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal { position: relative; width: min(420px, 100%); max-height: calc(100% - 16px); overflow-y: auto; background: linear-gradient(180deg, #2A1C11, var(--bark)); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); padding: 22px 18px 16px; text-align: center; animation: modalIn .35s cubic-bezier(.3, 1.3, .5, 1) both; }
.modal h2 { margin: 6px 0 8px; font-size: 23px; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.modal p { margin: 6px 0; font-weight: 500; color: var(--text-2); font-size: 15px; line-height: 1.4; }
.modal p b { color: var(--text); font-weight: 600; }
.modal .hero-ico { width: 64px; height: 64px; margin: 0 auto; }
.modal .big-num { font-size: 32px; font-weight: 700; color: var(--honey-hi); margin: 6px 0; }
.modal .btns { display: flex; gap: 8px; margin-top: 16px; }
.modal .btns button { flex: 1; min-height: 48px; border-radius: 13px; font-weight: 600; font-size: 16px; background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.modal .btns button.primary { background: linear-gradient(180deg, var(--honey-hi), var(--honey)); color: var(--honey-ink); font-weight: 700; border-color: transparent; }
.modal .x { position: absolute; top: 6px; right: 6px; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; font-weight: 500; color: var(--text-3); }
.modal-back.out { animation: fadeOut .18s both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { transform: translateY(18px) scale(.94); opacity: 0; } }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-weight: 600; text-align: left; }
.set-row input[type=range] { width: 50%; accent-color: var(--honey); height: 28px; }
.toggle { min-width: 64px; min-height: 44px; border-radius: 999px; font-weight: 600; background: #3A2A1B; color: #BCA483; }
.toggle[aria-pressed="true"] { background: var(--honey); color: var(--honey-ink); }
.seg { display: flex; gap: 4px; }
.seg button { min-height: 44px; padding: 0 12px; border-radius: 9px; font-weight: 600; border: 1px solid var(--line); color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--honey); color: var(--honey-ink); border-color: transparent; }
.stats { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.stats td { padding: 5px 2px; text-align: left; font-weight: 500; color: var(--text-2); }
.stats td:last-child { text-align: right; color: var(--text); font-weight: 600; }
.credits { font-size: 12px !important; color: var(--text-3) !important; margin-top: 12px !important; }
.perk { display: inline-block; margin-top: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 201, 74, .12); border: 1px solid var(--honey); color: var(--honey-hi); font-weight: 600; }

/* splash */
#splash { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #3A2716, var(--bark) 70%); transition: opacity .45s; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-logo svg { width: 84px; height: 84px; filter: drop-shadow(0 0 24px rgba(246, 169, 27, .45)); animation: bob 0.9s ease-in-out infinite alternate; }
.splash-title { font-weight: 700; font-size: 28px; letter-spacing: .02em; color: var(--text); }
.splash-bar { width: 140px; height: 4px; border-radius: 99px; background: rgba(255, 220, 160, .12); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 30%; background: var(--honey); border-radius: inherit; animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

.reduce *, .reduce *::before { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .combo.max, .boost.rush, .big-btn.glow, .tap-hint { animation: none; } }

@media (max-height: 520px) {
  .goal { padding: 4px 10px 5px; }
  .goal-reward { display: none; }
  #honey { font-size: 26px; }
  .hud-top { padding: 4px; }
}
