/* =====================================================================
   theme.css — 見た目の上書き（リッチ化）と PC 向けレイアウト
   既存の style.css / deck_builder.css の後に読み込み、配色は既存のピンク基調を踏襲する。
   スマホ（幅 1099px 以下）のレイアウトは変えず、装飾だけを加える。
   ===================================================================== */

:root {
    --lv-pink: #ff3d9a;
    --lv-pink-deep: #c2006c;
    --lv-violet: #8a5cff;
    --lv-cyan: #3ad6ff;
    --lv-gold: #ffd36b;
    --lv-panel: rgba(28, 22, 34, 0.86);
    --lv-panel-2: rgba(40, 30, 48, 0.9);
    --lv-line: rgba(255, 255, 255, 0.09);
    --lv-line-strong: rgba(255, 140, 200, 0.35);
    --lv-glow: 0 0 18px rgba(255, 61, 154, 0.35);
    --lv-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --lv-radius: 14px;
    --lv-font-title: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", -apple-system, BlinkMacSystemFont, sans-serif;
}

body, html { background: #120d16; }

/* ---------------------------------------------------------------------
   ホーム
   --------------------------------------------------------------------- */
#menu-view {
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(255, 61, 154, 0.28), transparent 60%),
        radial-gradient(900px 600px at 110% 110%, rgba(138, 92, 255, 0.30), transparent 60%),
        radial-gradient(circle at center, rgba(30, 20, 36, 0.9) 0%, rgba(14, 10, 18, 0.97) 100%),
        url('img/back.webp');
    background-size: auto, auto, auto, 72px;
    overflow: hidden;
}
#menu-view::before, #menu-view::after {
    content: ''; position: absolute; inset: -20%; pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.8), transparent 60%),
        radial-gradient(1.5px 1.5px at 70% 20%, rgba(255, 210, 240, 0.9), transparent 60%),
        radial-gradient(2px 2px at 40% 80%, rgba(200, 220, 255, 0.8), transparent 60%),
        radial-gradient(1.5px 1.5px at 85% 65%, rgba(255, 255, 255, 0.7), transparent 60%),
        radial-gradient(1px 1px at 10% 70%, rgba(255, 255, 255, 0.7), transparent 60%);
    /* 星は止めておく（画面全体より大きい層を毎フレーム動かすとホームが重くなるため） */
    opacity: 0.6;
}
#menu-view::after { opacity: 0.35; transform: scale(1.3); }

#menu-view > * { position: relative; z-index: 1; }
/* タイトルロゴ（img/logo.webp）。白フチのステッカー調なので、背後にピンクの光を敷いて暗い背景になじませる */
#menu-view h1.menu-logo {
    margin: 0 0 1.6rem;
    padding: 0;
    width: min(560px, 92vw);
    line-height: 0;
    font-size: 0;
    background: none;
    text-shadow: none;
    animation: lv-rise 0.7s ease-out both;
}
#menu-view h1.menu-logo::before {
    content: ''; position: absolute; inset: 8% 4% 4%; z-index: -1; pointer-events: none;
    background:
        radial-gradient(closest-side, rgba(255, 92, 170, 0.45), rgba(255, 61, 154, 0.12) 60%, transparent),
        radial-gradient(closest-side at 70% 60%, rgba(255, 211, 107, 0.18), transparent);
    filter: blur(18px);
    will-change: opacity;
    animation: lv-logo-glow 4.8s ease-in-out infinite;
}
#menu-view h1.menu-logo img {
    display: block; width: 100%; height: auto;
    user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(255, 61, 154, 0.35));
    animation: lv-logo-float 5.5s ease-in-out 0.7s infinite;
}
@keyframes lv-logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes lv-logo-glow { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    #menu-view h1.menu-logo img, #menu-view h1.menu-logo::before { animation: none; }
}
@keyframes lv-shine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes lv-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.menu-buttons { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.menu-buttons button {
    position: relative; overflow: hidden;
    width: min(300px, 78vw);
    border-radius: 16px;
    padding: 15px 18px;
    font-family: var(--lv-font-title);
    font-weight: 800; letter-spacing: 0.08em; text-transform: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, #ff4fa6 0%, #e4007f 45%, #a8008d 100%);
    box-shadow: 0 10px 24px rgba(228, 0, 127, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: lv-rise 0.6s ease-out both;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.menu-buttons button:nth-child(2) { animation-delay: 0.06s; background: linear-gradient(135deg, #9d7bff 0%, #6f4bff 50%, #4b2fc9 100%); box-shadow: 0 10px 24px rgba(111, 75, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.menu-buttons button:nth-child(3) { animation-delay: 0.12s; background: linear-gradient(135deg, #3ad6ff 0%, #1aa3e8 50%, #1667c7 100%); box-shadow: 0 10px 24px rgba(26, 163, 232, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.menu-buttons button::after {
    content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: translateX(-150%) skewX(-20deg);
    will-change: transform;
    animation: lv-sweep 4.5s ease-in-out infinite;
}
.menu-buttons button:nth-child(2)::after { animation-delay: 0.6s; }
.menu-buttons button:nth-child(3)::after { animation-delay: 1.2s; }
/* left ではなく transform で動かす（left だと毎フレーム再レイアウトが走って重い） */
@keyframes lv-sweep { 0%, 60% { transform: translateX(-150%) skewX(-20deg); } 100% { transform: translateX(325%) skewX(-20deg); } }
.menu-buttons button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.menu-buttons button:active { transform: scale(0.97); }
.menu-btn-sub { display: block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.04em; opacity: 0.85; margin-top: 2px; }
.menu-buttons button.menu-sub-btn {
    animation-delay: 0.18s;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: min(300px, 78vw);
    padding: 11px 18px;
    font-weight: 700;
}
.menu-buttons button.menu-sub-btn::after { display: none; }
#menu-view div[data-app-version] { font-family: var(--lv-font-title) !important; font-style: normal !important; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.4) !important; }

/* ---------------------------------------------------------------------
   共通: ヘッダー・ボタン・モーダル
   --------------------------------------------------------------------- */
.header-menu-btn, .builder-header .header-btn.home-btn {
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.15s ease, transform 0.1s ease;
}
.header-menu-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)) !important; }
.header-menu-btn:active { transform: scale(0.96); }
.modal-overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* モーダルを開いている間は後ろのループアニメーションを止める。
   背景ぼかし（backdrop-filter）は後ろが1px でも動くと毎フレーム掛け直しになり、とても重くなるため。
   ※止めるのは繰り返しの飾りだけ。登場時のフェードイン（lv-rise）まで止めると、別画面に置き去りの
     モーダルが display:flex のまま残っていた場合にホームが透明のまま固まる（実際に起きた）。 */
body:has(.modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"]) #menu-view h1.menu-logo img,
body:has(.modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"]) #menu-view h1.menu-logo::before,
body:has(.modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"]) .menu-buttons button::after,
body:has(.modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"]) .next-btn {
    animation-play-state: paused !important;
}
.modal-content, .modal-window {
    border-radius: 18px !important;
    box-shadow: var(--lv-shadow), 0 0 0 1px rgba(255, 140, 200, 0.18) !important;
    animation: lv-pop 0.22s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes lv-pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-title { font-family: var(--lv-font-title); letter-spacing: 0.06em; }

/* シミュレーション画面のヘッダー */
#simulation-view .header {
    background: linear-gradient(180deg, rgba(40, 24, 46, 0.98), rgba(24, 16, 30, 0.98)) !important;
    border-bottom: 1px solid var(--lv-line-strong) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.phase-display .phase-main, .phase-display { font-family: var(--lv-font-title); font-weight: 800; letter-spacing: 0.02em; }

/* 盤面のパネル類に質感を足す */
#playmat { background: radial-gradient(1200px 500px at 50% 0%, rgba(255, 61, 154, 0.08), transparent 60%), #14101a; }
.area-stage-stats { border-radius: 12px; border: 1px solid var(--lv-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }

/* NEXT ボタンを主役に */
.next-btn:not(:disabled) {
    background: linear-gradient(135deg, #ff4fa6, #e4007f) !important;
    box-shadow: 0 6px 18px rgba(228, 0, 127, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    border: none !important;
    animation: lv-breathe 2.4s ease-in-out infinite;
}
@keyframes lv-breathe { 0%, 100% { box-shadow: 0 6px 18px rgba(228, 0, 127, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35); } 50% { box-shadow: 0 6px 26px rgba(255, 61, 154, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35); } }

/* トースト: 1行に収める（長いときは showToast が文字を小さくする） */
#toast-container { width: max-content !important; max-width: min(calc(100vw - 20px), 560px) !important; align-items: center; }
#toast-container .toast { white-space: nowrap; max-width: min(calc(100vw - 20px), 560px); box-sizing: border-box; }
#toast-container .toast.wrap { white-space: normal; }
#toast, .toast, .toast-message {
    border-radius: 999px !important;
    background: linear-gradient(135deg, rgba(40, 24, 46, 0.96), rgba(24, 16, 30, 0.96)) !important;
    border: 1px solid var(--lv-line-strong) !important;
    box-shadow: var(--lv-shadow) !important;
}

/* カード: PC ではホバーで少し浮かせる */
@media (hover: hover) {
    .card-in-hand { transition: transform 0.15s ease, filter 0.15s ease; }
    .card-in-hand:hover { transform: translateY(-8px); filter: drop-shadow(0 8px 14px rgba(255, 61, 154, 0.35)); }
    .library-item { transition: transform 0.12s ease; }
    .library-item:hover { transform: translateY(-3px); }
}

/* デッキ編集 */
.builder-header { background: linear-gradient(180deg, rgba(40, 24, 46, 0.98), rgba(24, 16, 30, 0.98)) !important; border-bottom: 1px solid var(--lv-line-strong) !important; }
.builder-header h2 { font-family: var(--lv-font-title); font-weight: 800; }
.deck-item { border-radius: 12px !important; transition: transform 0.12s ease, background 0.15s ease; }
.deck-item:hover { background: rgba(255, 255, 255, 0.07) !important; }
.new-deck-btn { border-radius: 12px !important; background: linear-gradient(135deg, #3ad6ff, #1667c7) !important; box-shadow: 0 6px 16px rgba(26, 163, 232, 0.35); }

/* =====================================================================
   PC（横長・幅1100px以上）レイアウト
   ===================================================================== */
@media screen and (min-width: 1100px) and (min-aspect-ratio: 5/4) {
    #menu-view { max-width: none; }
    #menu-view h1.menu-logo { width: 640px; margin-bottom: 2rem; }
    .menu-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 18px; max-width: 980px; }
    .menu-buttons button {
        width: 280px; padding: 30px 22px; font-size: 1.35rem; border-radius: 20px; margin: 0;
    }
    .menu-buttons button.menu-sub-btn { width: 280px; flex-basis: 100%; max-width: 280px; padding: 12px; font-size: 0.95rem; }
    /* PC: 「はじめに」「オプション」は大きなボタンの下に縦並び（目立たせない） */
    #menu-view .menu-buttons .menu-sub-row { flex-basis: 100%; flex-direction: column; align-items: center; gap: 10px; width: auto; margin-top: 4px; }
    #menu-view .menu-buttons .menu-sub-row button.menu-sub-btn { flex: none; width: 280px; margin: 0; }

    /* ---- シミュレーション: 横に広げ、カード詳細を右側の常設パネルに ---- */
    #simulation-view {
        max-width: 1680px !important;
        margin: 0 auto;
        border-left: 1px solid var(--lv-line) !important;
        border-right: 1px solid var(--lv-line) !important;
    }
    #playmat {
        grid-template-columns: 15% minmax(0, 1fr) 17% 26%;
        grid-template-rows: minmax(0, 1fr) 23%;
        grid-template-areas:
            "left stage right-top info"
            "hand hand  hand      info";
        gap: 6px;
        padding: 6px;
    }
    #playmat.online-mode {
        grid-template-columns: 15% minmax(0, 1fr) 17% 26%;
        grid-template-rows: auto minmax(0, 1fr) 21%;
        grid-template-areas:
            "opponent opponent opponent info"
            "left     stage    right-top info"
            "hand     hand     hand      info";
    }
    #playmat.online-mode > .layout-left,
    #playmat.online-mode .layout-right-top { grid-row: auto; }
    .layout-right-top { min-height: 0; }
    .layout-right-top .area-resolution { flex: 1 1 auto; min-height: 0; }
    .layout-right-top .area-deck-trash { flex: 0 0 auto; gap: 8px; padding: 10px 0; }
    .layout-preview {
        border: 1px solid var(--lv-line) !important;
        border-radius: var(--lv-radius);
        background: linear-gradient(180deg, rgba(36, 26, 44, 0.95), rgba(20, 14, 26, 0.95));
        overflow-y: auto;
    }
    /* カード詳細パネルの大きなカード画像（テキストの下の残りを使う） */
    .layout-preview { overflow: hidden; }
    .layout-preview .preview-text-box { flex: 0 1 auto; min-height: 3.5em; font-size: 0.85rem; line-height: 1.45; }
    .preview-image-box {
        display: flex; flex: 1 1 0; min-height: 50%;
        align-items: flex-start; justify-content: center;
        padding-top: 8px;
    }
    .preview-image {
        max-width: 100%; max-height: 100%;
        object-fit: contain;
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    }
    /* ステージのカードは枠の高さにも収める。対戦では上に相手の盤面が入って自分のステージが低くなり、
       幅（30%）だけで大きさを決めるとカードの下が切れていた */
    .area-stage { container-type: size; }
    .area-stage .stage-slot { width: min(30cqw, calc((100cqh - 8px) * 0.714)); }
    /* 対戦レイアウトでは、ライブ置き場と手札を少し低くしてメンバーの段に高さを回す */
    #playmat.online-mode { grid-template-rows: auto minmax(0, 1fr) 17%; }
    #playmat.online-mode .area-live-set { flex: 3; }
    #playmat.online-mode .area-stage { flex: 7; }
    .layout-left, .layout-stage, .layout-right-top, .layout-hand {
        border-radius: var(--lv-radius);
        overflow: hidden;
    }
    .layout-hand { overflow-x: auto; }
    /* 成功ライブ置き場は3枚とも見えるように（エネルギー置き場と高さを分け合う） */
    .layout-left .area-success-live { flex: 5; }
    .layout-left .area-energy { flex: 5; }
    .success-live-slot, .success-slot-placeholder { width: auto; height: calc((100% - 30px) / 3); max-width: 92%; }
    .success-card-container { flex: 1; min-height: 0; justify-content: flex-start; }
    #playmat.online-mode .success-slot-placeholder,
    #playmat.online-mode .success-card-container .card-face { width: auto; height: calc((100% - 12px) / 3); max-width: 92%; }
    #playmat.online-mode .success-card-container { overflow: hidden; align-items: center; }

    /* ---- デッキ編集: 3カラム（ライブラリ｜詳細｜デッキ） ---- */
    #deck-builder-view { max-width: none !important; width: 100% !important; }
    .builder-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1.35fr) 320px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
    }
    .card-library-area { grid-column: 1; grid-row: 1; border-radius: var(--lv-radius); border: 1px solid var(--lv-line); }
    .builder-detail-area {
        grid-column: 2; grid-row: 1;
        height: auto !important;
        flex-direction: column;
        border-radius: var(--lv-radius); border: 1px solid var(--lv-line);
        overflow-y: auto;
    }
    .builder-detail-area .detail-image-box { width: 100% !important; max-width: none !important; height: auto !important; padding: 8px 0; flex: 0 0 auto; display: flex; justify-content: center; background: transparent !important; }
    .builder-detail-area .detail-image-box img { width: min(240px, 100%) !important; height: auto !important; max-height: 340px; object-fit: contain; border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); }
    .builder-detail-area .detail-info-box { flex: 1 1 auto; }
    .current-deck-area { grid-column: 3; grid-row: 1; height: auto !important; border-radius: var(--lv-radius); border: 1px solid var(--lv-line); overflow: hidden; }
    .library-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)) !important; }
    .deck-list-scroll { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)) !important; }

    .modal-window, .modal-content { max-width: 520px !important; }
}

/* =====================================================================
   PC の盤面（対戦・ひとりで練習）。pc_board.js が body に .pcb を付け、
   区画の飾り（.pc-gen）・山札の束・相手の手札などを足す。スマホの見た目は変えない。
   カードの大きさは --ch（縦）／--cw（横）。画面の縦と横の窮屈な方に合わせて全体が縮む。
   ===================================================================== */
body.pcb .pc-gen, body.pcb .pcl, body.pcb .pc-ohand, body.pcb .pc-leg, body.pcb .pc-ph { display: none; }
@media screen and (min-width: 1100px) and (min-aspect-ratio: 5/4) {
    body.pcb .pc-gen, body.pcb .pcl, body.pcb .pc-ph { display: block; }

    /* ---- 盤面の格子（対戦: 相手2段＋自分2段＋手札） ---- */
    body.pcb #playmat.online-mode {
        --ch: clamp(96px, min(calc((100dvh - 128px) / 4.25), calc((min(100vw, 1680px) * .76 - 110px) / 7)), 176px);
        --hh: calc(var(--ch) * .78);
        grid-template-columns: var(--pw) var(--yw) minmax(0, 1fr) var(--yw) var(--pw) minmax(240px, 24%) !important;
        grid-template-rows: var(--ch) var(--cw) var(--cw) var(--ch) calc(var(--hh) + 22px) !important;
        gap: 6px !important;
    }
    /* ひとりで練習: 相手の段をなくし、自分の2段＋手札（手札は場と同じ大きさ） */
    body.pcb #playmat:not(.online-mode) {
        --ch: clamp(96px, min(calc((100dvh - 190px) / 2.75), calc((min(100vw, 1680px) * .79 - 110px) / 7)), 210px);
        --hh: var(--ch);
        grid-template-columns: var(--pw) var(--yw) minmax(0, 1fr) var(--yw) var(--pw) minmax(240px, 21%) !important;
        grid-template-rows: calc(var(--cw) + 18px) calc(var(--ch) + 18px) calc(var(--hh) + 24px) !important;
        gap: 10px !important;
    }
    body.pcb #playmat {
        --cw: calc(var(--ch) * .714);
        --pw: calc(var(--cw) * .8 + 18px);
        --yw: calc(var(--cw) * 1.95);
        --yh: calc(var(--cw) - 28px);
        --ph: calc(var(--cw) * .74);
        --r1: 1; --r2: 2; --r3: 3; --r4: 4; --r5: 5;
        display: grid !important;
        grid-template-areas: none !important;
        padding: 6px !important;
        align-content: center !important;
    }
    body.pcb #opponent-area, body.pcb .opponent-container-flex, body.pcb .opponent-board, body.pcb .opponent-left-panel,
    body.pcb .layout-left, body.pcb .layout-stage, body.pcb .layout-right-top, body.pcb .area-deck-trash { display: contents !important; }
    body.pcb #playmat:not(.online-mode) #opponent-area { display: none !important; }
    body.pcb .opponent-score-area, body.pcb .opponent-info-bar, body.pcb .info-btn,
    body.pcb .area-success-live-label, body.pcb .opp-energy-label, body.pcb #opp-energy-count { display: none !important; }

    /* ---- 区画の見た目 ---- */
    body.pcb .pcz { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; position: relative; min-width: 0; min-height: 0; box-sizing: border-box; }
    body.pcb .pcl { position: absolute; top: 4px; left: 9px; font-size: .68rem; color: rgba(255,255,255,.55); letter-spacing: .05em; z-index: 3; pointer-events: none; white-space: nowrap; }
    body.pcb .pcl.ob { top: auto; bottom: 4px; left: auto; right: 9px; }
    body.pcb .pcz.live { background: linear-gradient(180deg, rgba(70,170,110,.20), rgba(70,170,110,.10)) !important; border-color: rgba(110,210,150,.28) !important; }
    body.pcb .pcz.stage { background: linear-gradient(180deg, rgba(230,90,140,.18), rgba(230,90,140,.08)) !important; border-color: rgba(255,140,190,.28) !important; }
    body.pcb .pcz.opp.live { background: linear-gradient(0deg, rgba(70,170,110,.20), rgba(70,170,110,.10)) !important; }
    body.pcb .pcz.opp.stage { background: linear-gradient(0deg, rgba(230,90,140,.18), rgba(230,90,140,.08)) !important; }
    body.pcb .pc-gen.pc-bz { z-index: 0; }
    body.pcb .area-stage, body.pcb .area-live-set, body.pcb .opponent-stage, body.pcb .opponent-live-area { background: none !important; border: none !important; z-index: 1; }
    body.pcb .pc-mid { grid-column: 1/6; grid-row: 2/4; align-self: center; height: 0; background: none !important; border: none !important; border-top: 1px dashed rgba(255,255,255,.18) !important; border-radius: 0 !important; pointer-events: none; margin-top: -3px; }

    /* ---- 中央: メンバーとライブは同じ大きさ（ライブは横向き） ---- */
    body.pcb .opponent-stage { grid-column: 3 !important; grid-row: 1 !important; position: relative !important; display: flex !important; flex-direction: row-reverse !important; justify-content: center; align-items: center; gap: calc(var(--cw) * .3) !important; width: auto !important; height: auto !important; top: auto !important; left: auto !important; }
    body.pcb .opponent-live-area { grid-column: 3 !important; grid-row: 2 !important; display: flex !important; flex-direction: row-reverse; justify-content: center; align-items: center; gap: 10px !important; width: auto !important; height: auto !important; margin: 0 !important; }
    body.pcb .area-live-set { grid-column: 3 !important; grid-row: var(--r3) !important; display: flex !important; justify-content: center; align-items: center; gap: 10px !important; flex: none !important; height: auto !important; padding: 0 !important; }
    body.pcb .area-stage { grid-column: 3 !important; grid-row: var(--r4) !important; display: flex !important; justify-content: center; align-items: center; gap: calc(var(--cw) * .3) !important; flex: none !important; height: auto !important; container-type: normal !important; padding: 0 !important; }
    body.pcb .opponent-member-slot, body.pcb .area-stage .stage-slot { width: calc(var(--cw) * .94) !important; height: calc(var(--ch) * .94) !important; flex: none !important; border-radius: 6px !important; }
    body.pcb .opponent-live-slot, body.pcb .live-slot { width: calc(var(--ch) * .94) !important; height: calc(var(--cw) * .94) !important; flex: none !important; border-radius: 6px !important; border-width: 1px !important; border-style: dashed !important; border-color: rgba(255,255,255,.25); position: relative !important; overflow: hidden; }
    /* 相手のカードは逆さ */
    body.pcb .opponent-member-slot .card-face { transform: rotate(180deg) !important; }
    body.pcb .opponent-member-slot.wait .card-face { transform: rotate(90deg) scale(.714) !important; }
    body.pcb .opponent-live-slot .card-face { background-size: 100% 100% !important; }
    body.pcb .opponent-live-slot .card-face[style*="rotate(0deg)"] { transform: rotate(180deg) !important; }
    body.pcb .opponent-live-slot .card-face:not([style*="rotate(0deg)"]) { width: calc(var(--cw) * .94) !important; height: calc(var(--ch) * .94) !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) rotate(270deg) !important; }

    /* ---- 左: 成功ライブ・エネルギー（相手は右上に鏡写し） ---- */
    body.pcb .area-success-live { grid-column: 1/3 !important; grid-row: var(--r3) !important; flex: none !important; height: auto !important; }
    body.pcb .area-energy { grid-column: 1/3 !important; grid-row: var(--r4) !important; flex: none !important; height: auto !important; }
    body.pcb #opp-success-area { grid-column: 4/6 !important; grid-row: 2 !important; margin: 0 !important; position: relative !important; top: auto !important; left: auto !important; right: auto !important; width: auto !important; height: auto !important; transform: none !important; display: block !important; }
    body.pcb #opp-success-area > .opp-success-card, body.pcb #opp-success-area > .opp-success-empty { display: none !important; }
    body.pcb .opponent-energy-area { grid-column: 4/6 !important; grid-row: 1 !important; margin: 0 !important; width: auto !important; height: auto !important; display: block !important; }
    body.pcb .pc-osc, body.pcb .pc-ogc { background: none !important; border: none !important; z-index: 1; position: relative; }
    body.pcb .pc-osc { grid-column: 4/6; grid-row: 2; cursor: pointer; }
    body.pcb .pc-ogc { grid-column: 4/6; grid-row: 1; }

    /* 成功ライブ: 3枠を実物の比率（1.4:1）で横に並べる */
    body.pcb #success-live-container, body.pcb .pc-osucc { position: absolute !important; left: 12px !important; right: 12px !important; top: 22px !important; bottom: 8px !important; width: auto !important; height: auto !important; display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: center !important; gap: 8px !important; padding: 0 !important; overflow: visible !important; }
    body.pcb .pc-osucc { top: 8px !important; bottom: 22px !important; flex-direction: row-reverse !important; }
    body.pcb #success-live-container > *, body.pcb .pc-osucc > * { flex: none !important; width: min(calc((100% - 16px) / 3), calc((var(--cw) - 32px) * 1.4)) !important; height: auto !important; aspect-ratio: 1.4 !important; max-width: none !important; max-height: none !important; min-width: 0 !important; margin: 0 !important; position: relative; border-radius: 5px; box-sizing: border-box; }
    body.pcb #success-live-container .card-face { position: absolute; inset: 0; width: 100% !important; height: 100% !important; transform: none !important; background-size: 100% 100% !important; border-radius: 5px; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
    body.pcb .success-slot-placeholder, body.pcb .pc-osucc .ph { border: 1px dashed rgba(255,255,255,.2) !important; background: none !important; }
    body.pcb .pc-osucc .c { background-size: 100% 100%; transform: rotate(180deg); box-shadow: 0 -3px 8px rgba(0,0,0,.5); }

    /* エネルギー: ゲージ（使える＝明るい青／使用済み＝暗い斜線／空き＝点線） */
    body.pcb #energy-count, body.pcb .pc-oen-count { position: absolute; top: 2px; right: 10px; font-size: .95rem; font-weight: 700; color: #5cc8ff; z-index: 3; }
    body.pcb .pc-oen-count { top: auto; bottom: 2px; right: auto; left: 10px; }
    body.pcb .pc-leg { position: absolute; top: 5px; left: 78px; display: flex; gap: 10px; font-size: .66rem; color: rgba(255,255,255,.6); z-index: 3; pointer-events: none; }
    body.pcb .pc-leg span { display: flex; align-items: center; gap: 4px; }
    body.pcb .pc-leg i { display: inline-block; width: 10px; height: 12px; border-radius: 2px; }
    body.pcb #energy-gauge, body.pcb .pc-ogauge { position: absolute !important; left: 14px; right: 14px; top: 24px; bottom: 10px; display: grid !important; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 1fr; gap: 6px !important; width: auto !important; height: auto !important; }
    body.pcb #energy-gauge { transform: scaleY(-1); }
    body.pcb .pc-ogauge { top: 10px; bottom: 24px; direction: rtl; }
    body.pcb .energy-segment { width: auto !important; height: auto !important; margin: 0 !important; border-radius: 5px !important; flex: none !important; box-sizing: border-box; transition: none !important; }
    body.pcb .energy-segment.active, body.pcb .pc-leg i.a { background: linear-gradient(160deg, #5ad6ff, #1677e0) !important; border: 1px solid #a8eaff !important; box-shadow: 0 0 9px rgba(80,190,255,.6) !important; opacity: 1 !important; }
    body.pcb .energy-segment.pc-wait, body.pcb .pc-leg i.w { background: repeating-linear-gradient(135deg, rgba(60,110,170,.55) 0 4px, rgba(25,45,80,.7) 4px 8px) !important; border: 1px solid rgba(110,170,230,.55) !important; box-shadow: none !important; opacity: 1 !important; }
    body.pcb .energy-segment.pc-empty, body.pcb .pc-leg i.e { background: transparent !important; border: 1px dashed rgba(255,255,255,.32) !important; box-shadow: none !important; }
    @media (max-width: 1500px) { body.pcb .pc-leg { display: none !important; } }

    /* ---- 右: エール（内側・ライブの隣）とハート集計（外側） ---- */
    body.pcb .area-resolution { grid-column: 4 !important; grid-row: var(--r3) !important; flex: none !important; padding: 0 !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; overflow: hidden !important; align-self: stretch !important; }
    body.pcb #resolution-summary { position: absolute; top: 2px; right: 8px; left: auto !important; display: flex; gap: 6px; font-size: .8rem; z-index: 5; }
    body.pcb #resolution-container, body.pcb .pc-oyell { position: absolute !important; left: 8px; right: 8px; bottom: 6px; top: 20px; height: auto !important; margin: 0 !important; display: flex; align-items: center; padding-right: calc(var(--yh) * .714 - 14px); }
    body.pcb .pc-oyell { top: 6px; bottom: 20px; flex-direction: row-reverse; padding-right: 0; padding-left: calc(var(--yh) * .714 - 14px); }
    body.pcb .res-card-item { position: relative !important; top: auto !important; left: auto !important; transform: none !important; flex: 0 1 calc(var(--yh) * .714); min-width: 10px; width: auto !important; height: var(--yh) !important; aspect-ratio: auto !important; }
    body.pcb .res-card-item img { position: absolute !important; left: 0; top: 0; width: calc(var(--yh) * .714) !important; height: 100% !important; transform: none !important; object-fit: fill !important; border-radius: 4px !important; box-shadow: -3px 0 8px rgba(0,0,0,.5); }
    body.pcb .pc-oyell .res-card-item img { left: auto; right: 0; transform: rotate(180deg) !important; box-shadow: 3px 0 8px rgba(0,0,0,.5); }
    /* エールのライブカードは横に倒して見せる。重なって枠が細くなってもメンバーと同じ端にそろえる（中央に置くとずれる） */
    body.pcb .res-card-item.res-rotate-live img { width: var(--yh) !important; height: calc(var(--yh) * .714) !important; left: calc(var(--yh) * .357) !important; top: 50% !important; right: auto !important; transform: translate(-50%, -50%) rotate(90deg) !important; }
    body.pcb .pc-oyell .res-card-item.res-rotate-live img { left: calc(100% - var(--yh) * .357) !important; transform: translate(-50%, -50%) rotate(270deg) !important; }
    body.pcb #stage-heart-stats { grid-column: 4 !important; grid-row: var(--r4) !important; margin: 0 !important; padding: 24px 10px 8px !important; height: auto !important; display: flex !important; flex-direction: column; justify-content: center; overflow: hidden !important; }
    body.pcb #stage-heart-stats .stat-row-main { position: absolute; top: 2px; right: 9px; width: auto !important; }
    body.pcb #stage-heart-stats .stat-grid { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 7px 5px !important; width: auto !important; }
    body.pcb #stage-heart-stats .stat-cell { width: auto !important; min-width: 0 !important; padding: 3px !important; font-size: .95rem !important; justify-content: center; }

    /* 相手の手札（裏向きのカード＋枚数）・ハート・見込み */
    body.pcb #opp-yell-container { grid-column: 2 !important; grid-row: 1 !important; display: flex !important; flex-direction: column; justify-content: flex-start; align-items: center; gap: 6px; padding: 10px 8px 22px !important; margin: 0 !important; width: auto !important; height: auto !important; background: rgba(255,255,255,.035) !important; border: 1px solid rgba(255,255,255,.08) !important; border-radius: 12px !important; position: relative; }
    body.pcb #opp-yell-container > .opp-info-item { font-size: 0 !important; padding: 0 !important; }
    body.pcb #opp-yell-icons { display: flex !important; gap: 8px !important; justify-content: center; font-size: .95rem; }
    body.pcb #opp-yell-status { font-size: .95rem !important; text-align: center; }
    body.pcb .pc-ohand { order: -1; display: flex; align-items: center; justify-content: center; height: calc(var(--ch) * .4); width: 100%; }
    body.pcb .pc-ohand i { display: block; height: 100%; aspect-ratio: .714; flex: none; background: #2a2238 url('img/back.png') center/100% 100% no-repeat; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,.55); transform: rotate(180deg); margin-left: calc(var(--ch) * -.19); }
    body.pcb .pc-ohand i:first-child { margin-left: 0; }
    body.pcb .pc-ohand b { margin-left: 10px; font-size: 1.05rem; font-weight: 700; color: #fff; background: rgba(10,8,16,.85); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
    body.pcb .pc-ohand b small { font-size: .62rem; color: rgba(255,255,255,.6); margin-right: 3px; font-weight: 400; }

    /* ---- 山札・控え室（4つとも同じ大きさ。相手は逆さ） ---- */
    body.pcb .pc-cell { display: flex; align-items: center; justify-content: center; }
    body.pcb .pc-pile { position: relative; height: var(--ph); width: calc(var(--ph) * .714); flex: none; border-radius: 6px; background: #1d1b26; box-shadow: 2px 2px 0 #444, 4px 4px 0 #333, 0 6px 12px rgba(0,0,0,.5); cursor: pointer; margin-top: 8px; }
    body.pcb .pc-pile .pw { position: absolute; inset: 0; overflow: hidden; border-radius: 6px; }
    body.pcb .pc-pile .pi { position: absolute; inset: 0; background: center/100% 100% no-repeat; border-radius: 6px; }
    body.pcb .pc-pile.lv .pi { inset: auto; width: 140%; height: 71.43%; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(90deg); }
    body.pcb .pc-pile b { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 60%); z-index: 2; background: rgba(10,8,16,.92); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 1px 9px; font-size: .8rem; color: #fff; white-space: nowrap; }
    body.pcb .pc-cell.opp .pc-pile { margin-top: 0; margin-bottom: 8px; transform: rotate(180deg); box-shadow: -2px -2px 0 #444, -4px -4px 0 #333, 0 -6px 12px rgba(0,0,0,.5); }
    body.pcb .pc-cell.opp .pc-pile b { transform: translate(-50%, 60%) rotate(180deg); }
    body.pcb .pc-cell .pcl { left: 50%; transform: translateX(-50%); }
    body.pcb .pc-cell.opp .pcl { top: auto; bottom: 4px; right: auto; }

    /* ---- 手札・NEXT・戻す・整頓 ---- */
    body.pcb #playmat .layout-hand { grid-column: 1/4 !important; grid-row: var(--r5) !important; height: auto !important; min-height: 0 !important; padding: 8px 10px !important; box-sizing: border-box; display: flex !important; align-items: center; }
    body.pcb .layout-hand .card-in-hand { height: var(--hh) !important; width: calc(var(--hh) * .714) !important; min-width: 0 !important; flex: none !important; }
    body.pcb .pc-dock { background: linear-gradient(135deg, rgba(255,80,170,.10), rgba(150,70,255,.08)) !important; border-color: rgba(255,140,200,.22) !important; }
    body.pcb #next-phase-btn { grid-column: 4/6 !important; grid-row: var(--r5) !important; justify-self: end !important; align-self: center !important; width: calc(100% - 128px) !important; max-width: 260px; height: 64px !important; margin: 0 14px 0 0 !important; padding: 0 !important; border-radius: 999px !important; font-size: 1.3rem !important; letter-spacing: .14em; font-weight: 800 !important; color: #fff !important; background: linear-gradient(135deg, #ff4fa3, #b93cff) !important; box-shadow: 0 6px 20px rgba(255,60,160,.45), inset 0 1px 0 rgba(255,255,255,.35) !important; border: none !important; z-index: 2; }
    body.pcb #next-phase-btn::after { content: '\25B6'; font-size: .7em; margin-left: .5em; vertical-align: .1em; }
    body.pcb #next-phase-btn:hover:not(:disabled) { filter: brightness(1.1); }
    body.pcb #next-phase-btn:disabled { filter: grayscale(.75) brightness(.6); box-shadow: none !important; }
    body.pcb #undo-btn { grid-column: 4/6 !important; grid-row: var(--r5) !important; justify-self: start !important; align-self: center !important; width: 88px !important; height: 64px !important; margin: 0 0 0 14px !important; padding: 0 !important; border-radius: 18px !important; background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.2) !important; font-size: 0 !important; z-index: 2; display: flex !important; flex-direction: column; align-items: center; justify-content: center; color: #fff !important; }
    body.pcb #undo-btn::before { content: ''; width: 26px; height: 26px; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center/contain no-repeat; }
    body.pcb #undo-btn::after { content: '戻す'; font-size: .72rem; color: rgba(255,255,255,.75); margin-top: 4px; letter-spacing: .1em; }
    body.pcb #undo-btn:disabled { opacity: .32; }
    body.pcb #board-check-btn { grid-column: 4/6 !important; grid-row: var(--r5) !important; justify-self: end !important; align-self: start !important; margin: 6px 14px 0 0 !important; width: auto !important; z-index: 2; }
    /* 整頓は手札の右下に固定（画面に浮かせて位置を測り直すと、描き直しのたびにずれて見えるため） */
    body.pcb #playmat #beta-sort-btn { position: static !important; grid-column: 1/4 !important; grid-row: var(--r5) !important; justify-self: end !important; align-self: end !important; margin: 0 12px 10px 0 !important; z-index: 5; }
    body.pcb #playmat #card-preview-area { grid-column: 6 !important; grid-row: 1 / -1 !important; }

    /* ひとりで練習は相手の2段が無いので、自分の段を上に詰める */
    body.pcb #playmat:not(.online-mode) { --r3: 1; --r4: 2; --r5: 3; }

    /* ---- マリガン: 盤面の真ん中に大きく ---- */
    body.pcb #beta-mulligan-panel { top: 50% !important; bottom: auto !important; left: calc((100vw - min(1680px, 100vw)) / 2 + 6px + (min(1680px, 100vw) - 12px) * .38) !important; right: auto !important; transform: translate(-50%, -50%); max-width: none !important; width: auto !important; border: 1px solid rgba(255,140,200,.35) !important; border-radius: 18px !important; padding: 0 0 10px !important; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 100vmax rgba(8,4,16,.55) !important; }
    body.pcb #beta-mulligan-panel > div:first-child { padding: 14px 18px 12px !important; }
    body.pcb #beta-mulligan-info { font-size: 1rem !important; }
    body.pcb #beta-mulligan-panel button { font-size: 1rem !important; padding: 10px 26px !important; }
    body.pcb #beta-mulligan-panel > div:nth-child(2) { gap: 14px !important; padding: 22px 22px 14px !important; overflow: visible !important; }
    body.pcb #beta-mulligan-panel > div:nth-child(2) > div { width: 136px !important; }
    body.pcb #beta-mulligan-panel > div:nth-child(2) > div > div:first-child { width: 136px !important; height: 190px !important; border-radius: 9px !important; }
    body.pcb #beta-mulligan-panel > div:nth-child(2) > div > div:nth-child(2) { font-size: .8rem !important; }
}

/* =====================================================================
   押下フィードバック（ui_press.js が押した要素に .lv-pressed を付ける）
   transform ではなく個別プロパティ scale を使うので、translate/rotate を持つ要素でも位置が崩れない。
   ===================================================================== */
.lv-pressed {
    scale: 0.94;
    filter: brightness(0.8) saturate(1.1) !important;
    transition: scale 0.06s ease-out, filter 0.06s ease-out !important;
}

/* ホームの「はじめに」「オプション」（スマホは横に並べて縦の長さを抑える） */
.menu-buttons .menu-sub-row { display: flex; gap: 10px; width: min(300px, 78vw); margin-top: 6px; }
.menu-buttons .menu-sub-row button.menu-sub-btn { flex: 1; width: auto; margin: 0; padding: 11px 8px; font-size: 0.9rem; letter-spacing: 0.04em; background: rgba(255, 255, 255, 0.08); box-shadow: none; animation-delay: 0.2s; }
@media (max-width: 1099px) {
    #menu-view h1.menu-logo { margin-bottom: 0.9rem; width: min(420px, 86vw); }
    .menu-buttons button { margin: 8px 0; padding: 12px 18px; }
    .menu-buttons .menu-sub-row { margin-top: 8px; }
}

/* =====================================================================
   スマホの盤面（縦画面・PCの並びにならない幅）。sp_board.js が body に .spb を付ける。
   上から: 相手の情報・相手のステージ・相手のライブ ／ 点線 ／ 成功ライブ｜エール・ハート｜山札と控え室・
   自分のライブ・自分のステージ・エネルギー｜戻す・NEXT・手札。詳細の欄はなくし、カードの上の「詳細」から出す。
   カードの大きさ --ch は画面の幅と高さの窮屈な方に合わせる。
   ===================================================================== */
body.spb #playmat {
    --ch: clamp(72px, min(calc((100vw - 24px) / 3.05), calc((100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 330px) / 3.8)), 118px);
    --cw: calc(var(--ch) * .714);
    --och: calc(var(--ch) * .74);
    --ocw: calc(var(--och) * .714);
    --r-sl: 4; --r-ht: 5; --r-lv: 6; --r-st: 7; --r-en: 8; --r-hd: 9;
    display: grid !important;
    grid-template-areas: none !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-template-rows: 26px minmax(var(--och), 1fr) minmax(calc(var(--ocw) + 2px), .7fr) 54px 58px minmax(calc(var(--cw) + 2px), .7fr) minmax(var(--ch), 1fr) 50px minmax(calc(var(--ch) * .82 + 12px), .6fr) !important;
    column-gap: 5px !important; row-gap: 6px !important;
    padding: 5px 6px 6px !important;
    align-content: stretch !important;
    flex: 1 1 0 !important; height: auto !important; min-height: 0 !important; overflow: visible !important;
}
/* ひとりで練習: 相手の段が無いぶん、自分のカードを大きく */
body.spb #playmat:not(.online-mode) {
    --ch: clamp(80px, min(calc((100vw - 24px) / 3.05), calc((100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 260px) / 2.55)), 124px);
    --r-sl: 1; --r-ht: 2; --r-lv: 3; --r-st: 4; --r-en: 5; --r-hd: 6;
    grid-template-rows: 54px 58px minmax(calc(var(--cw) + 2px), .7fr) minmax(var(--ch), 1fr) 50px minmax(calc(var(--ch) * .82 + 12px), .6fr) !important;
}
body.spb #opponent-area, body.spb .opponent-container-flex, body.spb .opponent-board, body.spb .opponent-left-panel,
body.spb .layout-left, body.spb .layout-stage, body.spb .layout-right-top, body.spb .area-deck-trash { display: contents !important; }
body.spb #playmat:not(.online-mode) #opponent-area { display: none !important; }
body.spb #card-preview-area, body.spb .opponent-score-area, body.spb .area-success-live-label, body.spb #opp-success-area,
body.spb .opponent-energy-area, body.spb .info-btn, body.spb #board-check-btn, body.spb #online-score-display { display: none !important; }
body.spb #playmat > *:not(.sp-zone) { position: relative; z-index: 1; }

/* ---- 床の色と境目（相手側は少し青く暗め、境目に点線） ---- */
body.spb .sp-zone { grid-column: 1 / 7; z-index: 0 !important; pointer-events: none; position: relative; margin: 0 -6px; }
body.spb .sp-zone.opp { grid-row: 1 / 4; margin-top: -5px; margin-bottom: -6px; background: linear-gradient(180deg, rgba(60, 70, 120, .32), rgba(60, 70, 120, .2)); }
body.spb .sp-zone.me { grid-row: var(--r-sl) / -1; margin-bottom: -6px; background: linear-gradient(180deg, rgba(255, 120, 190, .07), rgba(255, 120, 190, .03)); border-top: 1.5px dashed rgba(255, 255, 255, .28); }
body.spb #playmat:not(.online-mode) .sp-zone.me { border-top: none; margin-top: -5px; }
body.spb #playmat:not(.online-mode) .sp-zone.opp { display: none; }
body.spb #playmat.online-mode .area-success-live, body.spb #playmat.online-mode .area-resolution { margin-top: 8px !important; }

/* ---- 相手 ---- */
body.spb .opponent-info-bar { grid-column: 1 / 7 !important; grid-row: 1 !important; display: flex !important; gap: 6px; align-items: center; justify-content: space-between; padding: 0 6px !important; height: auto !important; margin: 0 !important; font-size: .7rem !important; background: rgba(255, 255, 255, .05); border-radius: 8px; }
body.spb .opponent-info-bar > span { white-space: nowrap; }
body.spb .opponent-stage { grid-column: 1 / 7 !important; grid-row: 2 !important; position: relative !important; display: flex !important; flex-direction: row-reverse !important; justify-content: center; align-items: center; gap: calc(var(--ocw) * .35) !important; width: auto !important; height: auto !important; top: auto !important; left: auto !important; border-radius: 10px; background: linear-gradient(0deg, rgba(230, 90, 140, .16), rgba(230, 90, 140, .06)); }
body.spb .opponent-member-slot { width: calc(var(--ocw) * .94) !important; height: calc(var(--och) * .94) !important; flex: none !important; border-radius: 5px !important; }
body.spb .opponent-member-slot .card-face { transform: rotate(180deg) !important; }
body.spb .opponent-member-slot.wait .card-face { transform: rotate(90deg) scale(.714) !important; }
body.spb .opponent-live-area { grid-column: 1 / 7 !important; grid-row: 3 !important; display: flex !important; flex-direction: row-reverse; justify-content: center; align-items: center; gap: 8px !important; width: auto !important; height: auto !important; margin: 0 !important; border-radius: 10px; background: linear-gradient(0deg, rgba(70, 170, 110, .18), rgba(70, 170, 110, .07)); }
body.spb .opponent-live-slot { width: calc(var(--och) * .94) !important; height: calc(var(--ocw) * .94) !important; flex: none !important; border-radius: 5px !important; border-width: 1px !important; border-style: dashed !important; border-color: rgba(255, 255, 255, .22); position: relative !important; overflow: hidden; }
body.spb .opponent-live-slot .card-face { background-size: 100% 100% !important; }
body.spb .opponent-live-slot .card-face[style*="rotate(0deg)"] { transform: rotate(180deg) !important; }
body.spb .opponent-live-slot .card-face:not([style*="rotate(0deg)"]) { width: calc(var(--ocw) * .94) !important; height: calc(var(--och) * .94) !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) rotate(270deg) !important; }
/* 相手のエール・見込み（相手がライブしたときだけ出る）: 相手のライブの段の右端に小さく */
body.spb #opp-yell-container { grid-column: 5 / 7 !important; grid-row: 2 / 4 !important; justify-self: end; align-self: center; position: relative !important; top: auto !important; left: auto !important; right: auto !important; width: auto !important; max-width: 110px; height: auto !important; flex: none !important; z-index: 3 !important; background: rgba(10, 8, 16, .88) !important; padding: 3px 6px !important; transform: none !important; }

/* ---- 自分: ライブ・ステージ ---- */
body.spb .area-live-set { grid-column: 1 / 7 !important; grid-row: var(--r-lv) !important; display: flex !important; justify-content: center; align-items: center; gap: 6px !important; flex: none !important; height: auto !important; padding: 0 !important; border-radius: 10px; background: linear-gradient(180deg, rgba(70, 170, 110, .2), rgba(70, 170, 110, .08)) !important; }
body.spb .live-slot { width: calc(var(--ch) * .94) !important; height: calc(var(--cw) * .94) !important; flex: none !important; border-radius: 6px !important; border-width: 1px !important; border-style: dashed !important; border-color: rgba(255, 255, 255, .25); position: relative !important; overflow: hidden; }
body.spb .area-stage { grid-column: 1 / 7 !important; grid-row: var(--r-st) !important; display: flex !important; justify-content: center; align-items: center; gap: calc(var(--cw) * .28) !important; flex: none !important; height: auto !important; container-type: normal !important; padding: 0 !important; border-radius: 10px; background: linear-gradient(180deg, rgba(230, 90, 140, .18), rgba(230, 90, 140, .07)) !important; }
body.spb .area-stage .stage-slot { width: calc(var(--cw) * .94) !important; height: calc(var(--ch) * .94) !important; flex: none !important; border-radius: 6px !important; }

/* ---- 自分: 成功ライブ｜エール ---- */
body.spb .area-success-live { grid-column: 1 / 4 !important; grid-row: var(--r-sl) !important; flex: none !important; height: auto !important; position: relative; border-radius: 10px; background: rgba(255, 255, 255, .04); padding: 0 !important; margin: 0; }
body.spb .area-success-live::before { content: '成功'; position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: .66rem; color: rgba(255, 255, 255, .55); }
body.spb #success-live-container { position: absolute !important; left: 32px; right: 6px; top: 7px; bottom: 7px; display: flex !important; flex-direction: row !important; gap: 3px !important; align-items: center !important; justify-content: flex-start !important; padding: 0 !important; height: auto !important; overflow: visible !important; width: auto !important; }
body.spb #success-live-container > * { flex: none !important; width: min(calc((100% - 6px) / 3), 56px) !important; height: auto !important; aspect-ratio: 1.4 !important; max-width: none !important; margin: 0 !important; position: relative; border-radius: 3px; box-sizing: border-box; }
body.spb #success-live-container .card-face { position: absolute; inset: 0; width: 100% !important; height: 100% !important; transform: none !important; background-size: 100% 100% !important; }
body.spb .success-slot-placeholder { border: 1px dashed rgba(255, 255, 255, .22) !important; background: none !important; font-size: 0 !important; }
body.spb .area-resolution { grid-column: 4 / 7 !important; grid-row: var(--r-sl) !important; flex: none !important; padding: 0 !important; height: auto !important; min-height: 0 !important; margin: 0; overflow: hidden !important; position: relative; border-radius: 10px; background: rgba(255, 255, 255, .04); }
body.spb .area-resolution::before { content: 'エール'; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: .6rem; color: rgba(255, 255, 255, .5); z-index: 2; }
body.spb #resolution-summary { position: absolute; right: 4px; top: 1px; font-size: .62rem; z-index: 3; }
body.spb #resolution-container { position: absolute !important; left: 36px; right: 4px; top: 4px; bottom: 4px; height: auto !important; margin: 0 !important; display: flex; align-items: center; }
body.spb .res-card-item { position: relative !important; top: auto !important; left: auto !important; transform: none !important; flex: 0 1 22px; min-width: 6px; width: auto !important; height: 30px !important; }
body.spb .res-card-item img { position: absolute !important; left: 0; top: 0; width: 22px !important; height: 100% !important; transform: none !important; border-radius: 3px !important; }

/* ---- 自分: ハート｜山札・控え室 ---- */
body.spb #stage-heart-stats { grid-column: 1 / 5 !important; grid-row: var(--r-ht) !important; margin: 0 !important; padding: 4px 60px 4px 6px !important; height: auto !important; min-height: 0 !important; max-height: 58px !important; display: flex !important; flex-direction: column; justify-content: center; overflow: hidden !important; border-radius: 10px; position: relative; }
/* ブレード数・ライブの合計スコアは、ハートの右に縦に並べる */
body.spb #stage-heart-stats .stat-row-main { position: absolute; right: 5px; top: 3px; bottom: 3px; width: 52px !important; margin: 0 !important; padding: 0 !important; border: none !important; display: flex !important; flex-direction: column; gap: 2px; align-items: center; justify-content: center; font-size: .7rem; }
body.spb #stage-heart-stats .stat-row-main .icon-img { width: 13px; height: 13px; }
body.spb #stage-heart-stats .stat-grid { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 3px !important; width: auto !important; }
body.spb #stage-heart-stats .stat-cell { width: auto !important; min-width: 0 !important; padding: 1px 2px !important; font-size: .72rem !important; justify-content: center; }
body.spb #stage-heart-stats .heart-icon { width: 12px !important; height: 12px !important; }
body.spb .stat-live-sum { font-size: .6rem; padding: 0 5px; }
body.spb .sp-piles { grid-column: 5 / 7; grid-row: var(--r-ht); display: flex; flex-direction: column; gap: 4px; justify-content: center; }
body.spb .sp-chip { display: flex; align-items: center; gap: 6px; height: 25px; padding: 0 8px; border-radius: 8px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #ddd; font-size: .72rem; cursor: pointer; }
body.spb .sp-chip .pp { width: 13px; height: 18px; border-radius: 2px; background: #1d1b26 center/100% 100% no-repeat; box-shadow: 1px 1px 0 #555; flex: none; }
body.spb .sp-chip b { margin-left: auto; color: #fff; font-size: .82rem; }

/* ---- 自分: エネルギー｜戻す・NEXT ---- */
body.spb .area-energy { grid-column: 1 / 4 !important; grid-row: var(--r-en) !important; flex: none !important; height: auto !important; position: relative; border-radius: 10px; background: rgba(255, 255, 255, .04); padding: 0 !important; margin: 0 !important; }
body.spb #energy-count { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: #5cc8ff; margin: 0 !important; }
body.spb #energy-gauge { position: absolute !important; left: 44px; right: 6px; top: 5px; bottom: 5px; display: grid !important; grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; grid-auto-flow: row; gap: 3px !important; width: auto !important; height: auto !important; transform: scaleY(-1); }
body.spb .energy-segment { width: auto !important; height: auto !important; margin: 0 !important; border-radius: 3px !important; transition: none !important; box-sizing: border-box; }
body.spb .energy-segment.active { background: linear-gradient(160deg, #5ad6ff, #1677e0) !important; border: 1px solid #a8eaff !important; box-shadow: 0 0 6px rgba(80, 190, 255, .6) !important; }
body.spb .energy-segment.pc-wait { background: repeating-linear-gradient(135deg, rgba(60, 110, 170, .55) 0 3px, rgba(25, 45, 80, .7) 3px 6px) !important; border: 1px solid rgba(110, 170, 230, .55) !important; box-shadow: none !important; }
body.spb .energy-segment.pc-empty { background: transparent !important; border: 1px dashed rgba(255, 255, 255, .3) !important; box-shadow: none !important; }
body.spb #undo-btn { grid-column: 4 !important; grid-row: var(--r-en) !important; align-self: center !important; justify-self: center !important; width: 48px !important; height: 46px !important; margin: 0 !important; padding: 0 !important; border-radius: 14px !important; background: rgba(255, 255, 255, .06) !important; border: 1px solid rgba(255, 255, 255, .2) !important; font-size: 0 !important; display: flex !important; flex-direction: column; align-items: center; justify-content: center; color: #fff !important; }
body.spb #undo-btn::before { content: ''; width: 20px; height: 20px; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center/contain no-repeat; }
body.spb #undo-btn::after { content: '戻す'; font-size: .6rem; color: rgba(255, 255, 255, .75); margin-top: 2px; }
body.spb #undo-btn:disabled { opacity: .32; }
body.spb #next-phase-btn { grid-column: 5 / 7 !important; grid-row: var(--r-en) !important; align-self: center !important; width: 100% !important; height: 46px !important; margin: 0 !important; padding: 0 !important; border-radius: 999px !important; font-size: 1.15rem !important; letter-spacing: .14em; font-weight: 800 !important; color: #fff !important; background: linear-gradient(135deg, #ff4fa3, #b93cff) !important; box-shadow: 0 6px 18px rgba(255, 60, 160, .45), inset 0 1px 0 rgba(255, 255, 255, .35) !important; border: none !important; }
body.spb #next-phase-btn::after { content: '\25B6'; font-size: .7em; margin-left: .5em; }
body.spb #next-phase-btn:disabled { filter: grayscale(.75) brightness(.6); box-shadow: none !important; }

/* ---- 手札（一番下）と整頓 ---- */
body.spb #playmat .layout-hand { grid-column: 1 / 7 !important; grid-row: var(--r-hd) !important; height: auto !important; min-height: 0 !important; padding: 6px !important; box-sizing: border-box; display: flex !important; align-items: center; }
body.spb .layout-hand .card-in-hand { height: calc(var(--ch) * .82) !important; width: calc(var(--ch) * .82 * .714) !important; min-width: 0 !important; flex: none !important; }
body.spb #playmat #beta-sort-btn { position: static !important; grid-column: 5 / 7 !important; grid-row: var(--r-hd) !important; justify-self: end !important; align-self: end !important; margin: 0 6px 6px 0 !important; z-index: 5; }

/* ---- 詳細ボタン（手札・自分のステージのカードをタップしたとき、カードの上に出る） ---- */
.sp-detail-btn { position: fixed; z-index: 9000; transform: translate(-50%, -100%); padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(20, 12, 28, .95); color: #fff; font-size: .78rem; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .6); }
body.spb #card-detail-sheet { z-index: 8600; } /* マリガン・カード選択の画面より手前に出す */
.sp-detail-btn::before { content: '\24D8 '; }
/* カードの直上のボタン（act_bar.js）: ［詳細］［起動］ */
.card-act-bar { position: fixed; z-index: 9000; transform: translate(-50%, -100%); display: flex; gap: 6px; }
.card-act-bar button { padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); color: #fff; font-size: .78rem; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .6); }
.card-act-bar .cab-detail { background: rgba(20, 12, 28, .95); }
.card-act-bar .cab-detail::before { content: '\24D8 '; }
.card-act-bar .cab-act { background: linear-gradient(135deg, #22b866, #127a42); border-color: rgba(160, 255, 200, .7); }
.card-act-bar .cab-act.used { background: #555; color: #bbb; border-color: rgba(255, 255, 255, .2); box-shadow: none; }
body:not(.spb) .card-act-bar button { font-size: .9rem; padding: 6px 16px; }
/* 起動できるカード・控え室は緑にほんのり光る */
.stage-slot.act-ready > .card-face, .card-in-hand.act-ready:not(.selected) { box-shadow: 0 0 0 2px rgba(90, 235, 150, .95), 0 0 12px 4px rgba(60, 220, 120, .55) !important; border-radius: 6px; }
.sp-chip.act-ready, .pc-pile.act-ready { box-shadow: 0 0 0 2px rgba(90, 235, 150, .95), 0 0 12px 4px rgba(60, 220, 120, .55) !important; }
/* 以前のカードの上の起動ボタンは見せない（自動テストのために残してある） */
.beta-activate-overlay-btn, .beta-hand-activate-overlay-btn { display: none !important; }
body.spb .pc-ph { display: block; }

/* iPhone は「押せない要素」のタップでは click を出さないので、外側タップで閉じる所は押せる要素にする
   （モーダルの暗い所・詳細のシート・盤面。タッチ端末だけなので見た目は変わらない） */
@media (pointer: coarse) {
    .modal-overlay, .intro-ov, #card-detail-sheet, body.spb #simulation-view { cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .modal-overlay > *, .intro-ov > * { cursor: auto; }
}

/* ===== カード詳細の見出し（v1.2.71）: 1行目＝カード名（横いっぱい）、2行目＝作品名・ユニット（左）とカード番号（右）。
   入りきらないときは JS（fitPreviewText）が高さを変えずに横だけ細くする ===== */
.preview-header { display: block !important; overflow: hidden; container-type: normal; }
.preview-header .preview-name-container { display: block; width: 100%; min-width: 0; overflow: visible; white-space: nowrap; }
.preview-header .preview-name { display: inline-block; white-space: nowrap; transform-origin: left center; flex: none; margin: 0; }
.preview-subinfo { display: flex !important; align-items: center; gap: 6px; min-width: 0; }
.preview-subinfo .psi-box { flex: 1 1 auto; min-width: 0; overflow: visible; white-space: nowrap; }
.preview-subinfo .psi-text { display: inline-block; white-space: nowrap; transform-origin: left center; }
.preview-subinfo .preview-rarity { flex: 0 0 auto; white-space: nowrap; margin-left: auto; transform: none !important; font-size: 0.62rem; color: #888; }

/* 効果で増えた分の札（betaRenderBuffBadges）: カードの右端の中ほどに縦に並べる */
/* 右の札（効果で増えた分）は右上から下へ、左の札（エネルギー・下のカード）は左下から上へ。どちらも枠から少しはみ出す。大きさは固定 */
.stage-slot, .opponent-member-slot { overflow: visible !important; }
.buff-badges { position: absolute; top: 3px; right: -5px; z-index: 18; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; pointer-events: none; }
.mem-left-badges { position: absolute; left: -5px; bottom: 3px; z-index: 18; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 1px; }
.buff-badges .bb-pill, .mem-left-badges .mlb-pill { box-sizing: border-box; width: 22px; height: 10px; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0; border-radius: 4px; border: 1px solid; font-size: 7px; font-weight: 800; line-height: 1; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.buff-badges .bb-pill { background: rgba(10, 40, 24, .9); border-color: #2ecc71; color: #6dffa8; }
.buff-badges .bb-ico { height: 7px; width: auto; }
.buff-badges .bb-heart { width: 7px; height: 7px; }
.buff-badges .bb-cost { font-size: 5.2px; letter-spacing: -.03em; background: rgba(60, 30, 0, .92); border-color: #f0a030; color: #ffd08a; }
.mem-left-badges .mlb-pill { position: static; }
.mem-left-badges .member-energy-badge { background: rgba(10, 30, 60, .92); border-color: #4aa8ff; color: #bfe0ff; pointer-events: none; }
.mem-left-badges .member-energy-badge::before { content: none; }
.mem-left-badges .member-under-badge { background: rgba(60, 20, 90, .92); border-color: #b47cff; color: #e6d2ff; cursor: pointer; }
/* 相手は鏡（左下から上へ）で、カードが小さいので札も小さく */
.buff-badges.bb-flip { top: auto; bottom: 3px; right: auto; left: -5px; flex-direction: column-reverse; align-items: flex-start; }
.buff-badges.bb-flip .bb-pill { width: 18px; height: 8px; font-size: 6px; border-radius: 3px; }
.buff-badges.bb-flip .bb-ico { height: 6px; }
.buff-badges.bb-flip .bb-heart { width: 6px; height: 6px; }
.buff-badges.bb-flip .bb-cost { font-size: 4.4px; }
/* PC はカードが大きいので札も大きく（pc_board.js は body に常に .pcb を付けるので、スマホでないことで判定する） */
body:not(.spb) .buff-badges .bb-pill, body:not(.spb) .mem-left-badges .mlb-pill { width: 34px; height: 14px; font-size: 10px; border-radius: 6px; }
body:not(.spb) .buff-badges .bb-ico, body:not(.spb) .buff-badges .bb-heart { height: 10px; }
body:not(.spb) .buff-badges .bb-heart { width: 10px; }
body:not(.spb) .buff-badges .bb-cost { font-size: 8px; }
body:not(.spb) .buff-badges.bb-flip .bb-pill { width: 30px; height: 12px; font-size: 9px; }
body:not(.spb) .buff-badges.bb-flip .bb-ico, body:not(.spb) .buff-badges.bb-flip .bb-heart { height: 9px; }
body:not(.spb) .buff-badges.bb-flip .bb-heart { width: 9px; }
body:not(.spb) .buff-badges.bb-flip .bb-cost { font-size: 7px; }

/* ---- 勝敗の画面（decorateGameEndModal） ---- */
.ge-modal { overflow: hidden; }
.ge-modal .ge-rays { position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .07) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 18%, transparent 46%); mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 18%, transparent 46%); }
.ge-modal.ge-win .ge-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, .16) 0deg 7deg, rgba(255, 80, 170, .05) 7deg 20deg); }
.ge-modal.ge-lose .ge-rays { background: repeating-conic-gradient(from 0deg, rgba(120, 150, 255, .07) 0deg 7deg, transparent 7deg 20deg); }
.ge-modal.ge-show .ge-rays { animation: ge-rays-in .8s ease-out forwards, ge-spin 40s linear infinite; }
@keyframes ge-rays-in { to { opacity: 1; } }
@keyframes ge-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.ge-modal .modal-window { position: relative; z-index: 2; overflow: visible; }
.ge-modal.ge-show .modal-window { animation: ge-pop .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ge-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ge-modal.ge-win .modal-window { border: 1px solid rgba(255, 215, 120, .8) !important; box-shadow: 0 0 0 1px rgba(255, 80, 170, .5), 0 0 40px rgba(255, 80, 170, .45), 0 0 90px rgba(255, 200, 90, .25) !important;
  background: linear-gradient(160deg, rgba(70, 26, 60, .97), rgba(28, 14, 36, .97)) !important; }
.ge-modal.ge-lose .modal-window { border: 1px solid rgba(130, 150, 230, .5) !important; box-shadow: 0 0 40px rgba(80, 100, 220, .3) !important; background: linear-gradient(160deg, rgba(28, 30, 56, .97), rgba(16, 16, 28, .97)) !important; }
.ge-modal.ge-draw .modal-window { border: 1px solid rgba(255, 210, 90, .6) !important; box-shadow: 0 0 40px rgba(255, 200, 80, .3) !important; }
.ge-modal .modal-header { background: transparent !important; border-bottom: none !important; letter-spacing: .12em; font-weight: 800; }
.ge-modal.ge-win .modal-header { text-shadow: 0 0 12px rgba(0, 255, 136, .7); }
.ge-modal .modal-body { position: relative; }
.ge-big { font-size: 3.6rem; font-weight: 900; line-height: 1; letter-spacing: .08em; margin: 2px 0 10px; background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.ge-win .ge-big { background-image: linear-gradient(100deg, #ffd56a 0%, #ff4fa3 30%, #fff 45%, #ff4fa3 60%, #ffd56a 100%); filter: drop-shadow(0 0 14px rgba(255, 80, 170, .6)); }
.ge-lose .ge-big { background-image: linear-gradient(100deg, #8fa2ff 0%, #d9defa 45%, #8fa2ff 100%); filter: drop-shadow(0 0 10px rgba(110, 130, 255, .4)); }
.ge-draw .ge-big { background-image: linear-gradient(100deg, #ffcf4a 0%, #fff6d0 45%, #ffcf4a 100%); filter: drop-shadow(0 0 12px rgba(255, 200, 80, .5)); }
.ge-show .ge-big { animation: ge-big-in .7s .15s cubic-bezier(.2, 1.5, .4, 1) both, ge-shine 3s 1s linear infinite; }
@keyframes ge-big-in { from { transform: scale(2.2); opacity: 0; letter-spacing: .4em; } to { transform: scale(1); opacity: 1; } }
@keyframes ge-shine { from { background-position: 100% 0; } to { background-position: -120% 0; } }
.ge-cards { display: flex; justify-content: center; height: 92px; margin: 4px 0 14px; }
.ge-card { width: 92px; height: 66px; margin: 12px -10px 0; border-radius: 6px; background: #222 center/cover no-repeat; border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 14px rgba(255, 210, 110, .35); transform: rotate(calc(var(--i) * 8deg)) translateY(calc(var(--i) * var(--i) * 6px)); }
.ge-lose .ge-card { box-shadow: 0 4px 14px rgba(0, 0, 0, .6); filter: saturate(.75); }
.ge-show .ge-card { animation: ge-card-in .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes ge-card-in { from { opacity: 0; transform: translateY(40px) rotate(0deg) scale(.7); } }
.ge-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.ge-confetti i { position: absolute; top: -20px; border-radius: 2px; opacity: 0; transform: rotate(var(--r)); }
.ge-show .ge-confetti i { animation-name: ge-fall; animation-timing-function: cubic-bezier(.3, .4, .6, 1); animation-iteration-count: 2; animation-fill-mode: both; }
@keyframes ge-fall { 0% { opacity: 0; transform: translate(0, 0) rotate(var(--r)); } 8% { opacity: 1; } 100% { opacity: .9; transform: translate(30px, 105vh) rotate(calc(var(--r) + 720deg)); } }
@media (prefers-reduced-motion: reduce) {
  .ge-show .ge-rays, .ge-show .ge-big, .ge-show .ge-card, .ge-show .modal-window { animation: none !important; opacity: 1; }
  .ge-confetti { display: none; }
}
.ge-modal .modal-body, .ge-modal .modal-footer { background: transparent !important; border-top-color: rgba(255, 255, 255, .08) !important; }
