/* ui/Workshop — Build and Grow (the design canvas's NBuild and NGrow): Torks's daylight blocks. */
.tk-ws {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--tk-ground);
  color: var(--tk-ink);
  font-family: var(--tk-font-ui);
}
.tk-ws__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The top bar. */
.tk-ws__top {
  height: 76px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
}
.tk-ws__button {
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--tk-paper);
  color: var(--tk-ink);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge);
  font: 400 14px/1 var(--tk-font-display);
  cursor: pointer;
}
.tk-ws__button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--tk-ink); }
.tk-ws__button[aria-selected="true"],
.tk-ws__button[aria-pressed="true"] { background: var(--tk-ink); color: var(--tk-paper); }
.tk-ws__button:disabled { opacity: 0.45; cursor: default; }
.tk-ws__button[data-tone="sun"] { background: var(--tk-sun); }
.tk-ws__button[data-tone="coral"] { background: var(--tk-coral); color: var(--tk-paper); }
.tk-ws__button[data-tone="sky"] { background: var(--tk-sky); color: var(--tk-paper); }
.tk-ws__button:focus-visible,
.tk-ws__tool:focus-visible,
.tk-ws__rung:focus-visible,
.tk-ws__name:focus-visible { outline: 3px solid var(--tk-sky); outline-offset: 2px; }
.tk-ws__icon { width: 38px; height: 38px; padding: 0; font-size: 18px; }
.tk-ws__tabs { display: flex; gap: 6px; margin-left: 10px; }
.tk-ws__tab { width: 96px; }
.tk-ws__name-label { display: flex; }
.tk-ws__name {
  width: 13ch;
  padding: 2px 0;
  background: transparent;
  color: var(--tk-ink);
  border: 0;
  border-bottom: 3px dashed var(--tk-ink-dim);
  font: 400 28px/1.1 var(--tk-font-display);
  text-transform: uppercase;
}
.tk-ws__name::placeholder { color: var(--tk-ink-dim); }
.tk-ws__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge-sm);
  font: 700 13px/1.2 var(--tk-font-ui);
}
.tk-ws__chip[data-saved="true"] { background: var(--tk-lime); font-family: var(--tk-font-display); font-weight: 400; font-size: 11px; }
.tk-ws__chip[data-saved="false"] { background: var(--tk-sun); font-family: var(--tk-font-display); font-weight: 400; font-size: 11px; }
.tk-ws__chip[data-over="true"] { background: var(--tk-sun); }
.tk-ws__chip[data-tone="bad"] { background: var(--tk-coral); color: var(--tk-paper); }
.tk-ws__tiers { margin-left: auto; font-weight: 600; font-size: 13px; }

/* The body: the floor and the panels beside it. */
.tk-ws__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  padding: 0 28px 18px;
}
.tk-ws__left { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.tk-ws__stage {
  position: relative;
  min-height: 0;
  flex: 1;
  border: var(--tk-border);
  box-shadow: var(--tk-ledge);
  background: var(--tk-paper-2);
  overflow: hidden;
}
.tk-ws__board { position: absolute; inset: 0; }
.tk-ws__board canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.tk-ws__over { position: absolute; display: flex; gap: 8px; align-items: center; }
.tk-ws__over--tl { left: 10px; top: 10px; }
.tk-ws__over--tr { right: 10px; top: 10px; gap: 6px; }
.tk-ws__over--bl { left: 10px; bottom: 10px; }
.tk-ws__hint {
  padding: 3px 8px;
  background: var(--tk-paper);
  border: 2px solid var(--tk-ink);
  font-size: 12px;
  font-weight: 600;
}
.tk-ws__side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding-bottom: 6px; }
/* The side scrolls in its own height on a short screen; its panels never squash into each other. */
.tk-ws__side > * { flex: none; }
.tk-ws__panel {
  padding: 12px 14px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge);
}
.tk-ws__h3 { margin: 0 0 8px; font: 400 14px/1.1 var(--tk-font-display); text-transform: uppercase; }
.tk-ws__note { margin: 6px 0 0; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--tk-ink-dim); }
.tk-ws__note[data-tone="bad"] { color: var(--tk-coral); }
.tk-ws__note[data-tone="ok"] { color: var(--tk-ink); }

.tk-ws__checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tk-ws__check { display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 600; }
.tk-ws__mark {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tk-ink);
  background: var(--tk-lime);
  font-size: 12px;
}
.tk-ws__check[data-ok="false"] .tk-ws__mark { background: var(--tk-coral); color: var(--tk-paper); }
.tk-ws__check[data-ok="false"] { color: var(--tk-ink); }

.tk-ws__lines { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-ws__line { height: 32px; padding: 0 9px; font-size: 11px; box-shadow: var(--tk-ledge-sm); }
.tk-ws__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-ws__big { height: 48px; font-size: 15px; }

/* The palette along the bottom. */
.tk-ws__palette {
  flex: none;
  display: flex;
  gap: 18px;
  padding: 10px 28px 12px;
  background: var(--tk-paper);
  border-top: var(--tk-border);
  overflow-x: auto;
}
.tk-ws__group { display: flex; flex-direction: column; gap: 6px; flex: none; }
.tk-ws__group-name { font: 400 11px/1 var(--tk-font-display); text-transform: uppercase; min-height: 11px; }
.tk-ws__tools { display: flex; gap: 5px; }
.tk-ws__tool {
  width: 70px;
  height: 74px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--tk-paper);
  color: var(--tk-ink);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge-sm);
  font: 600 11px/1.1 var(--tk-font-ui);
  text-align: center;
  cursor: pointer;
}
.tk-ws__tool[aria-pressed="true"] { background: var(--tk-sun); }
.tk-ws__swatch {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tk-ink);
  background: var(--tk-paper-2);
  box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--tk-ink) 22%, transparent);
  font-size: 13px;
}
.tk-ws__swatch[data-kind="gun"] { background: var(--tk-coral); }
.tk-ws__swatch[data-kind="cannon"] { background: color-mix(in srgb, var(--tk-coral) 70%, var(--tk-ink)); }
.tk-ws__swatch[data-kind="spar"] { background: var(--tk-ink-dim); }
.tk-ws__swatch[data-kind="magazine"] { background: color-mix(in srgb, var(--tk-sun) 70%, var(--tk-coral)); }
.tk-ws__swatch[data-kind="armour"] { background: var(--tk-sun); }
.tk-ws__swatch[data-kind="engine"] { background: var(--tk-ink); border-radius: 0; }
.tk-ws__swatch[data-kind="special"] { background: var(--tk-teal); }
.tk-ws__swatch[data-kind="erase"] { background: var(--tk-paper); color: var(--tk-coral); }

/* Grow: the ladder, the order. */
.tk-ws__ladder-panel { flex: none; }
.tk-ws__ladder { position: relative; display: flex; margin-top: 20px; border: var(--tk-border); }
.tk-ws__rung {
  flex: 1;
  height: 26px;
  padding: 0;
  border: 0;
  border-right: 2px solid var(--tk-ink);
  background: var(--tk-paper-2);
  cursor: pointer;
}
.tk-ws__rung:last-of-type { border-right: 0; }
.tk-ws__rung[data-on="true"] { background: var(--tk-sky); }
.tk-ws__rung[aria-current="step"] { background: var(--tk-coral); }
.tk-ws__mark-stage {
  position: absolute;
  top: -20px;
  left: calc(var(--at) * 100%);
  font: 400 10px/1 var(--tk-font-display);
  pointer-events: none;
}
.tk-ws__play-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.tk-ws__play-row .tk-ws__big { padding: 0 18px; }
.tk-ws__at { display: flex; flex-direction: column; gap: 8px; }
.tk-ws__order { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tk-ws__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  background: var(--tk-paper);
  border: 2px solid var(--tk-ink);
  font-size: 12px;
  font-weight: 600;
}
.tk-ws__step[data-welded="false"] { opacity: 0.5; }
.tk-ws__step[data-last="true"] { background: var(--tk-sun); }
.tk-ws__step .tk-ws__swatch { width: 18px; height: 18px; }
.tk-ws__step-n { width: 22px; font: 400 12px/1 var(--tk-font-display); }

@media (max-width: 900px) {
  .tk-ws { position: absolute; overflow: auto; }
  .tk-ws__top { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .tk-ws__body { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .tk-ws__stage { min-height: 360px; }
  .tk-ws__palette { padding: 10px 16px; }
}

/* Save and Drive it never scroll away (a 1280 × 720 frame, CrazyGames' own). */
.tk-ws__actions { position: sticky; bottom: 0; z-index: 1; padding-top: 6px; background: var(--tk-ground); }
@media (max-height: 800px) {
  .tk-ws__top { height: 64px; }
  .tk-ws__side { gap: 8px; }
  .tk-ws__panel { padding: 8px 12px; }
  .tk-ws__h3 { margin-bottom: 6px; }
  .tk-ws__checks { gap: 3px; }
  .tk-ws__check { font-size: 12px; }
  .tk-ws__mark { width: 17px; height: 17px; }
  .tk-ws__line { height: 28px; }
  .tk-ws__big { height: 42px; }
  .tk-ws__palette { padding: 6px 28px 8px; }
  .tk-ws__tool { height: 62px; width: 66px; }
}

/* Build after Sproks's builder (2026-10-19): pictures on the tiles, one headline, meters, live bars. */
.tk-ws__pic { width: 46px; height: 46px; object-fit: contain; display: block; flex: none; }
.tk-ws__tool { width: 76px; height: 86px; }
.tk-ws__headline { display: flex; gap: 10px; align-items: flex-start; border-left: 10px solid var(--tk-coral); }
.tk-ws__headline[data-ok="true"] { border-left-color: var(--tk-lime); }
.tk-ws__headline p { margin: 0; font: 700 15px/1.35 var(--tk-font-ui); }
.tk-ws__headline .tk-ws__mark {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tk-ink);
  background: var(--tk-coral);
  color: var(--tk-paper);
  font: 400 13px/1 var(--tk-font-display);
}
.tk-ws__headline[data-ok="true"] .tk-ws__mark { background: var(--tk-lime); color: var(--tk-ink); }
.tk-ws__meter { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.tk-ws__meter-top { display: flex; justify-content: space-between; font: 700 13px/1 var(--tk-font-ui); }
.tk-ws__meter-top b { font: 400 13px/1 var(--tk-font-display); }
.tk-ws__meter-bar, .tk-ws__live-bar {
  position: relative;
  display: block;
  height: 12px;
  background: var(--tk-paper-2);
  border: 2px solid var(--tk-ink);
  box-sizing: content-box;
}
.tk-ws__meter-fill { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: var(--tk-sky); }
.tk-ws__meter-fill[data-tone="lime"] { background: var(--tk-lime); }
.tk-ws__meter-fill[data-tone="sun"] { background: var(--tk-sun); }
.tk-ws__meter-fill[data-tone="teal"] { background: var(--tk-teal); }
.tk-ws__meter-fill[data-tone="coral"] { background: var(--tk-coral); }
.tk-ws__meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--tk-ink); }
.tk-ws__live { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tk-ws__live-title { font: 400 11px/1 var(--tk-font-display); text-transform: uppercase; color: var(--tk-ink-dim); }
.tk-ws__live-row { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: center; font: 700 13px/1 var(--tk-font-ui); }
.tk-ws__in-hand-top { display: flex; align-items: center; gap: 10px; font: 400 16px/1.1 var(--tk-font-display); text-transform: uppercase; }
.tk-ws__in-hand-top .tk-ws__pic { width: 54px; height: 54px; }
.tk-ws__starters {
  position: absolute;
  inset: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge);
  overflow: auto;
}
.tk-ws__starters-head { display: flex; justify-content: space-between; align-items: center; }
.tk-ws__starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-top: 10px; }
.tk-ws__starter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge-sm);
  font: 400 12px/1 var(--tk-font-display);
  text-transform: uppercase;
  color: var(--tk-ink);
  cursor: pointer;
}
.tk-ws__starter img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--tk-ground); border: 2px solid var(--tk-ink); }
.tk-ws__starter:hover { background: var(--tk-sun); }
.tk-ws__sizes { display: flex; gap: 8px; margin-top: 10px; }
.tk-ws__size { flex: 1; height: auto; padding: 4px 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tk-ws__size .tk-ws__pic { width: 34px; height: 34px; }
.tk-ws__size[aria-pressed="true"] { background: var(--tk-sun); }
@media (max-height: 500px) {
  /* A phone on its side (the mobile pass, 2026-10-19): one screen. A slim top bar on one line, the
     floor on the left with a narrow side column that scrolls on its own, and a shorter palette. */
  .tk-ws { position: fixed; overflow: hidden; }
  .tk-ws__top { height: 46px; flex-wrap: nowrap; gap: 8px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  .tk-ws__button { height: 34px; padding: 0 10px; font-size: 12px; }
  .tk-ws__icon { width: 32px; height: 32px; font-size: 15px; }
  .tk-ws__tab { width: auto; min-width: 64px; }
  .tk-ws__tabs { margin-left: 4px; }
  .tk-ws__name { width: 10ch; font-size: 18px; }
  .tk-ws__tiers { display: none; }
  .tk-ws__body { grid-template-columns: 1fr 240px; gap: 10px; padding: 0 max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .tk-ws__left { gap: 8px; }
  .tk-ws__stage { min-height: 0; }
  .tk-ws__over--bl, .tk-ws__over .tk-ws__hint { display: none; }
  .tk-ws__over--tl .tk-ws__button { height: auto; min-height: 30px; max-width: 120px; padding: 4px 8px; font-size: 10px; line-height: 1.15; white-space: normal; text-align: left; }
  .tk-ws__over--tr .tk-ws__button { height: 30px; }
  .tk-ws__side { gap: 6px; }
  .tk-ws__panel { padding: 6px 10px; }
  .tk-ws__headline p { font-size: 13px; }
  .tk-ws__big { height: 40px; font-size: 13px; }
  .tk-ws__palette { gap: 10px; padding: 4px max(12px, env(safe-area-inset-left)) 6px; }
  .tk-ws__tool { width: 58px; height: 60px; gap: 2px; font-size: 10px; }
  .tk-ws__pic { width: 30px; height: 30px; }
  .tk-ws__group-name { font-size: 10px; }
}
