/* Board designer */
.dz { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 22px; padding: 18px 22px 40px; max-width: 1500px; margin: 0 auto; align-items: start; }
.dz-board { min-width: 0; position: sticky; top: 12px; }
.dz-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dz-wrap { max-width: min(100%, calc(100vh - 150px)); }
.dz-wrap svg { touch-action: none; }
.dz-wrap.tool-add svg, .dz-wrap.tool-start svg { cursor: crosshair; }
.dz-wrap .sp.sel .face { stroke: #fff; stroke-width: 4; }
.dz-wrap .sp.dragging { opacity: .85; }
.dz-help { margin: 8px 2px 0; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.tool { background: var(--raise); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 12px; cursor: pointer; color: var(--muted); }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.check.inline { margin: 0 6px; align-items: center; }
.check.inline input { margin-top: 0; }
.file { position: relative; cursor: pointer; }
.steps { list-style: none; margin: 0 0 10px; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 14.5px; cursor: pointer; }
.steps li:last-child { border-bottom: 0; }
.steps li.sel { background: var(--raise-2); }
.steps .n { color: var(--faint); font-weight: 700; text-align: right; }
.steps .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .acts { display: flex; gap: 2px; }
.steps .acts button { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line-2); background: none; cursor: pointer; color: var(--muted); }
.steps .acts button:hover { color: var(--text); }
.problems { margin: 0 0 12px; padding-left: 20px; color: var(--warn); font-size: 14.5px; }
.problems.ok { color: var(--good); list-style: none; padding-left: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.order-badge { pointer-events: none; }
@media (max-width: 1100px) { .dz { grid-template-columns: minmax(0,1fr); } .dz-board { position: static; } }
.dz-wrap .sp.sel .face.ghost { fill: rgba(255,255,255,.35); stroke: #fff; }
.undo-group { display: inline-flex; gap: 4px; }
.tool.icon { display: inline-grid; place-items: center; width: 40px; height: 38px; padding: 0; color: var(--text); }
.tool.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tool.icon:disabled { opacity: .35; cursor: default; }
.tool.icon:not(:disabled):hover { border-color: var(--accent); }

/* Board / Cards tabs and the clan the designer is working for */
.mode-tabs button { font-size: 15px; padding: 8px 16px; }
.dz-for { max-width: 1500px; margin: 14px auto 0; padding: 0 22px; color: var(--muted); font-size: 14.5px; }
.dz-for b { color: var(--text); }
.route-stats { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }
.route-stats li.on { color: var(--text); }
.route-stats b { color: var(--text); margin-right: 4px; }
.map-peek { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.map-peek li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.35; }
.map-peek li.bad { color: var(--warn); }
.map-peek img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; background: var(--raise-2); }
.map-peek .mp-k { font-family: ui-monospace, Consolas, monospace; color: var(--accent); }
#bonusMaps { max-height: 260px; overflow: auto; }

/* Card editor */
.cz { max-width: 1180px; margin: 0 auto; padding: 18px 22px 50px; }
.cz-intro { margin: 0 0 6px; color: var(--muted); max-width: 80ch; }
.cz-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.cz-bar .field { margin: 8px 0; min-width: 220px; }
.cz-bar select, .cz-bar input, .ce-f input, .ce-f textarea, .ce-kind input { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: #000; color: var(--text); font: inherit; color-scheme: dark; }
.cz-actions { margin: 8px 0; gap: 10px; flex-wrap: wrap; }
.ce-group h2 { font: 700 28px/1.1 var(--display); margin: 30px 0 4px; }
.ce-group h2 .muted { font-size: 18px; color: var(--muted); }
.ce-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); }
.ce-card.changed { border-color: var(--accent); }
.cprev { width: 200px; height: 280px; position: relative; overflow: hidden; border-radius: 12px; }
.cprev-in { width: 320px; height: 448px; transform: scale(.625); transform-origin: top left; position: relative; }
.cprev .cface { box-shadow: none; }
.ce-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 12px; }
.ce-pc { margin: 0; }
.ce-pc img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 12px; display: block; }
.ce-pc figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 14px; }
.ce-pc figcaption span { color: var(--muted); }
.ce-fields { min-width: 0; }
.ce-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ce-head b { font-size: 16px; }
.ce-badge { font-size: 12.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 9px; }
.ce-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.ce-f { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; font-size: 14px; font-weight: 700; }
.ce-f span { display: flex; justify-content: space-between; gap: 8px; }
.ce-f .cnt { font-style: normal; font-weight: 400; color: var(--faint); font-size: 12.5px; }
.ce-f textarea { resize: vertical; min-height: 64px; font-weight: 400; }
.ce-f input { font-weight: 400; }
.ce-fx { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
.ce-fx b { color: var(--text); }
.ce-was { margin: 6px 0 0; font-size: 13.5px; color: var(--faint); }
.ce-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.ce-kind { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.ce-kind.changed { border-color: var(--accent); }
.ce-kind .ce-icon { text-align: center; font-size: 20px; padding: 6px; }
@media (max-width: 640px) {
  .ce-card { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .ce-fields { width: 100%; }
  .mode-tabs { order: 3; }
}
.mode-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* Close (back to the game), always in the top right corner */
body > .top { position: relative; padding-right: 76px; }
.dz-close { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--raise); color: var(--text); }
.dz-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.dz-close:hover, .dz-close:focus-visible { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { body > .top { padding-right: 64px; } .dz-close { top: 12px; right: 12px; transform: none; } }

.ce-pic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.ce-pic img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); }
.ce-pic .hint { font-size: 13px; color: var(--muted); }
