/* ============================================================
   PCワイド画面 サイドパネル（モバイル縦画面では非表示）
   ============================================================
   表示条件: 幅 1100px 以上
   #app (仮想800px) の左右余白に固定配置。
   #app の実際の幅 = min(100vw, 50vh) なので、
     - 左パネル: left=0 + width=calc(50%-min(50vw,25vh)) → 右端が #app 左端に一致
     - 右パネル: left=calc(50%+min(50vw,25vh)) + right=0 → 左端が #app 右端に一致
   ============================================================ */

.desktop-side-panel {
    display: none;
}

@media (min-width: 1100px) {

    /* ── 共通 ── */
    body.battle-active .desktop-side-panel {
        display: flex;
        position: fixed;
        top: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        z-index: 1;
        pointer-events: none;
    }

    body.battle-active .desktop-left-panel {
        left: 0;
        width: calc(50% - min(50vw, 25vh));
        padding: 20px 12px 20px 16px;
        align-items: flex-end;
    }

    body.battle-active .desktop-right-panel {
        left: calc(50% + min(50vw, 25vh));
        right: 0;
        padding: 20px 16px 20px 12px;
        align-items: flex-start;
    }

    .desktop-panel-inner {
        pointer-events: auto;
        width: 100%;
        max-width: 280px;
        max-height: calc(100vh - 40px);
        background: linear-gradient(180deg, rgba(22, 30, 58, 0.97) 0%, rgba(10, 14, 32, 0.98) 100%);
        border: 2px solid rgba(55, 80, 160, 0.48);
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* ── 左パネル: モンスターじょうほう ── */
    .desktop-info-panel {
        padding: 18px 16px;
        gap: 0;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(79, 172, 254, 0.3) transparent;
    }

    .desktop-info-panel::-webkit-scrollbar {
        width: 4px;
    }

    .desktop-info-panel::-webkit-scrollbar-track {
        background: transparent;
    }

    .desktop-info-panel::-webkit-scrollbar-thumb {
        background: rgba(79, 172, 254, 0.3);
        border-radius: 2px;
    }

    /* info-overlay.css の #app.portrait-mode スコープ外サイズを上書き */
    .desktop-info-panel .info-section-title {
        font-size: 13px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .desktop-info-panel .info-row {
        font-size: 13px;
        padding: 3px 0;
        gap: 8px;
    }

    .desktop-info-divider {
        height: 1px;
        width: 100%;
        background: var(--border-color);
        margin: 10px 0;
        flex-shrink: 0;
    }

    /* ── 右パネル: バトルログ ── */
    .desktop-message-panel {
        padding: 0;
    }

    .desktop-panel-header {
        font-family: var(--font-pixel);
        font-size: 12px;
        color: var(--primary-color);
        padding: 10px 14px 8px;
        border-bottom: 1px solid rgba(60, 88, 165, 0.45);
        background: linear-gradient(180deg, rgba(22, 32, 62, 0.70) 0%, rgba(7, 10, 24, 0.92) 100%);
        flex-shrink: 0;
        text-align: center;
        letter-spacing: 0.05em;
    }

    .desktop-message-scroll {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 12px;
        scrollbar-width: thin;
        scrollbar-color: rgba(79, 172, 254, 0.3) transparent;
        background: linear-gradient(180deg, rgba(4, 8, 22, 0.98) 0%, rgba(3, 5, 16, 0.99) 100%);
        box-shadow: inset 0 0 20px rgba(0, 20, 80, 0.25);
        /* panel-section--message と同じ border-color */
        border-top: 1px solid rgba(80, 120, 230, 0.55);
    }

    .desktop-message-scroll::-webkit-scrollbar {
        width: 4px;
    }

    .desktop-message-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .desktop-message-scroll::-webkit-scrollbar-thumb {
        background: rgba(79, 172, 254, 0.3);
        border-radius: 2px;
    }

    /* ── 問題一覧ログ ── */
    .desktop-problem-log {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .desktop-problem-entry {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 6px;
        padding: 2px 0;
        font-family: var(--font-pixel);
        font-size: 24px;
        font-weight: bold;
        line-height: 1.4;
    }

    .desktop-problem-text {
        flex: 1;
        color: #c8d4f0;
        word-break: break-all;
    }

    .desktop-problem-result {
        flex-shrink: 0;
        width: 1em;
        text-align: center;
        font-size: 28px;
        font-weight: bold;
    }

    .desktop-problem-result.correct {
        color: var(--success-color);
        text-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
    }

    .desktop-problem-result.wrong {
        color: var(--danger-color);
        text-shadow: 0 0 6px rgba(255, 75, 75, 0.5);
    }

    /* モンスター切り替え時の区切り線 */
    .desktop-log-separator {
        height: 1px;
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(79, 172, 254, 0.4) 30%,
            rgba(160, 220, 255, 0.7) 50%,
            rgba(79, 172, 254, 0.4) 70%,
            transparent 100%);
        margin: 5px 0 3px;
        flex-shrink: 0;
    }
}
