/* ============================================================================
   side.css — the rooms the other tapes lie in (scripts/sides.js).
   ============================================================================
   One plate, one list, one deck, and whatever paper came with the songs. Each
   room has its own light and its own stock; the bones are the same. Nothing in
   any of them asks to be played. (CSP: style-src 'self'.)
   ============================================================================ */
:root { --soot: #050403; --wet: #0c0a08; --ink: #8a7a5c; --dim: #4a4132; --lamp: #b8862e; --line: #14110d; --rule: #1a1611;
  --stock-a: #e8dcc4; --stock-b: #c4b48e; --stock-ink: #6d4a0e; --stock-head: #5a4828; --stock-dim: 0.82; }
/* The gutter: sodium on wet brick. Paper that has been rained on. */
body[data-side="gutter"] { --stock-a: #b9ab8c; --stock-b: #8f8266; --stock-ink: #3d2c0c; --stock-head: #33260e; --stock-dim: 0.7; }
/* The scrap: the desk lamp. Warmer, closer, nothing squared up. */
body[data-side="scrap"] { --ink: #9a8660; --dim: #56482f; --lamp: #d39a3c; --wet: #100c07; --line: #1a140c; }
/* The sensei side: clean stock, level rows. Kept, not dropped. */
body[data-side="sensei"] { --ink: #a39a86; --dim: #55503f; --lamp: #d8c79a; --wet: #0d0c0a; --stock-a: #efe8d6; --stock-b: #d9cfb6; --stock-dim: 0.9; }
/* The bird's: daylight coming, the only cold light in the house. Not his. */
body[data-side="bird"] { --soot: #05070a; --wet: #0b1016; --ink: #7f8d98; --dim: #3d4852; --lamp: #a9c0d0; --line: #10161c; --rule: #18202a;
  --stock-a: #dfe4e6; --stock-b: #b7c0c6; --stock-ink: #2c3a46; --stock-head: #33424e; }
/* One night a year: a candle in something hollow. */
body[data-side="halloween"] { --soot: #060405; --wet: #120a06; --ink: #9b6a3a; --dim: #54342a; --lamp: #e2701a; --line: #1a0f0a; --rule: #24130c;
  --stock-a: #e6cfa6; --stock-b: #c09a62; --stock-ink: #5a2408; --stock-head: #4a2208; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; }
html, body { background: var(--soot); }
body { color: var(--ink); font-family: 'Courier Prime', Courier, monospace; min-height: 100vh; overflow-x: hidden; }

.plate { position: relative; width: 100%; height: 62vh; min-height: 300px; max-height: 720px; overflow: hidden; background: var(--soot); }
.plate img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; filter: brightness(0.82); }
.plate::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,4,3,0.55) 0%, rgba(5,4,3,0) 22%, rgba(5,4,3,0) 60%, var(--soot) 100%); }
/* A room with no plate hung yet: the dark it would hang in, and one light a long way off. */
.plate.is-bare { height: 30vh; min-height: 200px;
  background: radial-gradient(ellipse 34% 60% at 72% 8%, color-mix(in srgb, var(--lamp) 16%, transparent), transparent 70%), var(--soot); }

.run { max-width: 720px; margin: -2.2rem auto 0; padding: 0 5vw 4rem; position: relative; z-index: 1; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim);
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); }
.head b { font-weight: 700; color: var(--ink); }
.s-row { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.8rem; align-items: baseline;
  width: 100%; padding: 0.78rem 0.2rem; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.s-row:hover, .s-row:focus-visible { background: var(--wet); outline: none; }
.s-no, .s-time { font-size: 0.72rem; color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.s-row.is-playing { background: var(--wet); }
.s-row.is-playing .s-title, .s-row.is-playing .s-no { color: var(--lamp); }
.s-row.is-jammed .s-title::after { content: ' — the tape chewed.'; opacity: 0.7; font-style: italic; }
.s-sec { height: 3.2rem; display: flex; align-items: flex-end; padding: 0 0.2rem 0.5rem; border-bottom: 1px solid var(--line); }
.s-sec span { font-style: italic; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--dim); }
.foot { display: flex; justify-content: space-between; margin-top: 1rem;
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.back { display: inline-block; margin: 3.2rem 0 6rem; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.back:hover, .back:focus-visible { color: var(--ink); outline: none; }

/* The scrap: strips of tape with a name pencilled on, none of them laid straight. */
body[data-side="scrap"] .s-row { transform: translateX(var(--x, 0)) rotate(var(--r, 0deg)); border-bottom-style: dashed; }
body[data-side="scrap"] .s-row:nth-child(4n+1) { border-left: 6px solid rgba(211,154,60,0.10); padding-left: 0.6rem; }

/* ---- the paper ---- */
.paper { max-width: 760px; margin: 2.5rem auto 0; padding: 0 5vw 1rem; position: relative; }
.page { position: relative; width: min(470px, 92%); margin: -0.5rem auto 0; padding: 1.15rem 1.6rem 1.2rem;
  border-radius: 2px; color: var(--stock-ink); cursor: pointer;
  background: linear-gradient(180deg, var(--stock-a), var(--stock-b));
  box-shadow: 0 12px 26px rgba(0,0,0,0.55), 0 2px 5px rgba(0,0,0,0.4);
  filter: brightness(var(--stock-dim));
  transform: translateX(var(--x, 0%)) rotate(var(--r, 0deg));
  transition: transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1), filter 0.5s ease; }
.page:first-child { margin-top: 0; }
.page:focus-visible { outline: 1px solid var(--lamp); outline-offset: 3px; }
.page-head { font-style: italic; font-size: 0.72rem; letter-spacing: 0.22em; color: var(--stock-head); opacity: 0.9; }
/* Folded: the title shows and the rest is inside. */
.page-body { display: none; margin-top: 1.4rem; padding-bottom: 0.8rem; }
.page.is-up { transform: translateX(0) rotate(0deg); filter: brightness(1); z-index: 20; margin-top: 0.6rem; margin-bottom: 1.1rem; cursor: default; }
.page.is-up .page-body { display: block; }
.page-stanza { font-size: 0.86rem; line-height: 1.85; letter-spacing: 0.02em; margin-bottom: 1.15em; }
.page-stanza:last-child { margin-bottom: 0; }
.page.is-print { width: min(340px, 78%); padding: 10px 10px 34px; cursor: default; margin-top: 0.4rem; margin-bottom: 0.9rem;
  background: linear-gradient(180deg, #ece6d8, #dcd3bf); }
.page.is-print img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; background: #0b0906; }
/* The gutter's paper is stuck down flat where the water left it. */
body[data-side="gutter"] .page { box-shadow: 0 2px 4px rgba(0,0,0,0.5); border-radius: 1px; }
/* The scrap's is held with a strip of masking tape. */
body[data-side="scrap"] .page::before { content: ''; position: absolute; top: -9px; left: 38%; width: 86px; height: 20px;
  background: rgba(222,205,160,0.55); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

@media (max-width: 600px) {
  .plate { height: 46vh; } .plate.is-bare { height: 22vh; }
  .s-row { font-size: 0.88rem; grid-template-columns: 2.1rem 1fr auto; }
  .page { padding: 1rem 1.1rem 1.1rem; transform: translateX(calc(var(--x, 0%) * 0.25)) rotate(calc(var(--r, 0deg) * 0.55)); }
  body[data-side="scrap"] .s-row { transform: rotate(calc(var(--r, 0deg) * 0.5)); }
}
@media (prefers-reduced-motion: reduce) { .page { transition: none !important; } }
/* Where each plate's tape sits in its frame. */
body[data-side="scrap"] .plate img { object-position: 50% 60%; }
body[data-side="sensei"] .plate img { object-position: 50% 58%; }
/* The bird's plate is the wide one: give it more height so the roof edge stays in. */
body[data-side="bird"] .plate { height: 74vh; max-height: 860px; }
body[data-side="bird"] .plate img { object-position: 62% 86%; filter: brightness(0.9); }
body[data-side="halloween"] .plate img { object-position: 50% 56%; }
