/* マイガレージ専用スタイル */

/* 基本スタイル */
body {
    font-family: "Nunito", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #2F2F2F 0%, #1a1a1a 100%);
    color: #FFFFFF;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 550px;
    margin: 0 auto;
}

/* ヘッダー */
.heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    font-weight: bold;
    color: #FFD700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.scores-container {
    display: flex;
    gap: 10px;
}

.score-container, .best-container {
    background: linear-gradient(135deg, #4A4A4A 0%, #3a3a3a 100%);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.score-label {
    font-size: 12px;
    font-weight: 700;
    color: #CCCCCC;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
}

/* ゲーム説明とボタン */
.above-game {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-intro {
    font-size: 16px;
    color: #CCCCCC;
    margin: 0;
}

.restart-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #2F2F2F;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
}

/* ゲームボード */
.game-container {
    position: relative;
    background: linear-gradient(135deg, #4A4A4A 0%, #3a3a3a 100%);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.grid-container {
    position: relative;
    z-index: 1;
}

.grid-row {
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.grid-row:last-child {
    margin-bottom: 0;
}

.grid-cell {
    width: 106.25px;
    height: 106.25px;
    border-radius: 6px;
    background-color: rgba(238, 228, 218, 0.25);
}

.tile-container {
    position: absolute;
    z-index: 2;
    top: 15px;
    left: 15px;
}

/* タイル */
.tile {
    position: absolute;
    width: 106.25px;
    height: 106.25px;
    border-radius: 6px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: 150ms ease-in-out;
    transition-property: transform;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* 乗り物アイコンスタイル（11段階・横から見たデザイン） */
.tile.tile-2 { background-image: url('my-garage-icons/vehicle_final_01_kickscooter.png'); }
.tile.tile-4 { background-image: url('my-garage-icons/vehicle_final_02_bicycle.png'); }
.tile.tile-8 { background-image: url('my-garage-icons/vehicle_final_03_moped.png'); }
.tile.tile-16 { background-image: url('my-garage-icons/vehicle_final_04_motorcycle.png'); }
.tile.tile-32 { background-image: url('my-garage-icons/vehicle_final_05_keicar.png'); }
.tile.tile-64 { background-image: url('my-garage-icons/vehicle_final_06_compact.png'); }
.tile.tile-128 { background-image: url('my-garage-icons/vehicle_final_07_sedan.png'); }
.tile.tile-256 { background-image: url('my-garage-icons/vehicle_final_08_racecar.png'); }
.tile.tile-512 { background-image: url('my-garage-icons/vehicle_final_09_privatejet.png'); }
.tile.tile-1024 { background-image: url('my-garage-icons/vehicle_final_10_yacht.png'); }
.tile.tile-2048 { background-image: url('my-garage-icons/vehicle_final_11_spaceship.png'); }

/* 特殊タイルのアニメーション */
.tile.tile-new {
    animation: appear 200ms ease;
}

.tile.tile-merged {
    animation: pop 200ms ease;
}

@keyframes appear {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ゲームメッセージ */
.game-message {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(47, 47, 47, 0.95);
    z-index: 100;
    text-align: center;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-message.hidden {
    display: none;
}

.game-message p {
    font-size: 50px;
    font-weight: bold;
    color: #FFD700;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-message.game-won p {
    color: #00FF00;
}

.game-message.game-over p {
    color: #FF6B6B;
}

.retry-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #2F2F2F;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
}

/* 乗り物進化チャート */
.vehicle-progress {
    background: linear-gradient(135deg, #4A4A4A 0%, #3a3a3a 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.vehicle-progress h3 {
    color: #FFD700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
}

.progress-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.progress-icon {
    width: 50px;
    height: 50px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    opacity: 0.3;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.progress-icon.unlocked {
    opacity: 1;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* 説明リンク */
.instructions {
    text-align: center;
    margin-top: 20px;
}

.instructions p {
    margin: 10px 0;
}

.instructions a {
    display: inline-block;
    transition: all 0.3s;
}

.instructions a:hover {
    transform: scale(1.05);
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }
    
    .title {
        font-size: 32px;
    }
    
    .scores-container {
        flex-direction: column;
        gap: 5px;
    }

    .score-container, .best-container {
        padding: 8px 15px;
    }

    .score-value {
        font-size: 20px;
    }
    
    .above-game {
        flex-direction: column;
        text-align: center;
    }

    .game-intro {
        font-size: 14px;
    }
    
    .grid-cell, .tile {
        width: 70px;
        height: 70px;
    }

    .grid-row {
        gap: 10px;
    }

    .tile-container {
        left: 10px;
        top: 10px;
    }

    .game-container {
        padding: 10px;
    }

    .game-message p {
        font-size: 36px;
    }

    .progress-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    .grid-cell, .tile {
        width: 60px;
        height: 60px;
    }

    .grid-row {
        gap: 8px;
    }
}

