.hamburger { display: none; width: 42px; height: 42px; border: 1px solid rgba(44,39,34,.16); background: rgba(251,246,238,.9); border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 0; }
.hamburger span { display: block; width: 18px; height: 2px; background: #2c2722; border-radius: 2px; }
.mnav { position: fixed; inset: 0; background: rgba(244,238,227,.97); z-index: 200; display: none; padding: 80px 24px 32px; overflow: auto; }
.mnav.open { display: block; }
.mnav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(44,39,34,.16); font-family: "Helvetica Neue Condensed Black", "Arial Narrow", sans-serif; font-size: 24.2px; font-weight: 900; color: inherit; text-decoration: none; }
.mnav .mclose { position: absolute; top: 18px; right: 18px; }

@media (max-width: 900px), (max-width: 900px) and (orientation: landscape) {
  .hamburger { display: flex !important; }
  .nav { padding: 10px 12px !important; grid-template-columns: auto 1fr auto !important; align-items: center !important; }
  .nav-right .chip, .nav-right a, .nav-right button.chip, #menuBtn { display: none !important; }
  .brand { font-size: 16px !important; }
  .indicator, .brand-btn, .jump-btn { font-size: 15px !important; }
  h1 { font-size: clamp(28px, 9vw, 44px) !important; }
  h2, h3 { font-size: clamp(18px, 5vw, 28px) !important; }
  p, .panel p, .hero-note { font-size: 14px !important; line-height: 1.4 !important; }
  .chip, .btn, .discover, .play, .price-link { font-size: 11px !important; padding: 6px 10px !important; }
  .reader { display: flex !important; flex-direction: column !important; grid-template-columns: 1fr !important; }
  .windows { order: 1; width: 100%; height: auto !important; min-height: 200px !important; }
  .board-col { order: 2; position: static !important; top: auto !important; width: 100% !important; max-height: none !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; margin-top: 14px !important; }
  .board-col h3 { flex: 0 0 auto; align-self: center; }
  .board-col button.thumb { flex: 0 0 72px !important; }
  .window:not(.is-open) { flex: 0 0 56px !important; min-width: 56px !important; max-width: 72px !important; }
  .cover-frame, .window.is-open .cover-frame { display: flex; align-items: center; justify-content: center; }
  .cover-frame img, .cover-frame canvas { object-fit: contain !important; object-position: center center !important; margin: auto !important; }
  .panel { border-left: none !important; border-top: 1px solid rgba(44,39,34,.16); overflow-y: auto !important; max-height: 42vh; -webkit-overflow-scrolling: touch; }
  .window.is-open { display: flex !important; flex-direction: column !important; height: auto !important; overflow: visible !important; }
  .window.is-open .cover-frame { position: relative !important; inset: auto !important; right: auto !important; top: auto !important; transform: none !important; width: 100% !important; height: auto !important; aspect-ratio: 16/9; }
  .window.is-open .panel { position: relative !important; inset: auto !important; width: 100% !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; overflow-y: auto !important; max-height: 36vh; }
  .page-wrap { padding: 16px !important; }
}

@media (max-width: 900px) and (orientation: portrait) {
  .window.is-open { display: flex !important; flex-direction: column !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .window.is-open .cover-frame { position: relative !important; inset: auto !important; right: auto !important; top: auto !important; transform: none !important; width: 100% !important; height: auto !important; aspect-ratio: 16/9; }
  .window.is-open .panel { position: relative !important; inset: auto !important; width: 100% !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
  .windows { height: auto !important; }
}

@media (max-width: 900px), (orientation: portrait) {
  .windows, .cast-windows { flex-direction: row !important; height: 52vh !important; min-height: 240px !important; }
  .cast-windows .window, .cast-windows .window.is-open { flex: 0.4 1 0 !important; min-height: 0 !important; }
  .windows .window { flex: 0.4 1 0 !important; }
  .windows .window.is-open, .cast-windows .window.is-open { flex: 2.2 1 0 !important; }
  .windows .window.m-hide, .cast-windows .window.m-hide { display: none !important; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .hamburger { display: flex !important; }
  .nav-right .chip, .nav-right a, .nav-right button.chip, #menuBtn { display: none !important; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .reader { display: flex !important; flex-direction: column !important; }
  .board-col { order: 2; position: static !important; width: 100% !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; max-height: none !important; }
  .board-col button.thumb { flex: 0 0 72px !important; }
}

@media (max-width: 900px) {
  .windows .window.m-hide, .cast-windows .window.m-hide { display: none !important; }
  .window.is-open .panel, .cast-windows .window.is-open .panel {
    bottom: 0 !important; justify-content: flex-end !important; overflow: visible !important;
  }
  .window.is-open .panel p, .cast-windows .window.is-open .panel p { font-size: 75% !important; }
  .panel .row .play, .panel .row .price-link, .panel .row .text-link, .panel .row .chip {
    font-size: 75% !important; padding: 5px 8px !important; transform: scale(0.75); transform-origin: left bottom;
  }
}
@media (max-width: 900px) and (orientation: portrait) {
  .windows .window.is-open, .cast-windows .window.is-open {
    display: flex !important; flex-direction: column !important; height: auto !important; overflow: visible !important;
  }
  .windows .window.is-open img.cover, .cast-windows .window.is-open .cover-box {
    position: relative !important; width: 100% !important; height: auto !important; inset: auto !important;
  }
  .windows .window.is-open .panel, .cast-windows .window.is-open .panel {
    position: relative !important; inset: auto !important; width: 100% !important; bottom: 0 !important;
    opacity: 1 !important; transform: none !important; justify-content: flex-end !important;
  }
}

@media (max-width: 900px) {
  .window, .cover-frame, .cover-box { overflow: hidden !important; }
  .window img, .cover-frame img, .cover-frame canvas, .cover-box img {
    max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; object-position: center center !important;
  }
  .window.is-open { display: flex !important; flex-direction: column !important; height: auto !important; overflow: visible !important; }
  .window.is-open .cover-frame, .window.is-open .cover-box { position: relative !important; inset: auto !important; right: auto !important; width: 100% !important; height: auto !important; aspect-ratio: 16/9; }
  .window.is-open .panel { position: relative !important; inset: auto !important; width: 100% !important; max-height: none !important; overflow: visible !important; }
  .swatches { grid-template-columns: repeat(6, 1fr) !important; }
  .patterns { grid-template-columns: repeat(3, 1fr) !important; }
  .tools { flex-wrap: wrap !important; }
  .tool { width: 42px !important; }
}

@media (max-width: 900px) {
  #windows .window.is-open img.cover, #windows .window.is-open .shade { display: none !important; }
  #windows .window.is-open .panel { position: relative !important; width: 100% !important; inset: auto !important; }
  .tools-slot { order: 2; width: 100%; background: #fbf6ee; border: 1px solid rgba(44,39,34,.16); border-radius: 16px; margin-top: 12px; }
  .board-col { order: 3 !important; }
}

@media (max-width: 900px) {
  #windows, .cast-windows { position: relative; overflow: hidden; }
  #windows .window, .cast-windows .window { position: relative !important; overflow: hidden !important; height: 100% !important; }
  #windows .window.is-open, .cast-windows .window.is-open { overflow: hidden !important; }
  #windows .window.is-open .panel, .cast-windows .window.is-open .panel {
    position: absolute !important; left: auto !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 46% !important; height: auto !important; margin: 0 !important;
    display: flex !important; flex-direction: column !important; justify-content: flex-end !important;
  }
  #windows .window.is-open img.cover, #windows .window.is-open .shade { display: none !important; }
  #windows .window.is-open .panel { width: 100% !important; left: 0 !important; }
  p, .panel p, .hero-note, .panel h3 { font-size: 18px !important; }
  .panel h3 { font-size: 26px !important; }
  .chip, .btn, .discover, .play, .price-link, .text-link { font-size: 14px !important; }
}

@media (max-width: 900px) and (orientation: portrait) {
  .reader .window.is-open .cover-frame, .reader .window.is-open img.cover { display: block !important; position: relative !important; width: 100% !important; height: auto !important; aspect-ratio: 16/9; object-fit: contain !important; }
  .reader .window.is-open { display: flex !important; flex-direction: column !important; }
  .reader .window.is-open .panel { position: relative !important; width: 100% !important; order: 2; }
  .reader .window.is-open .cover-frame { order: 1; }
  .cover-frame canvas, #pad { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  .window.is-open .cover-frame { height: 100% !important; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .board-col { flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; width: 100% !important; }
  .board-col button.thumb { flex: 0 0 72px !important; }
}

@media (max-width: 900px) {
  .tools-slot { position: relative !important; order: 2; width: 100%; clear: both; margin-top: 12px; }
  .tools-slot .panel, .reader .panel {
    position: relative !important; inset: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important; max-width: none !important; height: auto !important;
  }
  .board-col { order: 3 !important; flex-direction: row !important; overflow-x: auto !important; overflow-y: hidden !important; }
}

@media (max-width: 900px) {
  .window.is-open .cover-frame { aspect-ratio: auto !important; height: auto !important; overflow: visible !important; }
  .window.is-open { height: auto !important; overflow: visible !important; }
  .window.is-open .cover-frame canvas, .window.is-open .cover-frame img {
    width: 100% !important; height: auto !important; max-height: none !important; object-fit: contain !important;
  }
}

@media (max-width: 900px) {
  .window.is-open .cover-frame canvas#pad, .window.is-open .cover-frame canvas#page {
    width: 100% !important; height: auto !important; max-height: none !important; object-fit: contain !important; display: block;
  }
  .window.is-open .cover-frame { aspect-ratio: auto !important; height: auto !important; }
  .window.is-open { height: auto !important; }
}

@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr auto !important; }
  .brand-wrap, .jump { justify-self: center !important; text-align: center; }
  .window:not(.is-open) { height: 100% !important; }
  .window:not(.is-open) .cover-frame, .window:not(.is-open) img:not(.robot-big), .window:not(.is-open) .shade {
    height: 100% !important; width: 100% !important; object-fit: cover !important; object-position: center !important;
  }
  .window.is-open .cover-frame { width: 100% !important; height: auto !important; }
  .window.is-open .cover-frame canvas#pad, .window.is-open .cover-frame canvas#page {
    width: 100% !important; height: auto !important; display: block !important;
  }
}

@media (max-width: 900px) {
  .windows { height: 52vh !important; min-height: 240px !important; align-items: stretch !important; }
  .window, .window.is-open { height: 100% !important; }
  .window.is-open .cover-frame { height: 100% !important; }
  .window.is-open .cover-frame canvas#pad {
    width: 100% !important; height: 100% !important; object-fit: contain !important;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .windows { height: 52vh !important; }
  .window.is-open { height: 100% !important; }
  .window.is-open .cover-frame { aspect-ratio: auto !important; position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; }
  .window.is-open .cover-frame canvas#pad { width: 100% !important; height: 100% !important; display: block !important; }
}

@media (max-width: 900px) {
  .window.is-open .cover-frame { display: flex !important; align-items: flex-end !important; justify-content: center !important; }
  .window.is-open .cover-frame canvas#pad { align-self: flex-end !important; margin-top: auto !important; margin-bottom: 0 !important; }
}

/* slider fix: family slider stays a row under 900, left panel fills and centers */
@media (max-width: 900px), (orientation: portrait) {
  .cast-windows {
    flex-direction: row !important;
    height: 52vh !important;
    min-height: 280px !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }
  .cast-windows .window { height: 100% !important; min-height: 0 !important; }
  .cast-windows .window.is-open {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    overflow: hidden !important;
    flex: 5.4 1 0 !important;
  }
  .cast-windows .window.is-open .cover-box {
    position: relative !important;
    inset: auto !important;
    width: var(--cast-cover, 38%) !important;
    height: 100% !important;
    flex: 0 0 var(--cast-cover, 38%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  .cast-windows .window.is-open .cover-box .robot-big {
    position: relative !important;
    height: 100% !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    top: auto !important;
    left: auto !important;
    object-fit: contain !important;
    transform: scaleX(var(--sx,1)) scaleY(var(--sy,1)) rotate(var(--rot,0deg)) !important;
  }
  .cast-windows .window.is-open .panel {
    position: relative !important;
    width: auto !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow: auto !important;
  }
}

/* Hovering a picture scales it, including pictures inside sliders. */
.window img.cover,
.window .book-side img,
.window .cover-frame img,
.cover img,
figure img,
.gallery img,
.title-banner {
  transform-origin: center center;
  transition: transform 1.6s ease;
}
.window:hover img.cover,
.window:not(.is-open):hover .book-side > img,
.window:not(.is-open):hover .cover-frame > img,
.window.is-open .book-side:hover > img,
.window.is-open:not(.revealed) .cover-frame:hover > img,
.book-side:hover > img,
.cover:hover img,
figure:hover img,
.gallery figure:hover img,
.title-banner:hover,
.banner-link:hover .title-banner {
  transform: scale(1.08);
  animation: none;
}

/* Sound and account stay in the header when the other chips collapse into the menu. */
.nav-keep { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-keep .hamburger { margin-left: 0 !important; }
.icon-btn, .sound-icon, .account-icon, #soundBtn, #accountChip, #accountBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 36px;
  border: 1px solid rgba(44,39,34,.16);
  background: #fbf6ee;
  cursor: pointer;
}
.icon-frame {
  position: relative;
  width: 86%;
  height: 86%;
  overflow: hidden;
  flex: 0 0 auto;
  pointer-events: none;
}
.icon-frame img {
  position: absolute;
  display: block;
  max-width: none !important;
  max-height: none !important;
  object-fit: fill;
  pointer-events: none;
}
/* Artwork fills the frame; the frame is slightly smaller than the button. */
.icon-frame img.gear { width: 138%; height: 205.6%; left: -19.1%; top: -48.8%; }
.icon-frame img.speaker-on { width: 91.8%; height: 136.8%; left: 1.9%; top: -29.3%; }
.icon-frame img.speaker-off { width: 153.1%; height: 228.1%; left: -30%; top: -62.5%; }

/* Closed slider panes stay wide enough to see between 900 and 1200, and in a tall window. */
@media (max-width: 1200px), (orientation: portrait) {
  .windows > .window:not(.is-open),
  .cast-windows > .window:not(.is-open) {
    flex: 0 0 64px !important;
    min-width: 64px !important;
    max-width: 80px !important;
  }
  .windows > .window.is-open {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
  }
}

.windows { position: relative; }
.windows.has-slider-nav { overflow: hidden; }
.slider-nav-clip {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 8;
  pointer-events: none;
}
.slider-nav-clip[hidden] { display: none !important; }
.cast-windows .cover-box > .robot-big { transition: transform 1.6s ease; animation: none; }
.cast-windows .window:not(.is-open):hover > .cover-box > .robot-big,
.cast-windows .robot-big.m1:hover,
.cast-windows .robot-big.m2:hover {
  animation: castPanelScale 1.6s ease forwards, castPanelMotion1 3.6s ease-in-out 1.6s infinite !important;
}
.slider-nav {
  position: absolute;
  top: calc(100% * 5 / 6);
  bottom: auto;
  transform: translateY(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  flex: 0 0 64px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.slider-nav-clip.prev .slider-nav { left: 0; right: auto; }
.slider-nav-clip.next .slider-nav { left: auto; right: 0; }
.slider-nav-frame {
  position: relative;
  width: 75%;
  height: 75%;
  overflow: hidden;
  pointer-events: none;
}
.slider-nav-frame img {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}
.slider-nav-frame img.arrow-back { width: 137.3%; height: 204%; left: -19.3%; top: -54.1%; }
.slider-nav-frame img.arrow-fwd { width: 137.3%; height: 204%; left: -20.3%; top: -53.4%; }

/* Home-page slider and sticker rules. Closed strips scale and return. Placed stickers bob with motion 1. */
@keyframes floaterMotion1 {
  0%, 100% { transform: translateY(0) scaleX(var(--sx, 1)) scaleY(var(--sy, 1)) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-8px) scaleX(var(--sx, 1)) scaleY(var(--sy, 1)) rotate(calc(var(--rot, 0deg) - 1deg)); }
}
.window:not(.is-open):not(.is-placeholder) .book-side > img,
.window:not(.is-open):not(.is-placeholder) .cover-frame > img,
.window:not(.is-open) > img.cover {
  transform-origin: center center;
  transition: transform 1.6s ease;
  transform: scale(1);
}
.window:not(.is-open):not(.is-placeholder):hover .book-side > img,
.window:not(.is-open):not(.is-placeholder):hover .cover-frame > img,
.window:not(.is-open):hover > img.cover,
.window.is-open .book-side:hover > img:not(.map-bg):not(.puzzle-ref),
.window.is-open .cover-frame:hover > img:not(.puzzle-ref) {
  transform: scale(1.08);
  animation: none;
}
.puzzle-ref,
.puzzle-board:hover .puzzle-ref,
.map-bg {
  transform: none !important;
}
/* One sticker panel for every page: same rail, same 56px thumbs. */
.board-col {
  background: #f7f1e6;
  border: 1px dashed #d8cbb8;
  border-radius: 18px;
  padding: 10px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 68vh;
}
.board-col .sticker-menu {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f1e6;
}
.board-col .sticker-menu select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(44,39,34,.16);
  background: #fff;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
}
#stickerThumbs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 0 1 auto;
  /* Exactly ten 64px slots. The category above this box does not scroll. */
  height: calc(10 * 64px + 9 * 6px);
  max-height: calc(10 * 64px + 9 * 6px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.board-stage > .board-col {
  overflow: hidden;
  bottom: auto;
  height: auto;
  max-height: calc(100% - 24px);
}
#stickerThumbs button.thumb,
.board-col button.thumb {
  border: none;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  cursor: grab;
  overflow: hidden;
  box-sizing: border-box;
  height: 64px;
  flex: 0 0 64px;
}
#stickerThumbs img,
.board-col button.thumb img {
  width: 100%;
  height: 56px;
  object-fit: contain;
  object-position: center center;
  transform-origin: center center;
  transition: transform 0.35s ease;
  transform: scale(1);
}
#stickerThumbs button.thumb:hover img,
.board-col button.thumb:hover img {
  transform: scale(1.12);
}
.sticker:not(.party) { overflow: visible; }
.sticker:not(.party) .sticker-spin {
  overflow: visible;
  transform-origin: center center;
  transition: transform 0.35s ease;
  transform: scale(var(--scale, 1)) rotate(var(--rot, 0deg)) scaleX(var(--flip, 1));
}
.sticker:not(.party):hover .sticker-spin,
.floater:hover .sticker-spin {
  transform: scale(calc(var(--scale, 1) * 1.12)) rotate(var(--rot, 0deg)) scaleX(var(--flip, 1));
}
.floater .sticker-spin { transition: transform 0.35s ease; }
.sticker:not(.party) .h { z-index: 8; }
.sticker:not(.party) img,
.map-piece:not(.map-decor) img {
  --sx: 1;
  --sy: 1;
  --rot: 0deg;
  transform-origin: center center;
  animation: floaterMotion1 3.6s ease-in-out infinite;
}
/* Map decorations are placed artwork, not stickers. The bob animation's transform
   was winning over hover scale and sliding these pictures around the map. */
.map-piece.map-decor,
.map-piece.map-decor .sticker-spin,
.map-piece.map-decor img {
  animation: none !important;
}
.map-piece.map-decor img,
.book-side:hover .map-piece.map-decor img,
.window:hover .map-piece.map-decor img {
  transform: none !important;
}
/* Closed strips fill their height. Sides crop; the strip box does not grow.
   Who Keeps the House robots are not in this list: a collapsed robot stays
   small and full width of its strip. */
.window:not(.is-open) > img.cover,
.window:not(.is-open) .book-side > img,
.window:not(.is-open) .cover-frame > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}
.cast-windows .window:not(.is-open) > .cover-box > .robot-big {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}
