/**
 * SynergyCast フロントエンド プレイヤースタイル
 *
 * デフォルト: ライトテーマ（白・透明基調）
 * LP側のデザインに馴染む設計
 *
 * @package SynergyCast
 */

/* ───────────────────────────────
   リセット・全体
   ─────────────────────────────── */

.synergycast-player {
	position: relative;
	margin: 0 auto;
	max-width: 1100px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	box-sizing: border-box;
	color: #333;
	padding-top: 105px;
	background-repeat: no-repeat;
	background-position: top center;
	background-size: 100% auto;
}

.synergycast-player *,
.synergycast-player *::before,
.synergycast-player *::after {
	box-sizing: border-box;
}

/* ───────────────────────────────
   ライトテーマ（デフォルト）
   ─────────────────────────────── */

.synergycast-theme-light .synergycast-mode-code-input,
.synergycast-theme-light .synergycast-mode-countdown,
.synergycast-theme-light .synergycast-mode-ended {
	background: transparent;
	color: #333;
}

.synergycast-theme-light .synergycast-code-form-wrapper,
.synergycast-theme-light .synergycast-countdown-wrapper,
.synergycast-theme-light .synergycast-ended-wrapper {
	background: #fff;
	border: 1px solid #e0e0e0;
}

.synergycast-theme-light .synergycast-code-input {
	border-color: #d0d0d0;
	background: #fff;
	color: #333;
}

.synergycast-theme-light .synergycast-code-input:focus,
.synergycast-theme-light .synergycast-nickname-input:focus {
	border-color: #e63946;
}

/* ───────────────────────────────
   ダークテーマ
   ─────────────────────────────── */

.synergycast-theme-dark .synergycast-mode-code-input,
.synergycast-theme-dark .synergycast-mode-countdown,
.synergycast-theme-dark .synergycast-mode-ended {
	background: #1a1a2e;
	color: #e0e0e0;
}

.synergycast-theme-dark .synergycast-code-form-wrapper,
.synergycast-theme-dark .synergycast-countdown-wrapper,
.synergycast-theme-dark .synergycast-ended-wrapper {
	background: #16213e;
	border: 1px solid #2a2a4a;
}

.synergycast-theme-dark .synergycast-code-input,
.synergycast-theme-dark .synergycast-nickname-input {
	border-color: #444;
	background: rgba(255, 255, 255, 0.05);
	color: #e0e0e0;
}

.synergycast-theme-dark .synergycast-chat {
	background: #0f0f23;
	border-color: #2a2a4a;
}

.synergycast-theme-dark .synergycast-chat-header {
	background: #1a1a2e;
	border-color: #2a2a4a;
}

.synergycast-theme-dark .synergycast-chat-name {
	color: #72a0d6;
}

.synergycast-theme-dark .synergycast-chat-text {
	color: #ccc;
}

.synergycast-theme-dark .synergycast-chat-input-area {
	border-color: #2a2a4a;
	background: #1a1a2e;
}

.synergycast-theme-dark .synergycast-chat-input {
	background: rgba(255, 255, 255, 0.05);
	border-color: #444;
	color: #e0e0e0;
}

.synergycast-theme-dark .synergycast-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
}

/* ───────────────────────────────
   コード入力モード
   ─────────────────────────────── */

.synergycast-mode-code-input {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 32px 16px;
	border-radius: 8px;
}

.synergycast-code-form-wrapper {
	text-align: center;
	padding: 32px;
	border-radius: 12px;
	max-width: 400px;
	width: 100%;
}

.synergycast-code-title {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 20px 0;
}

/* ニックネーム入力 */
.synergycast-nickname-group {
	margin-bottom: 16px;
}

.synergycast-nickname-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #666;
	text-align: left;
}

.synergycast-nickname-input {
	width: 100%;
	font-size: 15px;
	padding: 10px 14px;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	background: #fff;
	color: #333;
	outline: none;
	transition: border-color 0.2s;
}

/* コード入力 */
.synergycast-code-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #666;
	text-align: left;
}

.synergycast-code-input-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.synergycast-code-input {
	flex: 1;
	font-size: 18px;
	font-family: "Courier New", Courier, monospace;
	letter-spacing: 2px;
	text-align: left;
	padding: 10px 14px;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	background: #fff;
	color: #333;
	outline: none;
	transition: border-color 0.2s;
}

.synergycast-code-input:focus {
	border-color: #e63946;
}

.synergycast-code-submit {
	font-size: 15px;
	font-weight: 600;
	padding: 10px 22px;
	border: none;
	border-radius: 8px;
	background: #e63946;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}

.synergycast-code-submit:hover {
	background: #c1121f;
}

.synergycast-code-submit:disabled {
	background: #aaa;
	cursor: not-allowed;
}

.synergycast-code-error {
	margin-top: 12px;
	padding: 8px 12px;
	background: rgba(230, 57, 70, 0.1);
	color: #e63946;
	border-radius: 6px;
	font-size: 13px;
}

/* ───────────────────────────────
   カウントダウンモード
   ─────────────────────────────── */

.synergycast-mode-countdown {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 32px 16px;
	border-radius: 8px;
}

.synergycast-countdown-wrapper {
	text-align: center;
	padding: 32px;
	border-radius: 12px;
}

.synergycast-countdown-label {
	font-size: 15px;
	margin: 0 0 20px 0;
	color: #666;
}

.synergycast-countdown-timer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.synergycast-countdown-unit {
	text-align: center;
}

.synergycast-countdown-value {
	display: block;
	font-size: 48px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	min-width: 70px;
	color: #222;
}

.synergycast-theme-dark .synergycast-countdown-value {
	color: #e0e0e0;
}

.synergycast-countdown-unit-label {
	display: block;
	font-size: 11px;
	margin-top: 4px;
	color: #999;
}

.synergycast-countdown-sep {
	font-size: 36px;
	font-weight: 300;
	color: #bbb;
	padding-bottom: 18px;
}

.synergycast-countdown-notice {
	font-size: 13px;
	margin: 20px 0 0 0;
	color: #999;
}

/* ───────────────────────────────
   視聴開始ボタンモード（オートプレイ対策）
   ─────────────────────────────── */

.synergycast-mode-start {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 32px 16px;
	border-radius: 8px;
}

.synergycast-theme-light .synergycast-start-wrapper {
	background: #fff;
	border: 1px solid #e0e0e0;
}

.synergycast-theme-dark .synergycast-start-wrapper {
	background: #16213e;
	border: 1px solid #2a2a4a;
}

.synergycast-start-wrapper {
	text-align: center;
	padding: 40px 32px;
	border-radius: 12px;
	max-width: 400px;
	width: 100%;
}

.synergycast-start-live-badge {
	margin-bottom: 16px;
}

.synergycast-start-text {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 24px 0;
	color: #333;
}

.synergycast-theme-dark .synergycast-start-text {
	color: #e0e0e0;
}

.synergycast-start-btn {
	font-size: 17px;
	font-weight: 700;
	padding: 14px 40px;
	border: none;
	border-radius: 8px;
	background: #e63946;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.synergycast-start-btn:hover {
	background: #c1121f;
}

/* ───────────────────────────────
   配信中モード（ライブ）
   ─────────────────────────────── */

.synergycast-mode-live {
	display: flex;
	flex-direction: row;
	gap: 0;
	border-radius: 8px;
	overflow: hidden;
}

/* プレイヤーエリア */
.synergycast-player-area {
	position: relative;
	background: #000;
	flex: 1;
	min-width: 0;
}

/* Vimeo埋め込み */
.synergycast-video-container {
	position: relative;
	width: 100%;
}

.synergycast-video-wrapper {
	width: 100%;
}

.synergycast-video-wrapper iframe {
	width: 100%;
	display: block;
}

/* シーク防止オーバーレイ */
.synergycast-seek-guard {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	cursor: default;
}

/* 音声ON救済オーバーレイ */
.synergycast-unmute-overlay {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: rgba(230, 57, 70, 0.95);
	color: #fff;
	border: none;
	border-radius: 30px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
	animation: synergycast-unmute-pulse 1.5s infinite;
}

.synergycast-unmute-overlay:hover {
	background: rgba(193, 18, 31, 0.95);
}

.synergycast-unmute-icon {
	font-size: 18px;
}

@keyframes synergycast-unmute-pulse {
	0%, 100% { transform: translateX(-50%) scale(1); }
	50% { transform: translateX(-50%) scale(1.05); }
}

/* オーバーレイ（LIVEバッジ・視聴者数） */
.synergycast-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 10px 14px;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
}

/* LIVE バッジ */
.synergycast-live-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	background: #e63946;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1px;
	border-radius: 4px;
	animation: synergycast-pulse 2s infinite;
}

@keyframes synergycast-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

/* 視聴者数 */
.synergycast-viewer-count {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 12px;
	border-radius: 4px;
}

.synergycast-viewer-icon {
	font-size: 13px;
}

/* ───────────────────────────────
   チャット
   ─────────────────────────────── */

.synergycast-chat {
	width: 300px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-left: none;
	border-radius: 0 8px 8px 0;
	min-height: 0;
	overflow: hidden;
}

.synergycast-chat-header {
	padding: 8px 12px;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
	background: #fafafa;
}

.synergycast-chat-title {
	font-size: 13px;
	font-weight: 600;
	color: #555;
}

.synergycast-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 8px 12px;
	min-height: 0;
}

.synergycast-chat-message {
	padding: 3px 0;
	font-size: 13px;
	line-height: 1.5;
}

.synergycast-chat-message-enter {
	animation: synergycast-chat-fadein 0.4s ease-out;
}

@keyframes synergycast-chat-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.synergycast-chat-name {
	font-weight: 600;
	margin-right: 5px;
	color: #999;
	font-size: 12px;
}

.synergycast-chat-text {
	color: #333;
	font-size: 13px;
}

/* チャット入力エリア */
.synergycast-chat-input-area {
	display: flex;
	gap: 6px;
	padding: 8px 10px;
	border-top: 1px solid #e0e0e0;
	flex-shrink: 0;
	background: #fafafa;
}

.synergycast-chat-input {
	flex: 1;
	font-size: 13px;
	padding: 6px 10px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	background: #fff;
	color: #333;
	outline: none;
	min-width: 0;
}

.synergycast-chat-input:focus {
	border-color: #999;
}

.synergycast-chat-send-btn {
	font-size: 13px;
	font-weight: 500;
	padding: 6px 12px;
	border: none;
	border-radius: 6px;
	background: #e63946;
	color: #fff;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}

.synergycast-chat-send-btn:hover {
	background: #c1121f;
}

/* チャットスクロールバー */
.synergycast-chat-messages::-webkit-scrollbar {
	width: 4px;
}

.synergycast-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

.synergycast-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.12);
	border-radius: 2px;
}

/* ───────────────────────────────
   終了モード
   ─────────────────────────────── */

.synergycast-mode-ended {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 32px 16px;
	border-radius: 8px;
}

.synergycast-ended-wrapper {
	text-align: center;
	padding: 32px;
	border-radius: 12px;
}

.synergycast-ended-icon {
	font-size: 44px;
	margin-bottom: 12px;
}

.synergycast-ended-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: #333;
}

.synergycast-theme-dark .synergycast-ended-title {
	color: #e0e0e0;
}

.synergycast-ended-next {
	font-size: 14px;
	color: #888;
	margin: 0;
}

/* ───────────────────────────────
   公開期限カウントダウン
   ─────────────────────────────── */

.synergycast-deadline-countdown {
	margin: 20px auto 0;
	padding: 20px 16px;
	border-radius: 8px;
	background: linear-gradient(135deg, #fff5e0, #ffe8c0);
	border: 1px solid #ffc870;
	text-align: center;
}

.synergycast-theme-dark .synergycast-deadline-countdown {
	background: linear-gradient(135deg, #2a2545, #3a2a55);
	border-color: #6b5fb5;
}

.synergycast-deadline-label {
	font-size: 14px;
	color: #d97706;
	margin: 0 0 10px 0;
	font-weight: 600;
	letter-spacing: 0.05em;
}

.synergycast-theme-dark .synergycast-deadline-label {
	color: #ffd966;
}

.synergycast-deadline-timer {
	font-size: 32px;
	font-weight: 700;
	color: #c2410c;
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.synergycast-theme-dark .synergycast-deadline-timer {
	color: #ffb86b;
}

.synergycast-deadline-segment {
	display: inline-block;
	white-space: nowrap;
}

.synergycast-deadline-value {
	display: inline-block;
	min-width: 1.4em;
}

.synergycast-deadline-unit {
	font-size: 16px;
	font-weight: 500;
	margin: 0 6px 0 2px;
	opacity: 0.85;
}

.synergycast-deadline-expired {
	font-size: 18px;
	font-weight: 700;
	color: #c2410c;
	margin: 0;
	letter-spacing: 0.05em;
}

.synergycast-theme-dark .synergycast-deadline-expired {
	color: #ffb86b;
}

@media screen and (max-width: 767px) {
	.synergycast-deadline-countdown {
		padding: 16px 8px;
	}
	.synergycast-deadline-timer {
		font-size: 22px;
	}
	.synergycast-deadline-unit {
		font-size: 13px;
		margin: 0 3px 0 1px;
	}
	.synergycast-deadline-expired {
		font-size: 16px;
	}
}

/* ───────────────────────────────
   CTA エリア
   ─────────────────────────────── */

.synergycast-cta-area {
	/* display: none がデフォルト（LP側で inline style で設定） */
}

.synergycast-cta-plugin {
	width: 100%;
	margin-top: 12px;
	padding: 20px 16px;
	background: linear-gradient(135deg, #fff5e0, #ffe8c0);
	border: 1px solid #ffc870;
	border-radius: 8px;
	color: #c2410c;
	font-size: 16px;
	line-height: 1.7;
	text-align: center;
}

.synergycast-cta-plugin h1,
.synergycast-cta-plugin h2,
.synergycast-cta-plugin h3 {
	color: #c2410c;
}

/* ───────────────────────────────
   レスポンシブ: PC (768px以上)
   動画とチャットは横並びで既に flex-direction: row
   ─────────────────────────────── */

/* ───────────────────────────────
   レスポンシブ: スマホ縦 (768px未満)
   ─────────────────────────────── */

@media screen and (max-width: 767px) {
	/* ヘッダー回避用の上部余白（スマホ） */
	.synergycast-player {
		padding-top: 90px;
	}

	/* ライブモード: 縦並びにする */
	.synergycast-mode-live {
		flex-direction: column;
	}

	/* チャットを動画の下に */
	.synergycast-chat {
		width: 100%;
		border: 1px solid #e0e0e0;
		border-top: none;
		border-radius: 0 0 8px 8px;
		max-height: none;
	}

	/* チャットメッセージ領域の高さ: 動画と同程度（56.25vw ≒ 16:9 動画の高さ） */
	.synergycast-chat-messages {
		max-height: 50vw;
	}

	/* コード入力 */
	.synergycast-code-input-group {
		flex-direction: column;
	}

	.synergycast-code-input {
		width: 100%;
	}

	.synergycast-code-submit {
		width: 100%;
	}

	/* カウントダウン */
	.synergycast-countdown-value {
		font-size: 36px;
		min-width: 50px;
	}

	.synergycast-countdown-sep {
		font-size: 28px;
	}
}

/* ───────────────────────────────
   レスポンシブ: スマホ横 (768px未満 + landscape)
   チャット非表示
   ─────────────────────────────── */

@media (max-width: 767px) and (orientation: landscape) {
	.synergycast-chat {
		display: none;
	}

	.synergycast-mode-live {
		flex-direction: row;
	}
}

/* ───────────────────────────────
   レスポンシブ: スマホ横（縦が短い画面全般）
   動画の最大高さを画面の縦から逆算して制限
   テーマのブレークポイント900pxに合わせて PC/SP ヘッダー帯を分岐
   ─────────────────────────────── */

/* 共通: 横向きかつ縦≤500px で発動 */
@media (orientation: landscape) and (max-height: 500px) {
	.synergycast-mode-live {
		justify-content: center;
	}
	.synergycast-player-area {
		width: 100%;
	}
}

/* SPヘッダー帯（max-width:899px = テーマのSP切替境界） */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 899px) {
	.synergycast-player {
		padding-top: 65px;
	}
	.synergycast-player-area {
		max-width: calc((100vh - 75px) * 16 / 9);
	}
}

/* PCヘッダー帯（min-width:900px = テーマのPC切替境界） */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 900px) {
	.synergycast-player {
		padding-top: 80px;
	}
	.synergycast-player-area {
		max-width: calc((100vh - 90px) * 16 / 9);
	}
}
