/* Spectator mode: hide the player's controls, keep the office, the stats bar and the toasts. */
body.watch #dock, body.watch #buildbar, body.watch #hint, body.watch #goals, body.watch #feed, body.watch #wins,
body.watch #mentor, body.watch #modal, body.watch #home, body.watch #guide, body.watch #splash,
body.watch #tb .speed, body.watch #tb .dd, body.watch #title .tpanel, body.watch #title #tset { display: none !important; }
body.watch #tb .stat { pointer-events: none; }

#aiPanel {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(var(--tbh, 80px) + 8px); bottom: 16px;
  width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--glass); border: 1px solid #fff; border-radius: 16px; box-shadow: 0 8px 24px var(--shadow);
  backdrop-filter: blur(8px); z-index: 12; font: 600 13px/1.4 var(--fb); color: var(--ink);
}
.aiHead { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.aiBrand { font: 700 14px 'Space Grotesk', var(--fd); letter-spacing: .1em; color: var(--ink); text-decoration: none; margin-right: auto; padding-right: 8px; }
.aiHead { gap: 8px; }
/* the home page preview: just the office and its stats bar */
body.embed #aiPanel, body.embed #aiWait, body.embed #toasts, body.embed #muteBtn, body.embed #tb { display: none !important; }
.aiLive { background: var(--bad); color: #fff; font: 800 11px var(--fb); letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; }
.aiLive.off { background: var(--muted); }
.aiWho b { display: block; font: 700 15px var(--fd); }
.aiWho small { color: var(--muted); font-weight: 600; }
.aiTreasury { background: #fff6dc; border: 1px solid #f1dc9a; border-radius: 10px; padding: 6px 10px; color: #6b4a00; }
.aiTreasury b { font-weight: 800; }
.aiTreasury small { color: #8a6a1c; font-weight: 600; }
.aiTreasury[hidden] { display: none; }
.aiThinking { color: var(--sky2); font-weight: 800; display: flex; align-items: center; gap: 3px; }
.aiThinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); animation: aiDot 1s infinite ease-in-out; }
.aiThinking i:nth-child(2) { animation-delay: .15s; } .aiThinking i:nth-child(3) { animation-delay: .3s; margin-right: 4px; }
@keyframes aiDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.aiFeed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.aiItem { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sky); border-radius: 10px; padding: 7px 10px; animation: aiIn .4s ease; }
.aiItem.note { border-left-color: var(--gold); }
.aiItem small { color: var(--muted); font-size: 11px; }
.aiItem p { margin: 2px 0 0; }
.aiActs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.aiAct { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 9px; background: #e3f5ec; color: var(--good); }
.aiAct.fail { background: #fbe6e2; color: var(--bad); }
@keyframes aiIn { from { opacity: 0; transform: translateY(-6px); } }

#aiWait { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 20; background: var(--glass); border-radius: 14px;
  padding: 12px 18px; box-shadow: 0 8px 24px var(--shadow); font: 600 14px var(--fb); color: var(--ink); text-align: center; }
#aiWait b { display: block; font: 700 17px var(--fd); }
#aiWait[hidden] { display: none; }

body.watch #toasts { right: auto; left: max(16px, env(safe-area-inset-left, 0px)); }

@media (max-width: 760px) { #aiPanel { top: auto; height: 38vh; } }

.aiBrand img { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: -4px; margin-right: 6px; }
.aiJobs { display: flex; flex-direction: column; gap: 6px; }
.aiJobs[hidden] { display: none; }
.aiJobs a { display: block; background: #e3f6ec; border: 1px solid #9fd8b8; border-radius: 10px; padding: 6px 10px; color: #155c38; text-decoration: none; }
.aiJobs a:hover { background: #d2f0e0; }
.aiJobs small { display: block; color: #2a7a50; font-weight: 600; }

/* the FOUNDR menu (bottom, like the game's dock) and the Bounties window on the left */
#fdock { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 3px; padding: 7px;
  background: var(--glass, rgba(255,255,255,.85)); border: 1px solid #fff; border-radius: 22px; box-shadow: 0 10px 30px var(--shadow, rgba(0,0,0,.18)); backdrop-filter: blur(8px); z-index: 30; }
#fdock button, #fdock a { position: relative; width: 70px; height: 62px; border: 0; border-radius: 16px; background: none; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font: 800 11px var(--fb, system-ui); color: var(--ink, #1f2a44); text-decoration: none; }
#fdock span { font-size: 24px; line-height: 1; transition: transform .15s; }
#fdock button:hover, #fdock a:hover { background: #e3ecfa; } #fdock button:hover span, #fdock a:hover span { transform: translateY(-2px) scale(1.08); }
#fdock button.on { background: #dce8fb; box-shadow: inset 0 0 0 2px #2f7de1; }
#fdock .badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: #2a9d63; color: #fff; font: 800 11px/18px var(--fb, system-ui); font-style: normal; }
#fdock .badge[hidden] { display: none; }
#bwin { position: fixed; left: 12px; top: 92px; bottom: 96px; width: min(380px, calc(100vw - 24px)); z-index: 29; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; box-shadow: 0 14px 40px rgba(0,0,0,.22); overflow: hidden; font: 600 13px/1.45 var(--fb, system-ui); color: var(--ink, #1f2a44); }
#bwin[hidden] { display: none; }
#bwin .bh { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; background: #2a9d63; color: #fff; }
#bwin .bh b { font-size: 16px; } #bwin .bh span { font-size: 11.5px; opacity: .85; flex: 1; }
#bwin .bh button { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-weight: 800; }
#bwin .bb { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
#bwin .bj { border: 1px solid #e3e8f2; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
#bwin .bj.done { background: #f6f8fc; }
#bwin .bt { display: flex; gap: 8px; align-items: baseline; } #bwin .bt b { flex: 1; font-size: 14px; } #bwin .bt em { font-style: normal; font-weight: 900; color: #2a9d63; font-size: 16px; }
#bwin .bm { font-size: 12px; color: #5d6886; } #bwin .bm span { font-weight: 900; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #e9eff8; color: #1f2a44; } #bwin .bm span.on { background: #2a9d63; color: #fff; }
#bwin p { margin: 0; color: #2c3a5c; }
#bwin .bs { background: #f3f6fb; border-radius: 8px; padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere; } #bwin .bs small { color: #8a93ab; }
#bwin .bgo { align-self: flex-start; background: #ffd27e; color: #1f2a44; border-radius: 10px; padding: 6px 12px; font-weight: 900; text-decoration: none; box-shadow: inset 0 -3px 0 #e6b422; }
#bwin .bnone { color: #5d6886; padding: 8px 4px; }
body.embed #fdock, body.embed #bwin { display: none !important; }
@media (max-width: 700px) { #bwin { top: 70px; bottom: 90px; } }
#fdock .ico { display: grid; place-items: center; width: 24px; height: 24px; } #fdock .ico svg { width: 20px; height: 20px; }
