:root {
  --bg: #0d0f14;
  --bg2: #13161d;
  --card: #181c25;
  --card2: #20242f;
  --line: #2b3040;
  --text: #e8e8e8;
  --muted: #9ca3af;
  --accent: #a78bfa;
  --accent2: #3fbf7f;
  --danger: #e2585b;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }

h1, h2, .ace, .tab, .stat .v { font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif; }

/* ACE site bar (shared look with aceclan.lol) */
.sitebar { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; }
.sitebar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, #ff4655, #7c3aed, #c89b3c, transparent);
}
.sitebar-inner { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; padding-bottom: 10px; gap: 12px; }
.ace { font-weight: 700; font-size: 1.3rem; letter-spacing: 3px; color: var(--text); text-decoration: none; }
.ace span { color: var(--accent); }
.ace small { font-size: .8rem; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-left: 4px; }
.sitebar nav { display: flex; gap: 18px; }
.sitebar nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .85rem; letter-spacing: 1px; text-transform: uppercase; }
.sitebar nav a:hover { color: var(--text); }

/* header */
.top { background: var(--bg2); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--card2); border-radius: 10px; border: 1px solid var(--line); }
h1 { font-size: 20px; margin: 0; }
.tag { margin: 0; color: var(--muted); font-size: 13px; }
.plans { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.plans select { min-width: 180px; }

/* controls */
input, select, button { font: inherit; color: inherit; }
input[type=number], input[type=search], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  background: var(--accent); color: #160d2e; border: 0; border-radius: 8px; padding: 7px 12px;
  cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; white-space: nowrap;
}
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 3px 8px; font-size: 12px; }

/* search */
.search-card { margin: 20px 0 8px; }
.search-row { display: flex; gap: 12px; align-items: end; }
.search-box { position: relative; flex: 1; }
.search-box input { width: 100%; padding: 12px 14px; font-size: 16px; background: var(--card); }
.qty { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.qty input { width: 90px; padding: 11px 10px; background: var(--card); font-size: 16px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px #0008;
  max-height: 420px; overflow-y: auto;
}
.suggest button {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none;
  border: 0; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button.active, .suggest button:hover { background: var(--card2); }
.suggest .id { color: var(--muted); font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.status { min-height: 1.5em; margin: 6px 2px 0; color: var(--muted); font-size: 13px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 13px; }
button.chip { cursor: pointer; font: inherit; font-size: 12px; }
button.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.custom { color: #f39cf3; border-color: #5e2a5e; background: #261326; }

/* custom item editor */
.custom-ed { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 10px 0; }
.custom-ed .field { margin: 10px 0; }
.custom-ed .field input { padding: 9px 10px; max-width: 360px; }
.custom-ed .search-box input { font-size: 14px; padding: 9px 12px; background: var(--card2); }
.custom-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.custom-head h3 { margin: 0; }
.c-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.c-row .grow { flex: 1; min-width: 0; }
.c-row input { width: 80px; padding: 5px 8px; }
.custom-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#customList { margin-top: 14px; }

/* empty */
.empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 12px; }
.empty h2 { margin-top: 0; }
.how { padding-left: 18px; }
.how li { margin: 6px 0; }

/* target */
.target { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.target-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.target h2 { margin: 2px 0 6px; font-size: 26px; }
.target-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap;
}
.chip.req { color: #f3c969; border-color: #5b4a1c; background: #2a2414; }
.chip.raw { color: #9fd8b7; border-color: #255a3c; background: #13261b; }
.chip.forge { color: #ff9e6b; border-color: #613520; background: #2a1810; }
.chip.npc { color: #8fc7ff; border-color: #234766; background: #111f2c; }
.chip.kat { color: #e3a8ff; border-color: #4f2a66; background: #22132b; }
.chip.ok { color: var(--accent2); border-color: #255a3c; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .bar { margin-top: 8px; }

.bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.full > span { background: var(--accent2); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600;
}
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab .n { font-size: 11px; background: var(--card2); border-radius: 99px; padding: 1px 6px; margin-left: 4px; color: var(--muted); }
.panel { padding: 14px 0 30px; }
.panel[hidden] { display: none; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.toolbar label { display: flex; gap: 6px; align-items: center; cursor: pointer; }

/* raw table */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg2); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.done td { opacity: .55; }
.table input[type=number] { width: 100px; text-align: right; padding: 4px 8px; }
.table .barcell { width: 18%; }
.item-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wiki { font-size: 12px; text-decoration: none; opacity: .8; }

/* tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 12px; border-left: 1px dashed var(--line); }
.tree li { margin: 2px 0; }
.node-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px;
}
.node-row:hover { background: var(--card); }
.twisty {
  width: 22px; height: 22px; border: 0; background: var(--card2); border-radius: 5px; cursor: pointer; color: var(--muted);
  flex: none; font-size: 11px; line-height: 22px; padding: 0;
}
.twisty.leaf { visibility: hidden; }
.qtyx { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); min-width: 3ch; }
.node-ctrl { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.node-ctrl input { width: 80px; padding: 3px 6px; text-align: right; }
.node-ctrl select { padding: 3px 6px; font-size: 12px; max-width: 200px; }
.covered { color: var(--accent2); font-size: 12px; }

/* req + steps */
.cards { display: grid; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent2); flex: none; }
.step.done .step-main { opacity: .5; text-decoration: line-through; }
.step-num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5ch; }
.step-in { color: var(--muted); font-size: 13px; margin-top: 2px; }

.mc { font-weight: 600; }

.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 20px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 10px 30px #0008; z-index: 50; max-width: calc(100% - 32px);
}

@media (max-width: 640px) {
  .search-row { flex-direction: column; align-items: stretch; }
  .qty input { width: 100%; }
  .table .barcell, .table th.barcell { display: none; }
  .table th, .table td { padding: 8px; }
  .table input[type=number] { width: 72px; }
  .node-ctrl { margin-left: 30px; width: 100%; flex-wrap: wrap; }
  .target h2 { font-size: 22px; }
}

/* ---------- shared tool pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 22px 0 14px; }
.page-head h2 { margin: 0; font-size: 28px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.clock { text-align: right; }
.clock .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.clock .v { font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif; font-size: 22px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, .field select { font-size: 14px; color: var(--text); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.controls .grow { flex: 1; min-width: 200px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.badge.live { background: #13261b; color: var(--accent2); border: 1px solid #255a3c; }
.badge.soon { background: #2a2414; color: #f3c969; border: 1px solid #5b4a1c; }
.empty-note { color: var(--muted); padding: 18px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.btn.icon { padding: 3px 8px; }

/* events */
.events { display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.event.active { border-color: #255a3c; background: linear-gradient(90deg, #13261b, var(--card) 60%); }
.event .ico { font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--card2); border-radius: 10px; }
.event h3 { margin: 0; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.event .sub { color: var(--muted); font-size: 13px; }
.event .cd { text-align: right; font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.event .cd small { display: block; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 400; color: var(--muted); }

/* mayor */
.mayor-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.mayor-card h3 { margin: 0 0 4px; font-size: 24px; font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif; }
.perk { padding: 10px 0; border-top: 1px solid var(--line); }
.perk:first-of-type { border-top: 0; }
.perk b { display: block; margin-bottom: 2px; }
.perk div { font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cand { display: grid; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cand .top-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cand .bar { height: 8px; }
.section-h { font-family: 'Rajdhani', 'Segoe UI', Arial, sans-serif; font-size: 20px; letter-spacing: 1px; margin: 26px 0 10px; }

/* forge timeline */
.slots { display: grid; gap: 6px; }
.slot { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; }
.slot .lab { color: var(--muted); font-size: 12px; }
.lane { position: relative; height: 34px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.job { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: #2d2250; border: 1px solid #5b44a8; font-size: 11px; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; color: var(--text); }
.job:nth-child(even) { background: #233046; border-color: #3f5f8f; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 4px 0 0 78px; }

/* lists */
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-top: 6px; }
.pick-list button { display: flex; justify-content: space-between; width: 100%; gap: 8px; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; text-align: left; }
.pick-list button:hover { background: var(--card2); }
.pick-list button:last-child { border-bottom: 0; }
.ing { font-size: 13px; color: var(--muted); }
.table select { padding: 4px 6px; font-size: 13px; }
.table input.small { width: 70px; text-align: right; padding: 4px 6px; }

@media (max-width: 640px) {
  .event { grid-template-columns: 36px 1fr; }
  .event .ico { width: 36px; height: 36px; font-size: 20px; }
  .event .cd { grid-column: 2; text-align: left; }
  .clock { text-align: left; }
  .table-wrap { overflow-x: auto; }
}

/* minion cards */
.minion { display: grid; gap: 10px; }
.minion-top, .minion-gear { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.minion-top h3 { margin: 0 auto 4px 0; font-size: 17px; min-width: 140px; }
.minion-gear select { max-width: 220px; }
.minion-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-top: 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* picture view of the recipe tree (Ironman planner) */
.seg { display: inline-flex; gap: 0; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; }
.vt-frame {
  overflow: auto; max-height: 70vh; padding: 14px; border-radius: var(--radius);
  cursor: grab; touch-action: none; user-select: none; scrollbar-width: none;
  background: #1d2131; border: 2px solid #3a4054; box-shadow: inset 0 0 0 2px #121521;
}
.vt-canvas { display: inline-block; min-width: 100%; }
.vt-node { display: flex; flex-direction: column; align-items: flex-start; }
.vt-box {
  position: relative; width: 40px; height: 40px; padding: 0; cursor: pointer; flex: none;
  background: #8b8b8b; border: 2px solid; border-color: #373737 #ffffff #ffffff #373737;
  display: grid; place-items: center;
}
.vt-box:hover { background: #a5a5a5; }
.vt-box.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.vt-box.raw { box-shadow: 0 0 0 2px #2f7d4f; }
.vt-box.done { background: #6f9c7c; }
.vt-box.closed::after { content: ""; position: absolute; top: 2px; left: 2px; border: 5px solid; border-color: #ffd34d transparent transparent #ffd34d; }
.vt-box img { width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.vt-letter { font: 700 18px/1 'Rajdhani', sans-serif; color: #1d2131; }
.vt-n {
  position: absolute; right: 1px; bottom: -1px; font: 700 12px/1 ui-monospace, Consolas, monospace; color: #fff;
  text-shadow: 1px 1px 0 #3f3f3f, 2px 2px 0 #3f3f3f; pointer-events: none; letter-spacing: -.5px;
}
/* connectors: children sit in a row under a bar that starts at the parent's centre */
.vt-kids { display: flex; align-items: flex-start; position: relative; margin-top: 10px; }
.vt-kids::before { content: ""; position: absolute; left: 19px; top: -10px; width: 2px; height: 10px; background: #e8e8e8; }
.vt-kids > .vt-node { position: relative; padding-top: 12px; padding-right: 12px; }
.vt-kids > .vt-node::before { content: ""; position: absolute; left: 19px; top: 0; width: 2px; height: 12px; background: #e8e8e8; }
.vt-kids > .vt-node:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 0; width: 100%; height: 2px; background: #e8e8e8; }
.vt-detail { margin-top: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; }
.vt-detail-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vt-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vt-actions input { width: 80px; padding: 3px 6px; text-align: right; }
.vt-frame::-webkit-scrollbar { display: none; }
.vt-frame.dragging { cursor: grabbing; }

/* enchantment glint: a purple sheen clipped to the icon's own shape */
.vt-icon { position: relative; width: 32px; height: 32px; display: block; pointer-events: none; }
.vt-icon.glint::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 0 30%, rgba(200, 120, 255, 1) 42%, rgba(140, 70, 255, .8) 50%, transparent 62% 100%);
  background-size: 300% 100%; background-repeat: no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
  mix-blend-mode: screen; animation: glint 2.8s linear infinite;
}
@keyframes glint { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .vt-icon.glint::after { animation: none; background-position: 50% 0; opacity: .6; } }

/* ---------- attribute shards ---------- */
.controls-wrap { margin-bottom: 14px; }
.controls-wrap > summary { cursor: pointer; font-weight: 600; padding: 8px 2px; }
.controls-wrap[open] > summary { margin-bottom: 8px; }
.shard-filters input[type=search] { flex: 1; min-width: 200px; padding: 8px 12px; background: var(--card); }
.shard-filters select { padding: 7px 8px; background: var(--card); }
.shard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 8px; }
.shard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.shard.tracked { border-color: #4b3b7a; }
.shard.done { border-color: #255a3c; }
.shard-head { display: flex; gap: 10px; align-items: center; }
.shard-head .grow { flex: 1; min-width: 0; }
.shard .code { font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.shard .ability { font-size: 12px; }
.shard-desc { font-size: 13px; line-height: 1.45; }
.shard-hunt summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.shard-hunt div { font-size: 12px; margin-top: 2px; }
.shard-track { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.shard-track select { padding: 3px 6px; margin-left: 4px; }
.shard-track .need { flex: 1; color: var(--text); }
.sh-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; border-radius: 3px; }
.sh-icon img { width: 28px; height: 28px; image-rendering: pixelated; }
.sh-icon.small { width: 24px; height: 24px; border-width: 1px; }
.sh-icon.small img { width: 18px; height: 18px; }
.sh-icon.small .vt-letter { font-size: 12px; }
#tab-fuse .search-box { position: relative; }
#tab-fuse .search-box input { padding: 9px 12px; font-size: 14px; }

/* ---------- greenhouse ---------- */
.gh-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .gh-layout { grid-template-columns: 1fr; } }
.gh-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, auto); gap: 3px;
  background: #1b2a1b; border: 1px solid #2f4a2f; border-radius: var(--radius); padding: 6px; user-select: none; touch-action: none;
}
.gh-cell { aspect-ratio: 1; border-radius: 4px; background: #5b3d24; border: 1px solid #6e4b2c; cursor: pointer; }
.gh-cell.locked { background: #141814; border-color: #222a22; }
.gh-cell.locked.next { background: #1d241d; border-style: dashed; border-color: #3b5a3b; }
.gh-grid[data-tool=inspect] .gh-cell.locked { cursor: default; }
.gh-cell:hover { outline: 2px solid #ffffff55; outline-offset: -2px; }
.gh-cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.gh-plant, .gh-ghost { pointer-events: none; display: grid; place-items: center; position: relative; border-radius: 4px; z-index: 1; }
.gh-plant img, .gh-ghost img { width: 72%; max-width: 40px; image-rendering: pixelated; filter: drop-shadow(0 1px 1px #000a); }
.gh-plant.mut { background: #ffffff10; box-shadow: inset 0 0 0 2px var(--rc, #fff3); }
.gh-plant.block img { opacity: .9; }
.gh-ghost { opacity: .45; box-shadow: inset 0 0 0 2px dashed; outline: 2px dashed var(--rc, #fff6); outline-offset: -3px; animation: ghpulse 2.4s ease-in-out infinite; }
@keyframes ghpulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .gh-ghost { animation: none; } }
.gh-ghost .n { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: 700; color: #fff; }
.r-common { --rc: #ffffff88; } .r-uncommon { --rc: #55ff55aa; } .r-rare { --rc: #6f6fffcc; } .r-epic { --rc: #c04ad0cc; } .r-legendary { --rc: #ffaa00cc; }
.badges { position: absolute; left: 1px; right: 1px; bottom: 0; display: flex; gap: 1px; justify-content: center; flex-wrap: wrap; }
.badges .b { font-size: 9px; line-height: 1.2; padding: 0 2px; border-radius: 3px; background: #000b; font-weight: 700; }
.badges .up { color: #55ff55; } .badges .down { color: #ff5555; } .badges .bd { color: #ffaa00; } .badges .imm { font-size: 8px; }
.palette { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 12px; }
.pal-h { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.pal-row { display: flex; flex-wrap: wrap; gap: 4px; }
.pal { width: 36px; height: 36px; display: grid; place-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; padding: 0; font-size: 16px; }
.pal img { width: 24px; height: 24px; image-rendering: pixelated; }
.pal.on { border-color: var(--accent); background: #2c2550; box-shadow: 0 0 0 1px var(--accent); }
.pal[class*=r-] { box-shadow: inset 0 -2px 0 var(--rc); }
.pal.on[class*=r-] { box-shadow: 0 0 0 1px var(--accent), inset 0 -2px 0 var(--rc); }
.gh-info .k, .mut-card .k { font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
.gh-info img, .mut-card .item-cell img, .spot img { width: 24px; height: 24px; image-rendering: pixelated; }
.fx-list { margin: 0; padding-left: 0; list-style: none; font-size: 13px; }
.fx-list li { margin: 3px 0; }
.chip.fx.good { color: #9fd8b7; border-color: #255a3c; background: #13261b; }
.chip.fx.bad { color: #ff9b9b; border-color: #5e2626; background: #2a1414; }
.drops { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.drop { display: inline-flex; align-items: center; gap: 4px; }
.drop img, .need img, .path img { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: middle; }
.spot { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spot .grow { flex: 1; }
.mut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.mut-card { border-left: 3px solid var(--rc); }
.mut-card .need { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; font-size: 13px; }
.mut-card .path { font-size: 13px; line-height: 1.9; }
.mut-card .btn { margin-top: 8px; }
#summary .stats { margin-top: 14px; }
#summary .card { margin-bottom: 4px; }

/* logged-in player chip in the top bar */
.sitebar nav { align-items: center; }
.user-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: .85rem !important; }
.user-chip img { border-radius: 3px; image-rendering: pixelated; }
.user-chip small { color: var(--muted); font-weight: 500; }
.user-chip:hover { border-color: var(--accent); }
@media (max-width: 420px) { .user-chip small { display: none; } }
.profile-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 14px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); font-size: .9rem; }
.profile-bar img { border-radius: 3px; image-rendering: pixelated; }
.profile-bar .pb-msg { flex: 1; min-width: 200px; }
.profile-bar.bad { border-color: #6b2a2a; }
.profile-bar.bad .pb-msg { color: #ff8a8a; }
.forge-now { display: grid; gap: 6px; margin-bottom: 14px; }
.forge-now .fn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); }
.forge-now .fn-row.ready { border-color: #255a3c; }
.forge-now .grow { flex: 1; min-width: 160px; }
.job.running { opacity: .65; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.08) 6px 12px); }
.table tr.gem-sub td { padding-top: 0; border-top: 0; }
.gem-tiers { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-left: 28px; font-size: .85rem; }
.gem-tiers label { display: inline-flex; gap: 6px; align-items: center; }
.gem-tiers input { width: 90px; }
.mus-more { margin-top: 4px; font-size: .85rem; }
.mus-more > summary { cursor: pointer; color: var(--muted); }
.mus-pieces { display: grid; gap: 4px; margin: 6px 0; }
.table.mini { margin: 6px 0; font-size: .85rem; }
.table.mini td { padding: 3px 8px; }
.stat .v small { font-size: 12px; font-weight: 500; }
