:root {
  color-scheme: light;
  font-family: "Nunito", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #4c321e;
  background: #fff8e9;
  --paper: #fffdf6;
  --line: #e5c789;
  --muted: #725235;
  --ink: #623b22;
  --amber: #ffd875;
}
* { box-sizing: border-box; }
[ng-cloak], [hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 15% 0%, #ffefc4, #fffcf4 76%); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #9b5223; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell { max-width: 1400px; margin: auto; padding: 0 30px; }
.topbar { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; font-size: 22px; font-weight: 850; white-space: nowrap; }
.brand-mark { position: relative; width: 42px; height: 40px; border: 1px solid #dfa944; border-radius: 13px; background: #ffe5a1; box-shadow: inset 0 -3px #f4c562; }
.brand-mark .bee { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg) scale(.48); }
.brand-mark .bee::before { animation: none; }
.toolbar { position: relative; display: flex; gap: 8px; align-items: center; }
.utility {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px;
  padding: 6px 10px; border: 1px solid #e2ba77; border-radius: 9px; background: #fff8e3;
  color: #704b27; font-size: 12px; font-weight: 750; white-space: nowrap;
}
.utility:hover { background: #ffedc0; border-color: #b78138; }
.utility > span:first-child { color: #965a21; }
.utility:disabled { color: #887658; background: #f1ead8; border-color: #e1d5b7; }
.volume-settings { position: static; }
.volume-settings summary { cursor: pointer; list-style: none; }
.volume-settings summary::-webkit-details-marker { display: none; }
.volume-settings summary:focus-visible,
.volume-slider input:focus-visible { outline: 2px solid #9b5223; outline-offset: 3px; }
.volume-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 15;
  width: 265px; max-width: calc(100vw - 20px); padding: 15px;
  border: 1px solid #dfba78; border-radius: 14px; background: #fffcf2;
  box-shadow: 0 8px 24px #6c431c26;
}
.volume-row + .volume-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eddcb4; }
.volume-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.volume-heading label { font-size: 13px; font-weight: 800; color: var(--ink); }
.volume-slider { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.volume-slider input { flex: 1; min-width: 0; height: 30px; margin: 0; cursor: pointer; accent-color: #b77d2e; }
.volume-slider output { min-width: 38px; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.title-screen { min-height: 100svh; display: grid; place-items: center; padding-block: 28px; }
.title-card {
  width: min(100%, 790px); display: grid; grid-template-columns: .96fr 1.04fr; overflow: hidden;
  border: 1px solid #dfba78; border-radius: 24px; background: var(--paper);
  box-shadow: 0 5px 0 #81572514, 0 20px 44px #a9762d19;
}
.title-art {
  position: relative; min-height: 354px; overflow: hidden;
  background: radial-gradient(ellipse at 46% 44%, #fff4cd, #ffe1a0 78%);
  --tile: 122px; --column: 93px; --row: 107px;
}
.title-comb { position: absolute; inset: 0; }
.title-comb span {
  position: absolute; width: var(--tile); height: calc(var(--tile) * .866);
  left: calc(50% + var(--q) * var(--column)); top: calc(50% + var(--r) * var(--row));
  transform: translate(-50%, -50%); background: #dba656;
  clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
}
.title-comb span::after { content: ""; position: absolute; inset: 2px; clip-path: inherit; background: #fff0c1; }
.title-comb span:first-child::after { background: #ffda80; }
.title-bee { position: absolute; inset: calc(50% - 50px) auto auto calc(50% - 66px); width: 132px; height: 100px; }
.title-art .bee { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-15deg) scale(1.75); }
.title-art .bee::before { animation: none; }
.title-perch, .title-landing-ripple {
  position: absolute; left: calc(50% - 61px); top: calc(50% + 26px); width: 122px; height: 24px; border-radius: 50%;
}
.title-perch { background: radial-gradient(ellipse, #8c592749, #ae753721 51%, transparent 72%); }
.title-landing-ripple { visibility: hidden; border: 2px solid #be78286b; }
.title-panel { position: relative; align-self: center; padding: clamp(22px, 4vw, 42px); }
.title-panel h1 { margin-bottom: 24px; color: var(--ink); font-size: clamp(29px, 4.7vw, 52px); line-height: 1.1; }
.title-word { display: flex; justify-content: space-between; gap: .09em; width: max-content; max-width: 100%; }
.title-word > span { display: inline-block; transform-origin: center 85%; text-shadow: 0 2px #e7be8569; }
.title-actions { display: grid; gap: 9px; }
.title-footer { display: flex; align-items: center; gap: 6px; min-height: 42px; padding-top: 8px; }
.title-footer .title-status { margin: 0; }
.title-card[data-intro] .title-footer .title-status { display: none; }
.title-intro-controls { display: flex; gap: 6px; margin-left: auto; }
.title-panel .utility { min-height: 44px; font-size: 15px; }
.title-intro-controls .utility { min-height: 34px; font-size: 12px; }
.title-card[data-intro="ready"] .title-intro-controls { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.title-intro-controls [data-intro-start] { min-width: 144px; min-height: 48px; font-size: 17px; }
.title-panel .title-primary { background: #ffda80; border-color: #bf8439; box-shadow: inset 0 -3px #efb957; }
.title-panel .title-primary:hover { background: #ffcf63; }
.title-panel .title-exit { background: transparent; border-color: #edd9b4; }
.title-panel .title-exit:hover { background: #fff1cb; }
.title-status { min-height: 18px; margin-block: 14px 6px; color: var(--muted); font-size: 13px; }
@media (max-width: 570px) {
  .title-card { max-width: 380px; grid-template-columns: 1fr; }
  .title-art { min-height: 199px; --tile: 86px; --column: 66px; --row: 76px; }
  .title-art .bee { transform: translate(-50%, -50%) rotate(-15deg) scale(1.28); }
  .title-perch, .title-landing-ripple { top: calc(50% + 17px); }
  .title-panel { padding: 24px; }
}

.resource-bar { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 15px; }
.resource-card {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 5px;
  background: #fffdf4; border: 1px solid #ead5a5; border-radius: 10px; min-width: 117px;
  box-shadow: 0 2px 0 #7951250d;
}
.resource-card:hover { border-color: #bf873d; }
.resource-icon { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px; color: #7d5127; background: #ffe7a4; }
.icon-meat { color: #ab5142; background: #fbe0d4; }
.icon-larva { color: #7e4381; background: #f1e2f3; }
.icon-energy { color: #2e607b; background: #dceff5; }
.icon-mutagen { color: #6f5285; background: #ede1f4; }
.resource-name { color: var(--muted); font-size: 12px; }
.resource-card strong { margin-left: auto; line-height: 1.15; font-size: 16px; overflow-wrap: anywhere; }
.offline-bar { display: flex; align-items: center; gap: 8px 13px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 13px; border: 1px solid #decf9e; border-radius: 10px; background: #fff6d6; font-size: 12px; }
.offline-bar .utility { margin-left: auto; min-height: 24px; padding: 0 7px; }

.world { border: 1px solid #dfba78; border-radius: 17px; background: var(--paper); box-shadow: 0 4px 0 #81572514, 0 16px 36px #a9762d16; }
.world-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 13px; }
.region-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.region-nav button {
  display: flex; gap: 6px; align-items: center; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); padding: 7px 12px; font-size: 13px; font-weight: 750;
}
.region-nav button:hover { background: #fff1c9; }
.region-nav button.active { border-color: #e3b45c; color: #633c1f; background: #ffe8a9; }
.guide-button { padding-inline: 9px; }
.guide-button > span { display: grid; place-items: center; font-weight: 900; width: 15px; height: 15px; border-radius: 50%; background: #f5dfa7; }
.credit-link { text-decoration: underline; text-underline-offset: 2px; }

.habitat { position: relative; isolation: isolate; }
.scene-board {
  position: relative; isolation: isolate; overflow: hidden; width: 100%;
  border-top: 1px solid #e4bc74; border-radius: 0 0 16px 16px; background: #ffedb4;
}
.map-window { position: relative; height: clamp(435px, 66svh, 680px); overflow: hidden; }
.honeycomb { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-scroll {
  position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: none; touch-action: pan-x pan-y;
}
.map-scroll:focus-visible { outline: 2px solid #a56a33; outline-offset: -2px; }
.can-pan .map-scroll { cursor: grab; }
.can-pan .map-scroll.dragging { cursor: grabbing; user-select: none; }
.map-surface { position: relative; touch-action: pan-x pan-y; width: 100%; height: 100%; }
.map-overlay {
  position: absolute; z-index: 7; top: 9px; left: 10px; right: 10px; display: flex;
  gap: 8px; align-items: flex-start; pointer-events: none;
}
.map-center { display: none; margin-left: auto; pointer-events: auto; }
.map-window.can-pan .map-center { display: inline-flex; }
.territory-level {
  display: inline-block; padding: 5px 8px; border: 1px solid #a7ad74; border-radius: 7px;
  background: #f5f5d9; color: #5f663b; font-size: 11px; font-weight: 800;
}
.stations { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.station {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px;
  left: calc(var(--origin-x) + var(--q) * 1.5 * var(--hex-radius));
  top: calc(var(--origin-y) + var(--row) * var(--hex-height));
  width: calc(var(--hex-radius) * 1.5);
  transform: translate(-50%, -50%);
  min-width: 0;
}
.station button { pointer-events: auto; }
.station-icon {
  position: relative; z-index: 1; display: grid; place-items: center; width: min(100%, 119px); height: 71px;
  padding: 0; border: 0; border-radius: 16px; background: transparent;
}
.station-icon:hover .art-shell, .station-icon:focus-visible .art-shell { transform: translateY(-5px); }
.art-shell {
  position: absolute; bottom: 5px; left: 0; width: 100%; height: 64px; display: grid; place-items: center;
  filter: drop-shadow(0 4px 1px #8b4d2630); transition: transform .18s ease-out;
}
.vacant .art-shell { opacity: .53; }
.vacant:hover .art-shell { opacity: .86; }
.station.building .art-shell { animation: building-placed 1.1s cubic-bezier(.2,.7,.38,1) both; transform-origin: center 90%; }
@keyframes building-placed {
  0% { transform: scale(.66,.14) translateY(16px); opacity: .34; }
  28% { transform: scale(1,.48) translateY(8px); opacity: 1; }
  69% { transform: scale(1.08,1.12) translateY(-2px); }
  100% { transform: scale(1); }
}
.upgrade-arrow {
  position: absolute; top: 5px; left: 4px; z-index: 2;
  display: grid; place-items: center; width: 19px; height: 19px;
  border: 1px solid #78a268; border-radius: 6px; background: #eaf6d7; color: #245c34;
  font-size: 15px; font-weight: 900; line-height: 1; pointer-events: none;
}
.station-name { display: block; text-align: center; color: #59351c; font-size: 13px; font-weight: 900; text-shadow: 0 1px #fff5cc; line-height: 1.25; }
.station-level { color: #714c29; font-size: 10px; font-weight: 700; }
.batch, .quick-action {
  display: grid; align-content: center; justify-items: center; gap: 1px; min-width: 32px; padding: 3px 6px;
  border: 1px solid #ad7134; border-radius: 7px; background: #ffd474; color: #664022;
  box-shadow: 0 2px #98662c39; min-height: 39px; font-size: 12px; font-weight: 850;
}
.batch:active:not(:disabled), .quick-action:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.batch { min-width: 64px; max-width: 100%; margin-top: 2px; }
.batch small, .quick-action small { max-width: 100%; color: #76502b; font-size: 10px; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.batch:hover:not(:disabled), .quick-action:hover:not(:disabled) { background: #fff1b0; border-color: #885321; }
.batch:disabled, .quick-action:disabled { color: #80694a; box-shadow: none; border-color: #d2b884; background: #f9eed3; }
.batch:disabled small, .quick-action:disabled small { color: #80694a; }
.quick-action { max-width: 150px; padding: 5px 9px; margin-top: 2px; }
.quick-compact { position: absolute; z-index: 3; top: -3px; right: 0; min-height: 25px; padding: 2px 4px; font-size: 10px; }
.quick-compact small { display: none; }
.ability-dock, .ascend-dock {
  position: relative; z-index: 4; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px;
  padding: 6px 15px 19px; margin-top: -7px;
}
.ability-dock button {
  display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; padding: 5px 9px;
  border: 1px solid #82a8ad; border-radius: 8px; background: #f3fcff; color: #365762; font-size: 12px; font-weight: 800;
}
.ability-dock button:hover:not(:disabled) { border-color: #407c86; background: #fff; }
.ability-dock button:disabled { opacity: .64; }
.ability-glyph { grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #d6ebed; }
.ability-dock small { font-size: 10px; text-align: left; }

.bee {
  position: relative; display: block; width: 62px; height: 38px; isolation: isolate;
  border: 3px solid #683d27; border-radius: 49% 51% 48% 52%;
  background: linear-gradient(91deg, #f4a336 0 18%, #784323 18% 31%, #ffd760 31% 46%, #845027 46% 59%, #ffe284 59% 100%);
  box-shadow: inset 0 -5px #a15a2a25;
}
.bee::before {
  content: ""; position: absolute; z-index: -1; left: 15px; top: -17px; width: 17px; height: 16px;
  border: 2px solid #9f7e63; border-radius: 60% 85% 20% 50%; background: #fff9f7;
  box-shadow: 11px 0 0 -1px #f8eff9, 12px 0 #b39479;
  transform-origin: 65% 100%; animation: wings .22s ease-in-out infinite alternate;
}
.bee b { position: absolute; right: 6px; top: 12px; width: 4px; height: 5px; border-radius: 50%; background: #58391f; box-shadow: -10px 0 #58391f, 2px 6px 0 1px #ec9a78; }
.bee b::after { content: ""; position: absolute; top: 5px; left: -5px; width: 5px; height: 4px; border-bottom: 1.5px solid #58391f; border-radius: 0 0 50% 50%; }
@keyframes wings { from { transform: rotate(-14deg) scaleY(.82); } to { transform: rotate(13deg) scaleY(1.12); } }

.icon-drawing { position: relative; display: block; width: 100px; height: 62px; }
.unit-sprite { display: block; width: 100px; height: 64px; pointer-events: none; }
.occupied :is(.drawing-queen, .drawing-greaterqueen, .drawing-hivequeen, .drawing-empress,
  .drawing-stinger, .drawing-mosquito, .drawing-wasp, .drawing-goon, .drawing-nightbug, .drawing-moth, .drawing-bat) {
  animation: colony-sprite-hover 1.7s ease-in-out infinite alternate;
}
.occupied :is(.drawing-swarmling, .drawing-spider, .drawing-locust, .drawing-roach,
  .drawing-giantspider, .drawing-centipede, .drawing-devourer) {
  transform-origin: center 82%;
  animation: colony-sprite-breathe 2.2s ease-in-out infinite alternate;
}
@keyframes colony-sprite-hover {
  from { transform: translateY(1px) rotate(-1deg); }
  to { transform: translateY(-2px) rotate(1deg); }
}
@keyframes colony-sprite-breathe {
  from { transform: scaleY(.98); }
  to { transform: scaleY(1.025); }
}
.icon-drawing b { position: absolute; display: block; }
.drawing-meat b {
  left: 10px; top: 28px; width: 43px; height: 30px; background: #ed9a95; border: 3px solid #995548;
  border-radius: 44% 50% 39% 42%; transform: rotate(-15deg); box-shadow: inset -4px -5px #d87972;
}
.drawing-meat b:nth-child(2) { left: 38px; top: 12px; width: 48px; height: 33px; transform: rotate(12deg); background: #f7ad9f; }
.drawing-meat b:nth-child(3) { left: 51px; top: 33px; width: 37px; height: 26px; transform: rotate(-8deg); }
.drawing-meat b:nth-child(4) { display: none; }
.drawing-meat b::after { content: ""; position: absolute; left: 7px; top: 5px; width: 14px; height: 8px; border-top: 2px solid #ffe1cc; border-radius: 50%; }
.drawing-eggs::before { content: ""; position: absolute; inset: auto 4px 2px; height: 29px; border: 3px solid #a26e3b; border-radius: 50%; background: #e5a862; box-shadow: inset 0 4px #ba7b45, inset 0 -5px #f4c47e; }
.drawing-eggs b, .drawing-cocoon b {
  bottom: 12px; left: 19px; width: 24px; height: 34px; border: 2px solid #9a6943; background: #fff7d4;
  border-radius: 52% 48% 46% 46%; box-shadow: inset -4px -4px #efca92; transform: rotate(-20deg);
}
.drawing-eggs b:nth-child(2) { left: 37px; bottom: 15px; height: 39px; transform: rotate(9deg); }
.drawing-eggs b:nth-child(3) { left: 56px; bottom: 11px; height: 27px; transform: rotate(24deg); background: #fbe0be; }
.drawing-eggs b:nth-child(4) { display: none; }
.drawing-cocoon b:first-child { left: 36px; top: 2px; width: 31px; height: 53px; border-radius: 41% 50% 44% 48%; transform: rotate(12deg); background: repeating-linear-gradient(150deg, #f4d7ec 0 6px, #e5bee3 7px 9px); box-shadow: inset -5px -3px #cFA5c6; }
.drawing-cocoon b:not(:first-child) { display: none; }

.drawing-nest { --house: #db9861; --roof: #f7bd70; --trim: #7b4327; }
.drawing-nest b:nth-child(1) {
  left: 16%; top: 29%; width: 68%; height: 67%; border-radius: 22% 22% 28% 28%;
  background: repeating-linear-gradient(0deg, var(--house) 0 7px, #f1b67c 8px 10px);
  border: 3px solid var(--trim); box-shadow: inset 0 -6px #9156353a;
}
.drawing-nest b:nth-child(2) {
  left: 8%; top: 1%; width: 84%; height: 49%; background: var(--trim);
  clip-path: polygon(9% 45%, 33% 8%, 67% 8%, 92% 45%, 100% 95%, 0 95%);
}
.drawing-nest b:nth-child(2)::before { content: ""; position: absolute; inset: 4px 4px 3px; clip-path: inherit; background: var(--roof); }
.drawing-nest b:nth-child(3) { left: 37%; bottom: 4%; width: 26%; height: 39%; border: 2px solid #784d32; border-radius: 56% 56% 12% 12%; background: #68432b; box-shadow: inset 3px 0 #a76c42; }
.drawing-nest b:nth-child(4) { left: 68%; top: 53%; width: 10%; height: 14%; border: 2px solid #9f6b39; border-radius: 4px; background: #ffe58f; }

.drawing-flag b:nth-child(1) { left: 43%; bottom: 3%; width: 6px; height: 55px; border: 2px solid #6e5437; border-radius: 5px; background: #dcba78; }
.drawing-flag b:nth-child(2) { left: 46%; top: 5%; width: 43%; height: 44%; background: #54865a; clip-path: polygon(0 0, 100% 0, 67% 46%, 93% 100%, 0 100%); box-shadow: inset 0 3px #a6c184; }
.drawing-flag b:nth-child(3) { inset: auto 19% 0; height: 12px; border-radius: 50%; background: #719057; box-shadow: inset 0 -3px #526b42; }
.drawing-flag b:nth-child(4) { display: none; }
.worker-path {
  position: absolute; z-index: 1; pointer-events: none; width: 34px; height: 25px;
  left: calc(var(--origin-x) + var(--from-q) * 1.5 * var(--hex-radius));
  top: calc(var(--origin-y) + var(--from-row) * var(--hex-height));
  --travel-x: calc((var(--to-q) - var(--from-q)) * 1.5 * var(--hex-radius));
  --travel-y: calc((var(--to-row) - var(--from-row)) * var(--hex-height));
  margin-left: calc(-17px + var(--lane)); margin-top: -13px;
}
.worker {
  position: absolute; left: 0; display: grid; place-items: center; width: 34px; height: 25px;
  background: transparent; border: 0; padding: 0; pointer-events: auto;
  animation: patrol var(--duration) var(--delay) linear infinite;
}
.worker:hover, .worker:hover .cargo { animation-play-state: paused; }
.worker .bee { position: absolute; transform: scale(.46); }
.worker .cargo { position: absolute; right: 1px; bottom: 2px; width: 9px; height: 7px; border: 1px solid #9b5449; border-radius: 45%; background: #f2a49a; animation: cargo var(--duration) var(--delay) step-end infinite; }
@keyframes patrol {
  0%, 8% { transform: translate(0, 0) rotate(var(--out-angle)); }
  43%, 49.99% { transform: translate(var(--travel-x), var(--travel-y)) rotate(var(--out-angle)); }
  50%, 57% { transform: translate(var(--travel-x), var(--travel-y)) rotate(var(--back-angle)); }
  92%, 99.99% { transform: translate(0, 0) rotate(var(--back-angle)); }
  100% { transform: translate(0, 0) rotate(var(--out-angle)); }
}
@keyframes cargo { 0%, 49.99% { opacity: 1; } 50%, 100% { opacity: 0; } }

.effects { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.scene-effect { position: absolute; inset: var(--fx-y, 50%) auto auto var(--fx-x, 50%); width: 0; height: 0; visibility: hidden; }
.scene-effect.positioned { visibility: visible; }
.fx-label {
  display: block; width: max-content; max-width: 150px; padding: 3px 7px; border: 1px solid #b47934; border-radius: 8px;
  background: #fff9e1; color: #64391f; font-size: 12px; font-weight: 900; text-align: center; white-space: normal;
  box-shadow: 0 2px #9c63352a; animation: float-label 1.04s ease-out both;
}
.fx-object { position: absolute; width: 30px; height: 20px; display: grid; place-items: center; animation: pop-object 1s ease-out both; }
.fx-object .bee { position: absolute; transform: scale(.5); }
.fx-unit-sprite { position: absolute; width: 44px; height: 28px; filter: drop-shadow(0 2px 1px #8b4d2650); }
.fx-drawing { position: absolute; transform: scale(.44); }
.effect-flight .fx-object { animation: fly-object 1.04s ease-in-out both; }
.fx-ring { position: absolute; inset: -29px auto auto -33px; width: 66px; height: 54px; border: 3px solid #ffe491; border-radius: 50%; opacity: 0; }
.effect-hatch .fx-ring, .effect-cocoon .fx-ring, .effect-unlock .fx-ring, .effect-mutate .fx-ring,
.effect-grow .fx-ring, .effect-charge .fx-ring { animation: aura 1s ease-out both; }
.effect-upgrade .fx-ring {
  inset: -29px auto auto -38px; width: 76px; height: 58px;
  border: 2px solid #438fcb; box-shadow: 0 0 8px #5fb8edc2, inset 0 0 7px #8ddcffb5;
  animation: upgrade-ring .9s cubic-bezier(.17,.7,.3,1) both;
}
.effect-upgrade .fx-ring::after {
  content: ""; position: absolute; inset: 3px; border: 1px solid #c9f4ff; border-radius: inherit;
}
.effect-upgrade::before {
  content: ""; position: absolute; inset: -40px auto auto -36px; width: 72px; height: 80px;
  background: radial-gradient(ellipse at center, #a3e8ff8f 8%, #6dccf66d 37%, transparent 69%);
  animation: upgrade-light .82s ease-out both;
}
.effect-upgrade .fx-object { display: none; }
.effect-upgrade .fx-label { position: relative; top: -26px; background: #eefaff; color: #274f73; border-color: #6b9cbb; }
@keyframes upgrade-ring {
  0% { opacity: 0; transform: scale(.55); }
  26% { opacity: .95; transform: scale(.93); }
  51% { opacity: .72; }
  100% { opacity: 0; transform: scale(1.42); }
}
@keyframes upgrade-light {
  0% { opacity: 0; transform: translateY(9px) scale(.65,.5); }
  30% { opacity: .78; }
  100% { opacity: 0; transform: translateY(-10px) scale(1,1.42); }
}
.effect-hatch .fx-ring { border-style: dotted; }
.egg-shell { position: absolute; left: -12px; top: -6px; width: 24px; height: 20px; }
.egg-shell i {
  position: absolute; top: 0; width: 12px; height: 19px; border: 2px solid #c69a67;
  background: #fff5df; border-radius: 65% 55% 48% 41%;
  clip-path: polygon(0 0, 90% 0, 74% 27%, 100% 44%, 68% 70%, 100% 100%, 0 100%);
  --shard-x: -20px; --shard-turn: -46deg;
  animation: shell-crack .58s ease-out both;
}
.egg-shell i + i { right: 0; --shard-x: 20px; --shard-turn: 46deg; }
@keyframes shell-crack {
  0% { opacity: .7; transform: translate(0) rotate(0); }
  34% { opacity: 1; transform: translate(0) rotate(0); }
  55% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--shard-x), 15px) rotate(var(--shard-turn)); }
}
.effect-build .fx-ring { width: 96px; height: 72px; left: -48px; top: -36px; border: 3px dashed #fff5c1; animation: aura 1.26s ease-out both; }
.effect-build .fx-object { animation: raise-object 1.13s ease-out both; }
.effect-build.effect-flight .fx-object { animation: fly-object 1.26s ease-in-out both; }
.effect-build .fx-label { animation-duration: 1.3s; }
.effect-expand .fx-ring { border-color: #fff4b2; animation: expand-ring 1.13s ease-out both; }
.effect-expand .fx-label { animation-duration: 1.16s; }
.effect-claim .fx-ring { border-color: #dced9d; animation: aura 1s ease-out both; }
.effect-ability .fx-ring, .effect-warp .fx-ring, .effect-ascend .fx-ring { border-color: #f2d6fc; width: 78px; height: 64px; left: -39px; top: -32px; animation: expand-ring 1.03s ease-out both; }
.effect-ascend .fx-label { animation-duration: 1.4s; }
.effect-ability .fx-label, .effect-warp .fx-label, .effect-mutate .fx-label, .effect-ascend .fx-label { background: #fff0fe; border-color: #b887b8; }
.scene-board.reborn::after, .scene-board.warping::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
}
.scene-board.reborn::after { background: radial-gradient(ellipse, #fffaf1, #ffe6a0 75%); animation: fresh-hive 1.35s ease-out both; }
.scene-board.warping::after { background: linear-gradient(75deg, transparent 15%, #f2ffffa8 49%, transparent 76%); animation: fast-forward .95s ease-out both; }
@keyframes fresh-hive { 0%, 12% { opacity: .9; } to { opacity: 0; } }
@keyframes fast-forward {
  0% { transform: translateX(-90%); opacity: 0; }
  27% { opacity: 1; }
  to { transform: translateX(90%); opacity: 0; }
}
@keyframes float-label {
  0%, 8% { opacity: 0; transform: translate(-50%, -25%) scale(.78); }
  23% { opacity: 1; transform: translate(-50%, -82%) scale(1.04); }
  80% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -210%) scale(.94); }
}
@keyframes pop-object {
  from { opacity: 0; transform: translate(-50%, 5px) scale(.46); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.08); }
  76% { opacity: .85; }
  to { opacity: 0; transform: translate(-50%, -27px) scale(.65); }
}
@keyframes fly-object {
  0% { transform: translate(calc(var(--fx-dx) - 15px), calc(var(--fx-dy) - 5px)) scale(.76); opacity: 0; }
  18%, 72% { opacity: 1; }
  83% { transform: translate(-50%, -10px) scale(1); }
  to { transform: translate(-50%, -16px) scale(.66); opacity: 0; }
}
@keyframes raise-object {
  0% { transform: translate(-50%, 4px) scale(.5,.15); opacity: 0; }
  30% { opacity: 1; }
  57% { transform: translate(-50%, -3px) scale(1.2,1.35); }
  to { transform: translate(-50%, -14px) scale(1); opacity: 0; }
}
@keyframes aura {
  from { opacity: 0; transform: scale(.62); }
  18% { opacity: 1; }
  to { opacity: 0; transform: scale(1.48); }
}
@keyframes expand-ring {
  from { opacity: 0; transform: scale(.6); }
  21% { opacity: 1; }
  to { opacity: 0; transform: scale(4); }
}
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }

.scene-tooltip {
  position: absolute; z-index: 10; width: min(234px, calc(100% - 16px)); padding: 10px 11px;
  background: #fffefa; border: 1px solid #c28d45; border-radius: 10px; box-shadow: 0 5px 20px #89521d29;
  color: #5a3c27; font-size: 12px; line-height: 1.52; pointer-events: none;
}
.scene-tooltip header { display: flex; justify-content: space-between; gap: 7px; align-items: baseline; }
.scene-tooltip header strong { color: #6e3b17; font-size: 14px; }
.scene-tooltip header span { color: #80521f; font-size: 11px; overflow-wrap: anywhere; }
.scene-tooltip p:not(:empty) { margin: 5px 0; color: var(--muted); }
.scene-tooltip > span { display: block; margin-top: 2px; }
.scene-tooltip .tooltip-bonus { color: #30566d; font-weight: 750; }
.scene-tooltip .tooltip-upgrade { margin-top: 5px; color: #23613a; font-weight: 800; }

.footer { display: flex; justify-content: space-between; gap: 10px; padding: 13px 2px 20px; color: var(--muted); font-size: 11px; }
.save-backup {
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.save-state::before { content: ""; display: inline-block; vertical-align: 1px; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #709750; }
.save-feedback {
  position: fixed; z-index: 30; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
.save-feedback span {
  display: block; padding: 11px 20px; border: 1px solid #c39855; border-radius: 11px;
  background: #fff8e3; color: #59391f; box-shadow: 0 5px 20px #744b242f;
  font-size: 15px; font-weight: 800; white-space: nowrap;
}
dialog {
  width: min(510px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0;
  color: #59391f; border: 1px solid #d1a16a; border-radius: 13px; background: #fffbf0;
}
dialog::backdrop { background: #48280576; }
.details-drawer {
  position: fixed; inset: auto; top: 12px; left: 12px; width: min(328px, calc(100vw - 24px)); margin: 0;
  box-shadow: 0 8px 27px #603a2040;
}
.details-drawer::backdrop { background: transparent; }
.dialog-content { padding: 17px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.detail-heading h2 { font-size: 19px; }
.dialog-content p { margin: 9px 0 11px; color: var(--muted); font-size: 13px; line-height: 1.58; }
.dialog-content p:empty { display: none; }
.dialog-content label { display: block; margin-bottom: 6px; font-size: 12px; }
.dialog-content textarea {
  width: 100%; min-width: 0; resize: vertical; border: 1px solid #dec596; border-radius: 7px; background: #fffefa; padding: 8px;
  font: 12px "IBM Plex Mono", monospace; color: #614021;
}
.dialog-content .save-error { color: #9d4b34; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.facts { margin: 12px 0; padding: 2px 10px; background: #f8efd6; border-radius: 8px; }
.facts > div { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 6px 0; font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { overflow-wrap: anywhere; }
.upgrades h3 { font-size: 13px; }
.upgrade-row { display: flex; justify-content: space-between; gap: 9px; align-items: center; padding: 7px 0; border-bottom: 1px solid #ead8ae; }
.upgrade-row strong, .upgrade-row small { display: block; font-size: 12px; }
.upgrade-row small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.upgrade-description { line-height: 1.5; }
.upgrade-description:empty { display: none; }
.detail-notice { background: #ffedb4; padding: 5px 8px; border-radius: 6px; }
.production-guide { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: #7b4a25; font-size: 12px; }
.production-guide span { padding: 5px 7px; background: #ffedb5; border: 1px solid #e7c482; border-radius: 7px; font-weight: 800; }

@media (max-width: 960px) {
  .shell { padding-inline: 17px; }
}
@media (max-width: 660px) {
  .shell { padding-inline: 10px; }
  .topbar { min-height: 65px; gap: 6px; }
  .brand { font-size: 18px; gap: 6px; }
  .brand-mark { width: 33px; height: 34px; }
  .brand-mark .bee { transform: translate(-50%, -50%) rotate(-18deg) scale(.38); }
  .toolbar { gap: 4px; }
  .toolbar .utility { padding: 4px 6px; font-size: 11px; gap: 3px; }
  .resource-bar { gap: 5px; margin-bottom: 10px; }
  .resource-card { min-width: 98px; gap: 5px; padding: 3px 6px 3px 3px; }
  .resource-card strong { font-size: 14px; }
  .resource-icon { height: 25px; width: 25px; }
  .resource-name { font-size: 11px; }
  .world-toolbar { padding: 7px; }
  .region-nav { gap: 2px; }
  .region-nav button { padding: 6px 7px; font-size: 11px; gap: 4px; }
  .guide-button { min-height: 30px; padding: 4px 6px; font-size: 11px; }
  .map-window { height: clamp(380px, 60svh, 495px); }
  .station-icon { height: 48px; }
  .art-shell { transform: scale(.66); bottom: -7px; }
  .station-icon:hover .art-shell, .station-icon:focus-visible .art-shell { transform: translateY(-3px) scale(.66); }
  .station-name { font-size: 11px; }
  .batch, .quick-action { padding-inline: 3px; min-width: 24px; min-height: 33px; font-size: 11px; }
  .batch { min-width: 52px; }
  .batch small, .quick-action small { font-size: 9px; }
  .quick-action { padding: 4px 5px; }
  .quick-compact { min-width: 24px; min-height: 23px; font-size: 9px; }
}
@media (max-width: 359px) {
  .toolbar .utility > span[aria-hidden] { display: none; }
  .toolbar .utility { padding-inline: 4px; }
  .toolbar { gap: 3px; flex-wrap: wrap; justify-content: flex-end; padding-block: 6px; }
}
@media (pointer: coarse) {
  .toolbar .utility { min-height: 43px; }
  .batch, .quick-action { min-height: 37px; }
  .quick-compact { min-height: 24px; }
}
