/* Fleet panel: stats strip, floating bot cards, account side sheet. Theme in theme.css. */

.fleet { padding: 18px clamp(12px, 2vw, 28px) 40px; }

/* ---------- stats strip ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  padding: 12px 14px; min-height: 78px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
}
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font: 20px/1.2 var(--pixel); color: #fff; font-variant-numeric: tabular-nums; text-shadow: 3px 3px 0 #000; }
.stat .v small { font: 13px var(--mc); color: var(--muted); margin-left: 6px; text-shadow: none; }
.stat.queue { grid-column: span 2; box-shadow: var(--drop), inset 0 3px 0 var(--gold); }
.stat.queue .v { color: var(--gold); }
.stat .sub { font-size: 13px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.toolbar h1 { flex: 1; font-size: 12px; }
.toolbar input { max-width: 340px; }
.fleet > .note { margin: 0 0 14px; }

/* ---------- bot cards ---------- */

.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }

.bot-card {
  --accent: #555;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 12px;
  cursor: pointer;
  box-shadow: var(--drop), inset 0 4px 0 var(--accent);
  transition: transform .1s steps(2), box-shadow .1s steps(2);
}
.bot-card:hover { transform: translate(-3px, -3px); box-shadow: var(--drop-up), inset 0 4px 0 var(--accent); }
.bot-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bot-card.selected { box-shadow: var(--drop-up), inset 0 4px 0 var(--accent), inset 0 0 0 2px #fff; transform: translate(-3px, -3px); }
.bot-card.st-ACTIVE, .bot-card.st-ATTACHED { --accent: var(--mc-green); }
.bot-card.st-HELD { --accent: var(--mc-aqua); }
.bot-card.st-QUEUED { --accent: var(--mc-yellow); }
.bot-card.st-KICK_READY { --accent: var(--orange); }
.bot-card.st-OFFLINE { --accent: #555; }
.bot-card.st-OFFLINE .card-live { opacity: .8; }

.card-top { display: flex; align-items: center; gap: 12px; }
.card-top .slot { width: 56px; height: 56px; flex: none; }
.ident { flex: 1; min-width: 0; }
.bot-name { font: 13px/1.5 var(--pixel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 2px 2px 0 #000; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.card-live { display: flex; flex-direction: column; gap: 10px; }

.session-line { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.session-line b { color: #fff; font-weight: 400; font-variant-numeric: tabular-nums; }
.session-line .kick b { color: var(--gold); }
.session-line .kick.soon b { color: var(--orange); }
.link { display: inline-flex; align-items: center; gap: 5px; }
.link::before { content: ""; width: 7px; height: 7px; background: var(--dim); }
.link.on { color: var(--ink); }
.link.on::before { background: var(--grass); }

.vitals { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.pips { display: inline-flex; align-items: center; gap: 1px; }
.pips .pix { width: 13px; height: 13px; }
.pips + .num { font-size: 13px; color: var(--muted); }
.vital { display: inline-flex; align-items: center; gap: 6px; }
.food .pips { flex-direction: row-reverse; } /* hunger fills from the right, like the game */

.meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: 14px; }
.meta dt { color: var(--dim); }
.meta dd { margin: 0; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta dd .muted { margin-left: 4px; }
.meta .task { color: var(--cyan); }

.card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 2px solid rgba(0, 0, 0, .35); }
.card-actions .spacer { flex: 1; }
.fly-inline { display: flex; gap: 6px; width: 100%; }
.fly-inline input { min-width: 0; }

.empty-state { padding: 40px; text-align: center; max-width: 460px; margin: 40px auto; }
.empty-state .pixel { font-size: 13px; margin: 0 0 10px; text-shadow: 2px 2px 0 #000; }

/* ---------- side sheet ---------- */

.sheet-backdrop { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 700; background: rgba(0, 0, 0, .45); }
.sheet {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; z-index: 750;
  width: min(640px, 100vw); display: flex; flex-direction: column;
  box-shadow: -6px 0 0 rgba(0, 0, 0, .5);
  animation: sheet-in .16s steps(4);
}
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface-2); box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font: 14px/1.4 var(--pixel); margin: 0; overflow: hidden; text-overflow: ellipsis; text-shadow: 2px 2px 0 #000; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px 30px; }
.sheet-body section { margin-top: 22px; }
.sheet-body h3 { margin-bottom: 10px; }
label.inline { margin: 0 0 0 auto; font: 13px var(--mc); text-transform: none; letter-spacing: 0; color: var(--muted); text-shadow: none; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; padding: 12px 14px; background: var(--well); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .5); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.cmd { display: flex; gap: 8px; margin-top: 8px; }
.cmd input { min-width: 0; }
#fly-form input { max-width: 120px; }
#move-node { min-width: 0; flex: 1; }
.move-steps { margin: 8px 0 0; padding: 8px 10px 8px 12px; list-style: none; font-size: 13px; background: #000; box-shadow: inset 0 0 0 2px #555; }
.move-steps li { padding: 1px 0; color: #e0e0e0; overflow-wrap: anywhere; }
.move-steps li.ok { color: var(--mc-green); }
.move-steps li.bad { color: var(--red); }
.output {
  margin: 8px 0 0; padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: #e0e0e0; background: #000; box-shadow: inset 0 0 0 2px #555;
}
.output:empty { display: none; }
.logs { max-height: 360px; font-size: 12px; line-height: 1.4; }
.login-hint { margin-top: 16px; padding: 10px 12px; color: #fff; background: rgba(85, 255, 255, .08); box-shadow: inset 3px 0 0 var(--mc-aqua); }
.login-hint a { color: var(--mc-aqua); }
.token { padding: 10px; word-break: break-all; white-space: pre-wrap; background: #000; color: var(--gold); }

/* ---------- puller menu (drawer) ---------- */

.puller-lists { display: grid; gap: 12px; }
.mc-inset { padding: 10px 12px; background: var(--well); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .5); }
.sub-label { margin: 0 0 8px; font: 10px/1.5 var(--pixel); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); text-shadow: 2px 2px 0 #000; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.mini th { font: 9px/1.5 var(--pixel); text-transform: uppercase; color: var(--dim); text-align: left; padding: 2px 8px 6px 0; }
table.mini td { padding: 4px 8px 4px 0; border-top: 2px solid rgba(0, 0, 0, .35); vertical-align: middle; }
table.mini td.act { text-align: right; padding-right: 0; width: 1%; white-space: nowrap; }
table.mini .who { display: inline-flex; align-items: center; gap: 8px; }
table.mini .uuid { font-family: var(--mono); font-size: 11px; color: var(--dim); }
table.mini tr.empty-row td { color: var(--dim); }
.pearl-in { color: var(--mc-green); }
.pearl-none { color: var(--mc-red); }
.pearl-wait { color: var(--mc-yellow); }
.pearl-unknown { color: var(--dim); }

@media (max-width: 760px) {
  .fleet { padding: 12px 10px 30px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { min-height: 0; padding: 8px 10px; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 14px; }
  .stat.queue { grid-column: 1 / -1; }
  .bot-card:hover { transform: none; }
  .bot-grid { grid-template-columns: 1fr; }
  .toolbar input { max-width: none; }
  #fly-form { flex-wrap: wrap; }
  #fly-form input { max-width: none; flex: 1 1 40%; }
}

/* ---------- inventory (inventory.js): the game's container window, slots, tooltip and glint ---------- */

.mc-window {
  --slot: 36px;
  display: inline-flex; flex-direction: column; gap: 4px;
  padding: 8px 10px 10px; background: #c6c6c6; color: #404040;
  border: 2px solid #000; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, var(--drop);
}
.mc-title { font: 14px/1.2 var(--mc); color: #404040; margin: 2px 0 2px 1px; }
.mgrid { display: grid; grid-template-columns: repeat(var(--cols), var(--slot)); }
.mslot {
  position: relative; width: var(--slot); height: var(--slot);
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
  display: grid; place-items: center; outline: none;
}
.mslot:hover, .mslot:focus-visible { background: #a8a8a8; }
.mslot.openable { cursor: pointer; }
.mslot .item-icon { width: calc(var(--slot) * .89); height: calc(var(--slot) * .89); display: block; image-rendering: pixelated; background-repeat: no-repeat; }
.mslot .item-icon.letter { display: grid; place-items: center; font: 11px var(--mc); color: #fff; background: #555; text-transform: uppercase; }
.mslot .count {
  position: absolute; right: 2px; bottom: 0; pointer-events: none;
  font: calc(var(--slot) * .4)/1 var(--mc); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
}
.mslot .dur { position: absolute; left: 12%; right: 12%; bottom: 10%; height: 3px; background: #000; pointer-events: none; }
.mslot .dur i { display: block; height: 2px; }
.mslot:has(.dur) .count { bottom: 4px; }
.mslot .glint {
  position: absolute; inset: calc(var(--slot) * .055); pointer-events: none; mix-blend-mode: screen; opacity: .75;
  background: linear-gradient(115deg, transparent 20%, #a35cff 35%, #e3c7ff 45%, #a35cff 55%, transparent 70%) 0 0 / 300% 300%;
  -webkit-mask: var(--mask) var(--mask-pos) / var(--mask-size) no-repeat; mask: var(--mask) var(--mask-pos) / var(--mask-size) no-repeat;
  animation: glint 3s linear infinite;
}
@keyframes glint { from { background-position: 100% 100%; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .mslot .glint { animation: none; background-position: 50% 50%; } }
.mslot.selected { box-shadow: inset 0 0 0 2px #fff, inset 2px 2px 0 2px #373737; background: #9d9d9d; }

.inv-view { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.inv-top { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 2px; }
.inv-player {
  align-self: stretch; width: calc(var(--slot) * 3); display: grid; place-items: center;
  background: #000; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
}
.hotbar-gap { height: 6px; }

/* Card: hotbar with the offhand slot to its left, scaled to the card. */
.mc-hotbar { display: flex; align-items: center; gap: 8px; --slot: clamp(26px, calc((100cqw - 52px) / 10), 36px); }
.card-live { container-type: inline-size; }
.mc-hotbar .mgrid { padding: 3px; background: #c6c6c6; border: 2px solid #000; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555; }

.mc-tooltip {
  position: fixed; z-index: 2000; pointer-events: none; max-width: 340px;
  padding: 5px 8px 6px; font: 14px/1.35 var(--mc); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  background: rgba(16, 0, 16, .94); border: 2px solid #100010; box-shadow: inset 0 0 0 2px #2d0a63;
}
.mc-tooltip .t-name { margin-bottom: 2px; }
.mc-tooltip .t-name.custom { font-style: italic; }
.mc-tooltip .t-count { color: #aaa; font-style: normal; }
.mc-tooltip .r-common { color: #fff; }
.mc-tooltip .r-uncommon { color: #ffff55; }
.mc-tooltip .r-rare { color: #55ffff; }
.mc-tooltip .r-epic { color: #ff55ff; }
.mc-tooltip .t-ench, .mc-tooltip .t-grey { color: #aaa; }
.mc-tooltip .t-curse { color: #ff5555; }
.mc-tooltip .t-white { color: #fff; }
.mc-tooltip .italic { font-style: italic; }
.mc-tooltip .t-id { color: #555; text-shadow: 2px 2px 0 #151515; }

.shulker-pop { position: fixed; z-index: 1900; animation: sheet-in .12s steps(3); }

/* ---------- fleet categories (drag a card between them) ---------- */

.fleet-cats { display: flex; flex-direction: column; gap: 22px; }
.cat { --cat: #555; }
.cat-HUNTING { --cat: var(--mc-green); }
.cat-LANDED { --cat: var(--mc-gold); }
.cat-PULLER { --cat: var(--mc-purple); }
.cat-CANARY { --cat: var(--mc-yellow); }
.cat-QUEUED { --cat: var(--orange); }
.cat-PARKED { --cat: var(--mc-aqua); }
.cat-OFFLINE { --cat: #555; }
.cat-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 11px; }
.cat-pip { width: 10px; height: 10px; background: var(--cat); box-shadow: 2px 2px 0 #000; }
.cat .bot-grid { min-height: 40px; padding: 4px; margin: -4px; }
.cat.empty .bot-grid { min-height: 64px; background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 2px var(--line); }
.is-dragging .cat.drag-active .bot-grid { min-height: 120px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 2px var(--line); }
.is-dragging .cat:not(.drag-active) { opacity: .45; }
.cat.drop-ok .bot-grid { box-shadow: inset 0 0 0 3px var(--cat); background: rgba(255, 255, 255, .05); }
body.can-fleet-control .bot-card[draggable="true"] { cursor: grab; }
.bot-card.dragging { opacity: .35; }
.drop-ph { min-height: 120px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 3px var(--cat); }

.park-menu { position: fixed; z-index: 1500; display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.park-menu[hidden] { display: none; }
.park-title { font: 11px var(--pixel); margin-right: 4px; text-shadow: 2px 2px 0 #000; }

/* ---------- drawer: chat and Zenith log tabs ---------- */

.log-head { display: flex; align-items: center; gap: 8px; }
.log-tabs { display: inline-flex; gap: 4px; }
.log-tab.active { --b-bg: var(--green); --b-ink: #fff; }
.chat-log { display: block; min-height: 180px; }
.chat-log:empty { display: block; }
.chat-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-at { color: var(--dim); }
.chat-line.k-system { color: var(--mc-yellow); }
.chat-line.k-whisper { color: var(--mc-purple); }
.chat-line.k-sent { color: var(--mc-aqua); }
.chat-line.k-dropped { color: var(--dim); font-style: italic; }
.chat-me { color: var(--mc-aqua); }
.chat-state { font-size: 12px; }
.chat-state.pending, .chat-state.unknown { color: var(--dim); }
.chat-state.ok { color: var(--mc-green); }
.chat-state.bad { color: var(--red); }
.chat-line.k-bad { color: #9a9a9a; text-decoration: line-through; text-decoration-color: rgba(255, 85, 85, .6); }
.chat-line.k-bad .chat-state, .chat-line.k-bad .chat-at, .chat-line.k-bad .chat-me { text-decoration: none; display: inline-block; }
.chat-line.k-blocked { color: #9a9a9a; }

/* ---------- remote client viewer ---------- */

.remote-dialog { width: min(1320px, 96vw); max-width: none; padding: 0; background: var(--surface); }
.remote-dialog:fullscreen { width: 100vw; height: 100vh; display: flex; flex-direction: column; }
.remote-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); }
.remote-bar .spacer { flex: 1; }
.remote-title { font: 12px var(--pixel); text-shadow: 2px 2px 0 #000; }
.remote-stage { position: relative; background: #000; display: grid; place-items: center; }
.remote-dialog:fullscreen .remote-stage { flex: 1; min-height: 0; }
#remote-canvas { display: block; width: 100%; height: auto; max-height: calc(96vh - 60px); object-fit: contain; outline: none; cursor: crosshair; }
.remote-dialog:fullscreen #remote-canvas { width: 100%; height: 100%; max-height: none; }
#remote-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--mc-green); }
.remote-overlay { position: absolute; inset: auto 0 0 0; padding: 8px 12px; font: 13px var(--mc); color: #fff; background: rgba(0, 0, 0, .65); pointer-events: none; }
.remote-overlay:empty, .remote-overlay[hidden] { display: none; }
