main:has(.market-counter) .intro { padding-block: 19px 15px; }
main:has(.market-counter) .intro h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.04em; margin-bottom: 0; }
main:has(.market-counter) .intro p { display: none; }
.game-content[data-counter]:not([data-counter=""]) { padding: 0; }

.counter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 50px;
  padding: 2px clamp(9px, 2.5vw, 18px);
  border-bottom: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: var(--cream);
}
.counter-toolbar .status-line { margin: 0; gap: 1px 12px; }
.counter-toolbar .status-line span:last-child { color: #3c5034; }
.counter-toolbar .button { flex-shrink: 0; padding-inline: 4px; }

.market-counter {
  --wall: #b7c9c5;
  --wall-grout: #e8eee6;
  --wall-ink: #263d35;
  --worktop: #9badab;
  --metal-light: #dce5df;
  --metal-edge: #738886;
  --rail: #4b655f;
  --bin: #bed2d7;
  --bin-edge: #6c8787;
  --liner: #e8f2ee;
  --label: #fff5d7;
  --outline: #993e25;
  padding-bottom: 12px;
  border-radius: 0 0 23px 23px;
  background: linear-gradient(180deg, var(--worktop) 20%, var(--metal-light) 200px, var(--worktop) 800px);
  animation: walk-up 260ms cubic-bezier(.18,.73,.19,1) both;
}
.market-counter[data-market="produce"] {
  --wall: #d3d6ae;
  --wall-grout: #f0edce;
  --wall-ink: #354629;
  --worktop: #a0ab77;
  --metal-light: #d2d7a8;
  --metal-edge: #697950;
  --rail: #535f3e;
  --bin: #a6ac78;
  --bin-edge: #68774e;
  --liner: #cbd199;
  --label: #fff2c8;
}
.market-counter[data-market="pantry"] {
  --wall: #e4c0a4;
  --wall-grout: #f4e2c8;
  --wall-ink: #5e3c2b;
  --worktop: #bd947d;
  --metal-light: #ebd0af;
  --metal-edge: #916751;
  --rail: #6e4b38;
  --bin: #d0b290;
  --bin-edge: #94725a;
  --liner: #eddbba;
  --label: #fff0d3;
}
@keyframes walk-up {
  from { opacity: .82; transform: translateY(7px) scale(.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.counter-wall {
  position: relative;
  display: flex;
  align-items: end;
  min-height: clamp(69px, 11vw, 124px);
  padding: 12px clamp(12px, 3vw, 26px);
  border-bottom: 5px solid var(--rail);
  box-shadow: inset 0 -1px var(--metal-light);
  background:
    linear-gradient(180deg, #fff5 0, transparent 54%, #1b222023 100%),
    repeating-linear-gradient(0deg, transparent 0 21px, var(--wall-grout) 21px 23px),
    repeating-linear-gradient(90deg, var(--wall) 0 55px, var(--wall-grout) 55px 57px);
}
.counter-wall h2 {
  min-width: 0;
  margin: 0;
  padding: 7px 14px 9px;
  border: 1px solid var(--metal-edge);
  border-radius: 4px;
  background: var(--cream);
  box-shadow: 0 3px 7px #211b2024;
  color: var(--wall-ink);
  font-size: clamp(1.35rem, 3.25vw, 2.35rem);
  letter-spacing: -.035em;
}

#counter-order { padding: 0 clamp(9px, 2.6vw, 24px); }
#counter-order > .dialogue {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 9px;
  border-color: var(--metal-edge);
  border-radius: 9px;
  background: var(--cream);
}
#counter-order > .dialogue .vendor { color: var(--wall-ink); margin: 0; }
#counter-order > .dialogue p { font-size: .9rem; }
.counter-order-ticket {
  margin-top: 13px;
  padding: 10px clamp(10px, 2.1vw, 19px) 14px;
  border-radius: 12px;
  background: var(--cream);
  box-shadow: 0 4px 15px #20272127;
}
.counter-order-ticket.just-chosen { animation: set-down 200ms ease-out both; }
@keyframes set-down { from { opacity: .66; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.counter-order-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.counter-order-head h3 { margin: 0; line-height: 1.1; font-size: clamp(1.15rem, 3vw, 1.5rem); }
.counter-order-head .button { flex: 0 0 auto; padding-inline: 5px; }
.counter-order-ticket .dialogue { margin-top: 3px; }
.counter-order-ticket .scale-tray { width: 140px; padding-inline: 8px; }
.counter-order-ticket .scale-tray canvas { display: block; width: 100%; height: auto; margin-top: -7px; margin-bottom: -4px; }

.counter-stock { padding: 0 clamp(9px, 2.6vw, 24px); }
.counter-stock-controls { padding-top: 12px; color: #20342b; }
.counter-stock-controls p { margin-bottom: 1px; font-weight: 850; }
.counter-sections { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.counter-sections .button { padding: 2px; color: #20342b; min-height: 44px; }
.counter-sections .button:hover { background: var(--cream); }
.stock-section { margin-block: 10px 16px; }
.stock-section h3 {
  width: fit-content;
  margin: 0;
  padding: 3px 9px 4px;
  border-radius: 3px 3px 0 0;
  background: var(--rail);
  color: #fffdf6;
  font-weight: 850;
  font-size: .85rem;
  letter-spacing: .015em;
}
.stock-bins {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 6px 6px 9px;
  border-radius: 0 8px 9px 9px;
  background: linear-gradient(180deg, var(--metal-edge), var(--metal-light) 10px, var(--metal-light) calc(100% - 8px), var(--metal-edge) 100%);
  box-shadow: 0 3px 7px #17282024;
}
.stock-bin {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  justify-items: stretch;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--bin-edge);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--bin);
  color: #342f28;
  transition: background-color 170ms ease-out, box-shadow 170ms ease-out;
}
.stock-art {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: clip;
  border-radius: 4px 4px 0 0;
  background: radial-gradient(ellipse at 50% 15%, var(--liner) 28%, var(--bin) 100%);
  box-shadow: inset 1px 2px 5px #283f3840;
}
[data-market="fish"] .stock-art {
  background:
    radial-gradient(ellipse at 16% 24%, #f6fffcda 1px, transparent 3px) 0 0 / 13px 17px,
    radial-gradient(ellipse at 70% 62%, #f6fffcda 1px, transparent 4px) 0 0 / 23px 17px,
    radial-gradient(ellipse at 30% 67%, #b1cad566 2px, transparent 7px) 0 0 / 19px 13px,
    radial-gradient(ellipse at 40% 39%, #c5d9e4 1px, transparent 5px) 0 0 / 29px 19px,
    var(--liner);
}
[data-market="produce"] .stock-art {
  background: repeating-linear-gradient(0deg, #4b64321c 0 2px, transparent 2px 11px), radial-gradient(ellipse at 50% 15%, var(--liner), var(--bin));
}
[data-market="pantry"] .stock-art {
  background: radial-gradient(ellipse at 50% 50%, #e2c9a3 1px, transparent 5px) 0 0 / 17px 16px, radial-gradient(ellipse at 50% 15%, var(--liner), var(--bin));
}
.stock-art canvas { width: 100%; max-width: 210px; height: auto; display: block; transform: scale(1.30); transition: transform 180ms ease-out; filter: drop-shadow(0 2px 2px #243b3938); }
.stock-label {
  min-width: 0;
  align-content: center;
  padding: 4px 3px 5px;
  min-height: 28px;
  background: var(--label);
  border-top: 1px solid var(--bin-edge);
  border-radius: 0 0 3px 3px;
  font-size: clamp(.75rem, 1.9vw, .86rem);
  font-weight: 880;
  line-height: 1.14;
  overflow-wrap: anywhere;
}
.stock-bin:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--outline); outline-offset: 1px; }
.stock-bin[aria-pressed="true"] { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--outline); }
.stock-bin[aria-pressed="true"] .stock-label { background: #ffe2a9; }
@media (hover: hover) { .stock-bin:hover .stock-art canvas { transform: translateY(-2px) scale(1.34); } .stock-bin:hover .stock-label { background: #ffe9b3; } }
@media (min-width: 751px) { .game-grid:has(.market-counter) .basket { position: sticky; top: 14px; } }
@media (max-width: 497px) {
  .counter-wall { min-height: 61px; }
  #counter-order > .dialogue p { font-size: .83rem; }
  .counter-sections { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .counter-sections .button { line-height: 1.22; font-size: .75rem; border-color: var(--metal-edge); text-decoration: none; }
  .stock-bins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) { .stock-bins { grid-template-columns: repeat(2, minmax(0, 1fr)); } .counter-toolbar .status-line { flex-direction: column; } }
