/* ==========================================================================
   Release room (detail) + listen sheet + shared listen/resource rows.
   The room is a listening space: the cover's own light fills the screen.
   ========================================================================== */

.room {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--bone);
  --bg: #09090b;
  --fg: #eeebe4;
  --fg-2: rgba(238, 235, 228, 0.7);
  --fg-3: rgba(238, 235, 228, 0.54);
  --fg-4: rgba(238, 235, 228, 0.22);
  --line: rgba(238, 235, 228, 0.14);
  --line-strong: rgba(238, 235, 228, 0.3);
}

.room__ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--night);
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}

.room__ambient img {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  filter: blur(90px) saturate(1.5) brightness(0.42);
  transform: scale(1.1);
}

.room__ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 25% 40%, transparent, rgba(9, 9, 11, 0.7)),
    linear-gradient(to bottom, rgba(9, 9, 11, 0.2), rgba(9, 9, 11, 0.6));
}

.room__backdrop {
  position: absolute;
  inset: 0;
}

.room__panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}

.room.is-open .room__ambient,
.room.is-open .room__panel {
  opacity: 1;
}

.room__bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  border-bottom: 1px solid var(--line);
}

.room__pos {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--fg-2);
}

.room__rec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  animation: rec-blink 2.4s steps(1, end) infinite;
}

.room__nav {
  display: flex;
  gap: 4px;
}

.room__step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color var(--d-1), background-color var(--d-1);
}

.room__step:hover:not(:disabled) {
  color: var(--fg);
  background: rgba(238, 235, 228, 0.08);
}

.room__step:disabled {
  opacity: 0.3;
  cursor: default;
}

.room__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--fg);
  transition: transform var(--d-3) var(--ease-out), border-color var(--d-2), background-color var(--d-2);
}

.room__close:hover {
  transform: rotate(90deg);
  border-color: var(--fg);
}

.room__layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 96px);
  padding: 0 var(--gutter);
}

/* Centred when it fits; scrolls on its own (never clipped behind the bar)
   when a release has many listen rows. */
.room__visual {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 20px;
  padding-block: clamp(24px, 4vh, 48px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.room__visual::-webkit-scrollbar {
  display: none;
}

.room__cover {
  width: min(100%, calc(100vh - 300px), 720px);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--night-2);
  box-shadow: 0 50px 140px -40px rgb(var(--art) / 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  will-change: transform;
}

.room__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room__streams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  column-gap: 20px;
  width: min(100%, calc(100vh - 300px), 720px);
}

.room__streams .listen--apple,
.room__streams .status-panel {
  grid-column: 1 / -1;
}

.room__streams .status-panel {
  max-width: 40em;
}

.room__jump {
  align-self: flex-start;
}

.room__content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: clamp(32px, 6vh, 72px) calc(80px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.room__content:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--signal);
}

/* Room for that ring: it sits 16px off the text instead of on the glyphs
   (the column keeps its alignment; the padding is taken from the gap). */
@media (min-width: 1101px) {
  .room__content {
    padding-inline: 16px;
    margin-inline: -16px;
  }
}

.room__titleblock {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.room__series {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}

.room__divider {
  margin: 0 0.6em;
  color: var(--fg-4);
}

.room__series #archive-modal-index:empty,
.room__series #archive-modal-index:empty ~ * {
  display: none;
}

.room__series:has(#archive-modal-index:empty) .room__divider {
  display: none;
}

.room__title {
  font-family: var(--f-display);
  font-weight: 760;
  font-size: clamp(2.25rem, 4.6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* A leading full-width bracket (「 《 …) is set half-width so its ink lines
   up with the text edge. Noto Sans JP carries the "halt" feature; where it
   does not apply the bracket simply keeps its normal width. Shared by the
   room and by page titles. */
.t-hang {
  font-family: "Noto Sans JP", "Hiragino Sans", var(--f-cjk);
  font-feature-settings: "halt" 1;
}

.room__artist {
  font-size: var(--t-4);
  color: var(--fg-2);
}

.room__artist:empty {
  display: none;
}

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

.tagpill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}

.tagpill.is-upcoming {
  border-color: var(--signal);
  color: var(--signal);
}

.room__section {
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}

.room__kicker {
  font-family: var(--f-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 16px;
}

.room__imprint {
  font-size: var(--t-4);
  font-weight: 500;
}

.room__prose p {
  white-space: pre-wrap;
}

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

.credit {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.credit dt {
  flex: none;
  font-size: 0.75rem;
  color: var(--fg-3);
  min-width: 6em;
}

.credit dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.room__lyrics {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 1.0625rem;
  line-height: 2;
  white-space: pre-wrap;
  color: var(--fg);
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.room__lyrics.is-placeholder {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  color: var(--fg-3);
}

.room__note {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--fg-2);
  white-space: pre-line;
}

.room__note:empty {
  display: none;
}

.room.is-switching .room__panel {
  pointer-events: none;
}

@media (max-width: 1100px) {
  .room__visual {
    overflow: visible;
  }

  .room__panel {
    overflow-y: auto;
    overscroll-behavior: contain;
    grid-template-rows: auto auto;
  }
  .room__bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(9, 9, 11, 0.55);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  /* The panel scrolls as one column here: let rows take their content
     height (min-height: 0 would clamp them to the viewport and the
     centred cover column would overflow onto the text). */
  .room__layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  /* One reading order on narrow screens: cover, title, where to listen,
     then the text (production kept the title beside the cover here). */
  .room__visual,
  .room__content {
    display: contents;
  }
  .room__cover {
    order: 0;
    margin-top: 20px;
  }
  .room__titleblock {
    order: 1;
    padding-top: 28px;
  }
  .room__streams {
    order: 2;
  }
  .room__jump {
    order: 3;
    margin-top: 20px;
  }
  .room__section {
    order: 4;
  }
  .room__cover,
  .room__streams {
    width: 100%;
  }
  .room__cover {
    width: min(100%, 58vh);
  }
  .room__title {
    white-space: normal;
  }
  .room__step span:not([aria-hidden]) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .room__step {
    width: 44px;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .credits {
    grid-template-columns: 1fr;
  }
}

/* --- Listen sheet ------------------------------------------------------------ */
.listen-sheet {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  color: var(--bone);
}

.listen-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 360ms var(--ease-out);
}

.listen-sheet__panel {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--night-1);
  border: 1px solid rgba(238, 235, 228, 0.12);
  transform: translate3d(0, 24px, 0);
  opacity: 0;
  transition: transform 560ms var(--ease-out), opacity 360ms var(--ease-out);
}

.listen-sheet__panel .room__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.listen-sheet.is-open .listen-sheet__backdrop {
  opacity: 1;
}

.listen-sheet.is-open .listen-sheet__panel {
  transform: none;
  opacity: 1;
}

.listen-sheet__title {
  font-size: var(--t-3);
  font-weight: 600;
  padding-right: 48px;
}

.listen-sheet__text {
  color: rgba(238, 235, 228, 0.66);
}

.listen-sheet__links {
  display: grid;
  border-top: 1px solid rgba(238, 235, 228, 0.13);
}

@media (prefers-reduced-motion: reduce) {
  .room__rec {
    animation: none;
  }
}
