@import url('/assets/css/player.css?v=20260720-answer-repair1');

.audience-shell {
  width: min(1280px, 100%);
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin-bottom: 16px;
}

.stream-placeholder {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
}

.chat-panel {
  padding: 18px;
  min-height: 360px;
}

.vote-card {
  padding: 20px;
}

@media (max-width: 880px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    display: block;
    min-height: 360px;
  }
}

/* YouTube現在ライブ表示 */
.youtube-live-area {
  position: relative;
  min-height: 260px;
  padding: 0;
  overflow: hidden;
}
.youtube-live-frame {
  display: block;
  width: 100%;
  height: min(56.25vw, 420px);
  min-height: 240px;
  border: 0;
  background: #000;
}
.youtube-live-message {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 20px;
  text-align: center;
}
.youtube-live-actions {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}
.youtube-live-actions a,
.youtube-live-actions button {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
@media (max-width: 720px) {
  .youtube-live-frame {
    height: 52vw;
    min-height: 200px;
  }
}


/* リスナー用：参加者用ページと同じ視聴画面・チャット表示 */
body[data-lilium-mode="audience"] #chat-panel {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
}

body[data-lilium-mode="audience"] .youtube-live-area {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
}

body[data-lilium-mode="audience"] .youtube-live-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0;
  border-radius: 0;
}

body[data-lilium-mode="audience"] .youtube-live-message {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body[data-lilium-mode="audience"] #chat-panel.has-youtube-chat .youtube-chat-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0;
  border-radius: 0;
}

body[data-lilium-mode="audience"] #chat-panel .youtube-chat-message {
  box-sizing: border-box;
  width: 100%;
  min-height: 360px;
  padding: 18px;
}

@media (max-width: 880px) {
  body[data-lilium-mode="audience"] #chat-panel,
  body[data-lilium-mode="audience"] #chat-panel .youtube-chat-message {
    min-height: 360px;
  }
}

/* リスナー用・参加者用：ページ名を左上に配置 */
.audience-header .audience-title-block {
  min-width: 0;
}


.audience-header h1 {
  margin-top: 0;
  line-height: 1.2;
}

.audience-header .audience-title-block > .subtle {
  margin: 6px 0 0;
}


/* リスナー用ページタイトル：文字は白、音符だけ青系 */
body[data-lilium-mode="audience"] .youtube-live-title {
  color: #fff;
}


/* リスナー用ページタイトル：YouTube風の再生マーク */
body[data-lilium-mode="audience"] .youtube-live-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-lilium-mode="audience"] .youtube-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 34px;
  height: 24px;
  border-radius: 6px;
  background: #ff0033;
}

body[data-lilium-mode="audience"] .youtube-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
  transform: translate(-42%, -50%);
}

body[data-lilium-mode="audience"] .youtube-live-icon {
  margin-left: -5px;
  font-size: 0.9em;
  line-height: 1;
}

/* ゲーム③：ランキング選択リストを白背景・黒文字で統一 */
.ranking-row select {
  color-scheme: light;
  background: #ffffff !important;
  color: #111111 !important;
  -webkit-text-fill-color: #111111;
  border: 1px solid #aeb7c4;
  border-radius: 8px;
}

.ranking-row select option {
  background: #ffffff !important;
  color: #111111 !important;
}

.ranking-row select:focus {
  border-color: #4d8dff;
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.28);
}


/* スマートフォン表示：タイトルを読みやすい大きさへ調整 */
@media (max-width: 760px), (orientation: portrait) {
  body[data-lilium-mode="audience"] .audience-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    min-height: 38px;
    padding-right: 0;
  }

  body[data-lilium-mode="audience"] .audience-title-block {
    width: 100%;
    min-width: 0;
  }

  body[data-lilium-mode="audience"] .youtube-live-title {
    gap: 7px;
    font-size: 1.45rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  body[data-lilium-mode="audience"] .youtube-mark {
    width: 25px;
    height: 18px;
    border-radius: 5px;
  }

  body[data-lilium-mode="audience"] .youtube-mark::after {
    border-top-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 7px;
  }

  body[data-lilium-mode="audience"] .youtube-live-icon {
    margin-left: -3px;
  }

}


/* スマートフォン専用：右上のクイズ回答ボタン */
.mobile-quiz-jump {
  display: none;
}

.page-bottom-anchor {
  width: 100%;
  height: 1px;
}

@media (max-width: 760px), (orientation: portrait) {
  html {
    scroll-behavior: smooth;
  }

  body[data-lilium-mode="audience"] .audience-header,
  body[data-lilium-mode="player"] .audience-header {
    align-items: center;
  }

  body[data-lilium-mode="audience"] .audience-title-block,
  body[data-lilium-mode="player"] .audience-title-block {
    flex: 1 1 auto;
    min-width: 0;
  }

  body[data-lilium-mode="audience"] .mobile-quiz-jump,
  body[data-lilium-mode="player"] .mobile-quiz-jump {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0 0 0 auto;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4b87, #925cff);
    box-shadow: 0 6px 18px rgba(85, 46, 144, 0.3);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
  }

  body[data-lilium-mode="audience"] .mobile-quiz-jump:active,
  body[data-lilium-mode="player"] .mobile-quiz-jump:active {
    transform: translateY(1px);
  }
}


/* 視聴ページ・ゲーム参加スペース切り替え */
.viewer-space-card[hidden],
.viewer-space-append[hidden],
[data-viewer-space-quiz][hidden],
.mobile-quiz-jump[hidden] {
  display: none !important;
}

.viewer-space-append {
  width: 100%;
  min-height: 420px;
}

.viewer-space-frame {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  background: transparent;
}

.viewer-space-message {
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
}

@media (max-width: 720px) {
  .viewer-space-frame {
    min-height: 520px;
  }
}

/* Append user console role modes (Phase 4) */
.viewer-space-frame-wrap {
  position: relative;
  width: 100%;
}

.viewer-space-frame-wrap.is-readonly .viewer-space-frame {
  pointer-events: none;
  user-select: none;
  opacity: .92;
}

.viewer-space-readonly-notice {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 196, 64, .6);
  border-radius: 10px;
  background: rgba(255, 196, 64, .12);
  color: #fff3c4;
  font-weight: 800;
  text-align: center;
}
