* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
}

.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
        border-radius: 10px;
    }
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 70%, #90EE90 70%, #90EE90 100%);
    border: 5px solid #333;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

button {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#startBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#restartBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

.instructions {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.instructions p {
    margin: 8px 0;
    color: #555;
    font-size: 1em;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 1000;
}

.game-over h2 {
    color: #f5576c;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 1.5em;
    color: #333;
    margin: 10px 0;
}

.name-input-container {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

#playerName {
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    width: 200px;
    text-align: center;
}

#submitScore {
    padding: 12px 30px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#submitScore:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.leaderboard {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.leaderboard h3 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.5em;
}

.leaderboard-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.status-dot.online {
    background-color: #4CAF50;
    box-shadow: 0 0 8px #4CAF50;
}

.status-dot.offline {
    background-color: #f44336;
}

.status-text {
    color: #666;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    font-weight: bold;
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: white;
    font-weight: bold;
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: white;
    font-weight: bold;
}

.rank {
    font-size: 1.3em;
    font-weight: bold;
    min-width: 40px;
}

.player-name {
    font-size: 1.1em;
}

.player-score {
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
    text-align: right;
}

.player-date {
    font-size: 0.8em !important;
    color: #666 !important;
    text-align: right;
}

.leaderboard-item.rank-1 .player-score,
.leaderboard-item.rank-2 .player-score,
.leaderboard-item.rank-3 .player-score {
    color: white;
}

.leaderboard-item.rank-1 .player-date,
.leaderboard-item.rank-2 .player-date,
.leaderboard-item.rank-3 .player-date {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 터치 컨트롤 버튼 */
.touch-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.control-btn {
    width: 80px;
    height: 80px;
    font-size: 2em;
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.control-btn.jump-btn {
    width: 100px;
    height: 100px;
    font-size: 2.5em;
}

@media (max-width: 768px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-header h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    .game-info {
        font-size: 0.9em;
        padding: 8px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    /* 리더보드 간단하게 */
    .leaderboard {
        padding: 10px;
        margin-top: 10px;
    }
    
    .leaderboard h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .leaderboard-list {
        max-height: 200px;
    }
    
    .leaderboard-item {
        padding: 8px 10px;
        margin: 5px 0;
        font-size: 0.85em;
    }
    
    .rank {
        font-size: 1em;
        min-width: 30px;
    }
    
    .player-name {
        font-size: 0.9em;
        padding-left: 10px;
    }
    
    .player-score {
        font-size: 0.95em;
    }
    
    /* 그라데이션 효과 제거 - 간단하게 */
    .leaderboard-item.rank-1 {
        background: #FFD700;
        color: #333;
    }
    
    .leaderboard-item.rank-2 {
        background: #C0C0C0;
        color: #333;
    }
    
    .leaderboard-item.rank-3 {
        background: #CD7F32;
        color: white;
    }
    
    .touch-controls {
        gap: 15px;
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8em;
    }
    
    .control-btn.jump-btn {
        width: 90px;
        height: 90px;
        font-size: 2.2em;
    }
    
    /* 모바일용 게임 오버 모달 */
    .game-over {
        padding: 30px 20px;
        width: 90%;
        max-width: 400px;
    }
    
    .game-over h2 {
        font-size: 2em;
    }
    
    .game-over p {
        font-size: 1.2em;
    }
    
    .name-input-container {
        flex-direction: column;
        width: 100%;
    }
    
    #playerName {
        width: 100%;
        font-size: 1.2em;
        padding: 15px;
    }
    
    #submitScore {
        width: 100%;
        padding: 15px;
        font-size: 1.2em;
    }
}
