/* 전체 페이지 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 20px 80px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#gameCanvas {
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: #87CEEB;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.upper-link {
    margin-top: 15px;
    display: flex;
    gap: 20px;
}

.upper-link a {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.upper-link a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upper-link__game {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
}

.upper-link__ach {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.upper-link__rank {
    background: linear-gradient(45deg, #ffe66d, #ffa500);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .game-container {
        padding: 0;
        margin: auto;
        border-radius: 0;
        background: none;
        box-shadow: none;
        border: none;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
        border: none;
        border-radius: 0;
    }
    
    .upper-link {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .upper-link a {
        text-align: center;
        padding: 15px;
        width: 100%;
    }
}

/* 게임 UI 요소들 */
.game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 24px;
    color: white;
}

/* 게임 오버 스타일 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-size: 48px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.jump-button-container {
    width: 100%;
    padding: 20px;
}

/* 모바일용 점프 버튼 */
.jump-button {
    display: none; /* 기본적으로 숨김 */
    width: 100%;
    max-width: 400px;
    height: 80px;
    margin: 30px auto;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    touch-action: manipulation; /* 더블탭 줌 방지 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}


/* 모바일에서만 버튼 표시 */
@media (max-width: 768px) {
    .jump-button-container,
    .jump-button {
        display: block;
    }
}

/* 로그인 모달 스타일 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.login-modal-content {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.login-modal-content h2 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-modal-content p {
    color: #ccc;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.4;
}

.name-list-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 0;
}

.name-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.name-item {
    padding: 15px 20px;
    margin: 0 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    font-weight: 500;
    text-align: center;
}

.name-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.name-item:active {
    transform: translateY(0);
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .login-modal-content {
        width: 95%;
        max-width: 350px;
        padding: 25px 20px;
        max-height: 85vh;
    }
    
    .login-modal-content h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .login-modal-content p {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .name-list-container {
        max-height: 350px;
    }
    
    .name-item {
        padding: 18px 15px;
        font-size: 16px;
        margin: 0 5px;
    }
}

/* 스크롤바 스타일링 */
.name-list-container::-webkit-scrollbar {
    width: 6px;
}

.name-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.name-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.name-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 랭킹 모달 스타일 */
.ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.ranking-modal-content {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 20px;
    max-width: 90%;
    width: 500px;
    max-height: 85vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.ranking-modal.show .ranking-modal-content {
    transform: scale(1);
    opacity: 1;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-header h2 {
    color: #fff;
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.close-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.ranking-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    max-height: 60vh;
}

.ranking-list {
    padding: 0 30px;
}

.loading-message {
    text-align: center;
    color: #ccc;
    padding: 40px 0;
    font-size: 16px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin: 0 0 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.ranking-item.current-user {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.ranking-item.current-user:hover {
    background: rgba(76, 175, 80, 0.3);
}

.rank-number {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

.rank-number.top-3 {
    color: #ffd700;
}

.rank-number.rank-1::before {
    content: '🥇 ';
}

.rank-number.rank-2::before {
    content: '🥈 ';
}

.rank-number.rank-3::before {
    content: '🥉 ';
}

.user-info {
    flex: 1;
    margin-left: 15px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.user-date {
    font-size: 12px;
    color: #ccc;
}

.user-score {
    font-size: 18px;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 80px;
    text-align: right;
}

.empty-ranking {
    text-align: center;
    color: #ccc;
    padding: 40px 0;
    font-size: 16px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .ranking-modal-content {
        width: 95%;
        max-width: 400px;
        max-height: 90vh;
    }
    
    .ranking-header {
        padding: 20px 20px 15px;
    }
    
    .ranking-header h2 {
        font-size: 20px;
    }
    
    .ranking-list {
        padding: 0 15px;
    }
    
    .ranking-item {
        padding: 12px 15px;
        margin-bottom: 5px;
    }
    
    .rank-number {
        font-size: 16px;
        min-width: 35px;
    }
    
    .user-info {
        margin-left: 10px;
    }
    
    .user-name {
        font-size: 15px;
    }
    
    .user-score {
        font-size: 16px;
        min-width: 70px;
    }
}

/* 랭킹 스크롤바 스타일링 */
.ranking-list-container::-webkit-scrollbar {
    width: 6px;
}

.ranking-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ranking-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.ranking-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

 