/* The film is supplementary; all existing page styles remain unchanged. */
.koujou-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 1.4em;
  min-height: 44px;
  margin-top: 20px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.koujou-profile-link[hidden],
.koujou-dialog [hidden] { display: none; }

.koujou-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f4f0e8;
  overflow: auto;
  overscroll-behavior: contain;
}

.koujou-dialog[open] { display: grid; place-items: center; }
.koujou-dialog::backdrop { background: rgba(18, 26, 23, .88); }

.koujou-panel {
  width: min(1120px, 100%, calc((100vh - 180px) * 16 / 9));
  width: min(1120px, 100%, calc((100dvh - 180px) * 16 / 9));
}

.koujou-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.koujou-dialog button {
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  cursor: pointer;
}
.koujou-dialog .koujou-close { width: 44px; padding: 0; font-size: 30px; font-weight: 400; }
.koujou-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #121a17; }
.koujou-stage { position: relative; }
.koujou-ending { position: absolute; inset: 0 0 52px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; pointer-events: none; font-family: var(--font-serif-ja); }
.koujou-ending p { margin: 0; font-size: clamp(20px, 3vw, 32px); }
.koujou-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; padding-top: 12px; }
.koujou-title { margin: 0; font-family: var(--font-serif-ja); font-size: 14px; line-height: 1.8; }
.koujou-title span { margin-left: 1.3em; }
.koujou-actions { display: flex; align-items: center; gap: 28px; }
.koujou-actions button { white-space: nowrap; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.koujou-play { text-decoration: underline; }
.koujou-actions span { margin-left: .65em; }
.koujou-status { margin: 8px 0 0; font-size: 14px; }
.koujou-dialog button:hover, .koujou-profile-link:hover { text-decoration: underline; text-underline-offset: 6px; }
.koujou-dialog button:focus-visible, .koujou-video:focus-visible, .koujou-profile-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

@media (max-width: 600px) {
  .koujou-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .koujou-title { font-size: 14px; }
  .koujou-actions { justify-content: space-between; width: 100%; gap: 12px; }
  .koujou-actions .koujou-site { margin-left: auto; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .koujou-panel { width: min(1120px, 100%, calc((100dvh - 122px) * 16 / 9)); }
  .koujou-toolbar { margin-bottom: 0; }
  .koujou-footer { flex-direction: row; align-items: center; padding-top: 4px; gap: 12px; }
  .koujou-title { font-size: 13px; }
  .koujou-title span { margin-left: .5em; }
  .koujou-actions { width: auto; gap: 16px; }
  .koujou-dialog .koujou-actions button { font-size: 14px; }
}
