/* ========================================
   Fluffy Dog Game Page Styles
   ======================================== */

/* Game Main (ヘッダー分のスペース確保) */
.game-main {
    padding-top: 80px;
    min-height: 100vh;
    background: rgb(185, 155, 200);
}

/* Game Page Layout */
.game-page {
    display: flex;
    padding: 20px;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

/* Game Container */
.game-container {
    flex-shrink: 0;
    width: 100%;
    max-width: 390px;
}

#unity-container {
    position: relative;
    width: 100%;
    max-width: 390px;
    aspect-ratio: 390 / 844;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#unity-container.unity-mobile {
    /* サイズはJavaScriptで動的に設定 */
    border-radius: 20px;
    margin: 0 auto;
    overflow: hidden;
}

#unity-canvas {
    width: 100%;
    height: 100%;
}

/* Loading Bar */
#unity-loading-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    text-align: center;
}

#unity-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: url('TemplateData/unity-logo.png') no-repeat center;
    background-size: contain;
}

#unity-progress-bar-empty {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: #fff;
    transition: width 0.3s ease;
}

#unity-warning {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Sidebar */
.sidebar {
    width: 280px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 4px solid white;
    font-family: 'MochiyPopOne', sans-serif;
}

/* 左サイドバー（ゲーム説明） */
.sidebar-left {
    text-align: center;
    background: rgb(240, 120, 150);
    /* ピンク系 - Games風 */
}

/* 右サイドバー（ランキング） */
.sidebar-right {
    background: rgb(222, 220, 120);
    /* 黄色系 - Apps風 */
}

.game-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    display: block;
}

.sidebar-left .game-title,
.sidebar-left h1.game-title {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: #000 !important;
    font-weight: 700;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #000 !important;
    background-clip: unset !important;
}

.game-description {
    font-size: 1rem;
    color: #000;
    line-height: 1.6;
}

.game-note {
    font-size: 0.8rem;
    color: #000;
    margin-top: 16px;
    line-height: 1.5;
    text-align: center;
}

/* 右サイドバー（ランキング） */
.sidebar-right h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #333;
    text-align: center;
}

/* High Score List */
#highscore-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading,
.no-scores {
    text-align: center;
    color: #888;
    padding: 20px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.score-item:hover {
    transform: translateX(4px);
}

.score-item.rank-1 {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px solid #ffd700;
}

.score-item.rank-2 {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #c0c0c0;
}

.score-item.rank-3 {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border: 2px solid #cd7f32;
}

.score-item .rank {
    font-size: 1.5rem;
}

.score-item .score {
    font-weight: 700;
    font-size: 1.2rem;
    color: #667eea;
}

/* Score Info */
.score-info {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.score-info p {
    color: #666;
}

.score-info #current-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* Responsive */
@media (max-width: 800px) {
    .game-page {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    .sidebar {
        width: 100%;
        max-width: 390px;
        order: 1;
    }

    #unity-container {
        width: 100%;
        max-width: 390px;
        height: auto;
        aspect-ratio: 390/844;
    }
}

@media (max-width: 420px) {
    #unity-container {
        border-radius: 0;
        max-width: calc(100% - 20px);
    }

    .game-page {
        padding: 10px;
        gap: 10px;
    }

    .sidebar {
        border-radius: 12px;
        max-width: calc(100% - 20px);
        margin: 0 10px;
    }
}

/* ========================================
   SNS Share Modal
   ======================================== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.share-modal {
    background: rgb(180, 220, 210);
    border: 4px solid white;
    border-radius: 20px;
    padding: 0;
    max-width: 350px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: 'MochiyPopOne', sans-serif;
    overflow: hidden;
}

.share-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.share-modal-close:hover {
    color: #000;
}

/* 画像化する部分 */
.share-modal-capture {
    text-align: center;
    padding: 8px 16px 24px;
}

/* シェア部分 */
.share-modal-actions {
    text-align: center;
    padding: 0 24px 24px;
}

.share-modal-icon {
    width: 300px;
    height: 300px;
    margin: 0 auto 16px;
    display: block;
}

.share-modal-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #333;
}

.share-modal-rank {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.share-modal-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-top: -80px;
    margin-bottom: 16px;
}

.share-modal-message {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.share-btn-line {
    background: #06C755;
}

.share-btn-x {
    background: #000000;
}

.share-btn-save {
    margin: 16px auto 0;
    background: #667eea;
    border: none;
    cursor: pointer;
    display: block;
}

.share-btn-copy {
    background: #ffffff;
    border: 2px solid #ddd;
    cursor: pointer;
    min-width: 48px;
    position: relative;
    color: #333;
}

.copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 8px;
    animation: tooltipFadeIn 0.2s ease;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 広告バナー */
/* 広告バナー（固定表示） */
.ad-banner {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #ddd;
    color: #999;

    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

/* 広告が被らないようにbodyに余白を追加 */
body {
    padding-bottom: 120px;
}