/* こみゃくゲーム — 万博2025和モダンデザイン */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ホーム画面用の変数もここで定義 */
    --expo-red: #E60012;
    --expo-blue: #0068B7;
    --expo-navy: #1a2744;
    --expo-gold: #c8a84b;
    --bg-warm: #f7f3ee;
    --text-main: #2c2c2c;
    --text-sub: #5a5a5a;
    --border-light: #e0dbd4;
    --panel-bg: #fff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 8px;
}

/* ===== ホーム画面 ===== */
#home-screen, #ranking-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-warm);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

.home-content, .ranking-screen-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.home-logo {
    margin-bottom: 12px;
}

.home-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--expo-red);
    background: #fff;
}

.home-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.home-subtitle {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 28px;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.home-btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.home-btn:active {
    transform: scale(0.97);
}

.home-btn-start {
    background: var(--expo-red);
    color: #fff;
}

.home-btn-start:hover {
    background: #cc0010;
}

.home-btn-ranking {
    background: var(--panel-bg);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.home-btn-ranking:hover {
    background: #f0ebe4;
}

.home-btn-back {
    background: var(--panel-bg);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.home-btn-back:hover {
    background: #f0ebe4;
}

.home-best-score {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 28px;
    padding: 10px 16px;
    background: var(--panel-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.home-best-label {
    font-size: 12px;
    color: var(--text-sub);
}

.home-best-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--expo-red);
    font-feature-settings: 'tnum';
}

.home-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.home-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.home-nav-item:hover {
    background: #f0ebe4;
}

.home-nav-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.home-nav-text {
    text-align: left;
    line-height: 1.3;
}

/* ===== ランキング画面 ===== */
.ranking-screen-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.ranking-screen-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f0ebe4;
    border-radius: 6px;
    padding: 3px;
}

.ranking-screen-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
}

.ranking-screen-tab.active {
    background: var(--panel-bg);
    color: var(--expo-red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ranking-screen-list {
    background: var(--panel-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 20px;
    min-height: 200px;
}

.ranking-screen-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.ranking-screen-entry:nth-child(1) { background: rgba(255, 215, 0, 0.1); }
.ranking-screen-entry:nth-child(2) { background: rgba(192, 192, 192, 0.1); }
.ranking-screen-entry:nth-child(3) { background: rgba(205, 127, 50, 0.1); }
.ranking-screen-entry:nth-child(n+4) { background: #faf8f5; }

.ranking-screen-rank {
    font-size: 18px;
    width: 32px;
    text-align: center;
}

.ranking-screen-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    font-feature-settings: 'tnum';
}

.ranking-screen-loading {
    text-align: center;
    color: var(--text-sub);
    padding: 40px 0;
    font-size: 14px;
}

.ranking-screen-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body {
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-warm);
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    touch-action: pan-y pinch-zoom;
    color: var(--text-main);
}

#game-container {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px;
    overflow: visible;
    touch-action: pan-y;
}

/* スマホ版レイアウト */
.left-panel, .right-panel {
    display: none;
}

.center-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    padding-bottom: 30px;
}

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--panel-bg);
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 400px;
}

.mini-button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--panel-bg);
    color: var(--text-main);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.mini-button:active {
    background: #f0ebe4;
}

.mini-score {
    flex-grow: 1;
    text-align: center;
}

.mini-score-label {
    font-size: 10px;
    color: var(--text-sub);
    letter-spacing: 0.5px;
}

.mini-score-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--expo-red);
    font-feature-settings: 'tnum';
}

.mini-next {
    width: 46px;
    height: 46px;
    background: #faf8f5;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

#mobile-next-canvas {
    width: 38px;
    height: 38px;
    display: block;
}

.pause-button-pc {
    display: none;
}

#game-canvas-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(400px, 92vw);
    height: min(650px, calc(100vh - 180px));
    max-height: calc(100vh - 180px);
    aspect-ratio: 400 / 650;
}

#game-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

canvas {
    border: 1px solid var(--border-light);
    background-color: #fff;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    touch-action: none;
}

/* ランキングタブ（共通） */
.ranking-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    background: #f0ebe4;
    border-radius: 6px;
    padding: 3px;
}

.ranking-tab {
    flex: 1;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.ranking-tab:hover {
    color: var(--text-main);
}

.ranking-tab.active {
    background: var(--panel-bg);
    color: var(--expo-red);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ranking-content {
    position: relative;
}

.ranking-list {
    display: none;
}

.ranking-list.active {
    display: block;
}

.ranking-panel {
    background: var(--panel-bg);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 400px;
    margin: 8px auto;
}

/* ランキング・スコアの基本スタイル（モバイル・PC共通） */
.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 6px;
    background: #faf8f5;
}

.rank-now {
    background: rgba(230, 0, 18, 0.06);
    border: 1px solid rgba(230, 0, 18, 0.15);
}

.rank-icon {
    font-size: 18px;
}

.rank-label {
    font-weight: 700;
    color: var(--expo-red);
    font-size: 11px;
    letter-spacing: 0.5px;
}

.rank-score {
    font-weight: 600;
    color: var(--text-sub);
    font-size: 14px;
    font-feature-settings: 'tnum';
}

.rank-score.current {
    color: var(--expo-red);
}

.panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.score-panel .current-score {
    font-size: 42px;
    font-weight: 700;
    color: var(--expo-red);
    margin: 4px 0;
    font-feature-settings: 'tnum';
}

.best-score-label {
    font-size: 10px;
    color: var(--text-sub);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.best-score-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

/* モバイル用ランキングパネル */
.mobile-ranking {
    background: var(--panel-bg);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 400px;
    margin: 4px auto;
}

@media (min-width: 1024px) {
    .mobile-ranking {
        display: none;
    }
}

/* PC版：3カラムレイアウト */
@media (min-width: 1024px) {
    #game-container {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 24px;
        padding: 24px;
    }

    .left-panel, .right-panel {
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex-shrink: 0;
    }

    .mobile-header {
        display: none;
    }

    .center-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .pause-button-pc {
        display: block;
        padding: 10px 32px;
        font-size: 14px;
        font-weight: 600;
        background: var(--panel-bg);
        color: var(--text-main);
        border: 1px solid var(--border-light);
        border-radius: var(--radius);
        cursor: pointer;
        transition: all 0.2s;
    }

    .pause-button-pc:hover {
        background: #f0ebe4;
        border-color: #ccc;
    }

    /* 左パネル */
    .score-panel {
        background: var(--panel-bg);
        padding: 20px;
        border-radius: var(--radius);
        text-align: center;
        border: 1px solid var(--border-light);
        box-shadow: var(--shadow-sm);
        width: 190px;
    }

    .ranking-panel {
        width: 190px;
    }

    /* 右パネル */
    .next-panel {
        background: var(--panel-bg);
        padding: 16px;
        border-radius: var(--radius);
        text-align: center;
        border: 1px solid var(--border-light);
        box-shadow: var(--shadow-sm);
        width: 170px;
    }

    .next-title {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-sub);
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

    .next-preview-large {
        width: 140px;
        height: 140px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    #next-canvas {
        display: block;
    }

    .evolution-panel {
        background: var(--panel-bg);
        padding: 14px;
        border-radius: var(--radius);
        text-align: center;
        border: 1px solid var(--border-light);
        box-shadow: var(--shadow-sm);
        width: 170px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .evolution-title {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-sub);
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

    #evolution-ring-canvas {
        display: block;
        margin: 0 auto;
    }
}

/* 一時停止ポップアップ */
.pause-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 39, 68, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.pause-popup.active {
    display: flex;
}

.pause-content {
    background: var(--panel-bg);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    max-width: 340px;
    width: 90%;
}

.pause-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 24px;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pause-btn {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.continue-btn {
    background: var(--expo-blue);
    color: white;
}

.continue-btn:hover {
    background: #005a9e;
}

.restart-btn {
    background: #f5f1ec;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.restart-btn:hover {
    background: #ebe6df;
}

.share-btn {
    background: var(--expo-navy);
    color: white;
}

.share-btn:hover {
    background: #243252;
}

.pause-btn:active {
    transform: scale(0.98);
}

/* ゲームオーバー */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 39, 68, 0.92);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 16px 80px;
}

.game-over-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.score-details {
    background: var(--panel-bg);
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    text-align: center;
}

.score-details .current-score,
.score-details .best-score-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0;
}

.score-details .current-score {
    color: var(--expo-red);
}

.game-over-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.retry-button, .share-button {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 140px;
    z-index: 101;
}

.retry-button {
    background: var(--expo-blue);
    color: white;
}

.retry-button:hover {
    background: #005a9e;
}

.share-button {
    background: var(--expo-navy);
    color: white;
}

.share-button:hover {
    background: #243252;
}

.retry-button:active, .share-button:active {
    transform: scale(0.97);
}

.new-record {
    font-size: 18px;
    font-weight: 700;
    color: var(--expo-gold);
    margin: 10px 0;
}

/* ゲームオーバー画面のサイト導線 */
.gameover-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 14px auto;
    max-width: 360px;
}

.gameover-nav-link {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.gameover-nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ゲームオーバー画面のランキング */
.gameover-ranking {
    background: var(--panel-bg);
    padding: 14px 16px;
    border-radius: var(--radius);
    margin: 20px auto;
    max-width: 320px;
    width: 90%;
}

.gameover-ranking-list {
    display: none !important;
}

.gameover-ranking-list.active {
    display: flex !important;
}

.gameover-ranking-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 8px;
}

.gameover-ranking-list {
    flex-direction: column;
    gap: 4px;
}

.gameover-ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #faf8f5;
    border-radius: 6px;
}

.gameover-ranking-item .rank-icon {
    font-size: 16px;
}

.gameover-ranking-item .rank-score {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    font-feature-settings: 'tnum';
}

/* 広告スタイル */
ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 120px;
}

.ad-sidebar {
    margin-top: 16px;
    padding: 8px;
    background: #faf8f5;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.ad-gameover {
    margin: 16px auto;
    padding: 8px;
    max-width: 400px;
    min-height: 140px;
    overflow-y: visible;
    max-height: none;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.ad-restart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 39, 68, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.ad-restart-overlay.active {
    display: flex;
}

.ad-restart-content {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
}

.ad-countdown {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

.ad-countdown-number {
    color: var(--expo-red);
    font-size: 20px;
}

.ad-restart-box {
    min-width: 300px;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: scroll;
    max-height: none;
}

@media (max-width: 1023px) {
    .ad-sidebar {
        display: none;
    }

    .ad-gameover {
        max-width: 90%;
    }

    .ad-restart-content {
        padding: 20px;
    }

    .ad-restart-box {
        min-width: 250px;
        min-height: 200px;
    }
}

/* やり直し確認モーダル */
.restart-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 39, 68, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.restart-confirm-modal.active {
    display: flex;
}

.restart-confirm-content {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 28px;
    max-width: 360px;
    text-align: center;
}

.restart-confirm-content h2 {
    font-size: 17px;
    margin-bottom: 10px;
    color: var(--text-main);
    font-weight: 700;
}

.restart-confirm-content p {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--text-sub);
}

.restart-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.restart-cancel-btn,
.restart-ok-btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.restart-cancel-btn {
    background: #f5f1ec;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.restart-cancel-btn:hover {
    background: #ebe6df;
}

.restart-ok-btn {
    background: var(--expo-blue);
    color: white;
}

.restart-ok-btn:hover {
    background: #005a9e;
}

/* 一時停止ボタン PC配置 */
@media (min-width: 1024px) {
    .pause-button-pc {
        width: 100%;
        margin: 12px 0;
        padding: 10px 16px;
    }
}

/* 左パネル高さ調整 */
@media (min-width: 1024px) {
    .score-panel {
        padding: 16px;
        min-height: auto;
    }

    .ranking-panel {
        padding: 16px;
        flex-shrink: 0;
    }

    .ad-sidebar {
        max-height: 250px;
        overflow: hidden;
        flex-shrink: 0;
    }

    .left-panel {
        max-height: calc(100vh - 48px);
        overflow: visible;
    }
}

/* 一時停止広告 */
.ad-pause {
    margin: 16px auto;
    padding: 8px;
    min-height: 140px;
    max-width: 400px;
    overflow-y: visible;
    max-height: none;
}

/* PC下部広告 */
.ad-pc-bottom {
    display: none;
}

@media (min-width: 1024px) {
    .ad-pc-bottom {
        display: block;
        width: 100%;
        max-width: 728px;
        margin: 20px auto;
        padding: 8px;
        text-align: center;
        min-height: 140px;
        overflow-y: visible;
        max-height: none;
    }
}

/* 広告閉じるボタン */
.ad-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #f5f1ec;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 18px;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10001;
}

.ad-close-btn:hover {
    background: #ebe6df;
}

/* モバイル/タブレット用マージン */
@media (max-width: 1023px) {
    body {
        padding: 0;
    }

    #game-container {
        padding: 12px 8px;
    }

    .center-area {
        margin: 0;
    }

    .mobile-header {
        margin-bottom: 8px;
    }
}

/* PC中央揃え */
@media (min-width: 1024px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 16px;
    }

    #game-container {
        max-width: 1100px;
        margin: 0 auto;
    }
}

/* アフィリエイト枠 */
.affiliate-slot {
    position: relative;
    text-align: center;
    border-radius: var(--radius);
    overflow: hidden;
}

.affiliate-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 1;
    line-height: 1.4;
}

/* PC左パネル用 */
.affiliate-pc {
    display: none;
}

@media (min-width: 1024px) {
    .affiliate-pc {
        display: block;
        background: #faf8f5;
        padding: 6px;
        border-radius: var(--radius);
        border: 1px solid var(--border-light);
    }
}

/* モバイル用（ゲーム下部） */
.affiliate-mobile {
    display: block;
    margin: 8px auto;
    max-width: 320px;
}

@media (min-width: 1024px) {
    .affiliate-mobile {
        display: none;
    }
}

/* ゲームオーバー画面用 */
.affiliate-gameover {
    margin: 10px auto;
    max-width: 468px;
}

/* SEOコンテンツ内 */
.affiliate-inline {
    margin: 12px 0;
    padding: 8px;
    background: #faf8f5;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    display: inline-block;
}

/* SEOコンテンツ（ゲーム下部の説明文） */
.seo-content {
    max-width: 640px;
    margin: 32px auto 20px;
    padding: 0 16px;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-main);
}

.seo-content h2 {
    font-size: 17px;
    font-weight: 700;
    border-left: 3px solid var(--expo-red);
    padding-left: 10px;
    margin-bottom: 10px;
}

.seo-content h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 16px 0 6px;
    color: var(--text-main);
}

.seo-content p {
    margin: 8px 0;
}

.seo-content ul {
    padding-left: 20px;
    margin: 6px 0;
}

.seo-content li {
    margin: 4px 0;
}

.seo-content .related-links {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-sub);
}

.seo-content .related-links a {
    color: var(--expo-blue);
    text-decoration: none;
}

.seo-content .related-links a:hover {
    text-decoration: underline;
}

.seo-affiliate {
    margin-top: 24px;
    padding: 14px;
    background: #faf8f5;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.seo-affiliate .affiliate-label-text {
    display: block;
    font-size: 10px;
    color: var(--text-sub);
    margin-bottom: 10px;
}

.seo-affiliate-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.seo-affiliate-grid img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.seo-affiliate-note {
    font-size: 11px;
    color: var(--text-sub);
    text-align: center;
    margin: 8px 0 0;
}
