/* Shared finish for the desk, workshop, and collection. Loaded after style.css. */
:root {
  --ink: #344338;
  --muted-ink: #65735f;
  --accent: #526b4d;
  --surface: #fffdf7;
  --hairline: #d9dfd0;
  --soft-shadow: 0 10px 30px #514c3910, 0 2px 6px #514c3907;
  -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }
body { color: var(--ink); }
main { padding-top: 24px; }
[hidden], #playView[hidden], #workshopView[hidden], #collectionView[hidden] { display: none !important; }
button { touch-action: manipulation; }
button:not(.bubble) {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
    box-shadow .18s ease, transform .18s ease;
}
button:active:not(.bubble):not(:disabled) { transform: translateY(1px) scale(.985); }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #846aa2;
  outline-offset: 4px;
}
button:disabled { cursor: default; }
.brand { letter-spacing: -.9px; }
.brand span { font-size: 9px; letter-spacing: 2.1px; color: var(--muted-ink); }
.edition { color: #687761; font-size: 10px; letter-spacing: 1.5px; }
#sound { min-width: 108px; background: #fffdf7b8; border-color: #c8d2bf; font-size: 13px; }
#sound[aria-pressed="true"] { background: #e6eddf; border-color: #acbca0; }
.intro { margin: 23px 0 24px; }
.intro h1 { font-size: clamp(38px, 4.6vw, 50px); letter-spacing: -1.9px; margin: 7px 0; }
.intro p, .collection-header p { font-size: 14px; line-height: 1.5; color: var(--muted-ink); }
.eyebrow { font-size: 10px; line-height: 1.4; letter-spacing: 1.6px; color: #667760; }

.app-nav {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  gap: 4px;
  padding: 5px;
  border: 1px solid #d9dfd1;
  border-radius: 19px;
  background: #fffcf3b3;
  box-shadow: inset 0 1px 0 #ffffffd9;
}
.app-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 125px;
  min-height: 44px;
  padding: 0 19px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05px;
  background: transparent;
  color: #6a785f;
  white-space: nowrap;
}
.app-nav button:is([aria-current="page"], [aria-selected="true"], [aria-pressed="true"], .active) {
  background: #526b4d;
  color: #fffdf7;
  box-shadow: 0 3px 7px #34472e1a, inset 0 1px 0 #ffffff20;
}
.app-nav button svg { width: 18px; height: 18px; flex-shrink: 0; }
.workspace { gap: 28px; }
.materials { gap: 7px; margin-bottom: 13px; }
.materials button { font-size: 12px; background: #fffcf5c7; border-color: #d3dbcb; }
.materials button[aria-pressed="true"] { box-shadow: 0 3px 7px #425d3620, inset 0 1px 0 #ffffff20; }
.desk-scene { border-color: #ffffffd4; box-shadow: 0 20px 42px #7760431c, 0 4px 10px #77604309, inset 0 1px 0 #fff9; }
.desk-top { font-size: 10px; letter-spacing: 1.4px; }
.desk-caption { color: #726047; font-size: 14px; }
.tray-head { font-size: 10px; letter-spacing: .7px; }
.tray-foot { font-size: 11px; line-height: 1.35; min-height: 25px; }
#saved { font-size: 9px; letter-spacing: .25px; }
footer { color: #617358; font-size: 12px; }
#reset { padding-left: 0; font-size: 12px; min-height: 44px; }
.hint { color: #687961; font-size: 11px; line-height: 1.4; }
.builder { background: #fffdf7bd; border-color: #ffffffeb; box-shadow: var(--soft-shadow); }
.builder-heading h2 { font-size: 31px; margin-bottom: 20px; }
legend { font-size: 10px; color: #738166; }
legend span { font-size: 13px; color: #52634b; }
.switches strong { font-size: 13px; font-weight: 600; }
.switches small { font-size: 10px; color: #66765b; line-height: 1.35; }
.switches button { padding: 12px 3px 9px; }
.switches button[aria-pressed="true"] { box-shadow: 0 0 0 1px #90a47c30, 0 4px 8px #5d74480a; }
.preview-sound { font-size: 12px; color: #526e45; }
.swatches button { font-size: 11px; color: #56664d; gap: 9px; padding: 7px 3px; }
.swatches i { width: 31px; height: 31px; }
.chips button { font-size: 12px; }
.glow-control { font-size: 12px; color: #657657; }
.glow-control output { width: 34px; font-size: 11px; }
.preset-title > span { font-size: 11px; color: #647951; }
#presetName { min-height: 44px; font-size: 13px; }
#presetName::placeholder { color: #7b8771; }
#presetForm button { font-size: 12px; }
#presetStatus { font-size: 11px; color: #687b5a; line-height: 1.55; }
.preset-load strong { font-size: 13px; }
.preset-load small { font-size: 10px; color: #657659; line-height: 1.4; }
.preset-delete { color: #607453; flex-shrink: 0; }
.page-note { font-size: 13px; line-height: 1.5; color: #718362; margin-top: 24px; }
.mobile-jump, .back-to-keys { display: none !important; }
#customizeDesk, #closeCustomizer, .sheet-backdrop { display: none; }

#workshopView, #collectionView { min-height: 480px; }
.workshopMount { margin: 26px auto 0; }
.collection-header { max-width: 550px; margin: 34px auto 27px; text-align: center; }
.collection-header h1 { font-size: clamp(36px, 4.6vw, 49px); letter-spacing: -1.8px; margin: 9px 0 12px; }
.collection-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  margin-top: 12px;
  padding: 5px 12px;
  border: 1px solid #d2ddc8;
  border-radius: 20px;
  background: #e8efdfc9;
  color: #5b724c;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 900px; margin: 0 auto; }
.collectible-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px 20px;
  text-align: left;
  border: 1px solid #ffffffed;
  border-radius: 25px;
  background: linear-gradient(145deg, #fffef9e0, #f5f4eab8);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}
.collectible-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 17px;
  margin-bottom: 13px;
  background: radial-gradient(ellipse at 50% 52%, #e9ecdf9c, #faf8f000 72%);
  pointer-events: none;
}
.collectible-card .item-tag { display: block; font-size: 10px; font-weight: 600; letter-spacing: 1.1px; line-height: 1.5; text-transform: uppercase; color: #6f845d; }
.collectible-card .item-name { display: block; margin-top: 6px; color: #3c5035; font: 24px/1.15 Georgia, serif; letter-spacing: -.5px; }
.collectible-card .item-caption { display: block; margin-top: 7px; font-size: 12px; line-height: 1.5; color: #68775e; }
.collectible-card.locked { background: #f7f5edb3; border-color: #e4e6da; box-shadow: 0 3px 9px #514c3905; }
.collectible-card.locked img { opacity: .52; filter: grayscale(.8) saturate(.4); }
.collectible-card.locked .item-tag { color: #7b7c71; }
.collectible-card.locked .item-name { color: #65705d; }
.collectible-card.locked .item-caption { color: #737b6b; }
dialog { width: min(450px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; border-color: #ffffffed; box-shadow: 0 28px 100px #26362d40, 0 3px 14px #26362d15; }
dialog p { font-size: 14px; line-height: 1.6; color: #65755e; }
dialog h2 { font-size: 34px; line-height: 1.1; }
dialog::backdrop { background: #27372e69; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#collectionModel { height: 300px; width: 100%; position: relative; isolation: isolate; border-radius: 21px; background: radial-gradient(ellipse at 50% 53%, #e7ecdd, #f4f7ee00 70%); overflow: hidden; }
#collectionModel canvas { position: relative; display: block; inset: auto; max-width: 100%; height: 100%; touch-action: pan-y; }
#collectionName { margin: 6px 0 12px; }
#collectionDescription { max-width: 330px; margin: 0 auto 20px; }
#placeCollectible, #unlockContinue, #unlockShelf, #closeCollection {
  display: block;
  min-height: 48px;
  width: 100%;
  border-radius: 15px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
}
#placeCollectible, #unlockContinue { margin-top: 14px; color: #fffdf5; background: #526b4d; box-shadow: 0 3px 8px #40553619, inset 0 1px 0 #ffffff20; }
#closeCollection, #unlockShelf { margin-top: 8px; color: #607551; background: transparent; border: 1px solid #dce4d3; }
.unlock-art { display: grid; place-items: center; height: 245px; max-width: 300px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, #e8eddd, #f4f7ee00 70%); }
.unlock-art img { width: 100%; height: 100%; max-height: 245px; object-fit: contain; filter: drop-shadow(0 15px 15px #54704319); }
#unlockName { margin-top: 10px; }

@media (hover: hover) and (pointer: fine) {
  .app-nav button:not(:is([aria-current="page"], [aria-selected="true"], [aria-pressed="true"], .active)):hover { background: #e9eedf; color: #405d36; }
  .materials button:not([aria-pressed="true"]):hover, .chips button:not([aria-pressed="true"]):hover, .switches button:not([aria-pressed="true"]):hover { border-color: #aabb97; background: #f9fcf3; }
  .collectible-card:not(.locked):hover { transform: translateY(-3px); box-shadow: 0 16px 34px #514c3918, 0 3px 7px #514c390a; border-color: #c7d4bb; }
  #placeCollectible:hover, #unlockContinue:hover { background: #425d3c; }
}

@media (max-width: 900px) and (min-width: 761px) {
  main { padding-left: 22px; padding-right: 22px; }
  .workspace { gap: 19px; grid-template-columns: minmax(0, 1.15fr) minmax(290px, 1fr); }
  .desk-scene { padding-left: 17px; padding-right: 17px; }
  .builder { padding: 23px 18px; }
}

@media (max-width: 760px) {
  main { max-width: 540px; padding: 16px 14px calc(100px + env(safe-area-inset-bottom, 0px)); }
  header { gap: 12px; min-height: 44px; }
  .brand { font-size: 24px; }
  .brand span { margin-top: 4px; font-size: 8px; letter-spacing: 1.7px; }
  #sound { min-width: 98px; padding: 0 13px; font-size: 12px; }
  .intro { margin: 19px 0 17px; }
  .intro h1 { font-size: 39px; line-height: 1.1; letter-spacing: -1.7px; margin: 7px 0; }
  .intro p { font-size: 12px; margin: 7px 0 0; }
  .eyebrow { font-size: 9px; letter-spacing: 1.35px; }
  .app-nav {
    position: fixed;
    z-index: 60;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px max(14px, calc((100vw - 500px) / 2)) calc(10px + env(safe-area-inset-bottom, 0px));
    background: #f9f8eff2;
    border: 0;
    border-top: 1px solid #d7dfcda6;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -7px 27px #3e50340d;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .app-nav button { min-width: 0; min-height: 48px; padding: 0 6px; border-radius: 14px; font-size: 12px; gap: 6px; }
  .materials { gap: 5px; margin-bottom: 10px; }
  .materials button { min-height: 44px; font-size: 11px; border-radius: 13px; }
  .materials i { width: 6px; height: 6px; margin-right: 4px; }
  .desk-scene { padding: 15px 13px 12px; border-radius: 25px; }
  .desk-top { font-size: 9px; letter-spacing: 1.1px; }
  .desk-props { height: 53px; margin-bottom: 5px; transform: scale(.77); transform-origin: 50% 25%; }
  .toy { padding: 13px 7px 10px; border-radius: 21px; }
  .tray-head { font-size: 9px; letter-spacing: .35px; padding: 0 5px; }
  .tray-foot { font-size: 10px; min-height: 24px; padding-left: 4px; padding-right: 4px; }
  #saved { font-size: 8px; }
  #board { min-height: 308px; }
  .desk-caption { font-size: 12px; line-height: 1.35; padding-top: 12px; }
  .hint { font-size: 11px; margin-top: 0; margin-bottom: 0; }
  .volume { gap: 7px; }
  footer { font-size: 11px; padding-top: 2px; }
  #reset { font-size: 12px; }
  #customizeDesk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin: 11px 0 3px;
    padding: 0 16px;
    border: 1px solid #c7d4bb;
    border-radius: 15px;
    background: #fcfff5aa;
    color: #526d44;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 8px #53664105;
  }
  #deskBuilder {
    display: block;
    position: fixed;
    z-index: 90;
    bottom: 0;
    left: 50%;
    width: min(560px, 100%);
    max-height: 80svh;
    margin: 0;
    padding: 22px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 28px 28px 0 0;
    border: 1px solid #ffffff;
    border-bottom: 0;
    background: #fbfaf3;
    box-shadow: 0 -18px 70px #27372d24;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 105%);
    transition: transform .3s cubic-bezier(.22, .72, .25, 1), visibility .3s;
  }
  #deskBuilder::before { content: ''; display: block; width: 34px; height: 4px; border-radius: 8px; background: #d2d9c8; margin: -8px auto 21px; }
  #closeCustomizer { display: grid; place-items: center; position: absolute; top: 15px; right: 15px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; background: #e9edde; color: #536a47; font-size: 13px; }
  #deskBuilder .builder-heading { padding-right: 31px; }
  #deskBuilder .builder-heading > span { display: none; }
  #deskBuilder .builder-heading h2 { margin-top: 7px; font-size: 32px; }
  #deskBuilder .switches strong { font-size: 14px; }
  #deskBuilder .switches small { font-size: 11px; }
  #presetName { font-size: 16px; }
  .sheet-backdrop { position: fixed; z-index: 80; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0; background: #27372e59; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); cursor: default; }
  body.customizing { overflow: hidden; }
  body.customizing #deskBuilder { visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
  body.customizing .sheet-backdrop { display: block; }
  body.customizing .sheet-backdrop:active { transform: none; }
  .page-note { font-size: 12px; margin: 20px 0 0; }
  .workshopMount { margin-top: 22px; }
  #workshopView, #collectionView { min-height: 0; }
  .collection-header { margin: 27px auto 23px; padding: 0 8px; }
  .collection-header h1 { font-size: 37px; line-height: 1.12; letter-spacing: -1.5px; }
  .collection-header p { font-size: 13px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .collectible-card { border-radius: 21px; padding: 10px 12px 16px; }
  .collectible-card img { margin-bottom: 9px; border-radius: 14px; }
  .collectible-card .item-name { font-size: 22px; }
  .collectible-card .item-tag { font-size: 9px; letter-spacing: .8px; }
  .collectible-card .item-caption { font-size: 11px; line-height: 1.5; margin-top: 6px; }
  dialog { padding: 18px 18px 23px; border-radius: 27px; }
  #collectionModel { height: 270px; }
  dialog h2 { font-size: 32px; }
  .unlock-art { height: 225px; }
  .unlock-art img { max-height: 225px; }
}

@media (max-width: 360px) {
  main { padding-left: 8px; padding-right: 8px; }
  .brand { font-size: 22px; }
  .brand span { margin-left: 22px; font-size: 7px; letter-spacing: 1.5px; }
  #sound { min-width: 89px; padding: 0 10px; }
  .intro { margin-top: 17px; }
  .intro h1 { font-size: 36px; }
  .intro p { font-size: 11px; }
  .materials button { font-size: 11px; padding: 0 3px; }
  .materials i { margin-right: 3px; }
  .desk-scene { padding-left: 7px; padding-right: 7px; }
  .toy { padding-left: 5px; padding-right: 5px; }
  .tray-head { font-size: 9px; }
  .tray-foot { font-size: 9px; gap: 4px; }
  #saved { font-size: 8px; }
  .app-nav { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .app-nav button { font-size: 11px; gap: 4px; }
  #deskBuilder { padding-left: 18px; padding-right: 18px; }
  #deskBuilder .switches small { font-size: 10px; }
  .collection-grid { gap: 9px; }
  .collectible-card { padding-left: 10px; padding-right: 10px; }
  .collectible-card .item-name { font-size: 20px; }
  .collection-header h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button:active:not(.bubble):not(:disabled), .collectible-card:not(.locked):hover { transform: none; }
  #deskBuilder { transition: none; }
}

/* Finished workshop palettes sit beside the original colors. */
.swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px 5px; }
.swatches button { min-height: 64px; min-width: 44px; padding-left: 0; padding-right: 0; }
.swatches button span { line-height: 1.25; white-space: nowrap; }
