/* 對戰影片模式（public/js/replay-video.js；docs/REPLAY_VIDEO_PLAN.md 步驟 1） */

.rv-chrome-btn {
  padding: 6px 12px; border: 2px solid #ffd23f; background: #ffd23f; color: #000;
  font-weight: 900; cursor: pointer; font-family: var(--b-font);
}

/* ── 設定視窗 ── */
.rv-setup-modal { max-width: 460px; }
.rv-setup-lead { font-size: 14px; line-height: 1.6; margin: 6px 0 12px; color: var(--b-black); }
.rv-setup-warn { font-size: 13px; line-height: 1.5; margin: 0 0 12px; padding: 8px 10px; background: #fff3cd; border: 2px solid #000; }
.rv-setup-hint { font-size: 12px; color: var(--muted2); margin: 12px 0 0; }
.rv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 14px; font-weight: 700; }
.rv-row select { padding: 5px 8px; border: 2px solid #000; background: #fff; font-weight: 700; min-width: 180px; }
.rv-check { justify-content: flex-start; font-weight: 500; }
.rv-setup-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.rv-primary { background: var(--b-red) !important; color: #fff !important; }

/* ── 影片模式：隱藏所有操作介面 ── */
body.video-mode { cursor: none; }
body.video-mode #replay-chrome,
body.video-mode .rp-actions,
body.video-mode #extraDrawBtn,
body.video-mode #game-chat-toggle,
body.video-mode #game-log-toggle,
body.video-mode #quick-msg-toggle,
body.video-mode #game-log-panel,
body.video-mode #game-chat-panel,
body.video-mode #hand-tray-btn,
body.video-mode #card-preview-content,
body.video-mode #cardHoverPopup,
body.video-mode .toast,
/* 播放中才跳出的站方視窗（遊戲公告、新版本提示、連線異常列、一般彈窗）不能錄進影片 */
body.video-mode #announceModal,
body.video-mode #update-banner,
body.video-mode #conn-issue-bar,
body.video-mode .overlay { display: none !important; }
body.video-mode #screen-game { pointer-events: none; }

/* ── 對手手牌公開面板（取代右上卡片預覽區） ── */
#rv-opp-hand, #rv-feed { display: none; }
body.video-mode #rv-opp-hand,
body.video-mode #rv-feed {
  display: block; position: absolute; right: 8px; width: 440px; z-index: 19;
  background: var(--b-cream); border: var(--b-border); box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.25);
  padding: 10px 12px; box-sizing: border-box; overflow: hidden;
}
body.video-mode #rv-opp-hand { top: 132px; height: 300px; }
body.video-mode #rv-feed { top: 452px; bottom: 170px; }
.rv-panel-title { font-family: var(--b-font); font-size: 16px; font-weight: 900; margin-bottom: 8px; letter-spacing: .5px; }
.rv-panel-title b { color: var(--b-red); margin-left: 4px; }
.rv-opp-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-opp-cards img, .rv-opp-cards .rv-card-ph { width: 76px; height: 105px; object-fit: cover; border: 2px solid #000; border-radius: 4px; }
.rv-card-ph { display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; box-sizing: border-box; background: #ddd; font-size: 11px; font-weight: 700; }
.rv-feed-item { font-size: 15px; line-height: 1.45; padding: 6px 0; border-top: 1px solid rgba(0, 0, 0, 0.15); color: #444; }
.rv-feed-item.rv-latest { color: #000; font-weight: 800; font-size: 17px; border-top: none; }

/* ── 演出覆蓋層 ── */
#rv-fx { display: none; }
/* 須高於盤面飛卡動畫（最高 100001），否則突襲動畫會蓋住演出 */
#rv-fx.rv-show { display: flex; position: fixed; inset: 0; z-index: 100002; pointer-events: none; flex-direction: column; align-items: center; animation: rvIn .22s ease-out; }
#rv-fx.rv-center { justify-content: center; background: rgba(0, 0, 0, 0.55); }
/* 攻擊宣告不壓暗盤面、放在中央 VS 分隔線上，避免蓋住雙方的能源線與前線 */
#rv-fx.rv-top { justify-content: center; }
@keyframes rvIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.rv-banner { font-family: var(--b-font); font-size: 34px; font-weight: 900; padding: 14px 34px; border: 4px solid #000; box-shadow: 6px 6px 0 rgba(0, 0, 0, .35); }
.rv-attack { background: var(--b-red); color: #fff; }
.rv-label { font-family: var(--b-font); font-size: 34px; font-weight: 900; color: #fff; text-shadow: 3px 3px 0 #000; margin-bottom: 18px; }
.rv-caption { font-family: var(--b-font); font-size: 30px; font-weight: 900; color: #ffd23f; text-shadow: 3px 3px 0 #000; margin-top: 18px; }
.rv-sub { font-size: 20px; font-weight: 700; color: #fff; margin-top: 12px; text-shadow: 2px 2px 0 #000; }

.rv-reveal { display: flex; gap: 28px; align-items: flex-start; background: var(--b-cream); border: 4px solid #000; padding: 22px; box-shadow: 8px 8px 0 rgba(0, 0, 0, .4); max-width: 900px; }
.rv-reveal .rv-sub { color: #333; text-shadow: none; }
.rv-big-img { width: 300px; height: 414px; object-fit: cover; border: 3px solid #000; border-radius: 8px; flex-shrink: 0; }
.rv-reveal-info { min-width: 260px; max-width: 480px; }
.rv-name { font-family: var(--b-font); font-size: 28px; font-weight: 900; margin-bottom: 14px; }
.rv-trigger { font-size: 19px; line-height: 1.7; background: rgba(255, 51, 0, .08); border: 2px solid var(--b-red); padding: 12px 14px; }
.rv-trigger b { color: var(--b-red); }

.rv-row-cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; max-width: 1500px; }
.rv-mid-img { width: 190px; height: 262px; object-fit: cover; border: 3px solid #000; border-radius: 6px; }
.rv-name-sm { font-size: 16px; font-weight: 800; color: #fff; text-shadow: 2px 2px 0 #000; text-align: center; max-width: 190px; margin-top: 6px; }

.rv-duel { display: flex; align-items: center; gap: 40px; }
.rv-duel-side { display: flex; flex-direction: column; align-items: center; transition: transform .3s, filter .3s; }
.rv-duel-img { width: 260px; height: 359px; object-fit: cover; border: 4px solid #000; border-radius: 8px; }
.rv-bp { font-family: var(--b-font); font-size: 30px; font-weight: 900; color: #fff; text-shadow: 3px 3px 0 #000; margin-top: 10px; }
.rv-win .rv-duel-img { border-color: #ffd23f; box-shadow: 0 0 36px rgba(255, 210, 63, .8); }
.rv-win { transform: scale(1.06); }
.rv-lose { filter: grayscale(.85) brightness(.6); }
.rv-vs { font-family: var(--b-font); font-size: 64px; font-weight: 900; color: var(--b-red); text-shadow: 4px 4px 0 #000; }

/* ── 片頭／片尾 ── */
#rv-title, #rv-end {
  position: fixed; inset: 0; z-index: 100003; display: flex; align-items: center; justify-content: center;
  background: #000; color: var(--b-cream); transition: opacity .4s;
}
#rv-end { background: rgba(0, 0, 0, .88); }
#rv-title.rv-fade { opacity: 0; }
.rv-title-inner { text-align: center; }
.rv-brand { font-family: var(--b-font); font-size: 28px; letter-spacing: 12px; color: var(--b-red); margin-bottom: 30px; }
.rv-players { display: flex; align-items: center; gap: 48px; font-family: var(--b-font); font-size: 64px; font-weight: 900; }
.rv-players em { font-style: normal; color: var(--b-red); font-size: 48px; }
.rv-winner { font-family: var(--b-font); font-size: 72px; font-weight: 900; color: #ffd23f; }
.rv-date { font-size: 22px; color: #aaa; margin-top: 26px; }
.rv-end-hint { font-size: 14px; color: #666; margin-top: 40px; }

/* ── 片頭／片尾：菜雞pUA 主視覺 ── */
.rv-logo { display: block; margin: 0 auto 18px; height: 460px; max-height: 46vh; width: auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); }
.rv-logo-sm { height: 240px; max-height: 24vh; margin-bottom: 10px; }
#rv-title .rv-brand { margin-bottom: 6px; font-size: 22px; }
.rv-main-title { font-family: var(--b-font); font-size: 96px; font-weight: 900; line-height: 1.05; color: #fff; letter-spacing: 4px; text-shadow: 5px 5px 0 var(--b-red); margin-bottom: 26px; }
#rv-title .rv-players { font-size: 52px; }
.rv-win-deck { font-family: var(--b-font); font-size: 34px; font-weight: 900; color: var(--b-cream); margin-top: 16px; }

/* ── 單人練習結束畫面：產生對戰紀錄 ── */
.rv-solo-save { margin-top: 14px; padding: 12px; border: 2px dashed #000; background: rgba(255, 210, 63, .18); display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.rv-solo-text { font-size: 13px; line-height: 1.5; }
.rv-solo-btn { background: #ffd23f !important; color: #000 !important; font-weight: 900; }

/* ── 最近對戰彈窗：練習對戰紀錄 ── */
.rv-practice { border-top: 3px solid #000; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 30vh; overflow-y: auto; }
.rv-practice-head { font-size: 14px; font-weight: 900; font-family: var(--b-font); letter-spacing: 1px; }
.rv-practice-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 2px dashed #000; background: #fffdf2; }
.rv-practice-main { flex: 1; min-width: 0; text-align: left; }
.rv-practice-title { font-size: 14px; font-weight: 900; }
.rv-practice-sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-practice-btn { flex: none; padding: 5px 10px; border: 2px solid #000; background: var(--b-red); color: #fff; font-size: 12px; font-weight: 900; font-family: var(--b-font); cursor: pointer; }
.rv-practice-date { flex: none; font-size: 12px; color: var(--muted2); font-family: Arial, sans-serif; }
.rv-players span { display: flex; flex-direction: column; align-items: center; }
/* 片頭的牌組標示：上行系列名（淡色）、下行玩家自取的牌組名（金色加大） */
.rv-players small { display: flex; flex-direction: column; align-items: inherit; gap: 4px; margin-top: 14px; letter-spacing: 0; max-width: 640px; line-height: 1.25; }
.rv-players .rv-series { font-style: normal; font-size: 21px; font-weight: 700; color: #cfcfd6; }
.rv-players .rv-deck { font-size: 30px; font-weight: 900; color: #ffd23f; }

/* 片頭 16:9 左右版面：左＝直式 logo 主視覺（870×1145），右＝標題文字 */
.rv-title-split { display: flex; align-items: center; justify-content: center; gap: 72px; text-align: left; padding: 0 64px; }
.rv-logo-hero { height: 86vh; max-height: 900px; max-width: 45vw; margin: 0; object-fit: contain; border-radius: 12px; box-shadow: 0 0 0 4px #000, 0 20px 60px rgba(0, 0, 0, .8); filter: none; }
.rv-title-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.rv-title-split .rv-main-title { font-size: 120px; margin-bottom: 36px; }
.rv-title-split .rv-players { justify-content: flex-start; gap: 36px; }
.rv-title-split .rv-players span { align-items: flex-start; }
.rv-title-split .rv-date { margin-top: 30px; }
/* logo 載入失敗被移除時，文字置中 */
.rv-title-split:not(:has(.rv-logo)) { text-align: center; }
.rv-title-split:not(:has(.rv-logo)) .rv-title-text { align-items: center; }

/* 全版背景：仿 logo 背景紋理（scripts/make_pua_bg_tile.js 產生），取代純黑 */
#rv-title, #rv-end { background: #141417 url(/images/pua-bg.jpg) center / cover no-repeat; }
/* logo 四邊羽化，與延伸出去的背景紋理融合（不再是一張有邊框的圖） */
.rv-logo-hero, .rv-logo-sm {
  border-radius: 0; box-shadow: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}
/* 文字壓在紋理上：加深陰影確保可讀 */
#rv-title .rv-brand, #rv-end .rv-brand, #rv-title .rv-date, #rv-end .rv-date, #rv-end .rv-end-hint, .rv-players small { text-shadow: 0 2px 6px #000, 0 0 2px #000; }
.rv-players span { text-shadow: 3px 3px 0 #000; }

/* ── 選擇畫面＋玩家選擇（影片模式）── */
.rv-choice-msg { font-size: 18px; max-width: 1100px; text-align: center; margin: 4px 0 36px; color: #eee; }   /* 下緣留空：選中的卡會上浮 */
.rv-choice-cards { gap: 16px; }
.rv-choice-card { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .25s, filter .25s, opacity .25s; }
.rv-choice-card.rv-picked { transform: translateY(-14px) scale(1.07); }
.rv-choice-card.rv-picked .rv-mid-img { border-color: #ffd23f; box-shadow: 0 0 0 3px #ffd23f, 0 0 34px rgba(255, 210, 63, .85); }
.rv-choice-card.rv-kept { filter: brightness(.72); }
.rv-choice-card.rv-unpicked { filter: grayscale(.8) brightness(.5); opacity: .8; }
.rv-choice-card.rv-discarded .rv-mid-img { border-color: var(--b-red); box-shadow: 0 0 0 3px var(--b-red), 0 0 26px rgba(255, 51, 0, .7); }
.rv-tag { margin-top: 6px; padding: 3px 12px; font-family: var(--b-font); font-size: 17px; font-weight: 900; border: 3px solid #000; white-space: nowrap; }
.rv-tag-pick { background: #ffd23f; color: #000; }
.rv-tag-keep { background: #3a3a40; color: #eee; }
.rv-options { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.rv-option { background: var(--b-cream); color: #000; border: 4px solid #000; padding: 14px 22px; font-size: 22px; font-weight: 800; line-height: 1.5; transition: transform .25s, filter .25s; }
.rv-option.rv-picked { background: #ffd23f; transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 210, 63, .8); }
.rv-option.rv-unpicked { filter: grayscale(.7) brightness(.55); }
.rv-banner.rv-yes { background: #1f7a3f; color: #fff; }
.rv-banner.rv-no { background: #3a3a40; color: #fff; }
.rv-banner.rv-choice-banner { background: var(--b-cream); color: #000; }
