@import url("./pico.css");
@import url("./ui.css");

.site-header, .site-footer, #main { max-width: 1240px; margin: 0 auto; padding-inline: 28px; }
.site-header { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.site-header nav { font-size: 13px; }
.site-header nav a { color: var(--muted); padding: 8px 0; }
#main { padding-block: 36px 56px; min-height: calc(100dvh - 130px); }
.site-footer { padding-block: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 8px 20px; }
#main.home { max-width: 760px; padding-top: 56px; }
.home-intro { margin-bottom: 32px; }
.home-intro p { margin-top: 12px; }
.join-panel { padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.join-panel > p { margin-top: 8px; }
.join-panel form { margin: 24px 0 0; }
.join-panel label { display: block; margin-bottom: 8px; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; }
.input-action button { white-space: nowrap; width: auto; flex: none; }
.field-error { color: #b91c1c; font-size: 13px; }
.field-error:not(:empty) { margin-top: 12px; }
.host-entry { margin-top: 32px; }
.host-entry p { margin: 8px 0 16px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { font-size: 24px; overflow-wrap: anywhere; }
.lead-small { font-size: 13px; margin-top: 6px; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.watch-main, .watch-sidebar, .replay-players > section { min-width: 0; }
.player-stage { position: relative; aspect-ratio: 16 / 9; min-width: 200px; min-height: 200px; background: #18181b; overflow: hidden; border-radius: 8px; }
.player-mount, .player-stage iframe { width: 100%; height: 100%; position: absolute; inset: 0; border: 0; }
.stage-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; text-align: center; gap: 8px; }
.stage-title { color: #f4f4f5; font-size: 15px; }
.stage-description { color: #a1a1aa; font-size: 12px; }
.placeholder-icon, .reaction-icon { color: #a1a1aa; margin-bottom: 4px; }
.placeholder-icon svg, .reaction-icon svg { width: 28px; height: 28px; }
.video-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; }
.video-meta h2 { font-size: 15px; overflow-wrap: anywhere; }
.source-tag { font-size: 12px; color: var(--muted); }
.video-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tool-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #3f3f46; }
.tool-button:hover { background: #f4f4f5; text-decoration: none; }
.tool-button[aria-pressed="true"] { background: #f4f4f5; border-color: #a1a1aa; color: #18181b; }
.transport-line { display: flex; align-items: center; gap: 12px; color: var(--muted); margin-top: 12px; font-size: 12px; }
.progress-track { flex: 1; height: 3px; background: #e4e4e7; overflow: hidden; border-radius: 3px; }
.progress-track span { display: block; height: 100%; background: #71717a; width: 0; }
.player-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.join-card, .settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
.join-card h2 { font-size: 16px; margin: 16px 0 8px; }
.join-card p { font-size: 13px; }
.join-card .wide { margin-top: 16px; }
.viewer-count { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-top: 16px; font-size: 12px; }
.viewer-count strong { font-variant-numeric: tabular-nums; color: #3f3f46; }
.settings-card { margin-top: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-title > span { color: var(--muted); }
.settings-card p { font-size: 12px; margin-top: 12px; }
.range-label { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.range-label output { font-variant-numeric: tabular-nums; }
.settings-card input[type="range"] { margin: 10px 0 0; width: 100%; }
.range-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.settings-card .text-button { margin-top: 12px; }
.message-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; margin-top: 16px; }
.message-panel p { color: #854d0e; font-size: 13px; }
.document-page { max-width: 760px; margin: 0 auto; padding: 0; background: none; box-shadow: none; }
.document-page p + p { margin-top: 8px; }
.document-page h1 { margin-bottom: 12px; }
.document-page .lead { font-size: 14px; }
.guide-steps { margin: 32px 0; }
.guide-steps > section { display: flex; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.guide-steps > section > span { color: var(--muted); font-size: 14px; width: 20px; flex-shrink: 0; }
.guide-steps h2 { font-size: 16px; margin-bottom: 8px; }
.guide-steps p { font-size: 13px; margin-bottom: 16px; }
.guide-steps p:last-child { margin-bottom: 0; }
.guide-steps details { margin: 16px 0 0; }
.guide-steps details p { margin: 12px 0 0; }
summary { font-size: 13px; }
.info-box { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin: 20px 0; font-size: 13px; color: var(--muted); }
.info-box h3 { margin-bottom: 8px; }
.document-page p a { text-decoration: underline; text-underline-offset: 2px; }
.narrow h2 { margin: 28px 0 8px; font-size: 17px; }
.empty-page { max-width: 600px; margin: 56px auto; }
.empty-page h1 { font-size: 24px; margin-bottom: 12px; }
.empty-page .button { margin-top: 20px; }
.loading { padding: 48px 0; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.studio-main { border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.studio-intro h2 { margin-bottom: 8px; }
.studio-intro p { font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 24px 0; }
.field input { width: 100%; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 400; }
.mapping-title { padding-top: 24px; border-top: 1px solid var(--line); margin: 28px 0 20px; }
.mapping-title p { font-size: 12px; margin-top: 6px; }
.segment-labels, .segment-row { display: grid; grid-template-columns: 1fr 1fr 1fr 32px; gap: 8px; }
.segment-labels { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.segment-row { margin-bottom: 8px; }
.segment-row input { width: 100%; font-variant-numeric: tabular-nums; }
.icon-button { padding: 6px; border: 0; background: transparent; color: var(--muted); }
.icon-button:hover { background: #f4f4f5; }
.form-footer { margin-top: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.form-footer p { font-size: 13px; }
.published-box { padding-top: 24px; border-top: 1px solid var(--line); margin-top: 24px; }
.published-box h3 { margin: 12px 0; }
.published-box > div + div { display: flex; flex-wrap: wrap; gap: 8px; }
.published-box .text-button { margin-top: 12px; }
.recording-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
.recording-stat { display: flex; align-items: baseline; gap: 8px; margin: 16px 0; }
.recording-stat strong { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.recording-stat span { font-size: 12px; color: var(--muted); }
.timeline-list { border-top: 1px solid var(--line); padding-top: 8px; }
.timeline-list > div { padding: 8px 0; }
.timeline-list p { font-size: 13px; overflow-wrap: anywhere; }
.recording-card > .caption { margin-top: 12px; }
.danger-zone { margin-top: 20px; padding: 16px 0; }
.danger-zone p { font-size: 12px; margin: 8px 0 12px; }
dialog { padding: 0; background: transparent; }
dialog:open { display: grid; place-content: center; }
dialog > article { background: #fff; padding: 24px; border: 1px solid var(--line); border-radius: 8px; max-width: 440px; margin: 16px; }
dialog h2 { font-size: 18px; }
dialog p { margin: 12px 0 24px; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.replay-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.replay-intro p { font-size: 13px; }
.replay-players { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.player-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.player-label span + span { color: var(--muted); }
.replay-video-title { font-size: 15px; margin: 12px 0 8px; overflow-wrap: anywhere; }
.text-link { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.reaction-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.twitch-stage { min-height: 300px; }
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 32px; }
.replay-controls p { font-size: 13px; }
.clip-card { padding: 24px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.clip-card h2 { font-size: 16px; margin-bottom: 8px; }
.clip-card p { font-size: 13px; }
.clip-card form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.clip-card label { display: flex; flex-direction: column; gap: 8px; }
.clip-card input { width: 96px; }
.clip-card form > span { padding-bottom: 10px; color: var(--muted); }
.theater-mode #main { max-width: 1600px; }
.theater-mode .watch-layout { grid-template-columns: minmax(0, 1fr); }
.theater-mode .watch-main > .player-stage { aspect-ratio: auto; height: min(56.25vw, calc(100dvh - 190px)); background: #000; border-radius: 0; }
.theater-mode .watch-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.theater-mode .settings-card { margin-top: 0; }
.theater-mode .replay-players { grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto; }
.theater-mode .replay-players > section { margin-bottom: 16px; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 10px; background: #fff; }
.skip-link:focus { top: 8px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px 18px; max-width: calc(100vw - 32px); font-size: 13px; z-index: 10; box-shadow: 0 4px 16px #0001; }
#toast.bad { color: #b91c1c; }
@media (max-width: 900px) {
  #theater { display: none; }
  .watch-layout, .studio-layout { grid-template-columns: 1fr; }
  .watch-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .settings-card { margin-top: 0; }
  .studio-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .clip-card { align-items: flex-start; flex-direction: column; }
  .replay-players { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-header, .site-footer, #main { padding-inline: 16px; }
  #main, #main.home { padding-top: 24px; }
  h1 { font-size: 24px; }
  .join-panel { padding: 20px; }
  .input-action { flex-direction: column; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-heading h1 { font-size: 22px; }
  .watch-layout { display: flex; flex-direction: column; gap: 16px; }
  .watch-main { width: 100%; }
  .watch-sidebar { display: contents; }
  .join-card { width: 100%; padding: 16px; }
  .join-card h2 { margin-top: 12px; }
  .settings-card { width: 100%; }
  .studio-main { padding: 16px; }
  .studio-aside { display: block; }
  .mapping-title { align-items: flex-start; flex-direction: column; }
  .segment-labels { font-size: 11px; }
  .segment-labels, .segment-row { gap: 4px; grid-template-columns: 1fr 1fr 1fr 28px; }
  .segment-row input { padding: 8px 4px; font-size: 12px; }
  .message-panel { align-items: flex-start; flex-direction: column; }
  .clip-card form { flex-wrap: wrap; }
  .clip-card button { width: 100%; margin-top: 8px; }
  .theater-mode .watch-sidebar { display: contents; }
  .transport-line { gap: 8px; }
}
