/* A worn brass rim separates the active tool from the recessed green slots. */
.dock-hud {
  --tool-width: clamp(56px, 4.65vw, 72px);
  --tool-height: clamp(56px, 6.6vh, 66px);
  --tool-art: clamp(29px, 2.6vw, 38px);
  gap: 7px;
}
.dock-hud .toolrack {
  position: relative;
  align-items: stretch;
  padding: 6px;
  gap: 7px;
  border: 1px solid #293b2c;
  border-radius: 10px;
  background: linear-gradient(175deg, #456557 0, #27483b 34%, #1a342b 100%);
  box-shadow: inset 0 0 0 1px #b19b68, inset 0 0 0 3px #355444, 0 3px 0 #382f21, 0 6px 13px #1c2a2159;
}
.dock-hud .toolrack #tools { gap: 3px; }
.dock-hud .slot {
  width: var(--tool-width);
  min-height: var(--tool-height);
  grid-template-rows: var(--tool-art) auto;
  align-content: center;
  gap: 2px;
  padding: 3px 2px 4px;
  border-radius: 6px;
  border: 1px solid #273f33;
  background: linear-gradient(145deg, #3c5848, #2b493a);
  color: #f2edd7;
  box-shadow: inset 0 1px #72836a, inset 0 -1px #1c392b;
  transition: background-color .14s, box-shadow .14s, color .14s;
}
.dock-hud .slot img {
  width: var(--tool-art);
  height: var(--tool-art);
  filter: drop-shadow(0 1px 0 #172b23);
}
.dock-hud .slot span { font-size: 13px; font-weight: 720; line-height: 1.13; white-space: nowrap; }
.dock-hud .slot kbd {
  left: 4px; top: 4px;
  color: #ced6b8;
  font: 650 10px/1 var(--number);
}
.dock-hud .slot[aria-pressed="true"] {
  color: #342e20;
  border-color: #e4ba6c;
  background: linear-gradient(155deg, #ffedb0, #ebc877 82%);
  box-shadow: inset 0 1px #fff4cd, inset 0 -2px #b88b46, 0 1px 3px #1e3026;
}
.dock-hud .slot[aria-pressed="true"]::after { display: none; }
.dock-hud .slot[aria-pressed="true"] kbd { color: #6b562c; }
.dock-hud .slot[aria-pressed="true"] img { filter: drop-shadow(0 1px 0 #ba955c); }
.dock-hud :is(.slot,.seed-pick,.quick-seed):active:enabled { transform: translateY(1px); translate: none; }
.dock-hud :is(.slot,.seed-pick,.quick-seed,.quick-seeds-head button):focus-visible {
  outline: 2px solid #fff1af; outline-offset: 1px; box-shadow: 0 0 0 3px #31523f;
}
.dock-hud .seed-pick {
  padding: 3px 10px 3px 8px;
  gap: 7px;
  border-color: #758366;
  border-radius: 6px;
  background: linear-gradient(155deg, #2c4b3c, #1c382e);
  box-shadow: inset 0 1px #6b8067;
}
.dock-hud .seed-pick[aria-expanded="true"] { border-color: #efce84; background: #355746; }
.dock-hud .seed-pick img { width: 32px; height: 32px; filter: drop-shadow(0 1px 0 #13271e); }
.dock-hud .seed-label { gap: 2px; font-size: 11px; line-height: 1.1; color: #d0d8bf; }
.dock-hud .seed-label b { color: #fff3d1; font-size: 15px; }
.dock-hud .seed-label small { color: #f3d78c; font-size: 12px; font-variant-numeric: tabular-nums; }
.dock-hud .seed-pick i { width: 6px; height: 6px; margin-left: 2px; border-color: #edce8d; transition: transform .15s; }
.dock-hud .seed-pick[aria-expanded="true"] i { transform: rotate(225deg); }

.dock-hud .hint {
  gap: 5px;
  max-width: min(91vw, 520px);
  padding: 4px 10px;
  color: #fff4d8;
  background: #213d32f2;
  border: 1px solid #aa9b6c;
  border-radius: 5px;
  box-shadow: 0 2px 6px #24392852;
  font-size: 13px;
  line-height: 1.35;
}
.dock-hud .hint svg { color: #dfcb8e; width: 14px; height: 14px; }
.dock-hud:has(.quick-seeds:not([hidden])) { z-index: 8; }
.dock-hud:has(.quick-seeds:not([hidden])) .hint,
.viewport:has(#panel:not([hidden]) .panel-feedback:not(:empty)) .dock-hud .hint { visibility: hidden; }

.quick-seeds {
  position: absolute;
  z-index: 1;
  bottom: calc(100% + 7px);
  right: 0;
  width: 100%;
  padding: 5px 7px 7px;
  color: #f5eccf;
  border: 1px solid #343e2d;
  border-radius: 8px;
  background: linear-gradient(145deg, #3c5947, #213f33 82%);
  box-shadow: inset 0 0 0 1px #aa9666, 0 3px #4d412e, 0 5px 12px #22322655;
  animation: menu-in .13s ease-out;
}
.quick-seeds-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.quick-seeds-head > :first-child { padding-left: 2px; font: 750 14px/1.2 var(--book); }
.quick-seeds-head button {
  padding: 3px 7px;
  min-height: 25px;
  border: 1px solid #7e8c70;
  border-radius: 4px;
  background: #345441;
  color: #f7e6b1;
  font-size: 12px;
  line-height: 1.1;
}
.quick-seed-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
.quick-seed {
  display: grid;
  grid-template-columns: minmax(19px, 27px) auto;
  grid-template-rows: auto auto;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 1px 2px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 2px;
  border: 1px solid #6b7f64;
  border-radius: 5px;
  background: #354f3f;
  color: #f8eed3;
  text-align: left;
}
.quick-seed img {
  grid-column: 1; grid-row: 1 / 3; justify-self: center;
  width: 100%; max-width: 27px; height: 27px; object-fit: contain; image-rendering: pixelated;
}
.quick-seed .quick-seed-name { grid-column: 2; font-size: 13px; line-height: 1.18; white-space: nowrap; }
.quick-seed small { grid-column: 2; font-size: 11px; font-weight: 550; line-height: 1.2; color: #e2dbb4; white-space: nowrap; }
.quick-seed[aria-pressed="true"] { background: #ecd290; color: #3e3826; border-color: #efd99d; box-shadow: inset 0 -2px #bd9c5c; }
.quick-seed[aria-pressed="true"] small { color: #5f542e; }
.quick-seed:disabled, .quick-seed[aria-disabled="true"] { background: #2c4336; border-color: #64755d; color: #c3cbb4; }
.quick-seed:disabled small, .quick-seed[aria-disabled="true"] small { color: #cad0ba; }
.quick-seed:disabled img, .quick-seed[aria-disabled="true"] img { opacity: .66; filter: saturate(.5); }
@media (hover: hover) {
  .dock-hud .slot[aria-pressed="false"]:hover, .dock-hud .seed-pick:hover,
  .quick-seed:not([aria-pressed="true"],[aria-disabled="true"]):enabled:hover, .quick-seeds-head button:hover {
    background: #496752; border-color: #b8b58a; color: #fff3cf;
  }
}
@media (orientation: portrait) {
  .dock-hud {
    --tool-art: clamp(24px, 6.8vw, 34px);
    --tool-height: clamp(48px, 13vw, 60px);
    width: min(520px, calc(100% - max(16px, env(safe-area-inset-left) * 2, env(safe-area-inset-right) * 2)));
    bottom: max(8px,env(safe-area-inset-bottom)); gap: 5px;
  }
  .dock-hud .toolrack { width: 100%; padding: 5px; gap: 5px; }
  .dock-hud .toolrack #tools { flex: 1; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
  .dock-hud .slot { width: auto; gap: 1px; }
  .dock-hud .slot span { font-size: 13px; }
  .dock-hud .seed-pick { gap: 4px; padding: 2px 6px; }
  .dock-hud .seed-pick img { width: 26px; height: 27px; }
  .dock-hud .seed-label b { font-size: 14px; }
  .dock-hud .seed-label small { font-size: 11px; }
  .dock-hud .hint { font-size: 12px; padding: 3px 8px; }
  .quick-seeds { bottom: calc(100% + 5px); }
  .quick-seed { grid-template-columns: minmax(18px,23px) auto; }
}
@media (orientation: portrait) and (max-width: 345px) {
  .dock-hud .seed-pick { padding-inline: 5px; }
  .dock-hud .seed-pick img { width: 21px; }
  .quick-seed { grid-template-columns: 18px auto; column-gap: 1px; }
  .quick-seed .quick-seed-name { font-size: 12px; }
}
@media (orientation: landscape) and (max-height: 710px) {
  .dock-hud { --tool-height: 50px; --tool-art: 25px; --tool-width: 54px; gap: 4px; }
  .dock-hud .toolrack { padding: 5px; }
  .dock-hud .seed-pick img { width: 26px; height: 26px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .dock-hud { --tool-height: 44px; --tool-width: 45px; --tool-art: 23px; gap: 3px; }
  .dock-hud .toolrack { padding: 4px; gap: 4px; }
  .dock-hud .slot { gap: 0; padding: 2px; }
  .dock-hud .slot span, .dock-hud .seed-label b { font-size: 12px; }
  .dock-hud .seed-pick { gap: 3px; padding: 2px 5px; }
  .dock-hud .seed-pick img { width: 21px; height: 23px; }
  .dock-hud .seed-label { font-size: 10px; gap: 1px; }
  .dock-hud .seed-label small { font-size: 10px; }
  .dock-hud .hint { padding: 2px 7px; font-size: 11px; }
}

/* On low screens the tray changes in place, leaving the bottom row of plots free. */
@media (orientation: landscape) and (max-height: 820px), (orientation: portrait) and (max-height: 545px) {
  .dock-hud .toolrack:has(.quick-seeds:not([hidden])) #tools { display: none; }
  .quick-seeds {
    order: -1; position: static; display: flex; align-items: stretch; gap: 4px;
    width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  }
  .quick-seeds-head { flex-direction: column; justify-content: center; gap: 2px; margin: 0; }
  .quick-seeds-head > :first-child { font-size: 12px; white-space: nowrap; }
  .quick-seeds-head button { min-height: 22px; padding: 2px 3px; white-space: nowrap; }
  .quick-seed-list { gap: 3px; }
  .quick-seed {
    min-width: 47px; min-height: 44px; grid-template-columns: auto;
    grid-template-rows: auto auto; padding: 3px 2px; gap: 2px; text-align: center;
  }
  .quick-seed img { display: none; }
  .quick-seed .quick-seed-name, .quick-seed small { grid-column: 1; }
}
@media (orientation: landscape) and (max-height: 820px) {
  .dock-hud:has(.quick-seeds:not([hidden])) { width: max-content; max-width: calc(100% - 14px); }
  .quick-seed-list { flex: none; grid-template-columns: repeat(4,minmax(50px,1fr)); }
}
@media (orientation: portrait) and (max-height: 545px) {
  .quick-seeds { flex: 1; min-width: 0; }
  .quick-seed-list { flex: 1; }
  .quick-seed { min-width: 0; }
  .toolrack:has(.quick-seeds:not([hidden])) .seed-pick img { display: none; }
}
.dock-hud .hint #status { min-width: 0; overflow-wrap: anywhere; }
.dock-hud .hint:has(#nudge:not([hidden])) { text-align: left; padding-right: 4px; }
.dock-hud #nudge {
  pointer-events: auto; flex: none; align-self: center;
  max-width: 7em; min-height: 30px; padding: 3px 8px;
  border: 1px solid #bdaa73; border-radius: 4px;
  background: #46644b; color: #ffe8a7;
  font: 700 13px/1.2 var(--font); white-space: nowrap;
}
.dock-hud #nudge:hover { background: #547756; }
.dock-hud #nudge:focus-visible { outline: 2px solid #ffdc83; outline-offset: 1px; }
@media (orientation: portrait) {
  .dock-hud .hint:has(#nudge:not([hidden])) { max-width: 96%; }
  .dock-hud #nudge { min-height: 32px; font-size: 12px; padding: 3px 6px; }
}
@media (orientation: portrait) and (max-height: 690px) {
  .viewport:has(.dock-hud #nudge:not([hidden])) .next { bottom: max(20%,110px); }
}
