.shelf-page {
  --edge:#5e958a;
  --accent:#ffe39c;
  color:#fff6e1;
  background:radial-gradient(ellipse at 50% 10%,#377f79,#163f46 55%,#0b212b);
}
.shelf-page .puzzle-main { width:min(calc(100% - 24px),650px); padding-block:8px 26px; }
.shelf-page .puzzle-heading { margin:0 0 10px; }
.shelf-page h1 { font-size:clamp(2rem,7vw,3.5rem); }
.shelf-page .puzzle-heading button { background:#23474c; }
.shelf-game {
  --wood-light:#ffdc9a;
  --wood-mid:#ecae6c;
  --wood-dark:#9a542f;
  padding:clamp(8px,2vw,15px);
  border-radius:18px;
  background:linear-gradient(155deg,#234f53,#153c43);
  border:1px solid #91ccba67;
  box-shadow:0 20px 40px #05191e80;
}
.shelf-game[data-scene="1"] { --wood-light:#f3c493; --wood-mid:#c78c59; --wood-dark:#794b31; }
.shelf-game[data-scene="2"] { --wood-light:#ffcf90; --wood-mid:#e49c72; --wood-dark:#994f40; }
.shelf-scene-copy { display:flex; justify-content:space-between; align-items:baseline; gap:6px; flex-direction:row-reverse; }
.shelf-scene-copy span { color:#ffe29e; font-size:.85rem; font-weight:800; }
.shelf-scene h2 { margin:0; font:600 clamp(1.4rem,4.7vw,2.4rem)/1.1 Georgia,serif; }
.shelf-toolbar { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:7px 0 10px; color:#e1f4e8; font-weight:700; font-size:.84rem; }
.shelf-progress { display:flex; align-items:center; gap:6px; }
.shelf-progress progress { width:clamp(35px,12vw,90px); height:8px; accent-color:#ffd284; }
.shelf-board {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(3px,.7vw,7px);
  padding:clamp(5px,1.25vw,10px);
  border:1px solid #ffecb3;
  border-radius:12px;
  background:repeating-linear-gradient(3deg,#fff2 0 1px,#66381712 2px 3px,transparent 4px 7px),linear-gradient(125deg,var(--wood-light),var(--wood-mid));
  box-shadow:0 5px 0 var(--wood-dark),0 8px 14px #081c26a8,inset 0 0 3px #fff8;
}
.shelf-slot {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  position:relative;
  align-items:stretch;
  min-width:0;
  aspect-ratio:2.35;
  padding:2px 2px 4px;
  border-radius:4px;
  background:linear-gradient(#201821,#47303a 76%,#805033 77%,#a96d42 100%);
  box-shadow:inset 0 3px 6px #0d0b13,0 1px 0 #fff5;
}
.shelf-cell {
  appearance:none;
  display:grid;
  place-items:end center;
  position:relative;
  min-width:0;
  padding:0;
  border:0;
  border-radius:4px;
  background:none;
  color:inherit;
  touch-action:manipulation;
  cursor:pointer;
}
.shelf-cell:focus-visible { outline:2px solid #fff0a1; outline-offset:-2px; }
.shelf-cell.is-target { box-shadow:inset 0 0 0 1px #bce6a1a8; background:#a9d88425; }
.shelf-cell.is-selected { box-shadow:inset 0 0 0 2px #ffed9f; background:#ffdc732c; z-index:2; }
.shelf-item {
  display:block;
  width:112%;
  aspect-ratio:1;
  margin:0 -6%;
  pointer-events:none;
  background:url("platform-assets/shelf-arcade-props.webp") var(--x) var(--y)/400% 300% no-repeat;
  filter:drop-shadow(0 3px 2px #0d0a0cb3);
}
.shelf-cell.is-selected .shelf-item { transform:translateY(-3px) scale(1.1); filter:drop-shadow(0 0 4px #ffda7bc9); }
.shelf-slot.is-matched::after {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  content:"✦";
  border-radius:4px;
  pointer-events:none;
  color:#fff6be;
  font-size:clamp(1.25rem,6vw,2.6rem);
  text-shadow:0 0 13px #ffe076,0 0 6px #ffb44f;
  background:radial-gradient(ellipse,#ffdb795b,transparent 75%);
  animation:shelf-match .55s ease-out both;
}
@keyframes shelf-match { 0% { opacity:0; transform:scale(.75); } 30% { opacity:1; } 100% { opacity:0; transform:scale(1.18); } }
.shelf-game .new-status { margin:12px 0 4px; min-height:1.4em; text-align:center; color:#e8f5e4; }
.shelf-actions.new-shell { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; padding:3px 0 0; border:0; background:none; box-shadow:none; }
.shelf-actions.new-shell button { background:#235259; }
.shelf-actions.new-shell .new-primary { background:var(--accent); }
@media (pointer:coarse) and (orientation:portrait) and (min-width:651px) {
  .shelf-page .puzzle-main { width:min(calc(100% - 28px),850px); }
  .shelf-toolbar,.shelf-scene-copy span,.shelf-game .new-status,.shelf-actions button { font-size:1.7vw; }
  .shelf-actions button { min-height:5.8vw; }
}
@media (prefers-reduced-motion:reduce) { .shelf-slot.is-matched::after { animation:none; } }
