:root {
  --room: #4A0D0D;
  --amber: #FCD34D;
  --carcass: #A5D6E7;
  --carcass-border: #91C7DC;
  --carcass-foot: #7CB4C9;
  --tray-rim: #C29655;
  --gold: #D4AF37;
  --chest-max: 520px;
  --row-h: 64px;
  --gap: 8px;
  --carcass-pad: 10px;
  --carcass-bw: 4px;
  --floor-h: 176px;
  --crown-h: 24px;
  --crown-overhang: 8px;
  --decor-h: 88px;
  --plinth-h: 40px;
  --scene-pad: 8px;
  --badge-h: 110px;
  --tray-h: 350px;
  --tray-rim-w: 4px;
}

@media (min-width: 640px) {
  :root {
    --chest-max: 600px;
    --row-h: 80px;
    --gap: 10px;
    --carcass-pad: 14px;
    --carcass-bw: 6px;
    --floor-h: 192px;
    --crown-h: 28px;
    --crown-overhang: 12px;
    --decor-h: 104px;
    --plinth-h: 48px;
    --scene-pad: 24px;
    --badge-h: 100px;
    --tray-h: 480px;
    --tray-rim-w: 12px;
  }
}

@media (min-width: 768px) {
  :root {
    --chest-max: 660px;
    --row-h: 88px;
    --decor-h: 112px;
    --tray-h: 520px;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--room);
  color: #fff;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }

body.locked { overflow: hidden; }

:where(button, a, input, textarea, select, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
:where(.plant, .cat, .glass-books, .bobble):focus-visible { border-radius: 6px; }

.label {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: none;
}

.scene {
  position: relative;
  min-height: max(100vh, 700px);
  min-height: max(100dvh, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--room);
}

.wall {
  position: absolute;
  inset: 0 0 var(--floor-h) 0;
  box-shadow: inset 0 -3px 0 #2F0707;
  background:
    radial-gradient(425px 310px at 50% 0, rgba(254, 243, 199, .12), rgba(253, 230, 138, .04) 50%, transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 .08'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 1.4px, transparent 1.4px 5.66px),
    radial-gradient(circle 45vmax at 20% 30%, rgba(255, 180, 160, .10), transparent),
    radial-gradient(circle 50vmax at 75% 25%, rgba(255, 160, 140, .08), transparent),
    radial-gradient(circle 60vmax at 50% 65%, rgba(0, 0, 0, .14), transparent),
    radial-gradient(circle 45vmax at 85% 80%, rgba(255, 140, 120, .06), transparent),
    radial-gradient(circle 50vmax at 10% 85%, rgba(0, 0, 0, .15), transparent),
    linear-gradient(#5C1010, #4F0C0C, #420909);
}

.watermark {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  user-select: none;
}
.watermark-big {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;
  color: rgba(254, 243, 199, .11);
}
.watermark-small {
  font-weight: 400;
  font-size: 9px;
  letter-spacing: .5em;
  color: rgba(253, 230, 138, .16);
  transform: translateY(-4px);
}

.skirting {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--floor-h);
  height: 16px;
  border-top: 1px solid #542D19;
  background: linear-gradient(#2E180D, #3D2012, #1F0F08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .65);
  z-index: 1;
}
.skirting::before,
.skirting::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
}
.skirting::before { top: 0; background: rgba(253, 230, 138, .2); }
.skirting::after { bottom: 0; background: rgba(0, 0, 0, .5); }

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--floor-h);
  background:
    radial-gradient(360px 64px at 50% 6px, rgba(253, 230, 138, .12), rgba(245, 158, 11, .05) 50%, transparent),
    linear-gradient(rgba(0, 0, 0, .55), rgba(120, 53, 15, .1), rgba(69, 26, 3, .4)),
    url("../assets/parquet.svg") 0 0 / 480px 144px;
}

.floor::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(90%, 660px);
  height: 56px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, .9);
  filter: blur(22px);
}
.floor-credit {
  position: absolute;
  left: 20px;
  bottom: 16px;
  margin: 0;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .2em;
  color: rgba(254, 243, 199, .32);
}

.floor-note {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 34px;
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1.3;
  color: rgba(254, 243, 199, .4);
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle closest-side, transparent 104%, rgba(0, 0, 0, .35) 190%);
}

@media (min-width: 640px) {
  .watermark-big { font-size: 92px; }
  .watermark-small { font-size: 11px; transform: translateY(-8px); }
  .floor-credit { left: 40px; }
  .floor-note { left: 40px; right: 40px; }
}

@media (min-width: 900px) {
  .floor-note { left: auto; right: 40px; bottom: 13px; max-width: 46%; text-align: right; }
}
@media (min-width: 768px) {
  .watermark-big { font-size: 120px; }
}

.scene-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 12px;
}
.wordmark { flex: 1; min-width: 0; margin-right: 2px; display: flex; align-items: center; gap: 10px; }
.wordmark-text { min-width: 0; }

.wordmark-logo { flex: none; width: 36px; height: 36px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
@media (min-width: 640px) { .wordmark-logo { width: 44px; height: 44px; } .wordmark { gap: 14px; } }
.wordmark-tag {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .6);
  white-space: nowrap;
}
@media (min-width: 640px) { .wordmark-tag { font-size: 11px; } }

.chrome-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 3px),
    linear-gradient(112deg, rgba(255, 246, 214, 0) 30%, rgba(255, 246, 214, .4) 46%, rgba(255, 246, 214, 0) 60%),
    linear-gradient(180deg, #E2C47E 0%, #C9A45C 38%, #B08A42 70%, #C59F55 100%);
  background-size: auto, 220% 100%, auto;
  background-position: 0 0, 100% 0, 0 0;
  color: #3A2A10;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 210, .8),
    inset 0 -1.5px 0 rgba(90, 62, 20, .55),
    inset 0 0 0 1px rgba(110, 78, 28, .55),
    0 1px 0 rgba(0, 0, 0, .35),
    0 6px 14px rgba(0, 0, 0, .45);
  transition: background-position .5s ease, transform .12s, box-shadow .12s;
}

.chrome-btn .icon {
  font-size: 16px;
  color: #3A2A10;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .55), 0 -.5px 0 rgba(60, 40, 10, .35);
}
.chrome-btn:hover { background-position: 0 0, 0 0, 0 0; }
.chrome-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(70, 48, 14, .45),
    inset 0 0 0 1px rgba(110, 78, 28, .6),
    0 1px 0 rgba(0, 0, 0, .3),
    0 3px 6px rgba(0, 0, 0, .35);
}
.chrome-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

@media (hover: hover) {
  .chrome-btn[data-tip]::after,
  .chrome-btn[data-tip]::before {
    position: absolute;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
  }
  .chrome-btn[data-tip]::after {
    content: attr(data-tip);
    top: calc(100% + 9px);
    padding: 5px 10px 4px;
    border-radius: 2px;
    background: #F3ECDD;
    color: #2C1D11;
    font-family: var(--serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
    transform: translate(-50%, -3px);
  }
  .chrome-btn[data-tip]::before {
    content: '';
    top: calc(100% + 5px);
    border: 4px solid transparent;
    border-bottom-color: #F3ECDD;
    border-top: 0;
    transform: translate(-50%, -3px);
  }
  .chrome-btn[data-tip]:hover::after,
  .chrome-btn[data-tip]:hover::before,
  .chrome-btn[data-tip]:focus-visible::after,
  .chrome-btn[data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); transition-delay: .12s; }

  #btn-guide[data-tip]::after { left: auto; right: -6px; transform: translateY(-3px); }
  #btn-guide[data-tip]:hover::after, #btn-guide[data-tip]:focus-visible::after { transform: none; }
}

.chrome-btn .die { width: 17px; height: 17px; color: #3A2A10; filter: drop-shadow(0 1px 0 rgba(255, 240, 200, .55)); }
.chrome-btn.muted .icon { opacity: .55; }

.chrome-btn.circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(90, 62, 20, .35) 60%, rgba(255, 240, 200, .35) 64%, transparent 67%),
    radial-gradient(circle at 35% 30%, #F1D891 0%, #D2AE62 35%, #B08A42 70%, #9A7535 100%);
}
.chrome-btn.circle:hover { background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(90, 62, 20, .35) 60%, rgba(255, 240, 200, .35) 64%, transparent 67%),
    radial-gradient(circle at 40% 28%, #F7E3A6 0%, #D9B66A 35%, #B8914A 70%, #A07A38 100%); }

@media (min-width: 640px) {
  .header { gap: 12px; padding: max(20px, env(safe-area-inset-top)) 32px 20px; }
  .chrome-btn.circle { width: 36px; height: 36px; }
  .chrome-btn .icon { font-size: 18px; }
  .chrome-btn .die { width: 19px; height: 19px; }
}

.cabinet-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px var(--scene-pad) 120px;
}
@media (min-width: 640px) { .cabinet-wrap { padding-bottom: 80px; } }

.chest {
  position: relative;
  width: 100%;
  max-width: var(--chest-max);
}

.badge-slot {
  position: relative;
  z-index: 4;
  height: var(--badge-h);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 170px;
  max-width: 440px;
  margin: 0 12px;
  padding: 9px 34px 10px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 3px),
    linear-gradient(112deg, rgba(255, 246, 214, 0) 30%, rgba(255, 246, 214, .45) 46%, rgba(255, 246, 214, 0) 60%),
    linear-gradient(180deg, #E2C47E 0%, #C9A45C 38%, #B08A42 70%, #C59F55 100%);
  color: #3A2A10;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 210, .8),
    inset 0 -1.5px 0 rgba(90, 62, 20, .55),
    inset 0 0 0 1px rgba(110, 78, 28, .55),
    0 1px 0 rgba(0, 0, 0, .35),
    0 10px 22px rgba(0, 0, 0, .55);
  animation: badge-in .17s ease-out;
}
.badge.leaving { animation: badge-out .17s ease-in forwards; }

.badge-screw {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F3DE9F, #9C7733 75%);
  box-shadow: inset 0 0 0 .5px rgba(70, 48, 14, .6), 0 .5px 0 rgba(255, 240, 200, .5);
}
.badge-screw::after {
  content: '';
  position: absolute;
  left: 1.5px;
  right: 1.5px;
  top: 4px;
  height: 1px;
  background: rgba(60, 40, 12, .7);
  transform: rotate(-35deg);
}
.badge-screw.l { left: 11px; }
.badge-screw.r { right: 11px; }
.badge-screw.r::after { transform: rotate(20deg); }

.badge-name, .badge-title { text-shadow: 0 1px 0 rgba(255, 240, 200, .55), 0 -.5px 0 rgba(60, 40, 10, .35); }
.badge-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  line-height: 1.2;
}
.badge-title {
  margin-top: 1px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.15;
  color: #4E3A16;
}
@media (min-width: 640px) {
  .badge { min-width: 200px; padding: 11px 40px 12px; }
  .badge-name { font-size: 15px; }
  .badge-title { font-size: 17px; }
  .badge-screw.l { left: 13px; }
  .badge-screw.r { right: 13px; }
}
@keyframes badge-in { from { opacity: 0; transform: translateY(16%); } }
@keyframes badge-out { to { opacity: 0; transform: translateY(16%); } }

.crown {
  position: relative;
  height: var(--crown-h);
  margin: 0 calc(var(--crown-overhang) * -1);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, #C9A762, #E2C17B, #B8954E);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .25);
  border-top: 2px solid #FFD791;
  border-bottom: 1px solid rgba(255, 215, 145, .6);
}
.crown::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 4px;
  background: rgba(140, 102, 35, .3);
}

.carcass {
  position: relative;
  z-index: 1;
  padding: var(--carcass-pad);
  background:
    repeating-linear-gradient(90deg, rgba(91, 157, 181, .15) 0 1px, transparent 1px 12px),
    var(--carcass);
  border: var(--carcass-bw) solid var(--carcass-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .85);
}
.drawer-row {
  display: flex;
  gap: var(--gap);
  height: var(--row-h);
}
.drawer-row + .drawer-row { margin-top: var(--gap); }

.drawer {
  position: relative;
  flex: var(--span) 1 0;
  min-width: 0;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.drawer:focus-visible .face { outline: 2px solid var(--amber); outline-offset: 2px; }

.drawer-move {
  position: absolute;
  inset: 0;
  transform: perspective(1200px);
  transition: transform .26s cubic-bezier(.33, 1, .68, 1);
}
.drawer.active .drawer-move,
.drawer.selected .drawer-move {
  transform: perspective(1200px) translate3d(0, -5px, 28px) rotateX(3deg) scale(1.02);
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: var(--frame);
  border-top: 1px solid rgba(255, 255, 255, .2);
  border-bottom: 1px solid rgba(0, 0, 0, .3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: box-shadow .26s;
}
.drawer.active .face,
.drawer.selected .face { box-shadow: 0 16px 30px -5px rgba(0, 0, 0, .7); }

.box-side {
  position: absolute;
  opacity: 0;
  transition: opacity .2s ease-in;
}
.drawer.active .box-side,
.drawer.selected .box-side { opacity: 1; }
.box-top {
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  display: flex;
  justify-content: space-evenly;
  transform-origin: bottom center;
  transform: perspective(1200px) rotateX(-60deg);
  background: linear-gradient(to top, #C49A5B, #DEB97A);
  border: .6px solid #9E763A;
  border-radius: 2px 2px 0 0;
}
.box-top i { width: 8px; background: rgba(130, 92, 39, .4); }
.box-left,
.box-right {
  top: 0;
  bottom: 0;
  width: 10px;
  border: .6px solid #735021;
}
.box-left {
  left: -10px;
  border-right: 0;
  transform-origin: center right;
  transform: perspective(1200px) rotateY(60deg);
  background: linear-gradient(90deg, #946E37, #BFA16B);
}
.box-right {
  right: -10px;
  border-left: 0;
  transform-origin: center left;
  transform: perspective(1200px) rotateY(-60deg);
  background: linear-gradient(270deg, #946E37, #BFA16B);
}

.panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88%;
  height: 78%;
}
.panel-plain {
  width: 80%;
  height: 80%;
  background: #F7F6F2;
  border: 1px solid #D6D3D1;
  border-radius: 2px;
}
.panel-scalloped {
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.panel-scalloped::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px dashed color-mix(in srgb, var(--bd) 30%, transparent);
  border-radius: 3px;
}
.corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--bd);
}
.corner.tl { top: -7px; left: -7px; }
.corner.tr { top: -7px; right: -7px; }
.corner.bl { bottom: -7px; left: -7px; }
.corner.br { bottom: -7px; right: -7px; }

.panel-pattern {
  border: 2px solid var(--bd);
  border-radius: 4px;
  overflow: hidden;
}
.panel-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 2px;
  box-shadow: inset 0 2px 8px 2px rgba(0, 0, 0, .6);
}
.pattern-harlequin {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='24'%3E%3Crect width='20' height='24' fill='%23EDE1D8'/%3E%3Cpath d='M10 0L20 6 10 12 0 6Z' fill='%23582B3D'/%3E%3Cpath d='M10 12L20 18 10 24 0 18Z' fill='%2344212E'/%3E%3Cpath d='M0 6H20M10 0V24' stroke='%23D5C4B8' stroke-width='.5'/%3E%3C/svg%3E");
}
.pattern-plaid {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='32' height='32' fill='%239DB4A8'/%3E%3Cg fill='%236F857A' fill-opacity='.75'%3E%3Crect y='8' width='32' height='8'/%3E%3Crect x='8' width='8' height='32'/%3E%3C/g%3E%3Cpath d='M0 12H32M12 0V32' stroke='%23fff' stroke-opacity='.85' stroke-width='1.2'/%3E%3Cpath d='M0 4H32M4 0V32' stroke='%23E0E8E4' stroke-opacity='.6' stroke-width='.6'/%3E%3C/svg%3E");
}
.pattern-floral {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%232D1C14'/%3E%3Ccircle cx='10' cy='10' r='4.5' fill='%23D99B26'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%238F391A'/%3E%3Ccircle cx='30' cy='30' r='5' fill='%23B84337'/%3E%3Ccircle cx='30' cy='30' r='2' fill='%23FCD34D'/%3E%3Cpath d='M14 10Q20 6 22 14Q16 16 14 10ZM26 30Q20 34 18 26Q24 24 26 30Z' fill='%23587D54'/%3E%3Ccircle cx='32' cy='12' r='3' fill='%232DD4BF'/%3E%3Ccircle cx='8' cy='28' r='3' fill='%2338BDF8'/%3E%3Ccircle cx='20' cy='20' r='1.5' fill='%23FED7AA'/%3E%3Ccircle cx='3' cy='3' r='1' fill='%23FED7AA'/%3E%3C/svg%3E");
}
.panel-buttercream {
  background: linear-gradient(#FAECAA, #DED089);
  border: 1px solid #B8A65A;
  border-radius: 4px;
}
.panel-library {
  background: linear-gradient(#8F2323, #691616);
  border: 1px solid #521313;
  border-radius: 4px;
}

.hw {
  position: relative;
  flex: none;
  transition: transform .3s ease-out, box-shadow .3s ease-out;
}

.hw-ring { display: flex; flex-direction: column; align-items: center; }
.ring-plate {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #292524;
  border: 1px solid #57534E;
}
.ring-plate i { width: 6px; height: 6px; border-radius: 50%; background: #1C1917; }
.ring {
  width: 18px;
  height: 24px;
  margin-top: -4px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  transform-origin: top center;
  transition: transform .3s ease-out;
}
.drawer.active .ring { transform: rotate(-12deg) scale(1.05); }

.hw-bin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--w);
  height: var(--h);
  background: linear-gradient(var(--g1), var(--g2), var(--g3));
  border: 1px solid var(--bd);
  border-radius: var(--h) var(--h) 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .28);
}
.groove {
  width: var(--gw);
  height: 5px;
  margin-top: 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--groove) 45%, transparent);
}
.screw {
  position: absolute;
  top: calc(var(--h) * .45 - 1px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--screw);
  border: .5px solid rgba(0, 0, 0, .35);
}
.screw.l { left: 2px; }
.screw.r { right: 2px; }
.drawer.active .hw-bin { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }

.hw-ornate {
  width: 60px;
  height: 24px;
  overflow: visible;
  filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .33));
}
.drawer.active .hw-ornate { transform: scale(1.1); }

.hw-knob {
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g1), var(--g2), var(--g3));
  border: 1px solid var(--bd);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.hw-knob .hl {
  position: absolute;
  top: calc(var(--size) * .12 - 1px);
  left: calc(var(--size) * .22 - 1px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hl);
}
.hw-knob .core { width: 6px; height: 6px; border-radius: 50%; background: var(--core); }
.drawer.active .hw-knob { transform: scale(1.16); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }

.hw-ribbed {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #52525B, #27272A, #09090B);
  border: 1px solid #18181B;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
}
.hw-ribbed span {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #78716C;
}
.hw-ribbed i { width: 6px; height: 6px; border-radius: 50%; background: #D6D3D1; }
.drawer.active .hw-ribbed { transform: scale(1.16); box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }

.hw-brass {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 24px;
  padding: 2px;
  background: linear-gradient(#E6CA65, #C49E35, #8C6B1B);
  border: 1px solid #63490B;
  border-radius: 3px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .25);
}
.brass-label {
  display: grid;
  place-items: center;
  width: 40px;
  height: 10px;
  background: #F5EBD2;
  border: .5px solid #8C6B1B;
  border-radius: 1px;
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.4px;
  color: #4D3609;
}
.brass-slot { width: 28px; height: 6px; background: #5E4407; border-radius: 0 0 2px 2px; }
.drawer.active .hw-brass { transform: scale(1.1); box-shadow: 0 2px 9px rgba(0, 0, 0, .4); }

.plinth {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: var(--plinth-h);
  margin: 0 -4px;
  padding: 0 12px;
  background: var(--carcass);
  border-top: 2px solid #80B9CE;
}
.foot {
  flex: none;
  width: 64px;
  height: 36px;
  transform: translateY(8px);
  background: var(--carcass);
  border-bottom: 4px solid var(--carcass-foot);
  border-left: 2px solid var(--carcass-foot);
  border-radius: 0 0 16px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
}
.foot-right {
  border-left: 0;
  border-right: 2px solid var(--carcass-foot);
  border-radius: 0 0 0 16px;
}
.arch {
  flex: 1;
  height: 16px;
  margin: 0 16px;
  overflow: visible;
  fill: none;
  stroke: rgba(124, 180, 201, .4);
  stroke-width: 2;
}
.arch path { vector-effect: non-scaling-stroke; }
@media (min-width: 640px) {
  .foot { width: 80px; height: 44px; }
  .arch { height: 20px; }
}

.decor {
  --s: 1;
  --gw: 20px;
  position: relative;
  z-index: 3;
  height: var(--decor-h);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
}
@media (min-width: 640px) {
  .decor { --s: 1.2; --gw: 24px; padding: 0 32px; }
}

.plant {
  position: relative;
  flex: none;
  pointer-events: auto;
  width: calc(60px * var(--s));
  height: calc(100px * var(--s));
}

.pesce-vase {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: calc(64px * var(--s));
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
  user-select: none;
  -webkit-user-drag: none;
}

.sunflowers {
  position: absolute;
  left: 50%;
  bottom: calc(50px * var(--s));
  width: calc(96px * var(--s));
  height: auto;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
  user-select: none;
  -webkit-user-drag: none;
}

.cat {
  position: relative;
  flex: none;
  width: 56px;
  height: 44px;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(var(--cat-x, 0px));
  transition: transform .4s ease-out;
}
.decor[data-phase='walking'] .cat { transition: transform 2s ease-in-out; }
.decor[data-phase='walkingBack'] .cat { transition: transform 1.8s ease-out; }
.cat-flip, .cat-bob { position: relative; width: 100%; height: 100%; }
.decor[data-phase='walkingBack'] .cat-flip { transform: scaleX(-1); }
.decor[data-phase='walking'] .cat-bob,
.decor[data-phase='walkingBack'] .cat-bob { animation: cat-bob .35s linear infinite; }

.leg {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 16px;
  border-radius: 0 0 6px 6px;
  background: #1C1917;
  transform-origin: top center;
  transition: transform .2s, bottom .2s;
}
.leg-far-hind { left: 6px; background: #292524; }
.leg-far-fore { right: 26px; background: #292524; }
.leg-near-hind { left: 14px; }
.paw { right: 18px; }
.decor[data-phase='walking'] .leg-a,
.decor[data-phase='walkingBack'] .leg-a { animation: gait-a .35s linear infinite alternate; }
.decor[data-phase='walking'] .leg-b,
.decor[data-phase='walkingBack'] .leg-b { animation: gait-b .35s linear infinite alternate; }
.decor[data-phase='pawing'] .paw,
.decor[data-phase='falling'] .paw {
  bottom: 4px;
  animation: swat .5s ease-in-out infinite alternate;
}

.tail {
  position: absolute;
  left: 0;
  bottom: 16px;
  width: 16px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: #1C1917;
  stroke-width: 2.4;
  stroke-linecap: round;
  transform-origin: bottom right;
  animation: tail-idle .5s ease-in-out infinite alternate;
}
.decor[data-phase='pawing'] .tail,
.decor[data-phase='falling'] .tail { animation-name: tail-wild; }
.decor[data-phase='shattered'] .tail { animation-name: tail-proud; }

.cat-body {
  position: absolute;
  left: 4px;
  bottom: 10px;
  width: 42px;
  height: 20px;
  border-radius: 20px;
  background: linear-gradient(90deg, #1C1917, #292524, #1C1917);
  border: 1px solid #292524;
}
.cat-head {
  position: absolute;
  right: 0;
  top: 0;
  width: 22px;
  height: 22px;
  overflow: visible;
  transition: transform .25s ease-out;
}
.decor[data-phase='pawing'] .cat-head { transform: rotate(12deg); }
.decor[data-phase='falling'] .cat-head { transform: rotate(24deg); }
.decor[data-phase='shattered'] .cat-head { transform: translateY(2px) rotate(32deg); }

.cat-eyes, .cat-eyes-happy, .cat-blush { transition: opacity .2s; }
.cat-eyes-happy, .cat-blush { opacity: 0; }
.cat.petted .cat-eyes { opacity: 0; }
.cat.petted .cat-eyes-happy { opacity: 1; }
.cat.petted .cat-blush { opacity: .55; }
.cat.petted .cat-head { transform: translate(-1px, 2px) rotate(-14deg); }
.cat.petted .cat-body { animation: cat-purr .09s linear infinite alternate; }
.cat.petted .tail { animation: tail-happy 1.1s ease-in-out infinite alternate; }
.cat.petted .cat-bob { animation: cat-lean 1.6s ease-in-out infinite; }
@keyframes cat-purr { to { transform: translateY(-.6px); } }
@keyframes tail-happy { from { transform: rotate(14deg); } to { transform: rotate(32deg); } }
@keyframes cat-lean { 50% { transform: translateY(1.5px) scaleY(.97); } }
.cat-heart {
  position: absolute;
  top: -2px;
  left: var(--hx, 40px);
  font-size: var(--hs, 11px);
  font-style: normal;
  line-height: 1;
  color: #FB7185;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  animation: cat-heart 1.5s ease-out forwards;
}
@keyframes cat-heart {
  0% { opacity: 0; transform: translate(0, 4px) scale(.4); }
  20% { opacity: 1; transform: translate(calc(var(--hd, 0px) * .3), -6px) scale(1); }
  100% { opacity: 0; transform: translate(var(--hd, 0px), -38px) scale(.85) rotate(var(--hr, 0deg)); }
}

.plant.rustle .sunflowers { animation: sunflower-sway .8s ease-in-out; }
@keyframes sunflower-sway {
  30% { transform: translateX(-50%) rotate(4deg); }
  65% { transform: translateX(-50%) rotate(-3deg); }
}
.pollen {
  position: fixed;
  z-index: 60;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #FDE68A;
  box-shadow: 0 0 4px rgba(253, 230, 138, .8);
  pointer-events: none;
}

.cat.sneezing .cat-head { animation: cat-sneeze-head .95s ease-in-out; }
.cat.sneezing .cat-bob { animation: cat-sneeze-body .95s ease-in-out; }
.cat.sneezing .cat-eyes { opacity: 0; }
.cat.sneezing .cat-eyes-happy { opacity: 1; }
.cat.sneezing .tail { animation: tail-happy .3s ease-in-out 3 alternate; }
@keyframes cat-sneeze-head {
  0% { transform: none; }
  38% { transform: translate(1px, -2px) rotate(-16deg); }
  46% { transform: translate(-1px, 3px) rotate(14deg) scale(1.06); }
  60% { transform: translate(0, 1px) rotate(5deg); }
  100% { transform: none; }
}
@keyframes cat-sneeze-body {
  0%, 40% { transform: none; }
  46% { transform: translate(-2px, 1px) scaleY(.94); }
  58% { transform: translate(1px, 0) scaleY(1.02); }
  100% { transform: none; }
}
.cat-puff {
  position: absolute;
  top: 13px;
  right: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  pointer-events: none;
  animation: cat-puff .5s ease-out forwards;
}
@keyframes cat-puff {
  from { opacity: 1; transform: translate(0, 0) scale(.6); }
  to { opacity: 0; transform: translate(var(--px), var(--py)) scale(1.6); }
}

@keyframes cat-bob { 50% { transform: translateY(-2px); } }
@keyframes gait-a { from { transform: rotate(20deg); } to { transform: rotate(-20deg); } }
@keyframes gait-b { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes swat { from { transform: rotate(-90deg); } to { transform: rotate(-50deg); } }
@keyframes tail-idle { from { transform: rotate(-5deg); } to { transform: rotate(10deg); } }
@keyframes tail-wild { from { transform: rotate(-25deg); } to { transform: rotate(25deg); } }
@keyframes tail-proud { from { transform: rotate(-20deg); } to { transform: rotate(30deg); } }

.glass-books {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  cursor: pointer;
  pointer-events: auto;
}
.glass-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: calc(var(--gw) + 8px);
  height: 32px;
}
.glass {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: bottom center;
  transition: transform .22s;
}

.glass img {
  display: block;
  width: auto;
  height: 30px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
  user-select: none;
  -webkit-user-drag: none;
}
.decor[data-phase='pawing'] .glass { transform: translateX(25%) rotate(22deg); }
.decor[data-phase='falling'] .glass {
  transform-origin: center;
  animation: glass-fall .5s cubic-bezier(.38, 0, .75, 1) forwards;
}
.decor[data-phase='shattered'] .glass,
.decor[data-phase='walkingBack'] .glass { visibility: hidden; transition: none; }
@keyframes glass-fall {
  from { transform: none; opacity: 1; }
  to { transform: translate(48px, 360px) rotate(290deg); opacity: 0; }
}

.book { display: block; border-radius: 1px; }

.turquoise-coast {
  width: 74px;
  height: 11px;
  object-fit: fill;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  user-select: none;
  -webkit-user-drag: none;
}

.bobble {
  position: relative;
  display: none;
  flex: none;
  height: 56px;
  aspect-ratio: 111 / 240;
  pointer-events: auto;
  cursor: pointer;
}
.bobble img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
.bobble-head { transform-origin: 60% 28.4%; }
.bobble.bobbling .bobble-head { animation: bobble 1.4s cubic-bezier(.3, .6, .4, 1); }
@keyframes bobble {
  0% { transform: rotate(0); }
  12% { transform: rotate(-9deg); }
  26% { transform: rotate(7deg); }
  40% { transform: rotate(-5deg); }
  54% { transform: rotate(3.5deg); }
  68% { transform: rotate(-2deg); }
  82% { transform: rotate(1deg); }
  100% { transform: rotate(0); }
}

.rocky {
  flex: none;
  pointer-events: auto;
  display: block;
  width: auto;
  height: 34px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
  user-select: none;
  -webkit-user-drag: none;
}

@media (min-width: 640px) {
  .glass-slot { height: 40px; }
  .glass img { height: 40px; }
  .turquoise-coast { width: 96px; height: 13px; }
  .bobble { display: block; }

  .rocky { height: 44px; }
}

.debris {
  position: absolute;
  z-index: 1;
  bottom: -72px;
  left: calc((100% - 180px) * .7);
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease-out;
}
.debris.show { opacity: 1; }
.debris .puddle {
  transform-origin: 90px 32px;
  transform: scale(.4);
  transition: transform .9s cubic-bezier(.34, 1.56, .64, 1);
}
.debris.show .puddle { transform: scale(1); }
.debris .frag {
  transform-origin: 0 0;
  transform: translate(90px, 32px) scale(0);
  transition: transform .9s cubic-bezier(.34, 1.56, .64, 1);
}
.debris.show .frag {
  transform: translate(calc(90px + var(--x)), calc(32px + var(--y))) rotate(var(--r)) scale(1);
}

.layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  animation: fade-in .3s ease-out;
}
.layer.closing { animation: fade-out .2s ease-in forwards; pointer-events: none; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .15s, background .15s, transform .12s;
}
.btn-pill:hover { filter: brightness(1.08); }
.btn-pill:active { transform: scale(.97); }

.drawer-view {
  display: flex;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, .9);
}
.dv-inner {
  width: 100%;
  max-width: 896px;
  margin: auto;
  padding: 12px 0;
}
.dv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(18, 15, 16, .9);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .6);
}
.dv-titles { flex: 1; min-width: 0; }
.dv-name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .25em;
  color: var(--amber);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-title {
  margin-top: 2px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-close {
  padding: 8px 12px;
  background: #fff;
  color: #000;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  gap: 6px;
}
.dv-close .icon { font-size: 15px; }
.dv-hint {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 12px;
  color: rgba(253, 230, 138, .5);
}
@media (min-width: 640px) {
  .drawer-view { padding: 24px; }
  .dv-inner { padding: 24px 0; }
  .dv-bar { padding: 12px 24px; }
  .dv-name { font-size: 10px; }
  .dv-title { font-size: 21px; }
  .dv-close { padding: 12px 16px; font-size: 11px; }
}

.tray {
  position: relative;
  height: var(--tray-h);
  margin-top: 16px;
  background: var(--lining);
  border: var(--tray-rim-w) solid var(--tray-rim);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .95);
  animation: tray-in .5s cubic-bezier(.34, 1.4, .64, 1) both;
}
@keyframes tray-in { from { opacity: 0; transform: translateY(15px) scale(.92); } }
.tray-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
}
.lining {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(closest-side, rgba(255, 255, 255, .08), transparent);
}
.lining.velvet {
  background-image:
    radial-gradient(closest-side, rgba(255, 255, 255, .08), transparent),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .14) 0 1.4px, transparent 1.4px 4.24px);
}
.lining.felt {
  background-image:
    radial-gradient(closest-side, rgba(255, 255, 255, .08), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.85'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
.lining.linen {
  background-image:
    radial-gradient(closest-side, rgba(255, 255, 255, .08), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 4px);
}
.lining.wood,
.lining.leather {
  background-image:
    radial-gradient(closest-side, rgba(255, 255, 255, .08), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='36' preserveAspectRatio='none'%3E%3Cpath d='M0 1Q200 4 400 0M0 10Q200 7 400 11M0 19Q200 23 400 18M0 28Q200 25 400 29' fill='none' stroke='%23000' stroke-opacity='.16' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 100% 36px;
}

.divider {
  position: absolute;
  border: .6px solid #6B4718;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.divider.v {
  top: 0;
  bottom: 0;
  width: 8px;
  margin-left: -4px;
  background: linear-gradient(90deg, #D4A86A, #B88C4E, #8C6229);
}
.divider.h {
  left: 0;
  right: 0;
  height: 8px;
  margin-top: -4px;
  background: linear-gradient(#D4A86A, #B88C4E, #8C6229);
}
.tray-depth {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 36px 10px rgba(0, 0, 0, .85);
}
.dovetail { position: absolute; width: 16px; height: 16px; background: #7A531E; }
.dovetail.tl { top: 0; left: 0; }
.dovetail.tr { top: 0; right: 0; }
.dovetail.bl { bottom: 0; left: 0; }
.dovetail.br { bottom: 0; right: 0; }

.compartment {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
}

.tray-decor {
  position: absolute;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(2px 5px 4px rgba(0, 0, 0, .5));
}
.tray-item {
  position: relative;
  flex: none;
  cursor: pointer;
  outline: none;
  transition: transform .17s ease-out;
}
.tray-item.loose { position: absolute; transform: rotate(var(--rot, 0deg)); }
.tray-item.active { z-index: 2; transform: rotate(var(--rot, 0deg)) scale(var(--hover)); }
.tray-item:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.tray-item img {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.tray-item img.photo {
  object-fit: cover;
  border-radius: 3px 5px 5px 3px;
  box-shadow: 4px 10px 18px rgba(0, 0, 0, .55);
}

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