.shelf-scene {
  width: min(100%, 700px);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(16px, 3dvh, 34px);
  color: var(--text);
}
.shelf-scene [hidden] { display: none !important; }
.shelf-group { width: 100%; text-align: center; }
.shelf-caption { font: 500 1rem/1.35 var(--font); margin: 0 0 8px; color: var(--text-muted); }
.shelf-row, .shelf-names {
  display: grid;
  grid-template-columns: repeat(var(--places), minmax(0,1fr));
  gap: clamp(6px, 2vw, 30px);
  padding-inline: clamp(5px, 2vw, 22px);
  position: relative;
}
.shelf-row { padding-bottom: 7px; align-items: end; }
.shelf-row::after {
  content: ''; position: absolute; bottom: 0; inset-inline: 0; height: 12px; border-radius: 3px 3px 7px 7px;
  background: var(--home-sand) url('../assets/images/shelf-wood.webp') center / 100% 100%;
  box-shadow: 0 3px 2px color-mix(in srgb,var(--home-ink) 12%,transparent);
  pointer-events: none;
}
.shelf-place {
  display: grid; place-items: end center; position: relative; justify-self: stretch;
  min-width: 0; min-height: 56px; padding: 6px 4px 5px;
  border: 2px solid transparent; border-radius: 16px 16px 5px 5px; color: var(--text);
}
.shelf-place img { width: 100%; height: clamp(64px, 14dvh, 120px); object-fit: contain; object-position: center bottom; }
.choices .shelf-place {
  background: color-mix(in srgb,var(--practice-surface) 65%,transparent);
  border-color: var(--practice-edge);
}
@media (hover:hover) { .choices button:not(:disabled):hover {border-color: var(--text-muted);} }
.choices button[aria-pressed=true] {border-color: var(--success);background: color-mix(in srgb,var(--success) 12%,var(--bg));}
.choices button:disabled {opacity: 1;cursor: default;}
.pick-tick {position:absolute;right:1px;top:1px;display:none;place-items:center;background:var(--success);color:var(--bg);border-radius:50%;width:25px;height:25px;}
.pick-tick .ui-symbol {width:20px;height:20px;stroke-width:3;}
[aria-pressed=true] .pick-tick {display:grid;}
.restored .pick-tick {width:31px;height:31px;}
.shelf-names {padding-top:5px; font-size: .8rem;line-height:1.25;}
.shelf-covered {
  width:100%; height:clamp(68px,11dvh,102px);display:flex;align-items:center;justify-content:center;gap:12px;
  border-radius:8px;border:1px dashed var(--practice-edge); color:var(--text-muted);background:var(--practice-surface);
}
.shelf-covered .ui-symbol,.cover-button .ui-symbol {width:30px;height:30px;}
.cover-button {display:flex;align-items:center;gap:10px;min-height:56px;padding:7px 22px;background:var(--practice-surface);color:var(--text);border:2px solid var(--practice-edge);border-radius:14px;}
.shelf-level {display:inline-flex;align-items:end;position:relative;justify-content:center;width:100%;max-width:105px;padding-bottom:3px;border-bottom:2px solid var(--home-sand);}
.shelf-level img {width:24% !important;height:32px !important;object-fit:contain;}
.shelf-cover-mini {position:absolute;right:0;bottom:0;display:block;width:45%;height:26px;background:var(--practice-edge);border-radius:2px;}
[data-exercise-id=shelf-swap] .intro-example img {object-fit:contain;}
[data-exercise-id=shelf-swap] .intro-example>.ui-symbol {width:32px;height:32px;}
[data-exercise-id=shelf-swap] .intro-description {max-width:38ch;margin-inline:auto;}
@media(max-width:600px) {
  .shelf-scene {gap:32px;}
  .shelf-place img {height:clamp(57px,19vw,88px);}
  .shelf-row,.shelf-names {gap:6px;padding-inline:4px;}
  .shelf-caption {font-size:.9rem;}
  .shelf-place {padding-inline:4px;}
}
@media(orientation:landscape) and (max-height:500px) {
  .shelf-scene {width:min(75%,530px);gap:5px;}
  .shelf-caption {font-size:.75rem;margin-bottom:0;}
  .shelf-place {padding:0 4px 4px;}
  .shelf-place img {height:43px;}
  .shelf-row {padding-bottom:3px;}
  .shelf-row::after {height:6px;}
  .shelf-names {font-size:.7rem;padding-top:0;}
  .shelf-covered {height:42px;}
}
.shelf-mode {font: 400 .75rem/1.1 var(--font);color:var(--text-muted);}
.match-mark {display:none;}
.model .stayed .match-mark {position:absolute;display:grid;place-items:center;top:0;right:0;width:25px;height:25px;border:1px dashed var(--text-muted);border-radius:50%;background:var(--bg);color:var(--text);}
.match-mark .ui-symbol {width:19px;height:19px;}
.choices .stayed .pick-tick {color:var(--text);background:var(--bg);border:1px dashed var(--text-muted);}
.shelf-covered {font:inherit;min-height:56px;}
.shelf-covered:hover {border-color:var(--text);}
@media(orientation:landscape) and (max-height:500px) {
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .exercise-start {grid-template-columns:minmax(100px,.65fr) minmax(0,1.35fr);width:100%;gap:10px;}
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .start-mark img {width:100%;height:auto;max-height:46dvh;}
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .start-copy {gap:2px;}
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .start-copy h1 {font-size:1.8rem;}
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .start-copy>p {font-size:.9rem;line-height:1.2;}
  .exercise-page [data-exercise-id=shelf-swap].intro-shell .level-choice .pill {min-height:76px;padding:2px 6px;gap:0;}
  [data-exercise-id=shelf-swap].intro-shell .level-leaves {height:23px;}
  [data-exercise-id=shelf-swap].intro-shell .level-leaves .ui-symbol {width:23px;height:23px;}
  [data-exercise-id=shelf-swap].intro-shell .level-preview {height:23px;min-height:23px;}
  [data-exercise-id=shelf-swap].intro-shell .shelf-level img {height:20px!important;}
  [data-exercise-id=shelf-swap].intro-shell .level-choice {gap:0;}
  [data-exercise-id=shelf-swap].intro-shell .child-action {min-height:56px;}
  [data-exercise-id=shelf-swap] .done {padding-block:6px;gap:4px;}
}
