/* メインディスプレイのレイアウト */
.display-container {
    --grid-gap: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--grid-gap);
    position: relative;
    margin: 0;
    padding: var(--grid-gap);
    background-color: transparent;
    min-height: 300px;
}

/* 共通のウィンドウスタイル */
.window {
    background-color: #000000;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    width: 100%;
    box-sizing: border-box;
}

/* 共通のタイトルスタイル */
.window-title {
    background-color: #000000;
    color: #fff;
    font-size: 14px;
    padding: 5px 15px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #333;
    border-bottom: none;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: -1px;
}

/* キャンバス設定 */
canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 軌道表示のコンテナ */
.orbit-container {
    grid-column: 1;
    width: 100%;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* 軌道表示のタイトル */
.orbit-container .window-title {
    color: #fff;
    font-size: 14px;
    padding: 5px 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #444;
    background-color: #000000;
    position: relative;
    z-index: 3;
}

/* 軌道表示ウィンドウ */
.orbit-window {
    width: 100%;
    aspect-ratio: 1;
    background-color: #000000;
    position: relative;
    z-index: 2;
}

/* 中央・右パネルのコンテナ */
.right-panels {
    grid-column: 2 / 4;
    display: flex;
    gap: var(--grid-gap);
    position: relative;
    height: var(--sky-height);
    align-items: flex-start;
    margin-top: 150px;
}

/* 天球表示ウィンドウのコンテナ */
.sky-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

/* 天球表示ウィンドウの共通スタイル */
.sky-window {
    width: 100%;
    height: 240px;
    background-color: #000000;
}

/* キャンバスの表示設定 */
.sky-window canvas {
    width: 100%;
    height: 100%;
    border-radius: 0 0 8px 8px;
}

/* 東天球ウィンドウ */
.east-window {
    flex: 1;
    position: relative;
    height: var(--sky-window-height);
}

/* 西天球ウィンドウ */
.west-window {
    flex: 1;
    height: var(--sky-window-height);
}

/* 金星状相表示 */
.phase-display {
    --phase-size: 160px;
    position: absolute;
    width: var(--phase-size);
    height: calc(var(--phase-size) + 30px);
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    background-color: #000000;
    left: 50%;
    transform: translateX(-50%);
    top: -150px;
}

/* 状態に関係なく背景色を維持 */
.phase-display,
.phase-display.disabled {
    background-color: #000000;
}

/* 状相表示のタイトル */
.phase-title {
    color: #fff;
    font-size: 14px;
    padding: 5px 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #444;
    background-color: #000000;
    position: relative;
    z-index: 3;
}

/* キャンバスのコンテナ */
.phase-display .canvas-container {
    position: relative;
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
}

/* 無効化状態のcanvas-container */
.phase-display.disabled .canvas-container {
    position: relative;  /* ::before, ::afterの基準位置 */
}

/* キャンバスのサイズと配置 */
.phase-display .canvas-container canvas {
    margin: 10px;
    width: calc(var(--phase-size) - 20px);
    height: calc(var(--phase-size) - 20px);
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .display-container {
        grid-template-columns: 1fr;
        padding: var(--grid-gap);
        gap: 130px;  /* 150pxから130pxに変更して20px上に */
    }

    .right-panels {
        grid-column: 1;
        flex-direction: column;
        height: auto;
        margin-top: 40px;
        position: relative;
    }

    .orbit-container {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    .orbit-window {
        width: 100%;
    }

    .window {
        width: 100%;
    }

    .phase-display {
        position: absolute;
        top: -190px;
    }
}

/* ウィンドウの無効化状態 */
.window.disabled {
    opacity: 0.9;
    pointer-events: none;
}

/* phase-displayの無効化状態 */
/* 無効化時のオーバーレイ */
.phase-display.disabled .canvas-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* orbit-viewの無効化時のメッセージ */
.orbit-window.disabled::before {
    content: "地球を固定したときの\A金星の位置の変化";
    white-space: pre;
    position: absolute;
    top: calc(50% - 70px); /* 70px上に移動（30px + 40px） */
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    z-index: 1;
}

/* phase-displayの無効化時のメッセージ */
.phase-display.disabled .canvas-container::before {
    content: "連続表示中のため\A非表示";
    white-space: pre;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    z-index: 1;
}