/* workers_v1 (2026-09-30) — production building panels as a living scene.
   Scoped to .overlay-card.worker-scene / .wk so it never touches the map, tower, chat or event UI. */

.overlay-card.worker-scene { padding: 0 0 18px; overflow-x: hidden; }
.overlay-card.worker-scene > .overlay-x { top: 10px; right: 10px; }
.wk { padding: 0 16px 2px; }

/* ---- scene banner ---- */
.wk-banner {
  position: relative;
  margin: 0 -16px;
  aspect-ratio: 16 / 9;
  max-height: 44dvh;
  overflow: hidden;
  background: #3e2616;
  border-bottom: 4px solid #6b4226;
  box-shadow: inset 0 -1px 0 #c9a24a;
}
.wk-pan {
  position: absolute;
  inset: -4%;
  animation: wkPan 24s ease-in-out infinite alternate;
  will-change: transform;
}
.wk-crop, .wk-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}
.wk-crop { filter: sepia(0.28) saturate(1.05) contrast(1.03) brightness(1.02); }
.wk-art { object-fit: cover; object-position: center 40%; display: block; user-select: none; }
.wk-vignette { position: absolute; inset: 0; pointer-events: none; }
.wk-banner.placeholder .wk-vignette {
  /* parchment vignette until Arena Art paints the worker scene */
  background:
    radial-gradient(ellipse 72% 70% at 50% 46%, rgba(243,226,192,0) 52%, rgba(233,212,168,0.72) 84%, rgba(224,200,146,0.97) 100%),
    linear-gradient(180deg, rgba(62,38,22,0) 60%, rgba(62,38,22,0.32) 100%);
  box-shadow: inset 0 0 0 3px rgba(201,162,74,0.55), inset 0 0 26px rgba(90,60,30,0.45);
}
.wk-banner.has-art .wk-vignette {
  background: linear-gradient(180deg, rgba(20,12,6,0.18) 0%, rgba(20,12,6,0) 26%, rgba(20,12,6,0) 62%, rgba(20,12,6,0.5) 100%);
}
.wk-plaque {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 14px 7px;
  border-radius: 10px;
  background: linear-gradient(180deg, #8b5a2b, #5e3a1f);
  border: 2px solid #c9a24a;
  box-shadow: 0 4px 10px rgba(30,16,6,0.45);
}
.overlay-card .wk-plaque h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.05;
  color: #fbeccb;
  text-shadow: 0 1px 0 #2a1608;
}
.wk-lv { font-size: 0.8rem; font-weight: 700; color: #efd48a; letter-spacing: 0.03em; white-space: nowrap; }
.wk-ready {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #d4483c, #9a2418 70%);
  border: 2px solid #efd48a;
  color: #fff3d6;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(60,10,4,0.45);
  animation: wkBounce 1.5s ease-in-out infinite;
}

/* ---- speech bubble ---- */
.wk-bubble {
  position: relative;
  margin: 16px 0 10px;
  padding: 10px 14px 11px;
  border-radius: 16px;
  background: #fffaf0;
  border: 2px solid #c9a24a;
  box-shadow: 0 3px 0 rgba(107,66,38,0.25);
}
.wk-bubble::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 30px;
  width: 18px;
  height: 18px;
  background: #fffaf0;
  border-left: 2px solid #c9a24a;
  border-top: 2px solid #c9a24a;
  transform: rotate(45deg);
}
.wk-who {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a6a3a;
  margin-bottom: 2px;
}
.wk-say {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
  color: #2a1c12;
}
.wk-bubble.asking {
  border-color: #b8862a;
  background: #fff6de;
  animation: wkPop 0.35s ease-out both;
}
.wk-bubble.asking::before { background: #fff6de; border-color: #b8862a; }
.wk-bubble.asking .wk-say { font-size: 1.28rem; }

/* ---- big buttons ---- */
.wk .wk-big {
  display: flex;
  width: 100%;
  min-height: 56px;
  margin: 10px 0 0;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 0 rgba(62,38,22,0.45);
  touch-action: manipulation;
}
.wk .wk-big:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(62,38,22,0.45); }
.wk .btn:disabled { opacity: 0.55; filter: saturate(0.6); cursor: default; }
.wk .wk-upgrade {
  background: linear-gradient(180deg, #f6dc8e, #c99a3a);
  border-color: #8a6420;
  color: #3e2616;
  font-family: var(--serif);
  font-size: 1.45rem;
}
.wk .wk-collect { font-size: 1.25rem; }
.wk .wk-collect.ready { animation: wkPulse 1.5s ease-in-out infinite; }
.wk .btn.gold {
  background: linear-gradient(180deg, #efd48a, #c9a24a);
  border-color: #8a6420;
  color: #3e2616;
}
.wk .wk-rush { width: 100%; margin-top: 8px; min-height: 44px; }
.wk-cost { margin: 6px 0 2px; }
.wk-cost .cost-chips, .wk-row .cost-chips { justify-content: center; gap: 4px; margin: 4px 0 0; }
.wk-cost .cost-chip, .wk-row .cost-chip { font-size: 0.7rem; padding: 3px 7px; }
.wk-cost .cc-flag, .wk-row .cc-flag { display: none; }

/* ---- building / storeroom bars ---- */
.wk-build, .wk-store { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 0.85rem; font-weight: 600; color: #5a4030; }
.wk-store { flex-direction: column; align-items: stretch; gap: 4px; }
.wk-build-bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(62,38,22,0.18); border: 1px solid rgba(107,66,38,0.35); overflow: hidden; }
.wk-build-fill { height: 100%; background: linear-gradient(90deg, #c99a3a, #efd48a); transition: width 0.9s linear; }
.wk-build-fill.warn { background: linear-gradient(90deg, #b8562a, #e08a4a); }

/* ---- quiet numbers ---- */
.wk-details { margin: 14px 0 0; }
.wk-details > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b4a2a;
}
.wk-details > summary::-webkit-details-marker { display: none; }
.wk-details > summary::before { content: "▸"; font-size: 0.8rem; transition: transform 0.15s; }
.wk-details[open] > summary::before { transform: rotate(90deg); }
.wk-strip {
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,248,232,0.6);
  border: 1px dashed rgba(139,90,43,0.45);
  font-size: 0.8rem;
  color: #5a4030;
}
.wk-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px dotted rgba(139,90,43,0.25); }
.wk-row:last-child { border-bottom: none; }
.wk-row strong { color: #3e2616; text-align: right; font-weight: 700; }
.wk-row.col { flex-direction: column; align-items: stretch; }
.wk-note { margin: 6px 0 0; font-size: 0.75rem; color: #7a5a3a; }
.wk .trade-list { margin-top: 12px; }
.wk .trade-row em { font-weight: 700; }
.wk .deal-bargain { color: #2a6b42; }
.wk .deal-pricey { color: #8a3a2a; }

/* ---- motion ---- */
@keyframes wkPan {
  0%   { transform: translate(-1.6%, 0.4%) scale(1.02); }
  100% { transform: translate(1.6%, -0.8%) scale(1.07); }
}
@keyframes wkBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  12% { transform: translateY(-7px) scale(1.06); }
  24% { transform: translateY(0) scale(0.98); }
  34% { transform: translateY(-3px) scale(1.02); }
  44% { transform: translateY(0) scale(1); }
}
@keyframes wkPulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(62,38,22,0.45), 0 0 0 0 rgba(106,186,122,0.55); }
  50% { box-shadow: 0 4px 0 rgba(62,38,22,0.45), 0 0 0 8px rgba(106,186,122,0); }
}
@keyframes wkPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wk-pan, .wk-ready, .wk .wk-collect.ready, .wk-bubble.asking { animation: none; }
}

/* ---- phone ---- */
@media (max-width: 480px) {
  .wk { padding: 0 12px 2px; }
  .wk-banner { margin: 0 -12px; max-height: 36dvh; }
  .overlay-card .wk-plaque h2 { font-size: 1.25rem; }
  .wk-say { font-size: 1.08rem; }
  .wk-bubble.asking .wk-say { font-size: 1.14rem; }
  .wk .wk-upgrade { font-size: 1.3rem; }
  .wk .wk-collect { font-size: 1.12rem; }
}
@media (min-width: 720px) {
  .overlay-card.worker-scene { overflow: auto; }
  .wk-banner { border-radius: 16px 16px 0 0; }
}
.wk p.wk-cost { margin: 6px 0 0; text-align: center; font-size: 0.8rem; color: #6b4a2a; }

/* ================= panels_v2 (2026-10-01): one screen, no scrolling =================
   Collect on top, rate in words, Upgrade card now -> next with have/need cost. */
.overlay-card.worker-scene { overflow: hidden; padding-bottom: 10px; }
@media (min-width: 720px) { .overlay-card.worker-scene { overflow: hidden; } }
.wk2 { padding: 0 14px 0; }
.wk2 .wk-banner { aspect-ratio: auto; height: clamp(92px, 17dvh, 170px); max-height: none; margin: 0 -14px; border-bottom-width: 3px; }
.wk2 .wk-plaque { left: 10px; bottom: 8px; padding: 4px 11px 5px; }
.overlay-card .wk2 .wk-plaque h2 { font-size: 1.2rem; }
.wk2 .wk-ready { top: 8px; left: 10px; padding: 4px 10px; font-size: .95rem; }
.wk2 .wk-bubble { margin: 8px 0 0; padding: 5px 10px 6px; border-radius: 12px; }
.wk2 .wk-bubble::before { top: -8px; width: 12px; height: 12px; }
.wk2 .wk-who { display: none; }
.wk2 .wk-say, .wk2 .wk-bubble.asking .wk-say { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk2 .wk-big { min-height: 52px; margin-top: 8px; }
.wk2 .cl .wk-collect { font-size: 1.3rem; min-height: 58px; }
.cl-sub { position: relative; display: flex; align-items: center; gap: 8px; margin: 5px 2px 0; font-size: .8rem; font-weight: 600; color: #5a4030; }
.cl-bar { flex: 0 0 64px; height: 8px; border-radius: 999px; background: rgba(62,38,22,.18); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4f9a5e, #8fd29a); transition: width .9s linear; }
.cl-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-flash { position: absolute; right: 0; top: -36px; padding: 3px 10px; border-radius: 999px; background: #2f6b3e; color: #f4ffe8; font-weight: 800; font-size: .9rem;
  box-shadow: 0 3px 8px rgba(20,40,20,.35); animation: clFloat 2.2s ease-out both; pointer-events: none; white-space: nowrap; }
@keyframes clFloat { 0% { opacity: 0; transform: translateY(8px); } 12% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.cl-tale { margin-top: 6px; }
.cl-tale .tale-btn.block { margin: 0; min-height: 44px; }
.cl-tale .dbl-chip { margin-top: 0; }
.wk-rate { margin: 8px 2px 0; font-size: .95rem; color: #3e2616; }
.wk-rate b { font-weight: 800; }
.wk-uses { color: #7a5a3a; font-size: .85rem; }
.wk2 .fixit-note { margin-top: 8px; }

/* upgrade card */
.uc { margin: 10px 0 0; padding: 9px 11px 10px; border-radius: 14px; background: rgba(255,248,232,.72); border: 2px solid rgba(139,90,43,.45); box-shadow: 0 2px 0 rgba(107,66,38,.18); }
.uc.can { border-color: #b8862a; background: #fff6de; }
.uc.maxed { text-align: center; font-weight: 700; color: #6b4a2a; }
.uc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: #3e2616; }
.uc-time { font-family: system-ui, sans-serif; font-size: .78rem; font-weight: 700; color: #7a5a3a; white-space: nowrap; }
.uc-gains { margin-top: 5px; }
.uc-gain { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 0; font-size: .9rem; color: #5a4030; }
.uc-k { white-space: nowrap; }
.uc-v { text-align: right; }
.uc-v b { color: #3e2616; font-weight: 800; }
.uc-v b.up { color: #2a6b42; }
.uc-arrow { margin: 0 5px; color: #b8862a; font-weight: 800; }
.uc-cost { margin-top: 6px; }
.uc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.uc-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 3px 9px; border-radius: 999px; font: 700 .82rem system-ui, sans-serif; border: 1.5px solid; background: #fff; }
.uc-chip .cur-ico { width: 16px !important; height: 16px !important; }
.uc-chip.ok { color: #2a6b42; border-color: rgba(42,107,66,.45); background: #eef8ee; }
.uc-chip.ok i { font-style: normal; font-weight: 900; }
.uc-chip.short { color: #9a4a3e; border-color: rgba(154,74,62,.45); background: #fbefea; }
button.uc-chip.short { cursor: pointer; }
button.uc-chip.short i { font-style: normal; font-weight: 900; margin-left: 1px; }
.wk2 .uc-btn { display: flex; width: 100%; justify-content: center; min-height: 50px; margin-top: 8px; border-radius: 12px; font-size: 1.2rem; box-shadow: 0 3px 0 rgba(62,38,22,.4); }
.wk2 .uc-btn:disabled { opacity: .5; filter: saturate(.4); box-shadow: none; }
.uc.building .wk-build-bar { margin-top: 6px; }
.uc-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.uc-acts .wk-rush { margin: 0; }
.uc-acts .tale-btn.block { margin: 0; min-height: 42px; }
.uc-acts #btnHourglass { margin: 0; min-height: 42px; font-size: .95rem; }
.wk2 .wk-details { margin: 6px 0 0; }
.wk2 .wk-details > summary { min-height: 30px; padding: 2px 6px; font-size: .78rem; }
.wk2 .wk-details[open] .wk-strip { max-height: 22dvh; overflow: auto; }
/* storage */
.wk-store.big { margin-top: 10px; gap: 6px; font-size: .9rem; }
.stor-head b { font-size: 1.1rem; color: #3e2616; }
.stor-head em.warn { color: #9a4a3e; font-style: normal; font-weight: 800; }
.wk2 .stor-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.wk2 .stor-chip { display: inline-flex; align-items: center; gap: 4px; }
.wk2 .stor-chip .cur-ico { width: 16px !important; height: 16px !important; }
/* trade desk keeps its list but inside the screen */
.wk2 .trade-list { max-height: 34dvh; overflow: auto; }
@media (max-height: 700px) {
  .wk2 .wk-banner { height: clamp(72px, 13dvh, 120px); }
  .wk2 .wk-bubble { display: none; }
}
.uc-chips .uc-chip.fixit-btn { min-height: 30px; padding: 3px 9px; margin: 0; gap: 4px; border-radius: 999px; border: 1.5px solid rgba(154,74,62,.45);
  background: #fbefea; color: #9a4a3e; font: 700 .82rem system-ui, sans-serif; box-shadow: none; letter-spacing: 0; }
.uc-chips .uc-chip.fixit-btn:hover { background: #f7e2da; }
.wk2 .wk-bubble { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.wk2 .wk-who { display: inline; flex: none; margin: 0; font-size: .66rem; }
.wk2 .wk-say { flex: 1; min-width: 0; }
.wk2 .stor-what { margin: 6px 2px 0; font-size: .85rem; color: #6b4a2a; }
