/* 시청 화면의 안내와 질문은 영상의 위아래에 둔다. 폰에서도 영상 높이 200px을 확보한다. */
.wq [hidden] {
  display: none !important;
}
#watch {
  width: min(calc(100% - 32px), 720px);
  flex: none;
  text-align: left;
  color: var(--ink);
  margin: 0 auto;
}
.wq:has(#watch:not([hidden])) :is(.wq-mark, .wq-title),
.live-page :is(.wq-live, .wq-login) {
  display: none;
}
.watch-head,
.watch-entry,
.ask-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.watch-mark {
  flex: none;
}
.watch-head > div {
  min-width: 0;
  flex: 1;
}
.watch-head h2 {
  font-size: clamp(18px, 3vw, 26px);
  line-height: 1.18;
  margin: 0;
  overflow-wrap: anywhere;
}
#watch small,
.watch-head p,
#watch-count,
#watch-help,
.watch-entry small {
  color: var(--soft);
  font-size: 13px;
}
.watch-head p {
  margin: 3px 0 0;
}
.watch-head p:empty {
  display: none;
}
#watch-count {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  font-variant-numeric: tabular-nums;
}
#watch-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: #25292b;
  font-size: 12px;
  font-weight: 700;
  border-radius: 99px;
  padding: 6px 11px;
  white-space: nowrap;
}
#watch-state::before,
#watch-playback::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a6a8a4;
}
#watch-state[data-live="true"]::before {
  background: var(--lime);
  box-shadow: 0 0 0 3px #c5f02c24;
}
#watch-media {
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  background: #10151a;
  box-shadow: 0 0 0 1px var(--line);
}
#watch-slot {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
}
#watch-playback {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: #22252a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
#watch-playback[data-live="true"]::before {
  background: #ff695f;
}
#watch-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#watch-cover {
  box-sizing: border-box;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 9px;
  padding: 16px;
  background:
    linear-gradient(150deg, transparent 40%, #49584450),
    repeating-linear-gradient(123deg, #101922 0px, #101922 30px, #18232b 31px, #101922 32px);
}
#watch-cover strong {
  font-size: clamp(18px, 3vw, 32px);
  overflow-wrap: anywhere;
}
#watch time {
  color: var(--soft);
  font-size: 14px;
}
#watch button,
#live-enter,
#watch-help a {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: #262d36;
  color: var(--ink);
}
#watch #play,
#live-enter {
  color: var(--lime-ink);
  background: var(--lime);
  padding-inline: 24px;
}
#watch button:disabled,
#live-enter:disabled {
  opacity: 0.5;
  cursor: default;
}
#watch-help {
  margin-top: 12px;
}
#watch-help summary {
  cursor: pointer;
}
#watch-help a,
#watch-help button {
  display: inline-block;
  margin: 10px 8px 0 0;
  text-decoration: none;
}
#watch-help figure {
  margin: 14px 0;
}
.watch-entry {
  margin-top: 20px;
  padding: 16px 0;
  justify-content: space-between;
  border-block: 1px solid var(--line);
}
.watch-entry b,
.watch-entry small {
  display: block;
}
.watch-entry small {
  margin-top: 3px;
}
#watch-ask h3 {
  font-size: 16px;
  margin: 16px 0 10px;
}
.ask-row input,
.ask-row textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
  line-height: 20px;
}
.ask-row input {
  width: 22%;
}
.ask-row textarea {
  flex: 1;
  resize: vertical;
}
#watch-ask small {
  display: block;
  margin-top: 8px;
}
/* 내용과 입장 카드는 안전 영역 안의 서로 다른 행에 둔다. 화면이 낮거나 글이 길면 본문만 스크롤한다. */
.wq:has(#watch:not([hidden])) {
  --watch-top: max(16px, env(safe-area-inset-top));
  --watch-bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100dvh;
  min-height: 0;
  padding: var(--watch-top) env(safe-area-inset-right) var(--watch-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}
.wq:has(#watch:not([hidden])) .wq-gate {
  min-height: 0;
  height: auto;
  overflow: auto;
  justify-content: flex-start;
  padding: 8px 0 12px;
}
#watch-dock {
  width: min(calc(100% - 32px), 720px);
  justify-self: center;
  padding-top: 6px;
}
#watch-dock .watch-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #788e39;
  border-radius: 16px;
  text-align: center;
  color: var(--ink);
  background: #202519;
  box-shadow: 0 6px 22px #0006;
}
#watch-dock #live-enter {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
}
/* 넓고 낮은 창에서는 질문과 하단 카드를 먼저 확보하고 남은 높이에 영상의 16:9 폭을 맞춘다. */
@media (min-width: 600px) {
  .wq:has(#watch-dock:not([hidden])) :is(#watch, #watch-dock) {
    width: min(calc(100% - 32px), clamp(480px, calc((100dvh - 464px) * 16 / 9), 720px));
  }
}
@media (max-width: 479px) {
  .ask-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ask-row button {
    padding-inline: 10px;
  }
}
@media (pointer: coarse) {
  #watch :is(button, input, textarea, summary, a),
  #watch-dock #live-enter {
    min-height: 48px;
    min-width: 48px;
  }
  #watch-help summary {
    align-content: center;
  }
}
/* 접은 폰을 펼쳐도 모서리 카메라와 행사 상태가 겹치지 않게 제목 옆에 붙인다. */
@media (min-width: 480px) and (max-width: 900px) {
  .watch-head {
    justify-content: flex-start;
    padding-right: clamp(0px, calc(78px - (100vw - 720px) / 2), 78px);
  }
}
