:root {
  --ink: #2c153f;
  --plum: #4d205f;
  --berry: #9b336c;
  --pink: #ed6fa7;
  --blush: #ffc1cf;
  --peach: #ffd09d;
  --gold: #f7c75e;
  --cream: #fff4df;
  --glass: rgba(255, 238, 242, 0.22);
  --shadow: #1a0b2b;
  --pixel: "Courier New", "Lucida Console", monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
html { overscroll-behavior:none; background:#d3f5f3 url("./assets/pastel-arcade.png") center / cover fixed; }
html:has(.welcome:not(.is-hidden)) { background-image:url("./assets/java-dash-picnic.png"); }
body { overscroll-behavior:none; }

body {
  margin: 0;
  color: var(--cream);
  background: #124d35;
  font-family: var(--pixel);
  overflow-x: hidden;
}

button { font: inherit; }

.world {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, #9bd75b55, transparent 65%),
    linear-gradient(180deg, #226b40 0%, #155b3d 54%, #103f32 100%);
}

.world::before,
.world::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.world::before {
  opacity: .28;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 4px 4px;
}

.world::after {
  box-shadow: inset 0 0 90px #052e242e;
}

.sky-glow {
  position: fixed;
  width: 58vw;
  height: 58vw;
  min-width: 520px;
  min-height: 520px;
  border-radius: 50%;
  background: rgba(248, 159, 174, .14);
  filter: blur(70px);
  animation: breathe 7s ease-in-out infinite;
}

.sound-button {
  position: fixed;
  z-index: 20;
  right: 22px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--cream);
  border: 2px solid rgba(255,244,223,.45);
  border-radius: 4px;
  background: rgba(44, 21, 63, .7);
  box-shadow: 3px 3px 0 rgba(14,5,30,.5);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.sound-button:hover,
.sound-button:focus-visible { background: var(--berry); outline: 3px solid var(--gold); outline-offset: 3px; }
.sound-icon { color: var(--gold); font-size: 1rem; }

.welcome {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  text-align: center;
  animation: rise .8s steps(8) both;
}

.welcome-stars {
  margin-bottom: 20px;
  color: var(--gold);
  font-size: 1.8rem;
  letter-spacing: .25em;
  text-shadow: 0 0 18px rgba(247,199,94,.8);
  animation: shimmer 2s steps(2) infinite;
}

.eyebrow,
.portal-kicker {
  margin: 0 0 18px;
  color: var(--peach);
  font-size: clamp(.72rem, 2vw, .9rem);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.welcome h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(2.1rem, 7vw, 5.4rem);
  line-height: 1.12;
  letter-spacing: -.05em;
  text-shadow:
    0 4px 0 var(--berry),
    0 8px 0 var(--plum),
    0 0 28px rgba(255,193,207,.3);
}

.welcome h1 span { color: var(--blush); }

.start-button {
  position: relative;
  display: block;
  min-width: min(330px, 90%);
  margin: 48px auto 0;
  padding: 17px 28px 13px;
  color: var(--ink);
  border: 0;
  border-radius: 5px;
  background: var(--gold);
  box-shadow: 0 7px 0 #b96d55, 0 12px 28px rgba(12, 4, 24, .45);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .08em;
  transition: transform .12s ease, box-shadow .12s ease;
}

.start-button::before,
.start-button::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 8px;
  background: rgba(255,255,255,.65);
}

.start-button::before { left: 8px; }
.start-button::after { right: 8px; }
.start-button:hover { transform: translateY(2px); box-shadow: 0 5px 0 #b96d55, 0 9px 20px rgba(12,4,24,.4); }
.start-button:active { transform: translateY(6px); box-shadow: 0 1px 0 #b96d55; }
.start-button:focus-visible { outline: 4px solid var(--cream); outline-offset: 5px; }

.start-button small {
  display: block;
  margin-top: 6px;
  font-size: .62rem;
  letter-spacing: .04em;
  opacity: .65;
}

.welcome { width:min(900px,100%); }
.welcome h1 { color:#fffbd5; text-shadow:0 4px #427b35,0 7px #123e29; font-size:clamp(2rem,6vw,4.5rem); }
.welcome h1 span { color:#fff7b0; }
.welcome-stars { margin-bottom:10px; }
.picnic-scene { position:relative; margin:30px auto 0; width:100%; overflow:hidden; border:5px solid #a8d978; border-radius:12px; box-shadow:0 7px 0 #0a3628,0 0 0 3px #143f2e; }
.picnic-scene img { display:block; width:100%; height:auto; image-rendering:pixelated; }
.lake-shimmer { position:absolute; inset:0; clip-path:polygon(54% 36%,78% 36%,85% 42%,100% 48%,100% 56%,76% 55%,73% 44%,70% 40%,54% 40%); pointer-events:none; opacity:.2; background:repeating-linear-gradient(175deg,transparent 0 19px,#eaffef 20px 22px,transparent 23px 36px); animation:lake-flow 7s linear infinite; }
@keyframes lake-flow { to { background-position:72px 36px; } }
@media(prefers-reduced-motion:reduce) { .lake-shimmer { animation:none; } }
.is-hidden { display: none !important; }

.game-shell {
  position: relative;
  z-index: 2;
  width: min(790px, 96vw);
  filter: drop-shadow(0 28px 45px rgba(8, 3, 18, .5));
  animation: machineIn .7s steps(8) both;
}

.machine-top {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding: 16px 24px;
  border: 5px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 16px 16px 3px 3px;
  background: linear-gradient(#f889b3, #c8467e);
  box-shadow: inset 0 5px 0 rgba(255,255,255,.34);
}

.marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 14px;
  border: 4px solid var(--ink);
  border-radius: 7px;
  background: #fff0d7;
  box-shadow: inset 0 -5px 0 #f4c2b2;
}

.marquee h2 {
  margin: 0;
  color: var(--plum);
  font-size: clamp(1.2rem, 4vw, 2.15rem);
  letter-spacing: .08em;
  text-shadow: 2px 2px 0 var(--blush);
}

.tiny-star { color: #d78a25; animation: spinStar 3s steps(12) infinite; }
.top-light { width: 17px; height: 17px; margin: auto; border: 3px solid var(--ink); border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.top-light.right { animation: blink 1s steps(2) infinite .5s; }
.top-light.left { animation: blink 1s steps(2) infinite; }

.machine-body {
  padding: 18px 22px 20px;
  border: 5px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(90deg, #8f2f66, #e75e9a 10%, #d34784 88%, #852b60);
  box-shadow: inset 7px 0 rgba(255,255,255,.12), inset -7px 0 rgba(55,14,67,.25);
}

.glass {
  position: relative;
  height: clamp(370px, 59vh, 560px);
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 5px;
  background: #cd839f;
  cursor: crosshair;
  outline: none;
  touch-action: none;
}

.glass:focus-visible { box-shadow: 0 0 0 4px var(--gold); }
.landscape { position: absolute; inset: 0; background: linear-gradient(180deg, #f3a9bd, #70507f 55%, #331d48); background-image: url("./assets/sunset-mountains.png"); background-size: cover; background-position: center; image-rendering: pixelated; }
.glass-shine { position: absolute; inset: 0; pointer-events: none; z-index: 12; background: linear-gradient(115deg, rgba(255,255,255,.18) 0 8%, transparent 8% 56%, rgba(255,255,255,.08) 56% 61%, transparent 61%); }
.rail { position: absolute; z-index: 7; left: 3%; right: 3%; top: 25px; height: 9px; border: 3px solid var(--ink); background: var(--gold); box-shadow: 0 4px 0 rgba(44,21,63,.35); }
.hill-shadow { position: absolute; left: -5%; right: -5%; bottom: -18px; height: 88px; border-radius: 50%; background: rgba(31,15,43,.35); filter: blur(2px); }

.claw {
  --x: 50%;
  --drop: 0px;
  position: absolute;
  z-index: 10;
  left: var(--x);
  top: 23px;
  width: 90px;
  height: calc(135px + var(--drop));
  transform: translateX(-50%);
  transition: left .12s linear, height .48s cubic-bezier(.3,.1,.2,1);
  pointer-events: none;
}

.carriage { position: absolute; top: 0; left: 22px; width: 46px; height: 24px; border: 4px solid var(--ink); border-radius: 4px; background: var(--gold); box-shadow: inset 0 4px rgba(255,255,255,.35); }
.carriage i { position: absolute; bottom: -10px; width: 12px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; background: var(--plum); }
.carriage i:first-child { left: 4px; }
.carriage i:last-child { right: 4px; }
.cable { position: absolute; left: 43px; top: 22px; width: 5px; height: calc(55px + var(--drop)); background: var(--ink); box-shadow: 2px 0 rgba(255,255,255,.2); }
.claw-head { position: absolute; left: 32px; top: calc(70px + var(--drop)); width: 28px; height: 25px; border: 4px solid var(--ink); border-radius: 6px; background: #efc8d0; }
.claw-head span { position: absolute; left: 8px; top: 6px; width: 5px; height: 5px; background: var(--gold); }
.claw-arms { position: absolute; left: 11px; top: calc(90px + var(--drop)); width: 70px; height: 45px; }
.claw-arms i { position: absolute; top: 0; width: 33px; height: 41px; border-bottom: 6px solid var(--ink); }
.claw-arms i:first-child { left: 2px; border-left: 6px solid var(--ink); border-radius: 0 0 0 26px; transform: rotate(-8deg); }
.claw-arms i:last-child { right: 2px; border-right: 6px solid var(--ink); border-radius: 0 0 26px 0; transform: rotate(8deg); }
.claw.dropping { --drop: min(265px, 39vh); }
.claw.closed .claw-arms i:first-child { transform: rotate(18deg) translateX(10px); }
.claw.closed .claw-arms i:last-child { transform: rotate(-18deg) translateX(-10px); }
.claw-arms i { transition: transform .22s steps(4); }

.sprite { position: absolute; z-index: 5; bottom: 56px; width: clamp(78px, 14vw, 128px); height: clamp(98px, 18vw, 158px); background-repeat: no-repeat; background-size: 200% 100%; image-rendering: pixelated; filter: drop-shadow(0 7px 1px rgba(37,15,52,.3)); }
.java-sprite { left: 22%; background-image: url("./assets/java-dog-sprites.png"); background-position: left center; animation: javaRun 5.3s linear infinite, bob .42s steps(2) infinite; }
.dog-sprite { left: 63%; width: clamp(90px, 15vw, 140px); background-image: url("./assets/java-dog-sprites.png"); background-position: right center; animation: dogRun 4.2s linear infinite, bob .35s steps(2) infinite reverse; }
.sprite.caught { z-index: 9; animation: none; transition: left .4s ease, bottom .55s ease; }
.sprite.hide-away { animation: dashAway .8s steps(8) both !important; }

.attempt-toast {
  position: absolute;
  z-index: 14;
  left: 50%;
  bottom: 19px;
  min-width: min(420px, 88%);
  padding: 12px 16px;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: rgba(255,244,223,.96);
  box-shadow: 5px 5px 0 rgba(44,21,63,.5);
  text-align: center;
  font-size: clamp(.72rem, 2.4vw, .93rem);
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity .2s, transform .2s;
}
.attempt-toast.show { opacity: 1; transform: translate(-50%, 0); }

.control-deck { display: grid; grid-template-columns: 1fr auto 112px; gap: 18px; align-items: center; padding: 18px 4px 5px; }
.status-panel { display: flex; align-items: center; min-height: 49px; gap: 11px; padding: 10px 14px; border: 4px solid var(--ink); border-radius: 5px; background: #351943; box-shadow: inset 0 0 0 3px #5d2b67; }
.status-panel p { margin: 0; color: #ffd5b0; font-size: clamp(.62rem, 1.8vw, .82rem); font-weight: 700; line-height: 1.35; letter-spacing: .06em; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; background: #8dffb3; box-shadow: 0 0 9px #8dffb3; }

.drop-button { position: relative; width: 72px; height: 72px; color: var(--cream); border: 5px solid var(--ink); border-radius: 50%; background: #c83166; box-shadow: 0 8px 0 #6f244c, inset 0 5px rgba(255,255,255,.23); cursor: pointer; font-size: .78rem; font-weight: 900; }
.drop-button:hover { background: #ec4d83; }
.drop-button:active { transform: translateY(6px); box-shadow: 0 2px 0 #6f244c; }
.drop-button:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }
.drop-button:disabled { filter: grayscale(.7); cursor: not-allowed; }
.button-glint { position: absolute; width: 11px; height: 7px; left: 17px; top: 12px; border-radius: 50%; background: rgba(255,255,255,.45); }

.attempts { color: var(--cream); text-align: center; font-size: .65rem; font-weight: 900; letter-spacing: .12em; }
#attemptPips { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
#attemptPips i { width: 17px; height: 17px; border: 3px solid var(--ink); border-radius: 50%; background: var(--gold); }
#attemptPips i.used { background: #60264d; box-shadow: inset 0 0 0 3px #a34172; }

.prize-door { display: grid; place-items: center; padding-top: 14px; }
.prize-slot { width: min(330px, 68%); padding: 7px; border: 4px solid var(--ink); border-radius: 5px; background: #ef8eb2; color: var(--ink); text-align: center; font-size: .61rem; font-weight: 900; letter-spacing: .15em; }
.slot-dark { height: 25px; margin-top: 6px; border: 3px solid var(--ink); border-radius: 3px 3px 13px 13px; background: #24112f; box-shadow: inset 0 7px #14091e; }

.portal {
  position: relative;
  z-index: 5;
  width: min(900px, 100%);
  text-align: center;
  animation: portalIn .7s steps(8) both;
}
.portal h2 { margin: 0; color: var(--cream); font-size: clamp(1.8rem, 5vw, 3.7rem); line-height: 1.15; text-shadow: 0 4px var(--berry); }
.portal-hint { margin: 14px 0 40px; color: var(--blush); font-weight: 700; }
.ball-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 4vw, 42px); align-items: start; }
.world-ball { position: relative; min-width: 0; padding: 0 0 18px; border: 0; color: var(--cream); background: transparent; cursor: pointer; transition: transform .18s steps(3); }
.world-ball:hover { transform: translateY(-10px); }
.world-ball:focus-visible { outline: 4px solid var(--gold); outline-offset: 8px; }
.ball-top, .ball-bottom { display: block; width: clamp(100px, 20vw, 168px); margin: auto; border: 5px solid var(--ink); }
.ball-top { position: relative; height: clamp(54px, 10vw, 86px); border-radius: 100px 100px 8px 8px; border-bottom-width: 3px; background: linear-gradient(135deg, #f886b7 0 50%, #b83d7a 50%); box-shadow: inset 9px 9px rgba(255,255,255,.2); }
.ball-bottom { height: clamp(48px, 9vw, 76px); border-radius: 8px 8px 100px 100px; border-top-width: 3px; background: #fff0dd; box-shadow: inset 0 -8px #efc2be; }
.ball-band { position: absolute; z-index: 2; top: clamp(47px, 9vw, 77px); left: 50%; width: clamp(108px, 21vw, 176px); height: 15px; transform: translateX(-50%); border: 4px solid var(--ink); background: var(--gold); }
.ball-band i { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; transform: translate(-50%,-50%); border: 5px solid var(--ink); border-radius: 50%; background: var(--cream); box-shadow: inset 0 0 0 5px var(--pink); }
.ball-symbol { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); color: var(--gold); font-size: clamp(1.4rem, 4vw, 2.2rem); text-shadow: 2px 2px var(--plum); }
.books-ball .ball-top { background: linear-gradient(135deg, #f5bc63 0 50%, #ce6c5f 50%); }
.books-ball .ball-band i { box-shadow: inset 0 0 0 5px #e6a253; }
.designs-ball .ball-top { background: linear-gradient(135deg, #b78de8 0 50%, #6f4a9e 50%); }
.designs-ball .ball-band i { box-shadow: inset 0 0 0 5px #a77bd4; }
.world-ball strong, .world-ball small { display: block; }
.world-ball strong { margin-top: 24px; font-size: clamp(.76rem, 2vw, 1rem); letter-spacing: .08em; }
.world-ball small { margin-top: 6px; color: var(--blush); font-size: .68rem; }
.replay-button { margin-top: 42px; padding: 10px 15px; color: var(--peach); border: 2px solid rgba(255,208,157,.45); border-radius: 4px; background: rgba(44,21,63,.6); cursor: pointer; font-size: .72rem; font-weight: 700; }
.replay-button:hover { background: var(--berry); }

.page-card { width: min(520px, calc(100vw - 32px)); padding: 34px; color: var(--ink); border: 6px solid var(--ink); border-radius: 8px; background: var(--cream); box-shadow: 12px 12px 0 rgba(19,7,30,.55); text-align: center; }
.page-card::backdrop { background: rgba(21,9,35,.78); backdrop-filter: blur(5px); }
.close-card { position: absolute; right: 12px; top: 10px; width: 38px; height: 38px; color: var(--ink); border: 3px solid var(--ink); background: var(--blush); cursor: pointer; font-size: 1.6rem; line-height: 1; }
.close-card:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; }
.card-number { margin: 0; color: var(--berry); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.card-emblem { display: grid; place-items: center; width: 92px; height: 92px; margin: 24px auto; color: var(--cream); border: 5px solid var(--ink); border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--plum)); box-shadow: 6px 6px 0 var(--gold); font-size: 2.5rem; }
.page-card h2 { margin: 0; font-size: 2rem; letter-spacing: .06em; }
.page-card p:not(.card-number) { margin: 17px auto 24px; max-width: 38ch; font-size: 1rem; line-height: 1.65; }
.coming-soon { display: inline-block; padding: 9px 12px; color: var(--cream); border: 3px solid var(--ink); background: var(--berry); font-size: .68rem; font-weight: 900; letter-spacing: .08em; }

@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .75; } }
@keyframes shimmer { 50% { opacity: .5; transform: translateY(-2px); } }
@keyframes machineIn { from { opacity: 0; transform: scale(.9) translateY(25px); } to { opacity: 1; transform: none; } }
@keyframes spinStar { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; box-shadow: none; } }
@keyframes bob { 50% { transform: translateY(-7px); } }
@keyframes javaRun { 0% { left: 13%; } 48% { left: 68%; } 50% { transform: scaleX(-1); } 98% { left: 13%; transform: scaleX(-1); } 100% { transform: none; } }
@keyframes dogRun { 0% { left: 56%; } 42% { left: 78%; } 50% { transform: scaleX(-1); } 92% { left: 24%; transform: scaleX(-1); } 100% { left: 56%; } }
@keyframes dashAway { to { transform: translateX(160%) scaleX(-1); opacity: .65; } }
@keyframes portalIn { from { opacity: 0; transform: scale(.86); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

@media (max-width: 620px) {
  .world { padding: 66px 10px 18px; align-items: start; }
  .game-shell { width: 100%; }
  .machine-top { grid-template-columns: 18px 1fr 18px; padding: 10px; border-width: 4px; }
  .marquee { gap: 8px; padding: 8px; border-width: 3px; }
  .machine-body { padding: 10px 10px 14px; border-width: 4px; border-top: 0; }
  .glass { height: min(52svh, 470px); border-width: 4px; }
  .control-deck { grid-template-columns: 1fr auto; gap: 10px; }
  .attempts { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; }
  #attemptPips { margin: 0; }
  .drop-button { width: 62px; height: 62px; }
  .prize-slot { width: 70%; }
  .ball-row { gap: 5px; }
  .world-ball small { display: none; }
  .world-ball strong { font-size: .63rem; }
  .sound-button { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* One animation clock owns all game motion; CSS no longer races the physics. */
.world { align-content: center; gap: 24px; }
.claw { transition: none; }
.claw .cable, .claw .claw-head, .claw .claw-arms { transition: none; }
.claw-arms i { transition: transform .2s ease; }
.sprite {
  bottom: 38px;
  width: clamp(108px, 19vw, 154px);
  height: clamp(108px, 19vw, 154px);
  animation: none;
  transition: none;
  background-size: 200% 100%;
  will-change: transform, left;
}
.java-sprite, .dog-sprite { animation: none; }
.java-sprite { background-image: url("./assets/java-run-v2.png"); background-size: contain; }
.dog-sprite { background-image: url("./assets/dog-run-v2.png"); background-size: contain; }
.dog-sprite { width: clamp(92px, 16vw, 130px); height: clamp(92px, 16vw, 130px); }
.held-pair {
  position: absolute;
  z-index: 9;
  width: clamp(108px, 19vw, 154px);
  height: clamp(108px, 19vw, 154px);
  transform: translateX(-50%);
  transform-origin: 50% 44%;
  background-repeat: no-repeat;
  background-image: url("./assets/java-holding-dog-v2.png");
  background-size: contain;
  background-position: center;
  image-rendering: pixelated;
  cursor: pointer;
}
.held-pair.ready-to-capture, .held-pair:focus-visible {
  filter: drop-shadow(0 0 10px #ffe0a0);
  outline: 2px dashed var(--gold);
  outline-offset: 4px;
}
.aim-guide {
  position: absolute;
  z-index: 4;
  top: 44px;
  bottom: 35px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #fff0c880 0 7px, transparent 7px 15px);
  pointer-events: none;
}
.aim-guide span {
  position: absolute;
  width: 68px;
  height: 16px;
  bottom: 0;
  left: -33px;
  border: 2px solid #fff0c8;
  border-radius: 50%;
  background: #fff0c822;
}
.aim-guide.on-target span { border-color: #a0ffcc; background: #a0ffcc55; box-shadow: 0 0 12px #a0ffcc; }
.capture-ready .glass { cursor: pointer; }
.portal { width: min(650px, 100%); animation: rise .35s ease both; }
.portal h2 { font-size: clamp(1.3rem, 4vw, 2rem); }
.portal-kicker { margin-bottom: 8px; font-size: .875rem; }
.portal-hint { margin: 12px 0 22px; line-height: 1.5; font-size: 1rem; }
.world-ball { transition: transform .2s ease; }
.world-ball[aria-pressed="true"] { filter: drop-shadow(0 0 12px #ffda88); transform: translateY(-6px); }
.world-ball:disabled { cursor: default; }
.world-ball:disabled:hover { transform: none; }
.world-ball strong { font-size: .875rem; }
.flying-capsule {
  position: fixed !important;
  z-index: 40;
  width: 64px !important;
  height: 64px;
  padding: 0;
  margin: 0;
  pointer-events: none;
  transition: none;
}
.flying-capsule .ball-top, .flying-capsule .ball-bottom { width: 64px; height: 32px; border-width: 3px; }
.flying-capsule .ball-band { width: 67px; height: 9px; top: 28px; border-width: 2px; }
.flying-capsule .ball-band i { width: 19px; height: 19px; border-width: 3px; }
.flying-capsule .ball-symbol { font-size: 16px; }
.flying-capsule:hover { transform: none; }
.status-panel p, .sound-button, .replay-button { font-size: .875rem; }
.game-shell { animation: none; }
.glass { height: clamp(330px, 43svh, 430px); }
.prize-door { min-height: 228px; position: relative; }
.prize-door .portal { width: 100%; animation: none; }
.prize-door .portal h2 { font-size: 1.05rem; text-shadow: none; }
.prize-door .portal-kicker { display: none; }
.prize-door .portal-hint { font-size: .875rem; margin: 8px 0 16px; }
.prize-door .ball-top, .prize-door .ball-bottom { width: 74px; height: 37px; border-width: 3px; }
.prize-door .ball-band { width: 79px; top: 31px; height: 12px; border-width: 3px; }
.prize-door .ball-band i { width: 26px; height: 26px; border-width: 3px; }
.prize-door .ball-symbol { font-size: 1.2rem; }
.prize-door .world-ball strong { margin-top: 12px; }
.prize-door .world-ball small { display: none; }
.prize-door .replay-button { margin-top: 0; padding: 5px 12px; }
.prize-door .world-ball { padding-bottom: 12px; }
.welcome-stars, .tiny-star, .top-light, .sky-glow { animation: none; }
.step-guide { margin: 0 0 12px; padding: 12px; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); border-radius: 5px; font-size: 1rem; font-weight: 900; text-align: center; line-height: 1.5; }
.held-pair, .capture-ready .glass { cursor: default; }
.drop-button.throw-ready { background: #ef173e; color: #fff; border-color: #640b24; box-shadow: 0 6px 0 #680b2d, 0 0 10px #ff224e, 0 0 28px #ff224ecc, inset 0 4px 0 #ff8099; }
.drop-button.throw-ready:hover { background: #ff3557; box-shadow: 0 6px 0 #680b2d, 0 0 15px #ff224e, 0 0 38px #ff224e; }
.drop-button:disabled { background: #785c71; color: #e8dbe6; box-shadow: 0 6px 0 #432338; filter: none; }
.java-sprite { background-image: url("./assets/java-run-v3.png"); }
.held-pair { background-image: url("./assets/java-holding-dog-v3.png"); }
.java-sprite, .held-pair { width: clamp(170px, 28vw, 220px); height: clamp(170px, 28vw, 220px); }
.dog-sprite { width: clamp(140px, 23vw, 180px); height: clamp(140px, 23vw, 180px); }
.glass { height: clamp(510px, 65svh, 640px); }
.plush-prizes { position: absolute; z-index: 3; bottom: 0; left: 0; width: 100%; height: 52%; background: url("./assets/pastel-prizes.png") center bottom / 100% auto no-repeat; pointer-events: none; image-rendering: pixelated; }
.arcade-action { display: flex; justify-content: center; padding: 22px 0 18px; }
.arcade-action .drop-button { width: 112px; height: 112px; font-size: 1.15rem; border-width: 6px; letter-spacing: .06em; }
.control-deck { grid-template-columns: 1fr 90px; }
.capture-ready .status-panel { display: none; }
.capture-ready .control-deck { display: none; }
.capture-ready .step-guide { margin-bottom: 8px; }
.capture-ready .arcade-action .drop-button { width: 130px; height: 130px; font-size: 1.35rem; }
.sound-button { top: 10px; right: 10px; min-height: 32px; padding: 4px 7px; gap: 4px; border-width: 1px; font-size: .75rem; letter-spacing: 0; opacity: .85; }
.sound-button .sound-icon { font-size: .875rem; }
.landscape { background-image: none; background: linear-gradient(135deg,#daf7ff 0%,#bee5f4 55%,#9fc9e0 100%); }
.glass { border-color: #eefaff; box-shadow: inset 0 0 0 4px #85b2cb, inset 12px 0 0 #ffffff38; }
.glass-shine { background: linear-gradient(115deg,transparent 0 12%,#ffffff80 12% 15%,transparent 15% 18%,#ffffff45 18% 20%,transparent 20% 74%,#ffffff70 74% 77%,transparent 77%); }
.glass::after { content:""; position:absolute; inset:10px; border-top:4px solid #ffffffa0; border-right:4px solid #ffffff80; pointer-events:none; z-index:12; }
.plush-prizes { height: 64%; background-size: auto 100%; }
.hill-shadow { background: #668ba830; }
.trainer-profile { display: none; }
.page-card.is-trainer::backdrop { background: linear-gradient(135deg,#fff0f4f5,#eee7fbf5 55%,#e1f4f4f5); backdrop-filter: blur(9px); }
.page-card.is-trainer { width: min(880px,calc(100vw - 28px)); padding: 52px 24px 24px; background: linear-gradient(145deg,#fff8fa,#f5edfc); border-color:#b58ca5; box-shadow:10px 10px 0 #cda9c340; text-align:left; }
.page-card.is-trainer > .card-number, .page-card.is-trainer > .card-emblem, .page-card.is-trainer > .coming-soon, .page-card.is-trainer > #cardCopy { display:none; }
.page-card.is-trainer > #cardTitle { font-size: 1rem; color:#493761; margin:0 0 14px; letter-spacing:.18em; }
.is-trainer .trainer-profile { display:block; }
.trainer-id { color:#573749; border:5px solid #fff9fb; outline:3px solid #c28da7; border-radius:12px; overflow:hidden; background:linear-gradient(125deg,#ffe4ee 0 32%,#fbd3e4 32% 60%,#f3c4d9 60%); box-shadow:6px 7px 0 #c78ba433; }
.trainer-heading { display:flex; align-items:center; gap:10px; padding:16px 20px; background:#edb0cc; color:#5c304a; text-shadow:1px 1px #fff2f8; font-size:clamp(1.1rem,3vw,1.7rem); font-weight:900; border-bottom:4px solid #ffeaf2; }
.trainer-id-number { margin-left:auto; font-size:.875rem; text-shadow:none; white-space:nowrap; }
.trainer-grid { display:grid; grid-template-columns:1fr 1.3fr; gap:22px; padding:22px; align-items:start; }
.trainer-fields { margin:0; display:grid; gap:12px; grid-column:2; grid-row:1; }
.trainer-fields > div { padding:10px 12px; background:#fff8fbbd; border-radius:7px; box-shadow:0 3px 0 #bd789929; }
.trainer-fields dt { font-size:.875rem; font-weight:700; color:#80556b; margin-bottom:6px; }
.trainer-fields dd { margin:0; font-size:1.05rem; line-height:1.55; font-weight:900; }
.trainer-fields dd span { color:#a86484; }
.trainer-photo { grid-column:1; grid-row:1; margin:0; padding:8px; background:#fff0f6; border:3px solid #c98eac; border-radius:8px; box-shadow:4px 4px 0 #b975982b; }
.trainer-photo img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; border:2px solid #5d4870; border-radius:3px; }
.trainer-photo figcaption { display:flex; justify-content:space-between; padding:10px 5px 3px; font-weight:900; letter-spacing:.15em; }
.trainer-photo figcaption span { color:#ae763a; }
.trainer-badges { display:flex; justify-content:space-evenly; padding:12px 20px; border-top:4px double #fff3f8; background:#edbdd3; }
.trainer-badges span { display:grid; place-items:center; width:34px; height:34px; border:2px solid #bd86a1; background:#ffeaf3; color:#805169; font-size:1.35rem; border-radius:5px; box-shadow:2px 2px #bd86a133; }
.trainer-socials { margin-top:26px; }
.trainer-socials h3 { font-size:1rem; margin:0 0 12px; color:#493761; }
.social-links { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.social-links button,.social-links a { text-align:center; font:700 1rem var(--pixel); display:block; padding:12px 8px; color:#483955; background:#fff4df; border:2px solid #8e7b9f; border-radius:6px; text-decoration:none; }
.social-links small { display:block; margin-top:6px; font-size:.75rem; font-weight:400; }
@media(max-width:560px) {
  .page-card.is-trainer { padding:48px 14px 20px; }
  .trainer-heading { padding:12px; flex-wrap:wrap; gap:6px; }
  .trainer-id-number { font-size:.75rem; }
  .trainer-grid { grid-template-columns:1fr; padding:14px; gap:18px; }
  .trainer-photo { grid-row:1; width:min(220px,100%); justify-self:center; }
  .trainer-fields { grid-column:1; grid-row:2; }
  .trainer-badges { padding:10px 5px; }
  .trainer-badges span { width:26px; height:28px; font-size:1rem; }
  .social-links { gap:6px; }
}
@media(max-width:620px) {
  .glass { height: clamp(460px, 65svh, 570px); min-height: 460px; }
  .world-ball strong { font-size: .875rem; }
  .control-deck { gap: 12px; }
}

/* Clear sleeves and metal rings turn the collections into working binders. */
.collection { display:none; }
.is-books #bookCollection,.is-designs #designCollection { display:block; }
.page-card.is-books,.page-card.is-designs { width:min(940px,calc(100vw - 24px)); padding:48px 24px 24px; background:#fef7e9; border-color:#bd925e; max-height:92svh; }
.page-card.is-designs { background:#fff1f7; border-color:#c88caf; }
.page-card.is-books::backdrop,.page-card.is-designs::backdrop { background:linear-gradient(140deg,#e6f6e8f5,#fce8eff5); backdrop-filter:blur(8px); }
.is-books > .card-number,.is-books > .card-emblem,.is-books > #cardCopy,.is-books > .coming-soon,.is-designs > .card-number,.is-designs > .card-emblem,.is-designs > #cardCopy,.is-designs > .coming-soon { display:none; }
.page-card.is-books h2,.page-card.is-designs h2 { font-size:clamp(1.5rem,4vw,2rem); margin-bottom:22px; }
.binder { position:relative; padding:24px 22px 24px 55px; border:7px solid #a77b46; border-radius:12px 20px 20px 12px; background:linear-gradient(90deg,#b98c52 0 34px,#f7deb4 34px); box-shadow:0 7px 0 #795b39, inset -5px 0 #fff3db; }
.design-binder { border-color:#c586a9; background:linear-gradient(90deg,#c58aa9 0 34px,#f8dce9 34px); box-shadow:0 7px 0 #966381,inset -5px 0 #fff3fa; }
.binder-rings { position:absolute; left:8px; top:12%; bottom:12%; display:flex; flex-direction:column; justify-content:space-between; z-index:3; }
.binder-rings i { width:40px; height:18px; border:2px solid #80858b; border-radius:8px; background:linear-gradient(#fdfdfd,#b4bac0 50%,#eef0f3 65%,#959da4); box-shadow:0 3px 3px #48301f40; }
.binder-pockets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 14px; }
.pocket { position:relative; display:flex; align-items:center; justify-content:center; aspect-ratio: .65; padding:9px; min-width:0; border:2px solid #fffefa; border-top:4px double #fdf9f1; border-radius:3px; background:linear-gradient(115deg,#ffffff6b 0 17%,#ffffff17 18% 57%,#ffffff77 58% 60%,#ffffff33 61%); box-shadow:inset 0 0 0 1px #ab92755c,2px 3px 2px #78594226; }
.empty-pocket span { font-size:2rem; color:#a1846859; }
.design-binder .empty-pocket span { color:#b6799a60; }
.book-pocket { color:#532e33; text-decoration:none; transition:transform .18s; }
.book-pocket:hover { transform:translateY(-4px); }
.book-pocket:focus-visible,.social-links a:focus-visible { outline:3px solid #ab416b; outline-offset:4px; }
.book-card { display:flex; flex-direction:column; width:100%; height:100%; padding:6px; border:3px solid #d8ad55; border-radius:5px; background:#fff2cc; box-shadow:2px 3px #765b343b; }
.book-card img { width:100%; height:0; min-height:0; flex:1; object-fit:contain; }
.book-card strong { margin:8px 0 5px; font-size:.9rem; line-height:1.3; }
.book-card small { font-size:.75rem; line-height:1.4; }
.page-card p.binder-soon { margin:0 auto 26px; font-family:Georgia,"Times New Roman",serif; font-size:clamp(1.8rem,5vw,2.6rem); color:#995274; font-weight:400; letter-spacing:.04em; transform:none; }
.social-links a { display:flex; align-items:center; justify-content:center; gap:10px; background:#fff6fa; color:#5b3b4f; border-color:#c994af; }
.social-links a:hover { background:#ffe1ee; }
.social-links img { object-fit:contain; flex-shrink:0; }
.social-links { display:flex; justify-content:center; gap:22px; }
.social-links a { width:64px; height:56px; }
.page-card.is-books { background:radial-gradient(ellipse at 15% 30%,#d9f8f7aa,transparent 55%),radial-gradient(ellipse at 90% 60%,#fae0f1aa,transparent 50%),#f7f9fc; border:1px solid #ffffff; border-radius:18px; box-shadow:0 20px 70px #66859035; padding-top:56px; }
.page-card.is-books h2 { font-family:Georgia,"Times New Roman",serif; font-size:clamp(2.3rem,6vw,4.4rem); font-weight:400; letter-spacing:-.035em; line-height:1.1; color:#404652; margin:0 0 30px; }
.museum-display { display:block; width:min(390px,85%); margin:auto; color:#606875; text-decoration:none; }
.exhibit-glass { position:relative; display:block; padding:32px 36px; border:7px double #cbd9e0; border-radius:10px; outline:1px solid #fff; background:linear-gradient(115deg,#ffffffb8,#d9e8ed38 35%,#ffffff77 80%); box-shadow:inset 0 0 0 3px #ffffffc9,inset 0 0 0 5px #adc1ce55,7px 8px 0 -2px #d7e1e699,9px 10px 0 -2px #a9bacb66,15px 24px 28px #8395a43b; }
.exhibit-glass::after { content:""; position:absolute; inset:5px; pointer-events:none; border:1px solid #ffffffda; border-radius:3px; background:linear-gradient(118deg,transparent 7%,#ffffff55 8% 9%,transparent 10% 80%,#ffffff30 81% 83%,transparent 84%); }
.exhibit-glass img { display:block; width:100%; height:auto; max-height:49svh; object-fit:contain; filter:drop-shadow(3px 5px 5px #53647345); }
.case-fasteners { position:absolute; inset:8px; pointer-events:none; }
.case-fasteners i { position:absolute; width:11px; height:11px; border:2px solid #d8e6eb; border-radius:50%; background:radial-gradient(circle,#334753 0 35%,#8095a5 40% 55%,#edf5f9 65%); box-shadow:0 0 0 1px #a1b3c0; }
.case-fasteners i:nth-child(1) { top:0;left:0; }.case-fasteners i:nth-child(2) { top:0;right:0; }.case-fasteners i:nth-child(3) { bottom:0;left:0; }.case-fasteners i:nth-child(4) { bottom:0;right:0; }
.exhibit-plaque { display:flex; justify-content:center; gap:18px; padding:18px 0; margin:12px auto 0; border:0; background:none; font:1rem var(--pixel); }
.exhibit-plaque span { color:#7b8290; }
.museum-display:focus-visible { outline:3px solid #a27542; outline-offset:8px; }
.world:has(.welcome:not(.is-hidden)) { padding:0; }
.world:has(.welcome.is-hidden) { background:#d3f5f3 url("./assets/pastel-arcade.png") center / cover fixed no-repeat; }
.world:has(.welcome.is-hidden)::after { box-shadow:none; background:#fff4fb12; }
.world:has(.welcome.is-hidden) .sky-glow { display:none; }
.welcome:not(.is-hidden) { width:100%; min-height:max(100svh,66.67vw); padding:clamp(35px,6vh,80px) 18px 0; display:flex; flex-direction:column; align-items:center; isolation:isolate; animation:none; }
.welcome .picnic-scene { position:absolute; inset:0; z-index:-2; width:100%; height:100%; margin:0; border:0; border-radius:0; box-shadow:none; }
.welcome .picnic-scene img { width:100%; height:100%; object-fit:cover; object-position:center; }
.welcome::after { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background:linear-gradient(#072e3c55,transparent 42%); }
.welcome .welcome-stars { display:none; }
.welcome h1 { font-size:clamp(2.1rem,5.5vw,4.8rem); line-height:1.12; color:#fffde1; text-shadow:0 3px #245338,0 5px #153c2e,0 0 18px #102f2ecc; }
.welcome .start-button { margin-top:24px; }
.welcome .lake-shimmer { clip-path:polygon(62% 59%,81% 59%,86% 63%,100% 65%,100% 72%,75% 68%,64% 65%); }
@media(max-width:600px) { .welcome:not(.is-hidden) { min-height:100svh; padding-top:9svh; }.welcome h1 { font-size:clamp(2rem,8vw,3rem); }.exhibit-glass { padding:20px; } }
@media(max-width:600px) {
 .binder { padding:16px 12px 16px 42px; border-width:5px; }
 .binder-pockets { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 8px; }
 .binder-rings { left:3px; }.binder-rings i { width:30px; }
 .page-card.is-books,.page-card.is-designs { padding:48px 10px 20px; }
 .pocket { padding:5px; }.book-card { padding:4px; }
 .social-links a { flex-direction:column; gap:8px; font-size:.875rem; }
 .start-button { margin-top:30px; }
.picnic-scene { margin-top:25px; border-width:3px; }
}

/* Each destination has its own repeating pixel wallpaper. */
body { background:transparent; }
html:has(.page-card.is-trainer[open]),.page-card.is-trainer::backdrop { background:#fce7ef url("./assets/puppy-wallpaper.png") center / 420px repeat; }
html:has(.page-card.is-books[open]),.page-card.is-books::backdrop { background:#f8fcf5 url("./assets/books-wallpaper.png") center / 420px repeat; }
html:has(.page-card.is-designs[open]),.page-card.is-designs::backdrop { background:#d4e9cd url("./assets/leaves-wallpaper.png") center / 420px repeat; }
.page-card.is-trainer { background:#fff4f8eF; }
.page-card.is-books { background:#ffffffed; border-color:#d7e4d6; }
.page-card.is-designs { background:#e9f3e4ee; border-color:#8bab84; }
.page-card.is-designs h2,.page-card.is-designs p.binder-soon { color:#4d7050; }
.design-binder { border-color:#91ad87; background:linear-gradient(90deg,#94af8b 0 34px,#e0ebd8 34px); box-shadow:0 7px 0 #66815f,inset -5px 0 #f7fff1; }
.design-binder .empty-pocket span { color:#64875970; }
.bookshelf { position:relative; width:min(700px,100%); margin:auto; aspect-ratio:3/2; perspective:1100px; isolation:isolate; }
.shelf-scene { display:block; width:100%; height:100%; object-fit:cover; border-radius:12px; image-rendering:pixelated; transition:opacity .7s; }
.shelf-book { position:absolute; z-index:2; left:42%; bottom:21.5%; width:16%; padding:0; border:0; background:#a62b2b; cursor:pointer; transform:rotateY(-24deg); transform-origin:center; box-shadow:9px 1px 0 #efe8da,12px 2px 0 #9d3430,15px 6px 8px #52654b40; }
.shelf-book img { display:block; width:100%; height:auto; }
.shelf-book:hover { filter:brightness(1.06); }
.shelf-book:focus-visible,.read-book:focus-visible,.return-book:focus-visible { outline:3px solid #689968; outline-offset:6px; }
.book-open .shelf-scene { opacity:.25; }
.book-open .shelf-book { left:36%; bottom:12%; width:28%; transform:rotateY(0); animation:book-swirl .85s cubic-bezier(.2,.7,.25,1) both; box-shadow:7px 2px 0 #efe8da,10px 3px 0 #9d3430,14px 14px 22px #49654c35; }
@keyframes book-swirl { 0% { transform:translate(30%,18%) scale(.57) rotate(-12deg) rotateY(-24deg); } 55% { transform:translate(-8%,-8%) scale(1.06) rotate(12deg) rotateY(190deg); } 100% { transform:translate(0) scale(1) rotate(0) rotateY(360deg); } }
.page-card p.shelf-hint { color:#557359; font-size:.9rem; margin:18px auto 4px; }
.book-reveal { display:flex; flex-direction:column; align-items:center; gap:14px; margin:22px auto 0; animation:reveal-book-link 1s both; }
@keyframes reveal-book-link { 0%,70% { opacity:0; } 100% { opacity:1; } }
.read-book { display:inline-block; padding:15px 22px; border:2px solid #60875c; border-radius:7px; background:#e4f1de; color:#385c36; font:700 1rem var(--pixel); text-decoration:none; box-shadow:0 4px #8cab82; }
.read-book:hover { background:#d5eacb; }
.return-book { border:0; padding:6px; background:none; color:#60765c; font: .875rem var(--pixel); cursor:pointer; text-decoration:underline; text-underline-offset:4px; }
@media(prefers-reduced-motion:reduce) { .book-open .shelf-book,.book-reveal { animation:none; }.shelf-scene { transition:none; } }

/* Fixed screens scale together to fit the available viewport. */
html,body { width:100%;height:100%;overflow:hidden;touch-action:none; }
.world { width:100%;height:100dvh;min-height:0;overflow:hidden; }
.welcome:not(.is-hidden) { min-height:0;height:100dvh; }
.game-shell { position:fixed;left:50%;top:50%;margin:0;transform:translate(-50%,-50%) scale(var(--screen-scale,1));transform-origin:center; }
.page-card { position:fixed;left:50%;top:50%;margin:0!important;max-height:none!important;overflow:visible;transform:translate(-50%,-50%) scale(var(--screen-scale,1));transform-origin:center; }
.page-card::backdrop { touch-action:none; }
.shelf-book { width:10%;height:46%;left:45%;bottom:36%; }
.shelf-book > img { display:none; }
.book-spine { display:flex;height:100%;align-items:center;justify-content:space-around;writing-mode:vertical-rl;padding:10px 0;color:#ffe6a2;background:linear-gradient(90deg,#761c25,#b73339 20%,#c44842 65%,#92222c);font:700 clamp(.8rem,2vw,1.2rem) Georgia,serif;letter-spacing:.05em;border:2px solid #8a2629; }
.book-spine small { font-size:.7em; }
.book-open .shelf-book { height:auto;bottom:12%; }
.book-open .shelf-book > img { display:block; }
.book-open .book-spine { display:none; }
html:has(.page-card.is-designs[open]),.page-card.is-designs::backdrop { background:#c8b8e3 url("./assets/leaves-wallpaper.png") center / 420px repeat; }
.page-card.is-designs { background:#f0e8f9ef;border-color:#a78dbb; }
.page-card.is-designs h2,.page-card.is-designs p.binder-soon { color:#765488; }
.design-binder { border-color:#a68aba;background:linear-gradient(90deg,#a48abc 0 34px,#e0d1ef 34px);box-shadow:0 7px 0 #77618b,inset -5px 0 #f9efff; }
.design-binder .empty-pocket span { color:#89649e80; }

/* Books is the room itself, with no dialog card surrounding the shelf. */
.page-card.is-books { inset:0!important;left:0;top:0;width:100vw;max-width:none;height:100dvh;margin:0;padding:0!important;border:0;border-radius:0;transform:none;box-shadow:none;overflow:hidden;background:#f6f5ef; }
.page-card.is-books > #cardTitle { display:none; }
.is-books #bookCollection { width:100%;height:100%; }
.is-books .bookshelf { position:absolute;left:50%;top:50%;width:max(100vw,150dvh);height:max(100dvh,66.667vw);max-width:none;margin:0;transform:translate(-50%,-50%); }
.is-books .shelf-scene { border-radius:0; }
.is-books .close-card { z-index:20;top:18px;right:20px;background:#fffaf3e6; }
.is-books .shelf-book { transform:none;box-shadow:6px 0 #681e25,10px 0 #e9dfcc,14px 2px #7d222a,16px 5px #71806b44; }
.is-books .book-spine { background:#a93236 url("./assets/pixel-book-spine.png") center / 244% 100% no-repeat;border:0;color:transparent;font-size:0;image-rendering:pixelated; }
.is-books .book-spine small { display:none; }
.is-books .book-open .shelf-book { left:50%;bottom:auto;top:50%;width:auto;height:min(62dvh,540px);transform:translate(-50%,-50%);animation:cover-spin .9s ease both; }
.is-books .book-open .shelf-book > img { width:auto;height:100%; }
@keyframes cover-spin { from { transform:translate(-50%,-35%) rotateY(-270deg) rotate(-18deg) scale(.6); } to { transform:translate(-50%,-50%) rotateY(0) rotate(0) scale(1); } }
.is-books .book-reveal { position:absolute;z-index:5;bottom:4dvh;left:0;right:0;margin:0; }
.is-books p.shelf-hint { position:absolute;bottom:4dvh;left:0;right:0;margin:auto;width:fit-content;max-width:90%;padding:10px 16px;border-radius:6px;background:#fffffff0; }
@media(prefers-reduced-motion:reduce) { .is-books .book-open .shelf-book { animation:none; } }

.is-books .shelf-book { width:6%;height:36%;left:25%;background:transparent;box-shadow:none; }
.is-books .book-spine { width:100%;height:100%;justify-content:center;align-items:center;padding:0;background:#b42d30 url("./assets/pixel-book-spine.png") center / 100% 100% no-repeat;color:#ffe8a3;font:700 clamp(12px,1vw,15px) var(--pixel);letter-spacing:.02em;text-shadow:1px 1px #321b15,-1px -1px #321b15;white-space:nowrap; }
.is-books .book-open .shelf-book { width:auto;height:min(62dvh,540px);left:50%; }
/* Metal housing, pulley wheels, braided cable and articulated gripping arms. */
.carriage { background:linear-gradient(#fafcff 0 15%,#b2c2d3 16% 45%,#6f849c 46% 60%,#c8d7e2 61%);border-color:#435166;box-shadow:inset 0 0 0 2px #e5f3fa,0 3px 0 #38465c; }
.carriage i { background:radial-gradient(circle,#fff 0 12%,#667589 15% 38%,#bed0dc 40% 58%,#455064 60%);border-color:#415164; }
.cable { left:41px;width:8px;background:repeating-linear-gradient(135deg,#435367 0 2px,#c1d4e0 2px 4px,#6f8395 4px 6px);border-left:1px solid #344151;border-right:1px solid #e0f4fb;box-shadow:2px 0 #24314130; }
.claw-head { left:27px;width:38px;height:30px;border:3px solid #42536a;border-radius:8px 8px 4px 4px;background:linear-gradient(90deg,#78899b,#eaf8fc 35%,#b0c6d6 60%,#596f84);box-shadow:inset 0 4px #ffffff99,0 3px #344b60; }
.claw-head::before { content:"";position:absolute;left:7px;right:7px;top:-9px;height:7px;border:2px solid #475b70;background:#a8bccb; }
.claw-head span { left:11px;top:8px;width:10px;height:10px;border:2px solid #52718a;border-radius:50%;background:#ffd67c;box-shadow:0 0 4px #fff0b1; }
.claw-arms { top:calc(94px + var(--drop)); }
.claw-arms i { border-color:#627b91!important;filter:drop-shadow(1px 1px 0 #283b50);box-shadow:inset 2px -2px #dff5ff; }
.claw-arms i:first-child { border-left-width:9px;border-bottom-width:9px; }
.claw-arms i:last-child { border-right-width:9px;border-bottom-width:9px; }
.claw-arms i::before { content:"";position:absolute;top:-4px;width:12px;height:12px;border:2px solid #344b60;border-radius:50%;background:radial-gradient(circle,#40556a 0 22%,#dcebf3 25% 55%,#839aad 60%); }
.claw-arms i:first-child::before { left:-11px; }.claw-arms i:last-child::before { right:-11px; }
.claw.closed { z-index:10; }
.claw.closed .claw-arms { transform:scale(.72);transform-origin:50% 100%; }
@media(max-aspect-ratio:1/1) {
 .is-books .bookshelf:not(.book-open) .shelf-book { left:calc(50% - 25vw);width:6%; }
}
/* Collectible portfolio cards; original photos stay smooth at full resolution. */
.page-card p.design-hint { font-size:14px; margin:0 0 16px; color:#765488; }
.design-binder .binder-pockets { grid-template-columns:repeat(3,minmax(0,1fr)); }
.design-pocket { cursor:pointer; color:#493252; font:inherit; transition:transform .18s,box-shadow .18s; }
.design-pocket:hover { transform:translateY(-4px); box-shadow:0 6px 16px #57336740; }
.design-pocket:focus-visible { outline:3px solid #b04c87; outline-offset:3px; }
.design-card { display:flex; flex-direction:column; width:100%; height:100%; min-height:0; padding:6px; border:4px solid #eacb80; border-radius:7px; background:linear-gradient(135deg,#f5d7eb,#e7e0ff 55%,#d6f1ed); box-shadow:inset 0 0 0 1px #fff9dc,0 2px 3px #543a6240; }
.design-card-title,.design-card-footer { display:flex; align-items:center; justify-content:space-between; gap:4px; line-height:1.25; text-align:left; }
.design-card-title { font:bold 14px Georgia,serif; padding:3px 0 7px; }
.design-card-footer { font:12px monospace; padding-top:7px; }
.design-card img { display:block; width:100%; height:0; min-height:0; flex:1; object-fit:cover; object-position:center; image-rendering:auto; border:2px solid #ac91b5; border-radius:2px; }
.design-viewer { position:fixed; inset:0; margin:auto; width:min(960px,96vw); height:94dvh; max-width:96vw; max-height:94dvh; padding:14px; border:2px solid #d7b5dd; border-radius:12px; background:#faf5ff; color:#50385e; box-shadow:0 20px 90px #160d2966; }
.design-viewer[open] { display:flex; flex-direction:column; gap:10px; }
.design-viewer::backdrop { background:#21152de8; backdrop-filter:blur(8px); }
.design-viewer header,.design-viewer footer { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:12px; }
.design-viewer h2 { margin:0; font:600 clamp(16px,3vw,22px) Georgia,serif; }
.design-viewer button { cursor:pointer; padding:9px 14px; border:1px solid #b998c9; border-radius:6px; background:#eee2f5; color:#50385e; font:600 14px system-ui,sans-serif; }
.design-viewer button:focus-visible { outline:3px solid #a64c88; outline-offset:2px; }
.design-viewer #closeDesignViewer { font-size:26px; padding:0 12px; }
.design-viewer > img { display:block; flex:1; min-height:0; width:100%; object-fit:contain; image-rendering:auto; }
.design-viewer footer { font:14px system-ui,sans-serif; }
@media(max-width:560px) { .design-pocket { padding:3px; } .design-card { padding:3px; border-width:3px; } .design-card-title { font-size:12px; } .design-card-footer { font-size:12px; } }
