/* ほのぼのとした雰囲気のスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', 'メイリオ', sans-serif;
    background: linear-gradient(to bottom, #FFE5CC 0%, #FFD4B3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: #FFF9F0;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #FFE5CC;
    border-radius: 15px;
}

.game-header .game-buttons {
    margin: 0;
}

.score-board {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label, .next-label {
    font-size: 14px;
    color: #8B6F5C;
    margin-bottom: 5px;
}

.score-value {
    font-size: 28px;
    font-weight: bold;
    color: #6B4E3D;
}

.next-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#next-cat-canvas {
    background: #FFF;
    border-radius: 10px;
    border: 2px solid #FFD4B3;
}

.game-main {
    position: relative;
    margin-bottom: 20px;
}

#game-canvas {
    display: block;
    margin: 0 auto;
    background: #FFF;
    border: 3px solid #FFD4B3;
    border-radius: 15px;
    cursor: pointer;
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

.game-over-overlay h2 {
    font-size: 36px;
    color: #6B4E3D;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 15px;
}

.final-score {
    font-size: 24px;
    color: #8B6F5C;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 10px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.retry-button {
    background: #FFB380;
    color: #FFF;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 179, 128, 0.4);
}

.retry-button:hover {
    background: #FF9966;
    transform: scale(1.05);
}

.game-controls {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-hint {
    background: #FFE5CC;
    padding: 15px;
    border-radius: 10px;
}

.control-hint p {
    font-size: 14px;
    color: #8B6F5C;
    margin: 5px 0;
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.game-button {
    background: linear-gradient(145deg, #FFB380, #FF9966);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(255, 179, 128, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    user-select: none;
    font-family: inherit;
    touch-action: manipulation;
}

.shake-button {
    background: linear-gradient(145deg, #FFB6C1, #FF69B4);
    box-shadow: 
        0 4px 15px rgba(255, 182, 193, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    border: 2px solid #FFC0CB;
}

.shake-button:hover {
    background: linear-gradient(145deg, #FFC0CB, #FF1493);
    transform: scale(1.05);
    box-shadow: 
        0 6px 20px rgba(255, 182, 193, 0.7),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.shake-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 2px 8px rgba(255, 182, 193, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.game-button:disabled {
    background: #CCCCCC;
    color: #888888;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.audio-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 100;
}

.audio-button {
    background: rgba(255, 229, 204, 0.9);
    border: 2px solid #FFD4B3;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.audio-button:hover {
    background: rgba(255, 179, 128, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cat-legend {
    background: #FFF9F0;
    border: 2px solid #FFD4B3;
    border-radius: 15px;
    padding: 15px;
    margin: 20px 0;
}

.cat-legend h3 {
    text-align: center;
    color: #6B4E3D;
    margin-bottom: 5px;
    font-size: 18px;
}

.evolution-hint {
    text-align: center;
    color: #8B6F5C;
    font-size: 12px;
    margin-bottom: 15px;
    font-style: italic;
}

.legend-cats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.legend-cats .legend-item:nth-child(10) {
    justify-self: center;
    align-self: center;
}

.legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F5F5F5;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 6px 2px;
    font-size: 8px;
    color: #6B4E3D;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    height: 65px;
    transition: all 0.3s ease;
    position: relative;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
}


.legend-item.ultimate {
    height: 85px;
    width: 85px;
    background: radial-gradient(ellipse at center, \n        #FFD700 0%, \n        #FF6B35 15%, \n        #E91E63 30%, \n        #9C27B0 45%, \n        #3F51B5 60%, \n        #009688 75%, \n        #4CAF50 85%, \n        #000000 100%);
    border: 3px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    transform: scale(1.05);
    z-index: 15;
    position: relative;
    overflow: visible;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}


.legend-item.ultimate .legend-cat-canvas {
    background: radial-gradient(circle, #FFD700 0%, #FFA500 50%, #DC143C 100%);
    border: 2px solid #FFD700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 1),
        inset 0 0 10px rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    padding: 5px;
    width: 50px;
    height: 50px;
    position: relative;
    z-index: 5;
}



.evolution-number {
    font-size: 8px;
    font-weight: bold;
    color: #8B6F5C;
    margin-bottom: 2px;
}


.cat-name {
    font-size: 7px;
    line-height: 1;
    margin-top: 2px;
}

.ultimate-name {
    font-size: 9px;
    line-height: 1.1;
    font-weight: bold;
    color: #E3F2FD;
    text-shadow: 
        0 0 8px rgba(0, 191, 255, 1),
        0 0 15px rgba(138, 43, 226, 0.8),
        0 0 25px rgba(75, 0, 130, 0.6),
        2px 2px 4px rgba(0, 0, 0, 1),
        0 0 30px rgba(255, 255, 255, 0.4);
    margin-top: 3px;
    letter-spacing: 0.5px;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.8);
    white-space: pre-line;
    width: 70px;
    max-width: 70px;
    overflow: visible;
    text-align: center;
}


.legend-cat-canvas {
    margin-bottom: 4px;
    background: #FFFFFF;
    border-radius: 50%;
    padding: 3px;
    overflow: visible;
}


.legend-item.created {
    background: #E8F5E8;
    border-color: #4CAF50;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

.legend-item:hover {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.legend-item.ultimate:hover {
    transform: scale(1.2);
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 1),
        0 0 80px rgba(255, 165, 0, 1),
        0 0 120px rgba(255, 255, 255, 0.8),
        0 0 160px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.6);
    filter: brightness(1.3) saturate(1.2);
    transition: all 0.3s ease;
}

.cat-name-display {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #6B4E3D;
    pointer-events: none;
    display: none;
}

/* レスポンシブ対応 */
@media (max-width: 500px) {
    .game-container {
        padding: 15px;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
}