* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    user-select: none;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* タイトル画面 */
.title-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.game-title {
    font-size: 4em;
    color: #764ba2;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title-mole {
    width: 100px;
    height: 100px;
    background: radial-gradient(ellipse at center, #8B4513 0%, #654321 100%);
    border-radius: 50% 50% 40% 40%;
    margin: 0 auto 30px;
    position: relative;
    animation: peekUp 2s infinite;
}

.title-mole::before,
.title-mole::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: #000;
    border-radius: 50%;
    top: 30px;
}

.title-mole::before {
    left: 25px;
}

.title-mole::after {
    right: 25px;
}

@keyframes peekUp {
    0%, 100% { transform: translateY(20px); }
    50% { transform: translateY(0); }
}

.menu-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.highscore-display {
    margin-top: 20px;
    font-size: 1.2em;
    color: #333;
}

#highscore-value {
    font-weight: bold;
    color: #764ba2;
}

.controls-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.controls-info p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 10px;
}

.control-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-icons span {
    font-size: 1em;
    color: #888;
}

/* ゲーム画面 */
.game-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.score-board {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.score-item {
    text-align: center;
}

.score-item .label {
    display: block;
    font-size: 1em;
    color: #666;
    margin-bottom: 5px;
}

.score-item .value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #764ba2;
}

.game-field {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    perspective: 1000px;
    padding: 20px;
    background: rgba(144, 238, 144, 0.3);
    border-radius: 20px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
}

.hole {
    width: 150px;
    height: 150px;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
    overflow: hidden;
}

.hole-front {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%;
    background: radial-gradient(ellipse at center, #3e2723 0%, #1a0e0a 100%);
    border-radius: 50%;
    z-index: 2;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.5);
}

.mole {
    position: absolute;
    bottom: -10px;
    width: 80%;
    height: 80%;
    left: 10%;
    background: radial-gradient(ellipse at center, #8B4513 0%, #654321 100%);
    border-radius: 50% 50% 40% 40%;
    transition: transform 0.3s ease;
    transform: translateY(100%);
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mole::before,
.mole::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #000;
    border-radius: 50%;
    top: 30%;
}

.mole::before {
    left: 25%;
}

.mole::after {
    right: 25%;
}

.mole.up {
    transform: translateY(0);
    z-index: 3;
}

.mole.hit {
    animation: hitAnimation 0.5s ease;
}

@keyframes hitAnimation {
    0% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-20px) rotate(180deg) scale(1.2); }
    100% { transform: translateY(100%) rotate(360deg); }
}

.combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.combo-display.show {
    opacity: 1;
    animation: comboAnimation 0.5s ease;
}

@keyframes comboAnimation {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.hit-effect {
    position: absolute;
    color: #FFD700;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.hit-effect.show {
    animation: floatUp 1s ease;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* ゲームオーバー画面 */
.gameover-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.gameover-title {
    font-size: 3em;
    color: #764ba2;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.final-score {
    margin-bottom: 30px;
}

.score-label {
    font-size: 1.5em;
    color: #666;
    margin-bottom: 10px;
}

.score-value {
    font-size: 4em;
    font-weight: bold;
    color: #764ba2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.new-record {
    display: none;
    margin: 20px 0;
    font-size: 1.5em;
    color: #FFD700;
    animation: pulse 1s infinite;
}

.new-record.show {
    display: block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 1em;
    color: #666;
    margin-bottom: 5px;
}

.stat-item span:last-child {
    font-size: 1.5em;
    font-weight: bold;
    color: #764ba2;
}

.gameover-buttons {
    margin-top: 30px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .game-title {
        font-size: 3em;
    }
    
    .game-field {
        gap: 20px;
        padding: 10px;
    }
    
    .hole {
        width: 100px;
        height: 100px;
    }
    
    .score-item .value {
        font-size: 1.5em;
    }
    
    .gameover-title {
        font-size: 2em;
    }
    
    .score-value {
        font-size: 3em;
    }
}

@media (max-width: 480px) {
    .title-container,
    .gameover-container {
        padding: 30px 20px;
    }
    
    .game-field {
        gap: 15px;
    }
    
    .hole {
        width: 80px;
        height: 80px;
    }
    
    .menu-btn {
        padding: 12px 30px;
        font-size: 1.1em;
    }
}