:root {
  --bg: #fdf6e3; --panel: rgba(255, 252, 242, .96); --ink: #2f3a2c; --muted: #7a806f; --line: #e6dcc0;
  --green: #3f9b4f; --green-d: #2c7a3a; --gold: #f3b52f; --red: #e0533d; --blue: #3a8fd9;
  --shadow: 0 10px 30px rgba(40, 30, 10, .25); --r: 18px;
  --font-h: 'Fredoka', 'Nunito', system-ui, sans-serif; --font-b: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fc8e8; color: var(--ink); font-family: var(--font-b); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-h); margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 16px; }
.ic { display: inline-block; vertical-align: -4px; flex-shrink: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .pos { color: var(--green-d); font-weight: 800; } .neg { color: var(--red); font-weight: 800; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.row.center, .center { justify-content: center; text-align: center; }
.spacer { flex: 1; }
#world { position: fixed; inset: 0; }
#world canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* HUD */
#hud { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; background: linear-gradient(180deg, rgba(76, 175, 80, .96), rgba(46, 125, 50, .96)); color: #fff; border-radius: 22px; box-shadow: var(--shadow); max-width: calc(100vw - 20px); flex-wrap: wrap; justify-content: center; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 38px; height: 38px; border-radius: 11px; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotate(-6deg) translateY(-2px); } }
.zname { font-family: var(--font-h); font-weight: 700; font-size: 17px; cursor: pointer; line-height: 1.1; }
.brand .sub { font-size: 12px; font-weight: 700; opacity: .9; }
.hchips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 4px 10px; display: flex; align-items: center; gap: 5px; font-weight: 800; white-space: nowrap; }
.chip small { font-weight: 600; opacity: .85; font-size: 11px; }
.chip.money { background: #fff; color: var(--green-d); font-size: 17px; min-width: 110px; justify-content: center; font-family: var(--font-h); }
.chip.money.neg { color: var(--red); }
.chip.money.pulse { animation: pulseM .6s; }
@keyframes pulseM { 30% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 235, 59, .6); } }
.clock { width: 70px; height: 7px; background: rgba(0, 0, 0, .22); border-radius: 9px; overflow: hidden; display: block; }
.clock i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe082, #ffb300); }
.delta { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.delta.pos { background: #c8f7c5; color: #1b5e20; } .delta.neg { background: #ffd6cf; color: #b71c1c; }
.speed { display: flex; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 3px; gap: 2px; }
.speed button { border: 0; background: transparent; padding: 5px 8px; border-radius: 999px; line-height: 0; }
.speed button.on { background: rgba(255, 255, 255, .95); }
.speed button.on .ic path, .speed button.on .ic rect { fill: var(--green-d); }
.speed button:hover:not(.on) { background: rgba(255, 255, 255, .2); }

/* dock */
#dock { position: fixed; left: 10px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); max-height: calc(100vh - 160px); overflow-y: auto; scrollbar-width: none; }
.dock-btn { position: relative; border: 0; background: transparent; border-radius: 14px; padding: 6px 4px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; font-weight: 800; color: var(--muted); width: 58px; transition: background .2s, transform .15s; }
.dock-btn:hover { background: #fff; transform: scale(1.06); }
.dock-btn.on { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .1); }
.dock-btn .dot { position: absolute; top: 4px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 83, 61, .6); } 100% { box-shadow: 0 0 0 9px rgba(224, 83, 61, 0); } }
.dock-sep { height: 2px; background: var(--line); margin: 2px 6px; }
.dock-area { border: 2px solid transparent; background: #fff; border-radius: 14px; padding: 2px; width: 58px; height: 52px; transition: transform .15s; }
.dock-area:hover { transform: scale(1.08); }
.dock-area.on { border-color: var(--green); }
.dock-area .thumb { width: 100%; height: 100%; object-fit: contain; }

/* drawer */
#drawer { position: fixed; right: 10px; top: 76px; bottom: 10px; width: 470px; max-width: calc(100vw - 20px); z-index: 25; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); transform: translateX(calc(100% + 20px)); transition: transform .35s cubic-bezier(.3, 1.2, .5, 1); display: flex; flex-direction: column; }
#drawer.open { transform: none; }
#drawer-body { overflow-y: auto; padding: 16px 16px 30px; flex: 1; }
.drawer-close { position: absolute; top: 10px; right: 10px; border: 0; background: #fff; border-radius: 50%; width: 32px; height: 32px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); z-index: 2; line-height: 0; }
.area-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 60%, #fff)); color: #fff; margin-right: 34px; position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.area-head h2 { font-size: 19px; margin: 0; }
.area-head p { margin: 2px 0 6px; font-size: 12px; font-weight: 700; opacity: .95; }
.area-head .thumb.head { width: 84px; height: 84px; background: rgba(255, 255, 255, .5); border-radius: 14px; }
.area-head .fly { position: absolute; right: 8px; bottom: 8px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .06); color: var(--muted); text-shadow: none; }
.area-head .tag { background: rgba(255, 255, 255, .85); color: var(--ink); }
.tag.t1 { background: #eceff1; color: #546e7a; } .tag.t2 { background: #e3f2fd; color: #1565c0; } .tag.t3 { background: #e8f5e9; color: #2e7d32; }
.tag.t4 { background: #fff3e0; color: #e65100; } .tag.t5 { background: #f3e5f5; color: #7b1fa2; } .tag.t6 { background: linear-gradient(90deg, #ffd54f, #ff8a65); color: #4e2600; }
.tag.t7 { background: linear-gradient(90deg, #b388ff, #ff80ab, #ffd180); color: #2a0a40; }
.tabs { display: flex; gap: 5px; margin: 12px 0; flex-wrap: wrap; }
.tab { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; color: var(--muted); display: flex; align-items: center; gap: 5px; transition: transform .15s; }
.tab:hover { transform: translateY(-2px); color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn { border: 0; border-radius: 12px; padding: 9px 14px; font-weight: 800; font-size: 14px; background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-d); transition: transform .1s, filter .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-d); }
.btn:disabled { background: #c9c4b4; box-shadow: 0 3px 0 #a9a392; cursor: not-allowed; transform: none; filter: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn.gold { background: var(--gold); box-shadow: 0 3px 0 #c98d12; color: #4a3200; }
.btn.blue { background: var(--blue); box-shadow: 0 3px 0 #23679f; }
.btn.red { background: var(--red); box-shadow: 0 3px 0 #a8321f; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.ib { border: 2px solid var(--line); background: #fff; border-radius: 10px; width: 32px; height: 32px; line-height: 0; padding: 0; transition: transform .12s; }
.ib:hover { transform: scale(1.1); }
.ib.red { border-color: #ffd0c8; }
.input { border: 2px solid var(--line); border-radius: 10px; padding: 7px 9px; font: inherit; background: #fff; color: var(--ink); }
.input.sm { padding: 4px 6px; }
.input.big { font-size: 17px; text-align: center; }
.input:focus { outline: 0; border-color: var(--green); }
.status { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: #f1f8e9; color: #33691e; margin: 6px 0; display: flex; gap: 6px; align-items: center; }
.status.warn { background: #fff3e0; color: #e65100; }
.status.bad { background: #ffebee; color: #c62828; }
.panel { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.bar { height: 8px; background: #eee5cc; border-radius: 9px; overflow: hidden; width: 60px; flex-shrink: 0; }
.bar i { display: block; height: 100%; border-radius: 9px; transition: width .6s; }
.thumb { display: block; opacity: 0; transition: opacity .3s, transform .2s; }
.thumb.ready { opacity: 1; }

/* animal list */
.alist { display: flex; flex-direction: column; gap: 6px; }
.arow { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 8px 4px 4px; }
.arow.escaped { border-color: var(--red); animation: pulse 1.4s infinite; }
.arow .thumb.sm { width: 48px; height: 48px; background: #f6efd9; border-radius: 10px; }
.arow:hover .thumb { transform: scale(1.12) rotate(-4deg); }
.arow .an { flex: 1; min-width: 0; line-height: 1.2; }
.arow .an b { margin-right: 3px; }

/* shop */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.filters #sq { grid-column: 1 / -1; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.scard { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px; text-align: center; cursor: pointer; transition: transform .18s, border-color .2s, box-shadow .2s; overflow: hidden; }
.scard:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: 0 8px 16px rgba(0, 0, 0, .12); }
.scard .thumb { width: 100%; aspect-ratio: 1; background: radial-gradient(circle at 50% 60%, #fbf5e3, #efe4c4); border-radius: 10px; }
.scard:hover .thumb { transform: scale(1.08); }
.scard .sn { font-weight: 800; font-size: 12px; line-height: 1.15; min-height: 28px; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.scard .sm { font-size: 11px; color: var(--muted); font-weight: 700; }
.scard .sp { font-family: var(--font-h); font-weight: 700; color: var(--green-d); font-size: 15px; }
.scard.cant .sp { color: var(--red); }
.scard .vtag { position: absolute; top: 8px; left: 8px; z-index: 1; background: rgba(255, 255, 255, .9); }
.scard .vtag.myth { left: auto; right: 8px; background: linear-gradient(90deg, #b388ff, #ff80ab); color: #fff; }
.scard.mythic { border-color: #c8a0ff; background: linear-gradient(160deg, #fbf4ff, #fff4fa); }
.scard.mythic::before, .scard.v-golden::before, .scard.v-rainbow::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.5s ease-in-out infinite; pointer-events: none; z-index: 2; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.pager { display: flex; gap: 5px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* build */
.fac-sec { margin-bottom: 14px; }
.fh { display: flex; gap: 10px; align-items: center; }
.fac-list { display: grid; gap: 8px; margin-top: 6px; }
.fac-item { display: flex; gap: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px; }
.fac-item .thumb.fac, .fac-ph { width: 78px; height: 78px; background: radial-gradient(circle, #f4f9ee, #e2ecd2); border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fi-body { flex: 1; min-width: 0; }
.fi-body .nm { font-weight: 800; }
.fi-body .info { font-size: 12px; color: var(--muted); font-weight: 700; }
.lv { display: flex; gap: 3px; margin: 2px 0; }
.lv b, .lv i { width: 14px; height: 6px; border-radius: 3px; background: var(--gold); display: block; }
.lv i { background: #e8e0c8; }
.add-card { border: 2px dashed #c8c0a8; background: transparent; border-radius: 14px; padding: 10px; font-weight: 800; color: var(--green-d); display: flex; gap: 6px; align-items: center; justify-content: center; }
.add-card:hover:not(:disabled) { background: #f1f8e9; border-color: var(--green); }
.add-card:disabled { color: #b0a890; cursor: not-allowed; }

/* areas */
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acard { background: #fff; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.acard:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0, 0, 0, .12); }
.acard .ac-art { position: relative; height: 92px; background: linear-gradient(180deg, #bfe6ff, #e8f6ff 45%, var(--g) 46%); display: flex; justify-content: center; align-items: flex-end; }
.acard .ac-art .thumb { height: 92px; width: 92px; }
.acard .ac-art .thumb.myth { position: absolute; right: 2px; bottom: 2px; width: 56px; height: 56px; }
.acard.locked .ac-art { filter: grayscale(.8) brightness(.95); }
.acard .lockb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.acard.affordable { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(243, 181, 47, .35); }
.ac-body { padding: 8px 10px 10px; }
.ac-body h3 { font-size: 14px; }
.mstats { display: flex; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); flex-wrap: wrap; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.steps span { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: #f0ead8; color: #b0a890; }
.steps span.on { background: #e8f5e9; color: var(--green-d); }
.bigprice { font-family: var(--font-h); font-size: 34px; font-weight: 700; }
.slider { width: 100%; accent-color: var(--green); }

/* stats */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.kpi .k { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-family: var(--font-h); font-size: 18px; font-weight: 700; }
.chart-box { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.chart-box canvas { width: 100%; height: 170px; display: block; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; font-weight: 700; margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.hbar { display: flex; align-items: center; gap: 6px; margin: 5px 0; font-size: 12px; font-weight: 700; }
.hbar .lbl { width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { flex: 1; height: 14px; background: #f0e8d0; border-radius: 9px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 9px; animation: grow 1s ease-out; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.hbar .val { width: 70px; text-align: right; }
.tbl { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; padding: 5px; border-bottom: 2px solid var(--line); }
td { padding: 5px; border-bottom: 1px solid var(--line); } tr[data-go] { cursor: pointer; } tr[data-go]:hover { background: #fff8e1; }
.log-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
.log-item .ld { min-width: 52px; color: var(--muted); font-size: 12px; font-weight: 800; }
.set .row { margin: 8px 0; } hr { border: 0; border-top: 2px solid var(--line); }

/* minimap & tools */
#minimap { position: fixed; left: 10px; bottom: 10px; z-index: 20; width: 170px; height: 170px; border-radius: 18px; overflow: hidden; border: 4px solid #fff; box-shadow: var(--shadow); cursor: crosshair; }
#minimap canvas { width: 100%; height: 100%; display: block; }
#cam-tools { position: fixed; right: 10px; bottom: 10px; z-index: 22; display: flex; gap: 6px; }
#drawer.open ~ #cam-tools { right: 490px; }
.tool { border: 0; background: var(--panel); border-radius: 14px; padding: 6px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 800; color: var(--muted); width: 56px; transition: transform .15s; }
.tool:hover { transform: translateY(-3px); }
.tool.on { background: var(--green); color: #fff; }

/* event & animal cards */
#event-card { position: fixed; top: 86px; left: 50%; transform: translate(-50%, -30px) scale(.9); opacity: 0; pointer-events: none; z-index: 40; width: min(560px, calc(100vw - 20px)); display: flex; gap: 12px; padding: 14px 16px; border-radius: 20px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); border: 4px solid var(--gold); transition: all .4s cubic-bezier(.3, 1.5, .5, 1); }
#event-card.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
#event-card.bad { border-color: var(--red); }
#event-card.good { border-color: #b388ff; }
#event-card .ev-ic { animation: wobble 1.2s ease-in-out infinite; }
@keyframes wobble { 25% { transform: rotate(-10deg) scale(1.1); } 75% { transform: rotate(10deg) scale(1.1); } }
.ev-kicker { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
#event-card p { margin: 4px 0 8px; font-weight: 600; }
#animal-card { position: fixed; bottom: 14px; left: 50%; transform: translate(-50%, 140%); z-index: 30; width: min(420px, calc(100vw - 20px)); background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); padding: 12px 14px; transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
#animal-card.show { transform: translate(-50%, 0); }
.ac-top { display: flex; gap: 10px; align-items: center; }
.thumb.big { width: 96px; height: 96px; background: radial-gradient(circle, #fbf5e3, #efe4c4); border-radius: 16px; }
.ac-stats { display: flex; gap: 12px; font-weight: 800; font-size: 13px; margin: 8px 0 4px; flex-wrap: wrap; }

/* modal & toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 30, 20, .45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 14px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 24px; max-width: 620px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); border: 4px solid #fff; }
@keyframes pop { from { transform: scale(.7) translateY(30px); opacity: 0; } }
.mhead { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.thumb.hero { width: 130px; height: 130px; background: radial-gradient(circle at 50% 60%, #fbf5e3, #efe4c4); border-radius: 20px; flex-shrink: 0; }
.center .thumb.hero { margin: 0 auto 8px; }
.thumb.bounce.ready { animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-8px) scale(1.04); } }
.mh3 { font-size: 15px; margin-top: 10px; }
.comp-list { display: grid; gap: 6px; }
.comp { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; transition: border-color .15s; }
.comp:hover { border-color: var(--green); }
.comp.on { border-color: var(--green); background: #f1f8e9; box-shadow: 0 0 0 3px rgba(63, 155, 79, .2); }
.comp .cn { font-weight: 800; } .comp .cd { font-size: 11px; color: var(--muted); font-weight: 600; }
.comp .cp { margin-left: auto; text-align: right; font-weight: 800; white-space: nowrap; }
.qty { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.summary { background: #f4ead0; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-weight: 700; display: grid; gap: 3px; }
.summary .tot { font-family: var(--font-h); font-size: 21px; color: var(--green-d); }
.err { color: var(--red); display: flex; gap: 4px; align-items: center; }
.help { text-align: left; line-height: 1.6; font-weight: 600; padding-left: 20px; }
.welcome h1 { font-size: 30px; }
.parade { overflow: hidden; white-space: nowrap; margin: 8px 0; display: flex; width: max-content; animation: marquee 30s linear infinite; }
.parade .thumb { width: 70px; height: 70px; display: inline-block; flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }
.welcome { overflow: hidden; }
#toasts { position: fixed; left: 50%; bottom: 200px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(460px, calc(100vw - 20px)); }
.toast { background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25); font-weight: 700; display: flex; gap: 6px; align-items: center; border-left: 6px solid var(--green); animation: tin .4s cubic-bezier(.3, 1.5, .5, 1), tout .4s ease-in 4.8s forwards; }
.toast.bad { border-left-color: var(--red); } .toast.gold { border-left-color: var(--gold); }
@keyframes tin { from { transform: translateY(30px) scale(.8); opacity: 0; } }
@keyframes tout { to { transform: translateY(-20px); opacity: 0; } }

/* loading */
#loading { position: fixed; inset: 0; z-index: 200; background: radial-gradient(circle at 50% 40%, #a8dcf0, #4caf50); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading img { width: 110px; height: 110px; border-radius: 26px; animation: bob 1.5s ease-in-out infinite; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
#loading .lt { font-family: var(--font-h); font-size: 22px; color: #fff; font-weight: 700; text-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
#loading .lb { width: 200px; height: 10px; background: rgba(255, 255, 255, .35); border-radius: 9px; overflow: hidden; }
#loading .lb i { display: block; height: 100%; width: 40%; background: #fff; border-radius: 9px; animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (max-width: 860px) {
  #hud { top: 6px; gap: 6px; padding: 5px 8px; border-radius: 16px; }
  .brand .sub, .clockchip, .chip small { display: none; }
  .zname { font-size: 14px; } .chip.money { font-size: 14px; min-width: 80px; }
  #dock { left: 6px; top: auto; bottom: 6px; transform: none; flex-direction: row; max-width: calc(100vw - 12px); max-height: none; overflow-x: auto; padding: 5px; border-radius: 16px; }
  .dock-sep { width: 2px; height: auto; margin: 4px 2px; }
  .dock-btn { width: 50px; } .dock-area { width: 48px; height: 46px; flex-shrink: 0; }
  #drawer { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: none; height: 70vh; border-radius: 20px 20px 0 0; transform: translateY(105%); }
  #drawer.open { transform: none; }
  #minimap { width: 110px; height: 110px; bottom: 76px; left: 6px; border-width: 3px; }
  #cam-tools { bottom: 76px; right: 6px; } #drawer.open ~ #cam-tools { right: 6px; }
  .tool { width: 48px; }
  .kpis { grid-template-columns: 1fr 1fr; } .area-grid { grid-template-columns: 1fr 1fr; }
  #toasts { bottom: 200px; }
  #event-card { top: 70px; }
}
