/* ===== キャンバス ===== */
#gameCanvas {
    border: 3px solid #333;
    background: #fdfaf3;
    cursor: default;
    display: block;
    touch-action: none;
    width: 100%;
    aspect-ratio: 800 / 600;
}

/* ===== ベース ===== */
body {
    background: white;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ヘッダー ===== */
.header {
    background: black;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    width: 100%;
}
.header .title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header nav {
    margin-left: auto;
}

/* ===== ページレイアウト ===== */
.page-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
.game-container {
    max-width: 1024px;
    margin: 0 auto;
}

/* ===== キャンバスエリア ===== */
.canvas-container {
    position: relative;
    max-width: min(800px, 82vw);
    margin: 0 auto;
    transition: max-width 0.3s;
}
#scroll-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 10%;
    height: 100%;
    z-index: 10;
    touch-action: pan-y;
}
.canvas-container.portrait {
    max-width: min(600px, 82vw);
}
.canvas-container.portrait #gameCanvas {
    aspect-ratio: 600 / 800;
}

/* ===== ゲームコントロールボタン ===== */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 0 14px;
    max-width: min(800px, 82vw);
    margin: 0 auto;
}
.ctrl-btn {
    padding: 9px 20px;
    border-radius: 8px;
    border: 2px solid #666;
    background: #f5f5f5;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.ctrl-btn:hover { background: #e0e0e0; }

/* ===== 関連アプリ ===== */
.right-column {
    width: 100%;
    flex-basis: 100%;
}
#link-list li a {
    flex-direction: row;
}

/* ===== 説明文 ===== */
.game-description {
    margin: 30px auto 0;
    padding: 0 20px 20px;
    max-width: 900px;
    color: #222;
}
.game-description-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.game-description article {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px 20px;
}
.game-description h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    border-left: 4px solid #555;
    padding-left: 8px;
}
.game-description ul {
    padding-left: 1.4em;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* ===== Thanks ===== */
.acknowledgement {
    max-width: 900px;
    padding: 0 20px 20px;
    margin: 15px auto;
}

/* ===== デスクトップ (1025px+) ===== */
@media (min-width: 1025px) {
    .page-wrapper {
        flex-wrap: nowrap;
    }
    .page-wrapper > main {
        flex: 1 1 auto;
        min-width: 0;
    }
    .right-column {
        flex: 0 0 280px;
        width: 280px;
        align-self: flex-start;
    }
}
