/*
 * battle-live.css — 争奪戦 1 ページ完結 UI の overlay 3 種のみ。
 * ボタン装飾等は既存 CSS (gummy-btn / gummy-btn-rainbow / gummy-btn-red) を再利用する。
 * ここには overlay の位置決めと表示制御 (display: none/flex トグル) だけを置く。
 *
 * z-index:
 *   1000001 動画オーバーレイ (battle-thumbnail-fireworks 999999 の上に置く)
 *   1000002 結果 popup / エラー popup (fireworks / notification bubble の上に置く)
 */

.battle-video-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000001;
    align-items: center;
    justify-content: center;
}

.battle-video-overlay.is-active {
    display: flex;
}

.battle-video-player {
    max-width: 100%;
    max-height: 100%;
    background: #000;
}

/* スキップボタンは通常ガチャ (turn_the_lottery_page.blade.php:398 .video-skip-btn) と
   同じ見た目にする。あちらは inline <style> 定義で lottery_page からは参照できないため、
   同一プロパティをここに複製する。 */
#battle-video-overlay .video-skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}
#battle-video-overlay .video-skip-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* mute/unmute ボタン (auction.css .auction-reveal-mute-btn と同じ見た目) */
.battle-video-mute-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    padding: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.battle-video-mute-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* 抽選中のローディング表示は既存 <x-loading-popup> (base layout) を再利用するため、
   ここには独自 spinner を持たない。動画到着後は下記 video overlay を使う。 */

/* ---------- 結果 popup ---------- */
.battle-result-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000002;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.battle-result-overlay.is-active {
    display: flex;
}

.battle-result-container {
    position: relative;
    background: #fff;
    width: 100%;  /* full viewport width (PC でも黒帯を出さない) */
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.battle-result-iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #fff;
}

.battle-result-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* popup を full height にする (iframe 内に既存の footer が固定表示されるため下端配置は不要) */
.battle-result-overlay {
    align-items: stretch;
}

/* ---------- エラー popup ---------- */
.battle-error-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000002;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.battle-error-overlay.is-active {
    display: flex;
}

.battle-error-container {
    background: #fff;
    max-width: 400px;
    width: 100%;
    padding: 20px 20px 16px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.battle-error-message {
    font-size: 15px;
    color: #333;
    text-align: center;
    line-height: 1.5;
}

/* 在庫不足でロックしたボタンは inline onclick が発火しないよう pointer-events を殺す。
   .gummy-btn-disabled 単体では delay-active 経由で `disabled` 属性が外され、
   inline onclick="openGachaModal(...)" が発火してしまう。 */
.battle-live-locked {
    pointer-events: none !important;
    cursor: not-allowed !important;
}

