:root {
  --ink: #241a3a;
  --paper: #fffdf6;
  --pink: #ff5fa2;
  --blue: #4cc3ff;
  --lime: #a6f94c;
  --sun: #ffd84a;
  --grape: #8f6bff;
  --orange: #ff9a3c;
  --bg1: #eadfff;
  --bg2: #dccbff;
  --dot: rgba(255, 255, 255, .7);
  --hand: "Gaegu", "Comic Sans MS", cursive;
  --fat: "Bagel Fat One", "Arial Black", sans-serif;
  --pixel: "VT323", ui-monospace, monospace;
  --shadow: 5px 5px 0 var(--ink);
}

body.night {
  --bg1: #1d1640;
  --bg2: #241c52;
  --dot: rgba(255, 246, 194, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1.25;
  background-color: var(--bg1);
  background-image:
    radial-gradient(circle at 50% 50%, var(--dot) 1.5px, transparent 2px),
    conic-gradient(var(--bg2) 25%, transparent 0 50%, var(--bg2) 0 75%, transparent 0);
  background-size: 28px 28px, 56px 56px;
  overflow-x: hidden;
  transition: background-color .6s;
}

h1, h2, p, ul, dl { margin: 0; }

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px dashed var(--pink); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  display: inline-block;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
}

.kana { font-family: "Hachi Maru Pop", var(--hand); font-size: .85em; }

.for-touch { display: none; }

[hidden] { display: none !important; }

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--sun);
  font-family: var(--pixel);
  font-size: 22px;
  white-space: nowrap;
  border-bottom: 3px solid var(--pink);
  cursor: default;
  user-select: none;
}

.marquee__track {
  display: inline-flex;
  animation: marquee 40s linear infinite;
  padding: 4px 0;
}

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- toolbar ---------- */

.toolbar {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px 0;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 16px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.tool:hover { transform: translate(-1px, -2px) rotate(-2deg); box-shadow: 4px 5px 0 var(--ink); }
.tool:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- desk ---------- */

.desk {
  position: relative;
  isolation: isolate;
  max-width: 1240px;
  min-height: 900px;
  margin: 0 auto;
  padding: 16px;
}

.desk.is-party .item { animation: party .5s ease-in-out infinite alternate; }

@keyframes party {
  from { transform: rotate(calc(var(--tilt, 0deg) - 4deg)) translateY(0); }
  to { transform: rotate(calc(var(--tilt, 0deg) + 4deg)) translateY(-10px); }
}

.item {
  position: absolute;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), filter .18s;
}

.item.is-dragging {
  will-change: transform;
  cursor: grabbing;
  transform: rotate(calc(var(--tilt, 0deg) * -1)) scale(1.04);
  filter: drop-shadow(10px 14px 0 rgba(36, 26, 58, .25));
  transition: none;
}

.item.is-dragging * { cursor: grabbing; }

.item input, .item textarea { user-select: text; -webkit-user-select: text; cursor: text; }

.desk.is-shaking { animation: shake .45s; }

@keyframes shake {
  20% { transform: translate(-8px, 3px) rotate(-.6deg); }
  40% { transform: translate(7px, -4px) rotate(.5deg); }
  60% { transform: translate(-5px, 2px); }
  80% { transform: translate(3px, -1px); }
}

.item h2 {
  font-family: var(--fat);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

/* title */

.title { --tilt: -2deg; }

.title__word {
  font-family: var(--fat);
  font-weight: 400;
  font-size: clamp(64px, 10vw, 128px);
  line-height: 1;
  display: flex;
}

.title__word span {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 var(--ink);
  transform: rotate(var(--r));
  transition: transform .25s cubic-bezier(.3, 1.8, .5, 1);
}

.title__word span:hover { transform: rotate(calc(var(--r) * -2)) translateY(-14px) scale(1.12); }
.title__word span.is-lit { transform: rotate(0) translateY(-6px); text-shadow: 5px 6px 0 var(--pink); }
.title__word.is-wave span { animation: wave .6s ease-in-out calc(var(--i) * 80ms) 2; }

@keyframes wave { 50% { transform: translateY(-26px) rotate(0); } }

.title__sub {
  margin: 8px 0 0 18px;
  font-size: 27px;
  font-weight: 700;
  transform: rotate(1deg);
}

body.night .title__sub, body.night .links__hint, body.night .panic__log, body.night .foot { color: #f3ecff; }

/* flag */

.flag { --tilt: 4deg; display: flex; align-items: flex-start; }

.flag__pole {
  width: 5px;
  height: 92px;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a8f99, #e8ecf2, #8a8f99);
  border: 1.5px solid var(--ink);
}

.flag__cloth {
  width: 78px;
  height: 52px;
  margin-top: 3px;
  display: block;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  border-left: 0;
  transform-origin: left center;
  animation: flutter 3s ease-in-out infinite;
  filter: drop-shadow(3px 3px 0 rgba(36, 26, 58, .3));
}

.flag__cloth.is-flip { animation: flagflip .5s ease-in-out; }

@keyframes flagflip { 50% { transform: rotateY(90deg); } }

@keyframes flutter {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50% { transform: skewY(-3deg) scaleX(.97); }
}

/* speech bubble */

.bubble {
  --tilt: 3deg;
  width: 300px;
  padding: 16px 20px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 28px;
  filter: drop-shadow(5px 5px 0 var(--ink));
  font-size: 24px;
  font-weight: 700;
}

.bubble__tail {
  position: absolute;
  left: 34px;
  top: 100%;
  width: 44px;
  height: 36px;
  overflow: visible;
}

.bubble__small { margin-top: 6px; font-size: 19px; font-weight: 400; }

/* sticky note */

.note {
  --tilt: -3deg;
  width: 330px;
  padding: 26px 22px 22px;
  background: linear-gradient(var(--sun), #ffe77f);
  box-shadow: 3px 6px 0 rgba(36, 26, 58, .22);
  clip-path: polygon(0 0, 100% 0, 100% 93%, 91% 100%, 0 100%);
}

.note ul { padding-left: 20px; }
.note li { margin: 4px 0; }
.note li::marker { content: "✦  "; color: var(--pink); }

.pin {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9cc8, var(--pink) 60%, #c2306f);
  box-shadow: 1px 2px 0 rgba(0, 0, 0, .3);
}

.pin--blue { background: radial-gradient(circle at 35% 35%, #bdf0ff, var(--blue) 60%, #1f7fc4); }

/* slime */

.slime { --tilt: 0deg; display: grid; justify-items: center; }

.slime__btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: inherit;
  -webkit-tap-highlight-color: transparent;
}

.slime__btn svg { display: block; overflow: visible; }

.slime__body { transform-origin: 80px 120px; animation: wobble 3.2s ease-in-out infinite; }
.slime__eyes { transform-origin: 80px 78px; animation: blink 4.5s infinite; }
.slime__sleep, .slime__zzz { display: none; }

.slime.is-asleep .slime__eyes { display: none; }
.slime.is-asleep .slime__sleep, .slime.is-asleep .slime__zzz { display: inline; }
.slime.is-asleep .slime__zzz { animation: zzz 2s ease-in-out infinite; }
.slime.is-gold .slime__body { fill: url(#slimeGold); }
.slime.is-gold svg { filter: drop-shadow(0 0 14px rgba(255, 216, 74, .9)); }
.slime.is-rimuru .slime__body { animation: wobble .8s ease-in-out infinite; }
.slime.is-rimuru svg { filter: drop-shadow(0 0 16px rgba(76, 195, 255, .95)); }

.slime.is-squished .slime__btn svg { animation: squish .5s cubic-bezier(.3, 1.8, .5, 1); }

@keyframes wobble {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.04, .96); }
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}

@keyframes squish {
  30% { transform: scale(1.25, .7); }
  60% { transform: scale(.9, 1.15) translateY(-10px); }
}

@keyframes zzz {
  50% { transform: translate(4px, -6px); opacity: .5; }
}

.slime__say {
  min-height: 30px;
  margin-top: 2px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 22px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px) scale(.8);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.8, .5, 1);
}

.slime__say.is-on { opacity: 1; transform: none; }

/* index card */

.index {
  --tilt: 2deg;
  width: 360px;
  padding: 16px 20px 18px;
  background:
    linear-gradient(transparent 46px, var(--pink) 46px 48px, transparent 48px),
    repeating-linear-gradient(transparent 0 29px, #b8d8ff 29px 30px) 0 48px / 100% calc(100% - 48px) no-repeat,
    var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.index h2 { margin-bottom: 6px; }

.index dl div { line-height: 30px; }
.index dt { display: inline; font-weight: 700; white-space: nowrap; }
.index dt .ic { margin-right: 2px; }
.index dt::after { content: " "; }
.index dd { display: inline; margin: 0; }

.mood { display: inline-block; color: var(--grape); font-weight: 700; }
.mood.is-flipping { animation: flip .4s; }

@keyframes flip { 50% { transform: rotateX(90deg); } }

/* player card */

.stats {
  --tilt: -1.5deg;
  width: 330px;
  padding: 16px 18px 14px;
  background: #1d1640;
  color: #f3ecff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
}


.stats__bars { list-style: none; padding: 0; display: grid; gap: 5px; }

.stats__bars li {
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 8px;
  font-family: var(--pixel);
  font-size: 20px;
  cursor: pointer;
}

.stats__bars i {
  position: relative;
  height: 14px;
  border: 2px solid #f3ecff;
  border-radius: 3px;
  overflow: hidden;
}

.stats__bars i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--v, 0) * 1%);
  background: repeating-linear-gradient(90deg, var(--lime) 0 8px, #7fd62a 8px 10px);
  transition: width 1.2s cubic-bezier(.2, .9, .3, 1);
}

.stats__bars li:nth-child(3) i::after { background: repeating-linear-gradient(90deg, var(--sun) 0 8px, #e0b52a 8px 10px); }
.stats__bars li:nth-child(4) i::after { background: repeating-linear-gradient(90deg, var(--blue) 0 8px, #2f9bd6 8px 10px); }
.stats__bars li:nth-child(n+5) i::after { background: repeating-linear-gradient(90deg, var(--pink) 0 8px, #d43f82 8px 10px); }

.stats__quip { margin-top: 8px; min-height: 44px; font-size: 18px; color: #cfc6ff; }

.note__taken { font-size: .85em; opacity: .75; }

/* things i've made */

.madetitle { --tilt: -3deg; padding: 10px 22px 12px; background: var(--sun); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); }
.madetitle h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 34px; }
.madetitle .ic { width: 30px; height: 30px; transform: rotate(90deg); }

.made {
  --tilt: 1deg;
  width: 362px;
  padding: 24px 18px 16px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.made h2 { display: flex; align-items: center; gap: 8px; font-size: 24px; }
.made h2 .ic { width: 28px; height: 28px; }
.made ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }

.made li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  padding: 4px 10px 4px 7px;
  background: var(--chip, #e2f4ff);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.made li .ic { width: 20px; height: 20px; margin-top: 1px; }

.made--c1 { --chip: #ffe3f0; }
.made--c2 { --chip: #e2f4ff; }
.made--c3 { --chip: #ecffd9; }
.made--c4 { --chip: #efe8ff; }
.made--c5 { --chip: #fff3c4; }
.made--c6 { --chip: #ffe8d6; }
.made--t1 { --tilt: -1.2deg; }
.made--t2 { --tilt: 1deg; }
.made--t3 { --tilt: -.6deg; }
.made--t4 { --tilt: 1.4deg; }
.made--t5 { --tilt: -1deg; }
.made--t6 { --tilt: .8deg; }
.made--t7 { --tilt: -1.4deg; }
.made--t8 { --tilt: 1.1deg; }
.made--t9 { --tilt: -.8deg; }
.made--t10 { --tilt: 1.3deg; }

.tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 110px;
  height: 26px;
  margin-left: -55px;
  background: rgba(255, 95, 162, .55);
  transform: rotate(-2deg);
}

.tape--blue { background: rgba(76, 195, 255, .55); transform: rotate(3deg); }

/* polaroid */

.polaroid {
  --tilt: -4deg;
  padding: 14px 14px 10px;
  background: var(--paper);
  box-shadow: 3px 6px 0 rgba(36, 26, 58, .25);
  border: 1px solid rgba(36, 26, 58, .2);
}

.polaroid::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 26px;
  margin-left: -45px;
  background: rgba(166, 249, 76, .7);
  transform: rotate(3deg);
}

.polaroid__pic { display: block; image-rendering: pixelated; }
.moon { cursor: pointer; }

.polaroid__cap { margin-top: 8px; text-align: center; font-size: 22px; font-weight: 700; }
.polaroid__cap small { font-weight: 400; font-size: 17px; }

/* links */

.links { --tilt: -1deg; display: grid; gap: 14px; justify-items: start; }

.sticker-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fat);
  font-size: 24px;
  text-decoration: none;
  padding: 8px 18px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s cubic-bezier(.3, 1.8, .5, 1);
}

.sticker-link:hover { transform: rotate(-4deg) scale(1.06); }

.sticker-link--send { background: var(--blue); transform: rotate(-3deg); }
.sticker-link--arcade { background: var(--lime); transform: rotate(2deg); margin-left: 26px; }
.sticker-link--term { background: var(--ink); color: var(--lime); transform: rotate(-1deg); margin-left: 8px; }

/* work */

.work {
  --tilt: -2deg;
  width: 330px;
  padding: 26px 20px 16px;
  background: #e9f6ff;
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.work h2 { display: flex; align-items: center; gap: 8px; }
.work__hint { font-size: 18px; margin-bottom: 12px; }

.work__open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fat);
  font-size: 19px;
  text-decoration: none;
  padding: 6px 16px;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}

.work__open:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); }
.work__open:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* 88x31 badges */

.badges {
  --tilt: 1.5deg;
  width: 410px;
  padding: 22px 16px 16px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
}

.badges__row { display: grid; grid-template-columns: repeat(auto-fill, 88px); gap: 6px; justify-content: center; }
.b88img { display: block; width: 88px; height: 31px; }

.b88 {
  width: 88px;
  height: 31px;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 11px;
  border: 1px solid var(--ink);
  box-shadow: inset -1px -1px 0 rgba(0, 0, 0, .35), inset 1px 1px 0 rgba(255, 255, 255, .5);
  overflow: hidden;
}

.b88 b { font-size: 16px; font-weight: 400; }

.b88--rainbow {
  font-size: 17px;
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--sun), var(--lime), var(--blue), var(--grape), var(--pink));
  background-size: 200% 100%;
  animation: rainbow 3s linear infinite;
}

@keyframes rainbow { to { background-position: -200% 0; } }

.b88--mac { background: #e6e6e6; }

/* sticker drawer */

.drawer {
  --tilt: -1.5deg;
  width: 330px;
  padding: 16px 18px;
  background: #ffe1ef;
  border: 2.5px dashed var(--ink);
  border-radius: 18px;
}

.drawer__hint { font-size: 17px; margin-bottom: 10px; }

.drawer__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }

.drawer__grid button {
  font-size: 28px;
  line-height: 1;
  padding: 6px 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.3, 1.8, .5, 1);
}

.drawer__grid button:hover { transform: scale(1.18) rotate(-8deg); }

/* placed stickers */

.sticker {
  position: absolute;
  font-size: 54px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(2px 3px 0 rgba(36, 26, 58, .35));
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s cubic-bezier(.3, 1.8, .5, 1);
  z-index: 50;
  will-change: transform;
}

.sticker.is-new { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.sticker.is-dragging { cursor: grabbing; transform: scale(1.2); transition: none; }

@keyframes pop { from { transform: scale(0) rotate(-40deg); } }

.trash {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9999;
  width: 76px;
  height: 76px;
  margin-left: -38px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(120px);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}

.trash svg { display: block; }
.trash.is-on { opacity: 1; transform: none; }
.trash.is-hot { transform: scale(1.25) rotate(-10deg); background: var(--pink); }

/* panic button */

.panic { --tilt: 3deg; display: grid; justify-items: center; gap: 10px; width: 220px; }

.panic__btn {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #e8232f 60%, #a3101a);
  color: #fff;
  font-family: var(--fat);
  font-size: 24px;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--ink);
  box-shadow: 0 10px 0 #6b0a12, 0 14px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent;
}

.panic__btn:active { transform: translateY(8px); box-shadow: 0 2px 0 #6b0a12, 0 5px 0 var(--ink); }

.panic__log { text-align: center; font-size: 19px; min-height: 48px; }

.rain { position: fixed; top: -60px; z-index: 9998; font-size: 34px; pointer-events: none; }

.toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 20px;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -140%) rotate(-2deg);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}

.toast.is-on { transform: translate(-50%, 0) rotate(-2deg); }
.toast svg { width: 30px; height: 30px; color: var(--pink); flex-shrink: 0; }

/* sparkle trail */

.spark {
  position: fixed;
  z-index: 9997;
  pointer-events: none;
  font-size: 14px;
  animation: spark .7s ease-out forwards;
}

@keyframes spark { to { opacity: 0; transform: translate(var(--dx), 26px) scale(.3) rotate(120deg); } }

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

.fridge { padding: 40px 16px 30px; }

.fridge__door {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 40px 40px 34px;
  background: linear-gradient(100deg, #f4fbff, #ffffff 35%, #e8f3fa);
  border: 3px solid var(--ink);
  border-radius: 34px;
  box-shadow: 10px 10px 0 var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  grid-template-areas: "head head" "send wall";
  gap: 26px 34px;
}

.fridge__handle {
  position: absolute;
  top: 60px;
  right: 14px;
  width: 16px;
  height: 160px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(90deg, #d9e4ec, #fff, #c7d3dc);
}

.fridge__head { grid-area: head; padding-right: 30px; }

.fridge__head h2 {
  font-family: var(--fat);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  color: var(--blue);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}

.fridge__head h2 .ic--big { width: .8em; height: .8em; vertical-align: -0.05em; }
.fridge__head p { margin-top: 6px; font-size: 22px; max-width: 720px; }

.odometer { margin-top: 12px; display: inline-flex; align-items: center; gap: 10px; font-size: 19px; }

.odometer span {
  font-family: var(--pixel);
  font-size: 30px;
  letter-spacing: 4px;
  padding: 0 8px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 6px;
}

/* send form */

.send {
  grid-area: send;
  align-self: start;
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.send { grid-template-columns: minmax(0, 1fr); }
.send > *, .send__panel > * { min-width: 0; }
.send__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

.send__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.send__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 20px;
  padding: 6px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
}

.send__tab.is-on { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-weight: 700; font-size: 19px; min-width: 0; }
.field small { font-weight: 400; }

.field input, .field textarea {
  width: 100%;
  min-width: 0;
  font-weight: 400;
  font-size: 20px;
  padding: 6px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
}

.field textarea { resize: vertical; min-height: 120px; line-height: 1.3; overflow-x: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.send__captcha { min-height: 0; }
.send__captcha:empty { display: none; }

.stick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--fat);
  font-size: 22px;
  padding: 10px 12px;
  background: var(--lime);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}

.stick:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--ink); }
.stick:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.stick:disabled { opacity: .6; cursor: wait; }

.send__status { min-height: 24px; font-size: 19px; font-weight: 700; text-align: center; }
.send__fine { font-size: 16px; text-align: center; opacity: .7; }

/* canvas + tools */

.canvas-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-stack canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ink { cursor: none; touch-action: none; }

.canvas-stack__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  opacity: .4;
  pointer-events: none;
  transition: opacity .2s;
}

.canvas-stack.has-ink .canvas-stack__hint { opacity: 0; }

.brush-cursor {
  position: absolute;
  left: 0;
  top: 0;
  border: 1.5px solid var(--ink);
  outline: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.canvas-stack.is-hover .brush-cursor { opacity: 1; }

.mini-tools { display: grid; gap: 8px; }
.mini-tools__colors { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tools__row { display: flex; align-items: center; gap: 6px; }
.mini-tools__row .size-range { flex: 1; min-width: 0; }

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--c);
  cursor: pointer;
  padding: 0;
}

.swatch.is-on { outline: 3px solid var(--pink); outline-offset: 2px; }

.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-weight: 700;
  font-size: 18px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}

.tbtn .ic { width: 22px; height: 22px; }
.tbtn.is-on { background: var(--sun); box-shadow: 2px 2px 0 var(--ink); }
.tbtn--max, .tbtn--done { background: var(--blue); }

input[type="range"] { accent-color: var(--pink); }

/* doodle wall */

.wallbox { grid-area: wall; min-width: 0; display: grid; gap: 14px; align-content: start; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-weight: 700;
  font-size: 18px;
  padding: 2px 14px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}

.chip.is-on { background: var(--ink); color: var(--paper); }

.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 26px 18px;
  align-content: start;
}

.wall[data-filter="art"] .is-note, .wall[data-filter="note"] .is-art { display: none; }

.post {
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s cubic-bezier(.3, 1.8, .5, 1);
}

.post:hover { transform: rotate(0deg) scale(1.05); z-index: 2; }
.post.is-new { animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }

.post::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--m, var(--pink));
  box-shadow: 1px 2px 0 rgba(0, 0, 0, .3);
}

.post.is-art {
  padding: 8px 8px 6px;
  background: var(--paper);
  border: 1px solid rgba(36, 26, 58, .25);
  box-shadow: 2px 4px 0 rgba(36, 26, 58, .2);
}

.post.is-art img { display: block; width: 100%; height: auto; aspect-ratio: 1; background: #fff; }

.post.is-note {
  padding: 18px 14px 12px;
  background: var(--n, #fff3a6);
  box-shadow: 2px 4px 0 rgba(36, 26, 58, .2);
  min-height: 140px;
}

.post__text { font-size: 19px; overflow-wrap: anywhere; white-space: pre-wrap; }
.post__name { margin-top: 6px; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.post__when { font-size: 14px; opacity: .6; }

.wall__empty { grid-column: 1 / -1; font-size: 22px; opacity: .7; padding: 30px 0; }

/* ---------- dialogs ---------- */

dialog {
  padding: 0;
  border: 3px solid var(--ink);
  color: var(--ink);
  font-family: var(--hand);
}

dialog::backdrop { background: rgba(29, 22, 64, .6); backdrop-filter: blur(3px); }

.term__close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}

.term__close .ic { width: 20px; height: 20px; }

/* studio */

.studio {
  width: 100vw;
  height: 100vh; height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: #efe6ff;
  display: none;
  flex-direction: column;
}

.studio[open] { display: flex; }

.studio__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.studio__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.studio__sliders label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; }
.studio__sliders input { width: 110px; }
.studio__colors input[type="color"] { width: 40px; height: 32px; padding: 0; border: 2.5px solid var(--ink); border-radius: 8px; background: none; cursor: pointer; }

.studio__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px;
}

.studio__stage .canvas-stack {
  width: min(100%, calc(100vh - 200px)); width: min(100%, calc(100dvh - 200px));
  max-width: 100%;
  box-shadow: 6px 6px 0 var(--ink);
}

.studio__hint { text-align: center; font-size: 15px; padding: 0 12px calc(8px + env(safe-area-inset-bottom)); opacity: .7; }

/* terminal */

.term {
  width: min(900px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 40px)); height: min(620px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  background: #0f0b24;
  color: #d8ffd0;
  border-radius: 16px;
  box-shadow: 10px 10px 0 var(--ink);
  display: none;
  flex-direction: column;
  font-family: var(--pixel);
  font-size: 22px;
}

.term[open] { display: flex; }

.term__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: #241a3a;
  color: #cfc6ff;
}

.term__dots { display: flex; gap: 6px; }
.term__dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.term__dots i:nth-child(2) { background: var(--sun); }
.term__dots i:nth-child(3) { background: var(--lime); }
.term__title { flex: 1; font-size: 20px; }

.term__out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.term__out .c-dim { color: #8d84b8; }
.term__out .c-pink { color: var(--pink); }
.term__out .c-blue { color: var(--blue); }
.term__out .c-sun { color: var(--sun); }
.term__out .c-lime { color: var(--lime); }
.term__out .c-err { color: #ff7a7a; }

.term__line { display: flex; align-items: center; gap: 8px; padding: 8px 16px 10px; border-top: 1px solid #2c2257; }
.term__prompt { color: var(--lime); white-space: nowrap; }

.term__line input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-family: var(--pixel);
  font-size: 22px;
  caret-color: var(--lime);
}



.term.is-hacking .term__out { color: var(--lime); text-shadow: 0 0 6px rgba(166, 249, 76, .6); }

/* arcade */

.arcade {
  width: min(960px, calc(100vw - 16px));
  height: min(760px, calc(100vh - 16px)); height: min(760px, calc(100dvh - 16px));
  max-width: none;
  max-height: none;
  background: #1d1640;
  color: #f3ecff;
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--ink);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.arcade[open] { display: flex; }

.arcade__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: #241a3a;
}

.arcade__title { flex: 1; font-family: var(--fat); font-weight: 400; font-size: 26px; color: var(--lime); }

.arcade__back {
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  padding: 4px 12px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}

.arcade__body { flex: 1; min-height: 0; overflow: auto; padding: 16px; position: relative; }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.picker button {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 16px;
  color: var(--ink);
  background: var(--c, var(--paper));
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 #000;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.3, 1.8, .5, 1);
}

.picker button:hover { transform: rotate(-2deg) scale(1.03); }
.picker svg { width: 54px; height: 54px; }
.picker b { font-family: var(--fat); font-weight: 400; font-size: 26px; }
.picker span { font-size: 18px; }
.picker small { font-family: var(--pixel); font-size: 18px; opacity: .75; }

.picker__head { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-family: var(--fat); font-weight: 400; font-size: 24px; color: var(--sun); }
.picker__head .ic { width: 30px; height: 30px; }
.picker--geo { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.picker--geo button { padding: 12px 14px; }
.picker--geo svg { width: 40px; height: 40px; }
.picker--geo b { font-size: 21px; }
.picker--geo span { font-size: 16px; }

/* geo games */

.geo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; max-width: 760px; margin: 0 auto; }
.geo__loading { font-family: var(--pixel); font-size: 24px; text-align: center; padding: 40px 0; }

.geo__setup { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 10px 0 20px; }
.geo__setup h3 { margin: 0; font-family: var(--fat); font-weight: 400; font-size: 34px; color: var(--lime); }
.geo__setup p { font-size: 19px; }
.geo__badge { display: grid; place-items: center; width: 76px; height: 76px; background: var(--c); border: 3px solid #000; border-radius: 20px; box-shadow: 4px 4px 0 #000; }
.geo__badge svg { width: 50px; height: 50px; }
.geo__label { font-family: var(--pixel); font-size: 20px; color: var(--sun); margin-top: 6px; }
.geo__best { font-family: var(--pixel); font-size: 20px; opacity: .8; }
.geo__score { font-family: var(--fat); font-size: 64px !important; line-height: 1; color: var(--sun); }

.geo__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; }

.geo__chip, .geo__zoomout {
  font-weight: 700;
  font-size: 17px;
  padding: 4px 14px;
  color: #f3ecff;
  background: transparent;
  border: 2.5px solid #8f80b8;
  border-radius: 999px;
  cursor: pointer;
}

.geo__chip.is-on { color: var(--ink); background: var(--lime); border-color: #000; }
.geo__zoomout { justify-self: center; }
.geo__zoomout:disabled { opacity: .45; cursor: default; }

.geo__go {
  font-family: var(--fat);
  font-size: 22px;
  padding: 8px 28px;
  color: var(--ink);
  background: var(--sun);
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
}

.geo__go:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.geo__go:disabled { opacity: .5; }
.geo__go--small { font-size: 18px; padding: 6px 16px; }

.geo__q { font-size: 22px; font-weight: 700; text-align: center; }
.geo__q--hop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; }

.geo__frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
  padding: 14px;
  background: #fffdf6;
  border: 3px solid #000;
  border-radius: 16px;
  box-shadow: 5px 5px 0 #000;
}

.geo__frame--small { padding: 10px; }
.geo__frame--zoom { width: min(100%, 420px); aspect-ratio: 3 / 2; justify-self: center; padding: 0; }
.geo__frame--shape { padding: 16px; }
.geo__frame--map { padding: 0; background: #bfe8ff; }

.geo__flag { display: block; max-width: min(100%, 360px); max-height: 220px; height: auto; border: 2px solid #241a3a; border-radius: 4px; }
.geo__frame--small .geo__flag { max-height: 90px; }
.geo__flag--zoom { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border: 0; border-radius: 0; transition: transform .45s cubic-bezier(.3, 1, .4, 1); }
.geo__shape { display: block; width: min(100%, 260px); height: auto; aspect-ratio: 1; }
.geo__miniflag { display: inline-block; width: 30px; height: 20px; object-fit: cover; border: 1.5px solid #241a3a; border-radius: 3px; vertical-align: middle; flex-shrink: 0; }
.geo__big-ic { width: 64px; height: 64px; }

.geomap { display: block; width: 100%; height: auto; max-height: min(52vh, 460px); }
.geomap__sea { fill: #bfe8ff; }
.geomap path { fill: #efe9fb; stroke: #241a3a; stroke-width: .7px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.geomap path.is-target, .geomap path.is-to { fill: #ff5fa2; }
.geomap path.is-from { fill: #a6f94c; }
.geomap path.is-path, .geomap path.is-found { fill: #4cc3ff; }
.geomap path.is-near { fill: #ffd84a; }
.geomap path.is-off { fill: #b3a9c9; }
.geomap path.is-reveal { fill: #ffffff; stroke-dasharray: 3 2; }
.geomap path.is-todo { fill: #fff6c9; }
.geomap path.is-missed { fill: #ff8a8a; }
.geomap__ring { fill: none; stroke: #ff5fa2; stroke-width: 3px; vector-effect: non-scaling-stroke; }

.geo__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.geo__choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.15;
  color: var(--ink);
  background: #fffdf6;
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  transition: transform .1s;
}

.geo__choice:hover:not(:disabled) { transform: translate(-1px, -2px); }
.geo__choice:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.geo__choice:disabled { cursor: default; }
.geo__choice.is-right { background: var(--lime); }
.geo__choice.is-wrong { background: #ff8a8a; }
.geo__choices--two .geo__choice { min-height: 96px; flex-direction: column; font-size: 21px; }
.geo__choices--two .geo__miniflag { width: 72px; height: 48px; }

.geo__note { min-height: 28px; font-size: 19px; text-align: center; }
.geo__note.is-good { color: var(--lime); }
.geo__note.is-bad { color: #ff9cb6; }

.geo__form { display: flex; gap: 8px; }

.geo__input {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fffdf6;
  border: 3px solid #000;
  border-radius: 12px;
}

.geo__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.geo__rows li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 26px 44px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 17px;
  color: var(--ink);
  background: #fffdf6;
  border: 2.5px solid #000;
  border-radius: 10px;
}

.geo__rows li.is-right { background: var(--lime); }
.geo__rows b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo__arrow { width: 24px; height: 24px; color: #8f6bff; transition: transform .3s; }

.geo__trail { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.geo__step { padding: 2px 10px; font-size: 16px; font-weight: 700; color: var(--ink); border: 2px solid #000; border-radius: 999px; background: #b3a9c9; }
.geo__step.is-path { background: #4cc3ff; }
.geo__step.is-near { background: #ffd84a; }

@media (max-width: 560px) {
  .geo__choices { grid-template-columns: minmax(0, 1fr); }
  .geo__choices--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .geo__choice { font-size: 17px; min-height: 48px; }
  .geo__rows li { grid-template-columns: 26px minmax(0, 1fr) auto 22px; font-size: 15px; gap: 6px; }
  .geo__rows li > span:last-child { display: none; }
  .geo__q { font-size: 19px; }
  .geomap { max-height: 42vh; }
}

.game { display: grid; gap: 12px; height: 100%; align-content: start; }
.game__hud { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-family: var(--pixel); font-size: 24px; }
.game__hud b { color: var(--sun); font-weight: 400; }
.game__msg { font-size: 20px; min-height: 26px; }

.gbtn {
  font-family: var(--fat);
  font-size: 20px;
  padding: 6px 16px;
  color: var(--ink);
  background: var(--lime);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.gbtn--alt { background: var(--paper); }
.gbtn.is-on { background: var(--pink); color: #fff; }

.aim {
  position: relative;
  height: min(520px, calc(100vh - 220px)); height: min(520px, calc(100dvh - 220px));
  min-height: 300px;
  background: radial-gradient(circle at 50% 40%, #2c2257, #120d2b);
  border: 3px solid #000;
  border-radius: 14px;
  overflow: hidden;
  touch-action: manipulation;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.aim__t {
  position: absolute;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, var(--pink) 19% 45%, #fff 46% 58%, var(--pink) 59%);
  border: 2px solid #000;
  animation: shrink var(--life) linear forwards;
  touch-action: manipulation;
}

@keyframes shrink { from { transform: scale(1); } to { transform: scale(.25); opacity: .6; } }

.aim__pop { position: absolute; pointer-events: none; font-family: var(--pixel); font-size: 22px; color: var(--lime); animation: rise .6s ease-out forwards; }
@keyframes rise { to { transform: translateY(-30px); opacity: 0; } }

.aim__cover { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(18, 13, 43, .82); }
.aim__cover p { font-size: 22px; margin-bottom: 12px; }

.mines { display: grid; justify-content: center; gap: 10px; }

.mines__board {
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  border: 4px solid;
  border-color: #808080 #fff #fff #808080;
  background: #bdbdbd;
  width: max-content;
  margin: 0 auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.mines__board button {
  width: var(--cell);
  height: var(--cell);
  padding: 0;
  display: grid;
  place-items: center;
  font-family: var(--fat);
  font-size: calc(var(--cell) * .55);
  background: #c6c6c6;
  border: 3px solid;
  border-color: #fff #7b7b7b #7b7b7b #fff;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mines__board button.is-open { border: 1px solid #9a9a9a; background: #bdbdbd; cursor: default; }
.mines__board button.is-boom { background: var(--pink); }
.mines__board button svg { width: 70%; height: 70%; }
.mines__board .n1 { color: #1d4ed8; } .mines__board .n2 { color: #15803d; } .mines__board .n3 { color: #dc2626; }
.mines__board .n4 { color: #1e1b4b; } .mines__board .n5 { color: #7f1d1d; } .mines__board .n6 { color: #0f766e; }
.mines__board .n7 { color: #000; } .mines__board .n8 { color: #555; }

.mines__face { width: 48px; height: 48px; padding: 4px; background: #c6c6c6; border: 3px solid; border-color: #fff #7b7b7b #7b7b7b #fff; cursor: pointer; }
.mines__face svg { width: 100%; height: 100%; }

.hop { width: 100%; height: min(420px, calc(100vh - 240px)); height: min(420px, calc(100dvh - 240px)); min-height: 260px; display: block; border: 3px solid #000; border-radius: 14px; background: #bdf0ff; touch-action: manipulation; }

/* ---------- footer ---------- */

.foot { text-align: center; padding: 10px 16px 60px; font-size: 19px; }

/* ---------- phones, tablets and narrow windows: the desk becomes a stack ---------- */

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .for-desk { display: none; }
  .for-touch { display: inline; }

  .desk {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 34px;
    padding: 24px 16px 20px;
    height: auto !important;
  }

  .item {
    position: relative;
    left: auto !important;
    top: auto !important;
    max-width: 100%;
    cursor: default;
    touch-action: auto;
  }

  .title { order: 0; }
  .flag { order: 1; margin-top: -18px; }
  .bubble { order: 2; }
  .slime { order: 3; }
  .note { order: 4; }
  .index { order: 5; }
  .stats { order: 6; }
  .links { order: 7; justify-items: center; }
  .madetitle, .made { order: 8; }
  .work { order: 9; }
  .polaroid { order: 10; }
  .badges { order: 11; }
  .drawer { order: 12; }
  .panic { order: 13; }

  .title__word { font-size: clamp(56px, 17vw, 96px); }

  .note, .index, .badges, .drawer, .bubble, .stats, .work { width: min(360px, 100%); }
  .made { width: min(360px, 100%); }
  .madetitle h2 { font-size: 28px; }

  .polaroid__pic { width: min(240px, 70vw); height: auto; }

  .index dl { font-size: 18px; }
}

@media (max-width: 860px) {
  body { font-size: 20px; }

  .fridge { padding: 30px 12px 20px; }

  .fridge__door {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "send" "wall";
    padding: 26px 18px 30px;
    border-radius: 26px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .fridge__handle { height: 100px; right: 8px; width: 12px; }
  .fridge__head { padding-right: 18px; }

  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }

  .studio__bar { gap: 6px 10px; padding-left: 10px; padding-right: 10px; }
  .studio__sliders input { width: 84px; }
  .studio__stage { padding: 10px; }
  .studio__stage .canvas-stack { width: min(100%, calc(100vh - 300px)); width: min(100%, calc(100dvh - 300px)); }

  .term { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; box-shadow: none; }
  .term__bar { padding-top: calc(8px + env(safe-area-inset-top)); }
  .arcade { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; box-shadow: none; }
  .stats__bars li { grid-template-columns: 106px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track, .b88--rainbow, .slime__body, .slime__eyes, .flag__cloth { animation: none; }
  .item, .post, .sticker { transition: none; }
}

/* ---------- 404 ---------- */

.lost { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 16px; }
.lost__box { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 30px 24px; background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow); }
.lost__box h1 { font-family: var(--fat); font-weight: 400; font-size: 72px; color: var(--pink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }

/* ---------- 6 7 ---------- */

.ss {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 216, 74, .55), rgba(143, 107, 255, .55) 45%, rgba(29, 22, 64, .85));
  animation: ss-in .25s ease-out both, ss-pulse var(--beat) ease-in-out .5s infinite;
  transition: opacity .45s;
}

.ss.is-out { opacity: 0; }

@keyframes ss-in { from { opacity: 0; } }
@keyframes ss-pulse { 50% { filter: brightness(1.18) saturate(1.2); } }

.ss__digits { display: flex; gap: .05em; font-family: var(--fat); font-size: clamp(140px, 34vw, 340px); line-height: .9; }

.ss__digits span {
  display: inline-block;
  -webkit-text-stroke: 10px var(--ink);
  paint-order: stroke fill;
  text-shadow: 10px 12px 0 var(--ink);
}

.ss__six { color: var(--pink); animation: ss-slam-l .55s cubic-bezier(.2, 1.5, .4, 1) both, ss-see calc(var(--beat) * 2) ease-in-out .6s infinite; }
.ss__seven { color: var(--blue); animation: ss-slam-r .55s cubic-bezier(.2, 1.5, .4, 1) .12s both, ss-see calc(var(--beat) * 2) ease-in-out calc(.6s - var(--beat)) infinite; }

@keyframes ss-slam-l { from { transform: translateX(-110vw) rotate(-40deg) scale(1.4); } }
@keyframes ss-slam-r { from { transform: translateX(110vw) rotate(40deg) scale(1.4); } }
@keyframes ss-see { 0%, 100% { transform: translateY(-22px) rotate(-4deg); } 50% { transform: translateY(22px) rotate(4deg); } }

.ss__ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 10px solid #fff;
  border-radius: 50%;
  opacity: 0;
  animation: ss-ring .7s ease-out .5s;
}

@keyframes ss-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(28); } }

.ss__hands { display: flex; gap: clamp(30px, 14vw, 160px); margin-top: -10px; }
.ss__hand svg { display: block; width: clamp(80px, 18vw, 150px); height: auto; filter: drop-shadow(6px 8px 0 rgba(36, 26, 58, .5)); }
.ss__hand--l { animation: ss-bob calc(var(--beat) * 2) ease-in-out infinite; }
.ss__hand--r { animation: ss-bob calc(var(--beat) * 2) ease-in-out calc(var(--beat) * -1) infinite; }
.ss__hand--r svg { transform: scaleX(-1); }

@keyframes ss-bob { 0%, 100% { transform: translateY(-34px) rotate(-6deg); } 50% { transform: translateY(34px) rotate(6deg); } }

.ss__cap {
  font-family: var(--fat);
  font-size: clamp(34px, 8vw, 72px);
  color: var(--sun);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 var(--ink);
  animation: ss-cap var(--beat) ease-in-out infinite alternate;
}

@keyframes ss-cap { to { transform: scale(1.12) rotate(-3deg); } }

.ss__sub { font-weight: 700; font-size: clamp(18px, 4vw, 26px); color: #fff; text-shadow: 2px 2px 0 var(--ink); }

.ss__drop { font-family: var(--fat); font-size: 46px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; z-index: 10002; }

body.is-67 main { animation: ss-seesaw calc(60s / 140 * 2) ease-in-out infinite; transform-origin: 50% 30vh; }

@keyframes ss-seesaw { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }

@media (prefers-reduced-motion: reduce) {
  .ss, .ss__six, .ss__seven, .ss__hand--l, .ss__hand--r, .ss__cap, .ss__ring { animation: none; }
}

/* ---------- the panic button breaks the page ---------- */

.evil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.evil svg { display: block; width: 100%; height: 100%; }
.ev-txt text { font-family: var(--pixel); fill: #ff3355; animation: evflicker 2.6s steps(1) infinite; }
.ev-txt text:nth-child(2n) { fill: #ff8fa6; animation-delay: -1.3s; }
.ev-eye { transform-box: fill-box; transform-origin: center; animation: evblink 4.2s infinite; }
.ev-wire { animation: evwire 1.2s linear infinite; }

@keyframes evflicker { 0%, 100% { opacity: .9; } 7% { opacity: .25; } 9% { opacity: .9; } 51% { opacity: .5; } 53% { opacity: .95; } }
@keyframes evblink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
@keyframes evwire { to { stroke-dashoffset: -44; } }

.cracks { position: fixed; inset: 0; z-index: 9990; width: 100%; height: 100%; pointer-events: none; }
.cracks path { fill: none; stroke: #fdfcff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cracks path.cracks__shadow { stroke: #241a3a; stroke-width: 5; opacity: .55; }

body.is-cracking .item.is-loose { transform: rotate(calc(var(--tilt, 0deg) + var(--loose, 8deg))) translateY(var(--sag, 8px)); }
body.is-cracking .panic__log { padding: 2px 10px; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; }

.item.is-fallen { pointer-events: none; animation: fall 1.3s cubic-bezier(.55, 0, .9, .55) forwards !important; }
.item.is-gone { visibility: hidden; animation: none !important; }

@keyframes fall {
  from { transform: rotate(calc(var(--tilt, 0deg) + var(--loose, 0deg))) translateY(var(--sag, 0px)); }
  to { transform: translateY(120vh) rotate(var(--spin, 60deg)); }
}

main.is-glitch { filter: hue-rotate(140deg) saturate(2.4) contrast(1.2); transform: translate(4px, -2px) skewX(-1deg); }

.marquee.is-evil { color: #ff2d55; background: #0b0306; border-bottom-color: #ff2d55; }

body.is-broken :is(.toolbar, .fridge, .foot) { filter: grayscale(.6) brightness(.85); }
body.is-broken .fridge { transform: rotate(-1.2deg) translateY(10px); }

.evil__fix {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9995;
  transform: translateX(-50%);
  font-family: var(--fat);
  font-size: 20px;
  padding: 8px 22px;
  color: #241a3a;
  background: var(--lime);
  border: 3px solid #241a3a;
  border-radius: 999px;
  box-shadow: 4px 4px 0 #241a3a;
  cursor: pointer;
}

/* ---------- dyslexia mode (fonts are SIL OFL, self-hosted) ---------- */

@font-face { font-family: "OpenDyslexic"; src: url("/fonts/OpenDyslexic-400-normal-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("/fonts/OpenDyslexic-700-normal-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/Lexend-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/Lexend-700-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/Atkinson-400-normal-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/Atkinson-700-normal-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }

.rd__btn.is-on { background: var(--sun); }

.rd {
  position: absolute;
  z-index: 9500;
  width: min(340px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  font-family: var(--hand);
  font-size: 18px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.rd__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--fat); font-size: 21px; cursor: pointer; }
.rd__head b { font-weight: 400; }
.rd__label { font-weight: 700; margin-bottom: -4px; }

.rd__switch {
  appearance: none;
  width: 52px;
  height: 30px;
  margin: 0;
  position: relative;
  background: #d9d2ea;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}

.rd__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: transform .15s;
}

.rd__switch:checked { background: var(--lime); }
.rd__switch:checked::after { transform: translateX(21px); }

.rd__choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rd__tints { grid-template-columns: repeat(5, 1fr); }

.rd__choices button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 2px 4px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
}

.rd__choices button[aria-checked="true"] { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); }
.rd__choices b { font-size: 22px; line-height: 1.1; font-weight: 700; }
.rd__choices small { font-size: 13px; line-height: 1.1; text-align: center; }
.rd__choices i { display: grid; place-items: center; width: 30px; height: 30px; font-style: normal; font-weight: 700; border: 2px solid var(--ink); border-radius: 50%; }
.rd .rd__fonts b, html.is-dys body div.rd.rd .rd__fonts b { font-family: var(--f) !important; }

.rd__row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 56px; align-items: center; gap: 8px; font-size: 17px; }
.rd__row input[type="range"] { width: 100%; accent-color: var(--grape); }
.rd__row output { font-family: var(--pixel); font-size: 19px; text-align: right; }
.rd__row--check { grid-template-columns: 1fr auto; cursor: pointer; }
.rd__row--check input { width: 22px; height: 22px; accent-color: var(--grape); }

.rd__reset { justify-self: start; font-weight: 700; padding: 2px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; }

.rd__ruler {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9400;
  height: calc(1em * var(--dys-line, 1.7) * var(--dys-size, 1) * 1.15);
  margin-top: calc(-0.5em * var(--dys-line, 1.7) * var(--dys-size, 1) * 1.15);
  font-size: 21px;
  pointer-events: none;
  background: rgba(255, 216, 74, .22);
  border-top: 2px solid rgba(255, 216, 74, .8);
  border-bottom: 2px solid rgba(255, 216, 74, .8);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .16);
}

/* the mode itself: only the reading changes. The look, motion and layout stay. */

html.is-dys[data-tint]:not([data-tint="none"]) { --paper: var(--dys-card); }

html.is-dys body,
html.is-dys body :is(h2, h3, h4, p, li, dt, dd, span, b, strong, em, small, a, button, input, textarea, label, summary, output, code):not(:is(.marquee, .b88, .term, .arcade, .title__word, .wp__title, .lost__box, .rd) *, .kana) {
  font-family: var(--dys-font) !important;
  letter-spacing: var(--dys-letter) !important;
  word-spacing: var(--dys-word) !important;
}

html.is-dys :is(p, li, dd, summary, label, .md, .wp__summary) { line-height: var(--dys-line) !important; }
html.is-dys :is(p, li, dd, dt, summary, label):not(:is(.rd, .term, .arcade, .marquee) *) { zoom: var(--dys-size); }
html.is-dys :is(li p, li li) { zoom: 1; }

html.is-dys body div.rd.rd, html.is-dys body div.rd.rd * { font-family: var(--hand) !important; letter-spacing: 0 !important; word-spacing: 0 !important; line-height: 1.2 !important; }
html.is-dys body div.rd.rd .rd__head b { font-family: var(--fat) !important; }
html.is-dys body div.rd.rd .rd__row output { font-family: var(--pixel) !important; }
