/* The feedback box (js/feedback.js): a sheet with a note that goes through a
   shredder. The movie page and game night share it; each wears its own room
   through data-page, from the tokens its own sheets already set (site.css and
   weberplex.css for the movie page, arcade.css for game night). */
.fb-overlay[data-page='movie'] {
  --fb-dim: rgb(10 4 7 / 0.72);
  --fb-card: var(--velvet-2);
  --fb-border: 1px solid var(--bulb);
  --fb-radius: 14px;
  --fb-text: var(--screen);
  --fb-soft: var(--dim);
  --fb-accent: var(--bulb);
  --fb-kicker: 600 0.75rem/1 var(--f-body);
  --fb-title: 700 1.5rem/1.15 var(--f-display);
  --fb-thanks: 700 1.375rem/1.25 var(--f-display);
  --fb-paper: var(--ticket);
  --fb-ink: var(--ticket-ink);
  --fb-ink-soft: var(--ticket-label);
  --fb-paper-rule: rgb(122 74 62 / 0.22);
  --fb-note: 400 1rem/1.5rem var(--f-mono);
  --fb-metal: #15100d;
  --fb-metal-hi: #3b3029;
  --fb-brand: var(--dim);
  --fb-brand-font: 600 0.625rem/1 var(--f-body);
  --fb-led: var(--bulb);
  --fb-led-off: #4a3b30;
  --fb-bin: #0b0705;
  --fb-mesh: rgb(255 191 79 / 0.08);
}
.fb-overlay[data-page='game'] {
  --fb-dim: rgb(5 7 26 / 0.9);
  --fb-card: var(--panel-2);
  --fb-border: 3px solid var(--line);
  --fb-radius: 0;
  --fb-text: var(--text);
  --fb-soft: var(--soft);
  --fb-accent: var(--lime);
  --fb-kicker: 400 0.6875rem/1 var(--f-label);
  --fb-title: 400 2.25rem/1 var(--f-pixel);
  --fb-thanks: 400 1.875rem/1.05 var(--f-pixel);
  --fb-paper: #fffdf4;
  --fb-ink: #0b0f2e;
  --fb-ink-soft: #5a6190;
  --fb-paper-rule: rgb(31 47 160 / 0.16);
  --fb-note: 400 1rem/1.5rem var(--f-body);
  --fb-metal: #0b0f2e;
  --fb-metal-hi: #3a4bb8;
  --fb-brand: var(--gold);
  --fb-brand-font: 400 0.625rem/1 var(--f-label);
  --fb-led: var(--lime);
  --fb-led-off: #23306f;
  --fb-bin: #070a22;
  --fb-mesh: rgb(156 255 60 / 0.1);
}

.fb-overlay {
  position: fixed; inset: 0; z-index: 47; display: grid; place-items: end center; overflow-y: auto;
  padding: 16px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--fb-dim);
}
.fb-overlay[hidden] { display: none; }
@media (min-width: 640px) { .fb-overlay { place-items: center; padding: 16px; } }
.fb-card {
  width: min(26rem, 100%); min-width: 0; display: grid; gap: 8px; padding: 16px 18px 18px;
  border: var(--fb-border); border-radius: var(--fb-radius); background: var(--fb-card); color: var(--fb-text);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.6); overflow-wrap: anywhere;
}
.fb-card:focus { outline: none; }
.fb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fb-kicker { font: var(--fb-kicker); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fb-soft); }
.fb-card h2 { margin: 0; font: var(--fb-title); color: var(--fb-accent); text-wrap: balance; }
.fb-hint { margin: 0; color: var(--fb-soft); font-size: 0.9375rem; line-height: 1.4; }
.fb-msg { margin: 0; color: var(--bad, var(--pink)); font-size: 0.9375rem; }
.fb-msg:empty { display: none; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-actions [hidden] { display: none; }

/* The stage: the note on top, its bottom edge in the shredder's slot, the bin under it. */
.fb-stage { display: grid; justify-items: center; margin: 4px 0 2px; }
.fb-feed { position: relative; width: 88%; height: 9.75rem; overflow: hidden; }
.fb-paper {
  display: block; box-sizing: border-box; width: 100%; height: 100%; margin: 0; padding: 8px 12px;
  border: 0; border-radius: 3px 3px 0 0; resize: none; overflow-y: auto;
  color: var(--fb-ink); font: var(--fb-note);
  background-color: var(--fb-paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.5rem - 1px), var(--fb-paper-rule) calc(1.5rem - 1px) 1.5rem);
  background-position: 0 8px; background-attachment: local;
}
.fb-paper::placeholder { color: var(--fb-ink-soft); opacity: 1; }
.fb-paper:focus { outline: 2px solid var(--fb-accent); outline-offset: -2px; }
.fb-paper[hidden] { display: none; }
/* The copy that gets cut: plain text, the same box. */
.fb-sheet { position: absolute; inset: 0; white-space: pre-wrap; overflow: hidden; pointer-events: none; }
.fb-strip { position: absolute; top: 0; inset-inline: auto; border-radius: 0; will-change: transform; }

.fb-shredder {
  position: relative; z-index: 1; box-sizing: border-box; width: 100%; height: 36px; padding: 6px 14px 0;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 8px 8px 4px 4px; background: linear-gradient(var(--fb-metal-hi), var(--fb-metal) 70%);
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.35);
}
.fb-slot { position: absolute; top: 0; left: 5%; right: 5%; height: 5px; border-radius: 0 0 3px 3px; background: #000; }
.fb-brand { font: var(--fb-brand-font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fb-brand); }
.fb-led { width: 8px; height: 8px; border-radius: 50%; background: var(--fb-led-off); }
.fb-shredder.on .fb-led { background: var(--fb-led); box-shadow: 0 0 8px var(--fb-led); }
.fb-bin {
  position: relative; width: 94%; height: 4.75rem; margin-top: -2px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
  background-color: var(--fb-bin);
  background-image:
    repeating-linear-gradient(90deg, var(--fb-mesh) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(0deg, var(--fb-mesh) 0 2px, transparent 2px 10px);
}

/* Done: the thanks sits where the note was, and the long word waves. */
.fb-thanks {
  position: absolute; inset: 0; margin: 0; padding: 8px; display: grid; place-content: center;
  text-align: center; font: var(--fb-thanks); color: var(--fb-accent); text-wrap: balance;
}
.fb-thanks:empty { display: none; }
.fb-long { white-space: nowrap; }
.fb-long span { display: inline-block; animation: fb-wave 0.7s ease-in-out calc(var(--i) * 55ms) 2 both; }
@keyframes fb-wave { 50% { transform: translateY(-0.28em); } }
.fb-card[data-state='done'] .fb-thanks { animation: fb-in 0.35s ease-out both; }
@keyframes fb-in { from { opacity: 0; transform: translateY(6px); } }

/* The label for screen readers (game night's sheet has no .sr-only of its own). */
.fb-overlay .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The way in, under each page's footer. */
.fb-invite { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.footer .fb-invite { flex-basis: 100%; font-size: 0.875rem; color: var(--dim); }
.foot .fb-invite { justify-content: center; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .fb-long span, .fb-card[data-state='done'] .fb-thanks { animation: none; }
}
