/* Fridge — an old, neglected fridge covered in word magnets. */

:root {
  --wall: #e9dcc0;
  --wall-shade: #d8c7a4;
  --tile: #f3efe4;
  --grout: #cfc6b2;
  --enamel: #ece4cc;
  --enamel-hi: #f8f3e3;
  --enamel-lo: #cfc3a0;
  --chrome-hi: #fbfbfb;
  --chrome-lo: #8d9296;
  --ink: #1d1b17;
  --note: #fff27a;
  --red: #c8382a;
  --blue: #2f6fd1;
  --green: #2e9d5b;
  --yellow: #f4b72a;
  --ui: 'Fredoka', 'Trebuchet MS', sans-serif;
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
  --serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  /* Fridge width: as big as fits under the toolbar without scrolling. */
  --fw: min(94vw, 760px, calc((100dvh - 150px) / 1.5));
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Escaping food and the smell lines hang off the edges; never scroll sideways
     for them (iOS ignores overflow-x on body alone). */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--ui);
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

.noscript {
  margin: 16px;
  padding: 12px 16px;
  background: var(--note);
  font-family: var(--hand);
  font-size: 20px;
}

/* --- Toolbar: alphabet-magnet buttons ------------------------------------- */

.toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px 16px 6px;
}
.brand {
  margin: 0;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.brand::first-letter {
  color: var(--red);
}
.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.tools button {
  border: 0;
  border-radius: 12px;
  padding: 7px 13px 8px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 2px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s;
}
.tools button:nth-child(4n + 1) {
  background: var(--red);
}
.tools button:nth-child(4n + 2) {
  background: var(--blue);
}
.tools button:nth-child(4n + 3) {
  background: #23864d;
}
.tools button:nth-child(4n + 4) {
  background: #a5650f;
}
.tools button:active {
  transform: translateY(2px) rotate(-2deg);
}
.tools button[aria-pressed='true'] {
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, 0.28),
    0 0 0 3px var(--ink);
}
.tools button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.banner {
  position: relative;
  z-index: 15;
  width: fit-content;
  max-width: min(92vw, 560px);
  margin: 4px auto 0;
  padding: 8px 16px 9px;
  background: var(--note);
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1.25;
  text-align: center;
  transform: rotate(-1deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.banner button {
  margin: 0 4px;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
}

.status {
  margin: 0;
  padding: 0 16px 14px;
  font-family: var(--hand);
  font-size: 18px;
  text-align: center;
  color: #5a4c33;
  min-height: 1.4em;
}

/* --- Kitchen ---------------------------------------------------------------- */

.scene {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: calc(var(--fw) * 0.16);
  min-height: calc(var(--fw) * 1.62);
}
.wall {
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  pointer-events: none;
  /* Subway-tile backsplash behind the fridge */
  background:
    linear-gradient(transparent 38%, rgba(0, 0, 0, 0.05) 38.4%, transparent 39%),
    repeating-linear-gradient(0deg, transparent 0 26px, var(--grout) 26px 28px) 0 40% / 100% 60% no-repeat,
    repeating-linear-gradient(90deg, var(--tile) 0 54px, var(--grout) 54px 56px) 0 40% / 100% 60% no-repeat,
    linear-gradient(var(--wall), var(--wall-shade));
}
.wall::before {
  /* lower backsplash band */
  content: '';
  position: absolute;
  inset: 40% 0 0;
  background:
    repeating-linear-gradient(0deg, var(--tile) 0 26px, var(--grout) 26px 28px);
  mask: repeating-linear-gradient(90deg, #000 0 54px, transparent 54px 56px);
  opacity: 0.9;
}
.outlet {
  position: absolute;
  left: calc(50% + var(--fw) * 0.62);
  top: 46%;
  width: 34px;
  height: 52px;
  border-radius: 4px;
  background: #f7f3e8;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px #d9d1bc;
}
.outlet::before,
.outlet::after {
  content: '';
  position: absolute;
  left: 11px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 2px, #3a352c 2px 4px, transparent 4px 8px, #3a352c 8px 10px, transparent 10px) 0 2px / 12px 6px no-repeat;
}
.outlet::before {
  top: 9px;
}
.outlet::after {
  bottom: 9px;
}
.calendar {
  position: absolute;
  right: calc(50% + var(--fw) * 0.6);
  top: 16%;
  width: 92px;
  height: 118px;
  padding: 8px;
  background: #fffdf6;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
  font-family: var(--hand);
  text-align: center;
  background-image: repeating-linear-gradient(90deg, transparent 0 11px, #e8e1cf 11px 12px),
    repeating-linear-gradient(0deg, transparent 0 13px, #e8e1cf 13px 14px);
  background-position: 8px 34px;
  background-size: calc(100% - 16px) calc(100% - 42px);
  background-repeat: no-repeat;
}
.cal-month {
  display: block;
  font-size: 17px;
  color: var(--red);
}
@media (max-width: 1000px) {
  .outlet,
  .calendar {
    display: none;
  }
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--fw) * 0.12);
  background:
    conic-gradient(#e7e0cf 25%, #b8ae98 0 50%, #e7e0cf 0 75%, #b8ae98 0) 0 0 / 48px 48px;
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.18);
}

/* --- The fridge ------------------------------------------------------------- */

.fridge {
  --enamel-now: var(--enamel);
  position: relative;
  z-index: 2;
  width: var(--fw);
  margin-bottom: calc(var(--fw) * 0.05);
  padding: calc(var(--fw) * 0.012) calc(var(--fw) * 0.014) 0;
  border-radius: calc(var(--fw) * 0.05) calc(var(--fw) * 0.05) calc(var(--fw) * 0.02) calc(var(--fw) * 0.02);
  background: linear-gradient(90deg, var(--enamel-lo), var(--enamel) 12%, var(--enamel-hi) 40%, var(--enamel) 75%, var(--enamel-lo));
  box-shadow:
    0 calc(var(--fw) * 0.03) calc(var(--fw) * 0.05) rgba(40, 28, 10, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.fridge::after {
  /* floor shadow */
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: calc(var(--fw) * -0.03);
  height: calc(var(--fw) * 0.04);
  border-radius: 50%;
  background: rgba(30, 20, 5, 0.35);
  filter: blur(6px);
  z-index: -1;
}

.fridge-top {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: calc(var(--fw) * 0.16);
  pointer-events: none;
}
.cereal {
  position: absolute;
  left: 8%;
  bottom: 0;
  width: 15%;
  height: 92%;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, #c94f2e, #e86b3c 60%, #b8452a);
  border-radius: 2px 2px 0 0;
  color: #fff3c4;
  font-weight: 600;
  font-size: calc(var(--fw) * 0.024);
  line-height: 1;
  text-align: center;
  transform: rotate(-4deg);
  transform-origin: bottom left;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  filter: saturate(0.7);
}
.plant {
  position: absolute;
  right: 12%;
  bottom: 0;
  width: 13%;
  height: 80%;
}
.pot {
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 42%;
  background: linear-gradient(90deg, #9a4f2b, #c46a3c, #8a4524);
  clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%);
}
.stem {
  position: absolute;
  bottom: 40%;
  left: 48%;
  width: 4%;
  height: 60%;
  background: #7d6b3d;
  transform: rotate(18deg);
  transform-origin: bottom;
}
.stem::before,
.stem::after {
  /* the last two leaves, brown and drooping */
  content: '';
  position: absolute;
  width: calc(var(--fw) * 0.035);
  height: calc(var(--fw) * 0.016);
  border-radius: 50%;
  background: #8c7a3c;
}
.stem::before {
  top: 10%;
  left: 100%;
  transform: rotate(40deg);
}
.stem::after {
  top: 45%;
  right: 100%;
  transform: rotate(-50deg);
  background: #a08b45;
}

.panel {
  position: relative;
  border-radius: calc(var(--fw) * 0.035);
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(100deg, var(--enamel-hi), var(--enamel) 55%, var(--enamel-lo));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    inset -3px -3px 6px rgba(0, 0, 0, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.18);
}
/* Yellowing that builds with neglect */
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 85% 90%, rgba(140, 95, 20, 0.5), transparent 60%),
    radial-gradient(ellipse at 10% 100%, rgba(120, 85, 30, 0.35), transparent 50%),
    rgba(190, 150, 60, 0.25);
  opacity: var(--patina, 0.15);
  transition: opacity 2s;
}

.freezer {
  aspect-ratio: 1 / 0.32;
  margin-bottom: calc(var(--fw) * 0.012);
}
.door-wrap {
  position: relative;
  aspect-ratio: 1 / 1.05;
  perspective: calc(var(--fw) * 2.4);
  /* The viewer stands a bit to the right, so an opening door shows a gap. */
  perspective-origin: 150% 50%;
}

.surface {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  z-index: 3;
}
.handle {
  position: absolute;
  z-index: 4;
  right: 3.5%;
  width: 3.2%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--chrome-lo), var(--chrome-hi) 40%, #c9cdd0 60%, var(--chrome-lo));
  box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.freezer .handle {
  bottom: 12%;
  height: 46%;
}
.door .handle {
  top: 6%;
  height: 26%;
}

.door {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.3, 1.25, 0.5, 1);
}
.door::after {
  /* door thickness, visible when it swings open */
  content: '';
  position: absolute;
  top: 1%;
  right: 0;
  width: 6%;
  height: 98%;
  transform-origin: right center;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #b9ad8c, #ddd3b8);
  border-radius: 2px;
}
.door.ajar {
  transform: rotateY(-14deg);
}
.door.wide {
  transform: rotateY(-34deg);
  transition-duration: 0.3s;
}
.door.rattle {
  animation: rattle 0.12s linear 6;
}
@keyframes rattle {
  0%,
  100% {
    transform: rotateY(0) translateX(0);
  }
  25% {
    transform: rotateY(-3deg) translateX(1px);
  }
  75% {
    transform: rotateY(-1deg) translateX(-1px);
  }
}

.interior {
  position: absolute;
  inset: 1.5% 1% 1.5% 1%;
  z-index: 1;
  border-radius: calc(var(--fw) * 0.03);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 8%, rgba(255, 246, 200, 0.9), rgba(255, 240, 180, 0.15) 30%, transparent 55%),
    linear-gradient(90deg, #2c2a24, #4a463b 40%, #6c6756);
}
.bulb {
  position: absolute;
  top: 3%;
  right: 6%;
  width: 6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 30px 10px rgba(255, 240, 170, 0.6);
}
.shelf {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.6%;
  background: linear-gradient(rgba(230, 240, 245, 0.55), rgba(160, 175, 180, 0.35));
}
.s1 {
  top: 30%;
}
.s2 {
  top: 55%;
}
.s3 {
  top: 78%;
}
.eyes i {
  position: absolute;
  width: 2.4%;
  aspect-ratio: 1 / 1.3;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #111 0 32%, #fffbe8 34%);
  box-shadow: 0 0 6px rgba(255, 255, 220, 0.6);
  animation: blink 3.2s infinite;
}
.eyes i:nth-child(even) {
  margin-left: 3%;
}

.kickplate {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--fw) * 0.07);
  margin: calc(var(--fw) * 0.01) calc(var(--fw) * 0.02) 0;
  border-radius: 4px 4px 0 0;
  background:
    repeating-linear-gradient(90deg, #3a3832 0 calc(var(--fw) * 0.012), #5a574e calc(var(--fw) * 0.012) calc(var(--fw) * 0.02));
  box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.4);
}
/* The maker's chrome script badge, bolted to the grille like an appliance brand */
.nameplate {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  min-height: 24px;
  padding: 0.05em 0.9em 0.15em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--chrome-hi), #d5d9dc 45%, #b4babe 55%, #e9ebec);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 #fff;
  color: #2a2722;
  font: 400 calc(var(--fw) * 0.034) / 1.1 'Yellowtail', 'Brush Script MT', cursive;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
.nameplate small {
  font: 600 max(9px, calc(var(--fw) * 0.014)) / 1 var(--ui);
  letter-spacing: 0.04em;
}
.nameplate:hover { background: linear-gradient(180deg, #fff, #e4e7e9 45%, #c6cbce 55%, #f3f4f5); }
.nameplate:focus-visible { outline: 3px solid #2f6fd1; outline-offset: 3px; }

/* Freezer notes */
.notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.menu-card {
  position: absolute;
  left: 4%;
  top: 12%;
  width: 17%;
  aspect-ratio: 0.72;
  display: flex;
  flex-direction: column;
  gap: 6%;
  padding: 3% 2%;
  background: #fbf3d9;
  color: #a23b2a;
  font-size: calc(var(--fw) * 0.017);
  line-height: 1;
  text-align: center;
  transform: rotate(-6deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.menu-card span {
  color: #b9a679;
  letter-spacing: -0.1em;
}
.menu-card::before,
.tally::before {
  /* the magnet holding it up */
  content: '';
  position: absolute;
  top: 2%;
  left: 42%;
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a73, #c0392b);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.tally {
  position: absolute;
  right: 12%;
  top: 14%;
  width: 21%;
  padding: 5% 3% 3%;
  background: #fffdf6;
  font-family: var(--hand);
  font-size: calc(var(--fw) * 0.022);
  line-height: 1.15;
  text-align: center;
  transform: rotate(3deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.tally::before {
  left: 44%;
  width: 12%;
  background: radial-gradient(circle at 35% 35%, #8fd0ff, #2f6fd1);
}
.sticky {
  position: absolute;
  padding: 1.4% 2%;
  background: var(--note);
  font-family: var(--hand);
  font-size: calc(var(--fw) * 0.022);
  line-height: 1.1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.8s;
}
.whose {
  left: 26%;
  bottom: 12%;
  transform: rotate(-4deg);
}
.mgmt {
  left: 24%;
  top: 14%;
  transform: rotate(2deg);
  background: #fffdf6;
  border-top: 4px solid var(--red);
}
.nightly {
  left: 48%;
  bottom: 14%;
  transform: rotate(-3deg);
  background: #bfe6ff;
}
body[data-neglect='1'] .whose,
body[data-neglect='2'] .whose,
body[data-neglect='3'] .whose {
  opacity: 1;
}
body.breakroom .whose {
  opacity: 0;
}
body.breakroom .mgmt,
body.breakroom .nightly {
  opacity: 1;
}
body.breakroom .tally {
  display: none;
}

.frost {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 0 0, rgba(235, 248, 255, 0.95), transparent 30%),
    radial-gradient(ellipse at 100% 0, rgba(235, 248, 255, 0.9), transparent 25%),
    radial-gradient(ellipse at 50% 100%, rgba(235, 248, 255, 0.7), transparent 35%);
  opacity: 0;
  transition: opacity 3s;
}
body[data-neglect='3'] .frost {
  opacity: 1;
}

/* --- Magnets ---------------------------------------------------------------- */

.magnet {
  --r: 0deg;
  position: absolute;
  z-index: 1;
  padding: 0.16em 0.42em 0.18em;
  border: 0;
  border-radius: 1px;
  background: linear-gradient(#ffffff, #f2f0e8);
  color: #111;
  font-family: var(--serif);
  font-size: max(11px, 2.6cqw);
  line-height: 1.2;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transform: rotate(var(--r));
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    1px 2px 3px rgba(40, 30, 10, 0.3);
  transition:
    box-shadow 0.12s,
    transform 0.12s;
}
.magnet.affix {
  padding-left: 0.28em;
  padding-right: 0.28em;
  background: linear-gradient(#fbfbf6, #ecebe3);
}
.magnet.punct {
  min-width: 1.4em;
  text-align: center;
}
.magnet.lifted {
  cursor: grabbing;
  transform: rotate(var(--r)) scale(1.08);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.3),
    4px 10px 14px rgba(40, 30, 10, 0.35);
  transition: none;
}
.magnet.grabbed {
  outline: 3px dashed var(--blue);
  outline-offset: 3px;
}
.magnet.food-word {
  color: var(--red);
  background: linear-gradient(#fffaf0, #f5ead0);
  font-weight: 700;
}
.magnet.jiggle {
  animation: jiggle 0.18s linear 4;
}
@keyframes jiggle {
  50% {
    transform: rotate(calc(var(--r) + 4deg)) translateY(-1px);
  }
}
.magnet.carried {
  transition: none;
  pointer-events: none;
}
body.cleaning .magnet {
  pointer-events: none;
}

/* --- Grime ------------------------------------------------------------------ */

.grime {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
body.cleaning .grime {
  pointer-events: auto;
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='32' viewBox='0 0 40 32'%3E%3Crect x='2' y='4' width='36' height='14' rx='4' fill='%23f6d64a' stroke='%23a8871a' stroke-width='2'/%3E%3Crect x='2' y='16' width='36' height='12' rx='3' fill='%2336a35c' stroke='%23206b39' stroke-width='2'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%23d4b02c'/%3E%3Ccircle cx='24' cy='8' r='1.6' fill='%23d4b02c'/%3E%3C/svg%3E")
      20 16,
    crosshair;
}
.mold {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(var(--dirt, 1));
  opacity: var(--dirt, 1);
  background:
    radial-gradient(circle at 40% 40%, rgba(236, 245, 220, 0.95) 0 14%, transparent 15%),
    radial-gradient(circle at 62% 58%, rgba(220, 235, 200, 0.85) 0 10%, transparent 11%),
    radial-gradient(circle, #6e8f45 0 38%, #8aa859 52%, rgba(110, 140, 70, 0.55) 70%, transparent 72%);
  filter: drop-shadow(0 0 2px rgba(90, 120, 50, 0.6));
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.suds {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, rgba(220, 240, 255, 0.7) 60%, rgba(180, 210, 240, 0.4));
  pointer-events: none;
  animation: suds 0.9s ease-out forwards;
}
@keyframes suds {
  to {
    transform: translateY(-24px) scale(1.4);
    opacity: 0;
  }
}

.smell,
.flies {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s;
}
.smell {
  right: -2%;
  top: 0;
  width: 14%;
  height: 40%;
}
.smell i {
  position: absolute;
  bottom: 0;
  width: 18%;
  height: 60%;
  border-radius: 50%;
  border-left: 3px solid rgba(110, 140, 60, 0.55);
  animation: waft 3.4s ease-in-out infinite;
}
.smell i:nth-child(1) {
  left: 20%;
}
.smell i:nth-child(2) {
  left: 50%;
  animation-delay: -1.1s;
}
.smell i:nth-child(3) {
  left: 80%;
  animation-delay: -2.2s;
}
@keyframes waft {
  0% {
    transform: translateY(20%) scaleY(0.6);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) scaleY(1.1) skewX(-12deg);
    opacity: 0;
  }
}
.flies {
  right: 2%;
  top: 30%;
  width: 18%;
  height: 22%;
}
.flies i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1d1b17;
  animation: buzz 1.7s linear infinite;
}
.flies i:nth-child(2) {
  animation-duration: 2.3s;
  animation-direction: reverse;
}
.flies i:nth-child(3) {
  animation-duration: 1.3s;
  animation-delay: -0.6s;
}
.flies i:nth-child(4) {
  animation-duration: 2.9s;
  animation-delay: -1.4s;
}
@keyframes buzz {
  0% {
    transform: rotate(0deg) translateX(28px) rotate(0deg);
  }
  50% {
    transform: rotate(180deg) translateX(18px) translateY(6px) rotate(-180deg);
  }
  100% {
    transform: rotate(360deg) translateX(28px) rotate(-360deg);
  }
}

body[data-neglect='1'] .panel {
  --patina: 0.35;
}
body[data-neglect='2'] .panel {
  --patina: 0.6;
}
body[data-neglect='3'] .panel {
  --patina: 0.9;
}
body[data-neglect='1'] .smell {
  opacity: 0.6;
}
body[data-neglect='2'] .smell,
body[data-neglect='3'] .smell,
body[data-neglect='2'] .flies,
body[data-neglect='3'] .flies {
  opacity: 1;
}

/* --- The break room's office fridge ------------------------------------- */

body.breakroom {
  --enamel: #e3e6e8;
  --enamel-hi: #f6f8f9;
  --enamel-lo: #b8bec3;
  --wall: #d9dee0;
  --wall-shade: #c3c9cc;
  --tile: #eef1f2;
  --grout: #c7ced1;
}
body.breakroom .cereal {
  background: linear-gradient(90deg, #4a6a8a, #5e83a8 60%, #44617f);
}
body.breakroom .cereal span {
  font-size: 0;
}
body.breakroom .cereal span::after {
  content: 'COFFEE';
  font-size: calc(var(--fw) * 0.022);
}

/* --- Food ------------------------------------------------------------------- */

.food-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.food {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--fw) * 0.12);
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent;
}
.food svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.food .body {
  transform-origin: 50% 100%;
}
.food.walking .body {
  animation: bob 0.32s ease-in-out infinite alternate;
}
.food.walking .leg-a {
  animation: step 0.32s ease-in-out infinite alternate;
}
.food.walking .leg-b {
  animation: step 0.32s ease-in-out infinite alternate-reverse;
}
.food .lid-eye {
  animation: blink 3.6s infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.food.wobbly .body {
  animation: wobble 0.5s ease-in-out infinite;
}
.food.caught {
  pointer-events: none;
}
.food.caught .body {
  animation: none;
}
.food .bubble {
  opacity: 0;
}
.food.caught .bubble {
  opacity: 1;
}
@keyframes bob {
  to {
    transform: translateY(-3px);
  }
}
@keyframes step {
  from {
    transform: rotate(-16deg);
  }
  to {
    transform: rotate(16deg);
  }
}
@keyframes wobble {
  0%,
  100% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.12, 0.88);
  }
  60% {
    transform: scale(0.92, 1.08);
  }
}
@keyframes blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.1);
  }
}

/* --- The freezer (pull the handle) ------------------------------------- */

.freezer-pull {
  position: absolute;
  z-index: 5;
  right: 1%;
  bottom: 8%;
  width: max(28px, 8%);
  height: 54%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.freezer-pull:hover { background: rgba(255, 255, 255, 0.18); }
.freezer-pull:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.freezer.peek { transform: perspective(900px) rotateY(-14deg); transform-origin: left center; transition: transform 0.35s ease; }
dialog.frosty {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(160deg, #eef7fb, #d5e8f0);
}
.frost-numbers {
  margin: 0 0 6px;
  padding: 10px 12px;
  background: #fffdf6;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.6;
  word-spacing: 0.3em;
  color: #3a3a40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* --- Share dialog -------------------------------------------------------- */

dialog {
  max-width: min(92vw, 460px);
  padding: 22px 24px 18px;
  border: 0;
  border-radius: 6px;
  background: #fffdf6;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font-family: var(--ui);
}
dialog::backdrop {
  background: rgba(40, 30, 15, 0.45);
}
dialog h2 {
  margin: 0 0 10px;
  font-size: 22px;
}
.poem-preview {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--enamel);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 3em;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.share-actions button,
dialog .close {
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
dialog .close {
  margin-top: 12px;
  background: var(--ink);
}
.share-note {
  min-height: 1.3em;
  margin: 10px 0 0;
  font-family: var(--hand);
  font-size: 18px;
}

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 600px) {
  :root {
    --fw: min(96vw, 760px);
  }
  .brand {
    font-size: 22px;
  }
  .tools button {
    padding: 6px 10px 7px;
    font-size: 14px;
  }
  .scene {
    padding-top: calc(var(--fw) * 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .door,
  .magnet {
    transition: none;
  }
  .door.rattle,
  .magnet.jiggle,
  .food.walking .body,
  .food.wobbly .body,
  .smell i,
  .flies i {
    animation: none;
  }
}

/* --- Toast: a sticky note that slaps on and peels off ---------------------- */

.toast {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 50;
  margin: 0;
  max-width: min(90vw, 420px);
  padding: 10px 16px 11px;
  background: var(--note);
  font-family: var(--hand);
  font-size: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -16px) rotate(-2deg);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-2deg);
}

/* --- Light switch: lights off, back to the Digital Playground ------------ */

.light-switch {
  position: absolute;
  z-index: 6;
  left: calc(50% + var(--fw) / 2 + 26px);
  top: calc(var(--fw) * 0.42);
  width: 44px;
  height: 70px;
  border-radius: 5px;
  background: linear-gradient(160deg, #fffdf6, #e7e0cd);
  box-shadow:
    0 2px 4px rgba(40, 30, 10, 0.3),
    inset 0 0 0 1px #d6ccb4;
}
.light-switch::before,
.light-switch::after {
  /* screws */
  content: '';
  position: absolute;
  left: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 42%, rgba(0, 0, 0, 0.45) 42% 58%, transparent 58%),
    #cfc6ae;
}
.light-switch::before {
  top: 6px;
}
.light-switch::after {
  bottom: 6px;
}
.light-switch .lever {
  position: absolute;
  left: 15px;
  top: 21px;
  width: 14px;
  height: 28px;
  border-radius: 3px;
  background: #d8d0bb;
  box-shadow: inset 0 0 0 2px #c4bba3;
}
.light-switch .lever::after {
  /* the toggle itself: up is on */
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 10px;
  height: 13px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(#fffef8, #ece5d2);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
  transition: top 0.08s;
}
.light-switch:hover .lever::after {
  background: linear-gradient(#ffffff, #f3eddd);
}
.light-switch.off .lever::after {
  top: 13px;
  box-shadow: 0 -2px 2px rgba(0, 0, 0, 0.3);
}
/* No room beside the fridge (phones, narrow windows): on the wall above it. */
.scene.switch-top .light-switch {
  left: calc(50% - 22px);
  top: 4px;
  width: 36px;
  height: 56px;
  transform: scale(0.85);
  transform-origin: top center;
}
.scene.switch-top .light-switch .lever {
  left: 11px;
  top: 14px;
}
.scene.switch-top .light-switch::before,
.scene.switch-top .light-switch::after {
  left: 15px;
}

.lights-out {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: #07060a;
  opacity: 0;
  transition: opacity 0.45s ease-in;
}
.lights-out i {
  /* something in the fridge, watching you leave */
  position: absolute;
  top: 52%;
  width: 10px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #120f05 0 30%, #f5f0a8 34%);
  box-shadow: 0 0 10px rgba(240, 235, 140, 0.8);
  opacity: 0;
  transition: opacity 0.3s 0.5s;
}
.lights-out i:first-child {
  left: calc(50% + var(--fw) * 0.42);
}
.lights-out i:last-child {
  left: calc(50% + var(--fw) * 0.42 + 16px);
}
body.lights-off .lights-out,
body.lights-off .lights-out i {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .lights-out,
  .lights-out i {
    transition: none;
  }
}
