:root {
  --f-label: 'Special Elite', 'Courier New', monospace;
  --f-hand: 'Caveat', 'Segoe Script', cursive;
  --f-body: 'Karla', system-ui, -apple-system, sans-serif;

  --line: rgba(233, 245, 224, 0.1);
  --line-bold: rgba(233, 245, 224, 0.2);

  --fit: 1;

  --mgap: clamp(20px, 5vw, 38px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100000;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-label);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border-radius: 0 0 4px 4px;
  transition: top 0.18s ease;
}
.skip:focus { top: 0; }

.mat {
  position: fixed;
  inset: 0;

  background:
    repeating-linear-gradient(180deg, var(--line-bold) 0 1px, transparent 1px 150px),
    repeating-linear-gradient(90deg, var(--line-bold) 0 1px, transparent 1px 150px),
    repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 30px),
    radial-gradient(130% 110% at 50% 0%, var(--mat) 0%, var(--mat-dark) 100%);
  box-shadow:
    inset 0 0 220px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  touch-action: none;
  isolation: isolate;
}

.mat::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: overlay;
}

.ruler {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;

  height: 16px;
  background:
    repeating-linear-gradient(90deg, var(--line-bold) 0 1px, transparent 1px 15px),
    rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid var(--line-bold);
  pointer-events: none;
  z-index: 900;
}
.ruler--left {
  top: 0;
  bottom: 0;
  left: 0;
  right: auto;
  width: 16px;
  height: auto;

  background:
    repeating-linear-gradient(180deg, var(--line-bold) 0 1px, transparent 1px 15px),
    rgba(0, 0, 0, 0.18);
  border-bottom: 0;
  border-right: 1px solid var(--line-bold);

  clip-path: inset(16px 0 0 0);
}

.item {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);

  --cx: -50%;       
  --cy: -50%;
  --dx: 0px;        
  --dy: 0px;
  --rot: 0deg;
  --s: 1;
  --lift: 0;

  transform:
    translate(var(--cx), var(--cy))
    translate(var(--dx), var(--dy))
    rotate(var(--rot))
    scale(calc(var(--s) * var(--fit) * (1 + var(--lift) * 0.05)));

  --shadow: 0 6px 9px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow);

  transition: box-shadow 0.25s ease, filter 0.25s ease,
    transform 0.35s cubic-bezier(0.2, 1.1, 0.4, 1);
  cursor: grab;
  text-decoration: none;
  color: var(--ink);
  display: block;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  border: 0;
  text-align: left;
  font-family: var(--f-body);
  background-color: transparent;
}

.item.dragging {
  cursor: grabbing;
  transition: box-shadow 0.2s ease, filter 0.2s ease;
  --shadow: 0 26px 26px rgba(0, 0, 0, 0.55);
  will-change: transform;
}
.item:hover { --shadow: 0 12px 16px rgba(0, 0, 0, 0.55); }
.item:focus-visible { outline: 2px dashed var(--paper-2); outline-offset: 8px; }

.item.decor,
.item.shaped {
  box-shadow: none;
  filter: drop-shadow(var(--shadow));
}

.item.settle { animation: settle 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes settle {
  0% {
    transform: translate(var(--cx), var(--cy)) translate(var(--dx), var(--dy))
      rotate(calc(var(--rot) - 4deg)) scale(calc(var(--s) * var(--fit) * 1.04));
  }
  60% {
    transform: translate(var(--cx), var(--cy)) translate(var(--dx), var(--dy))
      rotate(calc(var(--rot) + 2deg)) scale(calc(var(--s) * var(--fit)));
  }
  100% {
    transform: translate(var(--cx), var(--cy)) translate(var(--dx), var(--dy))
      rotate(var(--rot)) scale(calc(var(--s) * var(--fit)));
  }
}

.item.decor { z-index: 3; }

.item.nolink { cursor: grab; }
.mat[data-editmode] .item.nolink::after {
  content: 'no link';
  position: absolute;
  right: -6px;
  bottom: -10px;
  font-family: var(--f-label);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: var(--paper-2);
  background: rgba(158, 59, 46, 0.85);
  padding: 2px 5px;
  border-radius: 2px;
  pointer-events: none;
}

.label { font-family: var(--f-label); letter-spacing: 0.02em; line-height: 1.15; }
.note { font-family: var(--f-hand); color: var(--ink-blue); line-height: 1.05; }

.papertex {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23p)' opacity='0.45'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
}

.header-note {
  width: clamp(196px, 19vw, 320px);
  padding: 12px 16px 14px;
  text-align: center;
}
.header-note .eyebrow {
  font-family: var(--f-label);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: #8a8371;
  text-transform: uppercase;
}
.header-note .h {
  font-family: var(--f-hand);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-weight: 700;
  color: var(--ink);
  margin-top: 3px;
  line-height: 1.1;
}
.header-note .sub {
  font-size: 0.72rem;
  color: #605a4c;
  margin-top: 6px;
  line-height: 1.4;
}

.polaroid {
  width: clamp(150px, 13vw, 224px);
  padding: 10px 10px 0;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow);
}
.polaroid .shot {
  aspect-ratio: 1;
  background: linear-gradient(165deg, #365a2e, #1c2e19);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.polaroid .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid .shot svg { width: 58%; }
.polaroid .caption {
  font-family: var(--f-hand);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  text-align: center;
  padding: 7px 2px 12px;
  color: var(--ink);
  line-height: 1.1;
}
.polaroid .caption small {
  display: block;
  font-family: var(--f-label);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: #8a8371;
  margin-top: 4px;
}

.film {
  width: clamp(124px, 11vw, 186px);
  padding: 13px 7px;
  background: #1a1a18;
  border-radius: 2px;
}
.film .holes { display: flex; justify-content: space-between; padding: 0 3px; margin: 0 0 7px; }
.film .holes span { width: 8px; height: 6px; background: var(--paper); border-radius: 1px; opacity: 0.85; }
.film .holes.bottom { margin: 7px 0 0; }
.film .frame {
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, #3f6534, #22371f);
  display: grid;
  place-items: center;
}
.film .frame svg { width: 30%; fill: var(--paper); opacity: 0.9; }
.film .cap {
  text-align: center;
  color: var(--paper);
  font-family: var(--f-label);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  padding-top: 8px;
}
.film .film-sub {
  text-align: center;
  color: #b8c9ac;
  font-size: 0.95rem;
  padding-top: 2px;
}

.tape-case {
  width: clamp(158px, 15vw, 240px);
  padding: 11px;
  background: linear-gradient(160deg, #3a3a36, #1e1e1b);
  border-radius: 4px;
}
.tape-case .sticker { padding: 9px 10px 11px; }
.tape-case .reels { display: flex; justify-content: space-around; align-items: center; margin-top: 9px; }
.tape-case .reel {
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #2c2c28 34%, #6b6b62 35%, #4a4a43 100%);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
.tape-case .band { flex: 1; height: 9px; margin: 0 6px; background: #1e1e1b; border-radius: 2px; }
.tape-case .t { font-size: 0.9rem; }
.tape-case .n { font-size: 1.05rem; margin-top: 2px; }

.seed {
  width: clamp(134px, 12vw, 204px);
  padding: 14px 12px 16px;
  background-color: var(--kraft);
  border-radius: 2px 2px 0 0;
  text-align: center;
}
.seed .flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.14), transparent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}
.seed .win {
  margin: 16px auto 10px;
  width: 64%;
  aspect-ratio: 1.35;
  background: rgba(30, 45, 25, 0.34);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}
.seed .win svg { width: 52%; opacity: 0.85; }
.seed .t { font-size: 0.94rem; }
.seed .n { font-size: 1.05rem; margin-top: 2px; }

.tag-wrap { width: clamp(120px, 11vw, 180px); }
.tag-wrap .string { display: block; height: 34px; width: 100%; margin-bottom: -3px; }
.tag {
  padding: 15px 12px 14px;
  clip-path: polygon(0 12%, 50% 0, 100% 12%, 100% 100%, 0 100%);
  text-align: center;
}
.tag .hole {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #20321c;
  margin: 0 auto 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}
.tag .t { font-size: 0.9rem; }
.tag .n { font-size: 1rem; margin-top: 2px; }

.folded {
  width: clamp(136px, 12vw, 200px);
  padding: 16px 14px;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23p2)' opacity='0.45'/%3E%3C/svg%3E");
  background-position: center, center, 0 0;
  background-size: 50% 100%, 100% 50%, auto;
  background-repeat: no-repeat, no-repeat, repeat;
  background-color: var(--paper-2);
  background-blend-mode: normal, normal, multiply;
}
.folded .t { font-size: 0.92rem; }
.folded .n { font-size: 1.05rem; margin-top: 3px; }

.washi {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 22px;
  margin-left: -26px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, rgba(213, 224, 196, 0.85), rgba(178, 196, 155, 0.78));
  clip-path: polygon(3% 8%, 97% 0, 100% 92%, 0 100%);
  transform: rotate(-7deg);
  pointer-events: none;
}

.ticket {
  width: clamp(168px, 16vw, 260px);
  display: flex;
  align-items: stretch;
  border-radius: 3px;
  overflow: hidden;
}
.ticket .ticket-main { padding: 13px 12px; flex: 1; min-width: 0; }
.ticket .t { font-size: 0.9rem; }
.ticket .n { font-size: 1.05rem; margin-top: 2px; }

.ticket .ticket-stub {
  position: relative;
  width: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-left: 2px dashed rgba(0, 0, 0, 0.28);
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 7px,
      rgba(0, 0, 0, 0.05) 7px 8px
    ),
    rgba(158, 59, 46, 0.07);
}
.ticket .ticket-stub::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: #20321c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}
.ticket .ticket-stub span {
  font-family: var(--f-label);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: var(--stamp);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  padding-top: 24px;  
}

.profilecard {
  width: clamp(140px, 13vw, 205px);
  padding: 11px 11px 13px;
  text-align: center;
  border-radius: 3px;
}

.profilecard .pc-ecke {
  position: absolute;
  top: 0;
  right: 0;
  width: 17px;
  height: 17px;
  background: linear-gradient(225deg, var(--mat-dark) 0 50%, rgba(0, 0, 0, 0.16) 50%);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  pointer-events: none;
}
.profilecard .pc-rahmen {
  padding: 5px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(43, 42, 36, 0.16), 0 1px 2px rgba(0, 0, 0, 0.25);
}
.profilecard .pc-foto {
  display: block;
  width: 100%;

  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(165deg, #365a2e, #1c2e19);
}
.profilecard .pc-foto-leer {
  display: grid;
  place-items: center;
  color: rgba(233, 245, 224, 0.5);
}
.profilecard .pc-foto-leer svg { width: 46%; }

.profilecard .t {
  font-size: 0.88rem;
  margin-top: 9px;
  line-height: 1.2;
  overflow-wrap: break-word;
}
.profilecard .n { font-size: 1rem; margin-top: 1px; }

.profilecard .pc-zahl {
  margin: 9px auto 0;
  display: inline-block;
  padding: 3px 9px 4px;
  border: 2px solid var(--stamp);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(158, 59, 46, 0.25);
  transform: rotate(-1.5deg);
  color: var(--stamp);
  line-height: 1;
}
.profilecard .pc-zahl strong {
  display: block;
  font-family: var(--f-label);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  font-weight: 400;
}
.profilecard .pc-zahl small {
  display: block;
  font-family: var(--f-label);

  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.85;
}

.vinyl {
  width: clamp(158px, 15vw, 236px);
  padding: 12px 12px 13px;
  text-align: center;
}

.vinyl .platter {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  isolation: isolate;
}

.vinyl .disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #16161a 0 27%, transparent 27%),
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, 0.045) 0 1px,
      rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(circle at 50% 50%, #26262b 0%, #101013 62%, #1c1c20 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;

  animation: vinyl-spin 3s linear infinite;
  animation-play-state: paused;
}
.vinyl.is-playing .disc { animation-play-state: running; }
@keyframes vinyl-spin {
  to { transform: rotate(360deg); }
}

.vinyl.is-playing.can-scratch .platter {
  cursor: grab;
  touch-action: none;
}
.vinyl.is-scratching .platter { cursor: grabbing; }
.vinyl.is-scratching .disc {
  animation: none;
  transform: rotate(var(--turn, 0deg));
}
.vinyl .vinyl-play { cursor: pointer; }

.vinyl .grooves {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%,
    rgba(255, 255, 255, 0.05) 0 1px,
    rgba(0, 0, 0, 0.12) 1px 2.5px);

  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  mask: radial-gradient(circle at 50% 50%, transparent 0 41%, #000 41.5%);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 41%, #000 41.5%);
}

.vinyl .cover {
  position: relative;
  z-index: 1;
  width: 56%;

  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px rgba(0, 0, 0, 0.4);
}
.vinyl .cover-leer {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--kraft), #9d8560);
  color: rgba(30, 40, 26, 0.65);
}
.vinyl .cover-leer svg { width: 38%; }

.vinyl .spindle {
  position: absolute;
  z-index: 2;
  width: 5.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.vinyl .sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0) 34%,
    rgba(255, 255, 255, 0.16) 46%,
    rgba(255, 255, 255, 0.03) 52%,
    rgba(255, 255, 255, 0) 62%);
}

.vinyl .arm {
  position: absolute;
  top: 3%;
  right: -5%;
  width: 34%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(270deg, #c3c9bc, #8d948a);
  transform: rotate(-42deg);
  transform-origin: right center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 4;
}

.vinyl .arm::before {
  content: '';
  position: absolute;
  right: -6px;
  top: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #dfe4da, #7c837a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.vinyl .arm::after {
  content: '';
  position: absolute;
  left: -6px;
  top: -3px;
  width: 11px;
  height: 10px;
  border-radius: 2px 2px 3px 3px;
  background: linear-gradient(160deg, #6c7468, #3f463c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.vinyl .vinyl-ring {
  position: absolute;

  inset: 3px;
  pointer-events: none;
  transform: rotate(-90deg);  
  overflow: visible;
}
.vinyl .vinyl-ring circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}
.vinyl .ring-bg { stroke: rgba(43, 42, 36, 0.14); }
.vinyl .ring-fg {
  stroke: var(--stamp);

  stroke-dasharray: 282.7;
  stroke-dashoffset: calc(282.7 * (1 - var(--progress, 0)));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.vinyl.is-playing .ring-fg { opacity: 1; }

.vinyl .vinyl-play {
  position: absolute;
  z-index: 5;
  right: -3%;
  bottom: -3%;
  width: 31%;
  max-width: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(43, 42, 36, 0.25);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.14s ease, background 0.2s ease;
  padding: 0;
}
.vinyl .vinyl-play:hover { background: var(--paper); transform: scale(1.06); }
.vinyl .vinyl-play:active { transform: scale(0.96); }
.vinyl .vinyl-play:focus-visible { outline: 2px dashed var(--paper-2); outline-offset: 3px; }

.vinyl .vinyl-icon {
  width: 12px;
  height: 14px;
  background: currentColor;

  clip-path: polygon(20% 0%, 100% 50%, 20% 100%);
  transform: translateX(0.8px);
}
.vinyl.is-playing .vinyl-icon {
  height: 13px;
  transform: none;

  clip-path: none;
  background: linear-gradient(
    90deg,
    currentColor 0 33.34%,
    transparent 33.34% 66.66%,
    currentColor 66.66% 100%
  );
}
.vinyl .vinyl-play[data-loading='1'] .vinyl-icon { opacity: 0.35; }

.vinyl .vinyl-link {
  display: block;
  margin-top: 11px;
  text-decoration: none;
  color: var(--ink);
}
.vinyl .vinyl-link .t { display: block; font-size: 0.86rem; }
.vinyl .vinyl-link .n { display: block; font-size: 1.02rem; margin-top: 1px; }
.vinyl .vinyl-hint {
  display: block;
  font-family: var(--f-label);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8371;
  margin-top: 4px;
}
.vinyl a.vinyl-link:hover .vinyl-hint { color: var(--stamp); }
.vinyl a.vinyl-link:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }

.vinyl .vinyl-error {
  display: block;
  font-family: var(--f-label);

  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--stamp);
  margin-top: 5px;
  line-height: 1.3;
}

.envelope { width: clamp(162px, 15vw, 244px); padding: 16px 14px 14px; }
.envelope .rip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: var(--paper-2);
  clip-path: polygon(0 0, 8% 70%, 17% 10%, 26% 80%, 35% 20%, 44% 75%, 53% 15%, 62% 80%, 71% 25%, 80% 70%, 89% 15%, 100% 65%, 100% 0);
  pointer-events: none;
}
.envelope .t { font-size: 0.84rem; letter-spacing: 0.01em; overflow-wrap: break-word; }
.envelope .n { font-size: 1rem; margin-top: 3px; }
.stamp {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-family: var(--f-label);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  padding: 2px 6px;
  transform: rotate(-12deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 1.5, 0.4, 1);
  pointer-events: none;
  background: rgba(244, 237, 221, 0.75);
}
.stamp.show { opacity: 0.95; transform: rotate(-12deg) scale(1); }

.d-leafy { width: clamp(96px, 10vw, 172px); opacity: 0.95; }
.d-clip { width: clamp(34px, 4vw, 48px); opacity: 0.9; }
.d-snip { width: clamp(26px, 3vw, 38px); opacity: 0.85; aspect-ratio: 1.6; }
.snip-paper { clip-path: polygon(0 10%, 100% 0, 92% 100%, 6% 88%); }
.snip-kraft {
  clip-path: polygon(4% 0, 100% 12%, 88% 96%, 0 82%);
  aspect-ratio: 1.3;
  background-color: var(--kraft);
}
.d-mug { width: clamp(58px, 6vw, 96px); }
.d-scissors { width: clamp(84px, 9vw, 140px); }
.d-pencil { width: clamp(96px, 10vw, 158px); }
.d-notebook {
  width: clamp(96px, 10vw, 152px);
  padding: 11px 10px 13px;
  background-color: #7e6a48;
  background-image: none;
  border-radius: 3px;
}
.d-notebook .band {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 22%;
  width: 9px;
  background: linear-gradient(90deg, #20241c, #3a4034);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
.d-notebook .plate { padding: 7px 8px; background: var(--paper-2); position: relative; z-index: 1; }
.d-notebook .plate p {
  font-family: var(--f-label);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #5a5344;
}
.d-loupe { width: clamp(72px, 8vw, 120px); }
.d-pin { width: clamp(18px, 2vw, 30px); }

.d-eraser { width: clamp(46px, 4.8vw, 72px); }
.d-tapestrip {
  width: clamp(48px, 6vw, 86px);
  height: clamp(18px, 2.2vw, 28px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, rgba(228, 235, 214, 0.7), rgba(196, 210, 178, 0.62));
  clip-path: polygon(2% 6%, 98% 0, 100% 94%, 0 100%);
}

.mark {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(calc(var(--s, 1) * var(--fit)));
  pointer-events: none;
  z-index: 2;
}
.m-coffee-ring {
  width: clamp(66px, 7vw, 108px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 7px solid rgba(74, 48, 26, 0.34);
  box-shadow: inset 0 0 10px rgba(74, 48, 26, 0.16);
  filter: blur(0.6px);
}
.m-cuts { width: clamp(90px, 10vw, 160px); }
.m-scuff { width: clamp(110px, 12vw, 190px); }

.hud {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: opacity 0.3s ease;
}

html:not([data-js]) .hud { opacity: 0; pointer-events: none; }

.sound {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(15, 26, 16, 0.6);
  border: 1px solid rgba(207, 224, 194, 0.3);
  border-radius: 50%;
  cursor: pointer;
  color: #cfe0c2;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  order: 2;
}
.sound:hover { background: rgba(15, 26, 16, 0.9); color: #fff; }
.sound:focus-visible { outline: 2px dashed var(--paper-2); outline-offset: 3px; }
.sound svg { width: 19px; height: 19px; }
.sound.off { opacity: 0.55; }
.sound .wave { transition: opacity 0.2s ease; }
.sound.off .wave { opacity: 0; }
.sound .slash { opacity: 0; transition: opacity 0.2s ease; }
.sound.off .slash { opacity: 1; }

.tidy {
  font-family: var(--f-label);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #cfe0c2;
  background: rgba(15, 26, 16, 0.6);
  border: 1px solid rgba(207, 224, 194, 0.3);
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.25s ease;
  order: 1;
}
.tidy:hover { background: rgba(15, 26, 16, 0.9); color: #fff; }
.tidy:focus-visible { outline: 2px dashed var(--paper-2); outline-offset: 3px; }

.tidy:disabled { opacity: 0; pointer-events: none; transform: translateY(6px); }

.footer {
  position: fixed;
  left: 26px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 890;
  font-family: var(--f-label);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: rgba(207, 224, 194, 0.45);
  pointer-events: none;
}

@media (max-width: 960px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-x: hidden; overflow-y: auto; }

  .mat {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--mgap);
    padding: calc(34px + env(safe-area-inset-top)) 14px calc(120px + env(safe-area-inset-bottom));
    touch-action: auto;
  }
  #links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--mgap);
    width: 100%;
  }

  .mat > .item.card,
  #links > .item {
    position: relative;
    align-self: flex-start;
    left: var(--mx, 50%);
    top: auto;
    --cy: 0%;
    flex: none;
    touch-action: pan-y;  
  }
  .mat > .item.card.dragging,
  #links > .item.dragging,
  .item.lifting { touch-action: none; }

  .item.decor {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    pointer-events: none;
    opacity: 0.8;
  }

  .mat[data-editmode] .item.decor { pointer-events: auto; }

  .item { --shadow: 0 4px 7px rgba(0, 0, 0, 0.5); }

  .header-note { width: min(86vw, 340px); padding: 14px 18px 16px; }
  .header-note .h { font-size: clamp(1.45rem, 6.5vw, 1.9rem); }
  .header-note .sub { font-size: 0.8rem; }
  .polaroid { width: min(58vw, 230px); }
  .film { width: min(46vw, 190px); }
  .tape-case { width: min(64vw, 260px); }
  .folded { width: min(58vw, 240px); }
  .seed { width: min(52vw, 210px); }
  .tag-wrap { width: min(48vw, 195px); }
  .ticket { width: min(70vw, 290px); }
  .profilecard { width: min(52vw, 215px); }
  .vinyl { width: min(62vw, 250px); }
  .envelope { width: min(74vw, 300px); }

  .vinyl .vinyl-play { width: 30%; max-width: 58px; }
  .folded .t, .tape-case .t, .seed .t, .tag .t, .ticket .t { font-size: 1rem; }
  .folded .n, .tape-case .n, .seed .n, .tag .n, .ticket .n { font-size: 1.15rem; }
  .envelope .t { font-size: 0.95rem; }

  .tidy { font-size: 0.62rem; padding: 8px 12px; }
  .footer { position: static; text-align: center; padding: 0 0 18px; }
}

@media (min-width: 600px) and (max-width: 960px) {
  .profilecard { width: min(30vw, 240px); }
  .header-note { width: min(52vw, 400px); }
  .header-note .h { font-size: clamp(1.5rem, 3.4vw, 2rem); }
  .polaroid { width: min(34vw, 260px); }
  .film { width: min(28vw, 210px); }
  .tape-case { width: min(38vw, 290px); }
  .folded { width: min(34vw, 270px); }
  .seed { width: min(30vw, 230px); }
  .tag-wrap { width: min(28vw, 215px); }
  .ticket { width: min(40vw, 320px); }
  .envelope { width: min(42vw, 330px); }
}

@media (min-width: 961px) and (max-height: 760px) {
  :root { --fit: 0.9; }
}
@media (min-width: 961px) and (max-height: 620px) {
  :root { --fit: 0.8; }
}

@media (pointer: coarse) {
  .sound { width: 46px; height: 46px; }
  .tidy { padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .vinyl .disc {
    animation: none !important;
    transform: none !important;
  }
  .vinyl .ring-fg { transition: none !important; }
}

.mat[data-editmode] .item { cursor: move; }
.mat[data-editmode] .item.selected { outline: 2px solid #7fd1ff; outline-offset: 6px; }
