:root {
  --bg: #0d1114;
  --bg-accent: #151c22;
  --panel: rgba(19, 25, 30, 0.92);
  --text: #ecf0f3;
  --muted: #97a2aa;
  --line: rgba(236, 240, 243, 0.1);
  --primary: #9db4c3;
  --primary-deep: #dce8f0;
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(157, 180, 195, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(54, 74, 89, 0.28), transparent 24%),
    linear-gradient(145deg, #0a0e11 0%, var(--bg) 52%, var(--bg-accent) 100%);
}

button,
input,
a {
  font: inherit;
}

.hidden {
  display: none;
}

.page-shell {
  width: min(1720px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 10px 0 12px;
  min-height: 100vh;
}

.login-panel {
  min-height: calc(100vh - 20px);
  display: grid;
  place-items: center;
}

.login-card,
.info-card,
.chapter-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(520px, 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-card h1,
.hero h1,
.section-head h3 {
  margin: 0;
  font-family: "Montserrat", "Noto Sans JP", sans-serif;
}

.login-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.login-copy,
.helper-text,
.event-meta,
.section-note {
  color: var(--muted);
}

.login-copy {
  margin: 14px 0 22px;
  line-height: 1.7;
  font-size: 0.92rem;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}

.login-form button,
.chapter-item,
.toggle-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.login-form button {
  background: linear-gradient(135deg, #7e97a7 0%, #a9c0ce 100%);
  color: #0f1519;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
}

.helper-text {
  margin: 14px 0 0;
  font-size: 0.8rem;
}

.viewer-page {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  min-height: 100%;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 4px 0;
}

.hero h1 {
  font-size: clamp(1.15rem, 1.8vw, 1.85rem);
  line-height: 1.04;
}

.event-meta {
  margin: 6px 0 0;
  font-size: 0.76rem;
}

.viewer-layout,
.player-column,
.content-grid {
  min-height: 0;
}

.player-column {
  display: grid;
  gap: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.left-stage {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  align-self: start;
  position: sticky;
  top: 10px;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 13, 16, 0.24), rgba(9, 13, 16, 0.72)),
    linear-gradient(135deg, #35414a 0%, #20282f 42%, #11171c 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  font-size: 0.7rem;
}

.player-mount,
.player-mount iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-cluster {
  display: grid;
  gap: 6px;
  width: fit-content;
}

.utility-cluster {
  justify-items: end;
}

.cluster-label {
  margin: 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  justify-self: center;
}

.source-label {
  color: #86adc9;
}

.control-label {
  color: #ccb88f;
}

.toggle-group,
.utility-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.toggle-button,
.icon-button {
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 10px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.toggle-button.is-active {
  background:
    linear-gradient(180deg, rgba(169, 192, 206, 0.34), rgba(129, 150, 163, 0.18)),
    rgba(169, 192, 206, 0.16);
  color: #f7fbfd;
  border-color: rgba(169, 192, 206, 0.36);
}

.chapter-card,
.info-card {
  padding: 14px;
  border-radius: var(--radius-lg);
}

.chapter-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h3 {
  font-size: 0.94rem;
}

.section-note {
  margin: 0;
  font-size: 0.68rem;
}

.chapter-groups {
  display: grid;
  gap: 10px;
}

.chapter-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.chapter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  font-weight: 700;
  font-size: 0.8rem;
}

.chapter-summary::-webkit-details-marker {
  display: none;
}

.chapter-summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chapter-summary span::before {
  content: ">";
  color: var(--primary);
  font-size: 0.82rem;
  transition: transform 0.18s ease;
}

.chapter-group[open] .chapter-summary span::before {
  transform: rotate(90deg);
}

.chapter-summary small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.chapter-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.chapter-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.chapter-time {
  font-family: "Montserrat", sans-serif;
  color: #c9dae5;
  font-weight: 700;
  font-size: 0.66rem;
}

.chapter-title {
  color: #f5f8fa;
  font-weight: 600;
  font-size: 0.76rem;
}

.event-summary {
  display: grid;
  gap: 10px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.summary-line span {
  color: var(--muted);
  font-size: 0.7rem;
}

.summary-line strong {
  color: #f5f8fa;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.summary-copy {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.7;
}

.event-card-mobile {
  display: none;
}

.login-form button:hover,
.chapter-item:hover,
.toggle-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .page-shell {
    width: calc(100vw - 12px);
    padding: 8px 0;
  }

  .hero {
    padding-inline: 0;
  }

  .hero h1 {
    font-size: 1.02rem;
  }

  .event-meta {
    font-size: 0.7rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
  }

  .left-stage {
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, rgba(10, 14, 17, 0.98), rgba(10, 14, 17, 0.92));
    padding-bottom: 8px;
  }

  .event-card-desktop {
    display: none;
  }

  .event-card-mobile {
    display: block;
  }
}

@media (max-width: 720px) {
  .chapter-card,
  .info-card,
  .login-card {
    padding: 12px;
  }

  .control-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .control-cluster {
    gap: 5px;
    width: 100%;
  }

  .utility-cluster {
    justify-items: stretch;
  }

  .toggle-group,
  .utility-buttons {
    display: grid;
    gap: 6px;
  }

  .toggle-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utility-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toggle-button,
  .icon-button {
    min-width: 0;
    width: 100%;
    padding: 9px 4px;
    font-size: 0.62rem;
  }

  .chapter-summary {
    padding: 10px 11px;
    font-size: 0.78rem;
  }

  .chapter-item {
    grid-template-columns: 58px 1fr;
    gap: 8px;
    padding: 8px 9px;
  }

  .chapter-time {
    font-size: 0.64rem;
  }

  .chapter-title {
    font-size: 0.72rem;
  }

  .summary-line {
    flex-direction: column;
    gap: 4px;
  }
}
