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

body {
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gameCanvas {
    border: 4px solid #4a4e69;
    border-radius: 8px;
    background: linear-gradient(to bottom, #0f0f23, #1a1a3e, #2d2d5a);
    box-shadow: 0 0 30px rgba(100, 100, 255, 0.3);
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#height-display {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
}

#power-bar-container {
    width: 150px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #4a4e69;
    border-radius: 10px;
    overflow: hidden;
}

#power-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, #00ff00, #ffff00, #ff0000);
    transition: width 0.05s linear;
    border-radius: 8px;
}

#power-label {
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}

#instructions {
    position: absolute;
    bottom: -100px;
    text-align: center;
    color: #888;
    font-size: 14px;
    line-height: 1.8;
}

#instructions p {
    margin: 5px 0;
}

#instructions strong {
    color: #ffd700;
    font-size: 16px;
}

/* 캐릭터 선택 화면 */
#character-select {
    text-align: center;
    color: white;
}

#character-select h1 {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

#character-select h2 {
    font-size: 24px;
    color: #aaa;
    margin-bottom: 30px;
}

#character-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.character-card {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid #4a4e69;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
}

.character-card:hover {
    transform: translateY(-10px);
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.character-card span {
    display: block;
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
}

.character-preview {
    width: 60px;
    height: 80px;
    margin: 0 auto;
    border-radius: 5px;
    position: relative;
}

/* 해골 프리뷰 */
.skeleton-preview {
    background: #e0e0e0;
}
.skeleton-preview::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 30px;
    background: #ffffff;
    border-radius: 50%;
}
.skeleton-preview::after {
    content: '💀';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
}

/* 인간 프리뷰 */
.human-preview {
    background: #ff6b6b;
}
.human-preview::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    width: 40px;
    height: 25px;
    background: #ffe66d;
    border-radius: 5px;
}
.human-preview::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    background: #333;
}

/* 강아지 프리뷰 */
.dog-preview {
    background: #c4a574;
}
.dog-preview::before {
    content: '🐕';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
}

/* 고양이 프리뷰 */
.cat-preview {
    background: #ff9a56;
}
.cat-preview::before {
    content: '🐱';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
}

.select-hint {
    margin-top: 30px;
    color: #888;
    font-size: 14px;
}

/* 게임 모드 선택 화면 */
#mode-select, #bet-setup {
    text-align: center;
    color: white;
}

#mode-select h1, #bet-setup h1 {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

#mode-select h2, #bet-setup h2 {
    font-size: 24px;
    color: #aaa;
    margin-bottom: 30px;
}

#mode-options {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.mode-card {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid #4a4e69;
    border-radius: 20px;
    padding: 30px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 200px;
}

.mode-card:hover {
    transform: translateY(-10px);
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.mode-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.mode-title {
    display: block;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.mode-desc {
    font-size: 14px;
    color: #aaa;
}

/* 점프 횟수 설정 화면 */
#jump-count-setting {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

#jump-count-setting label {
    display: block;
    font-size: 18px;
    margin-bottom: 15px;
}

.count-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.count-selector button {
    width: 50px;
    height: 50px;
    font-size: 24px;
    border: none;
    border-radius: 10px;
    background: #4a4e69;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.count-selector button:hover {
    background: #ffd700;
    color: #1a1a2e;
}

#jump-count {
    width: 100px;
    height: 50px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #4a4e69;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #ffd700;
}

#jump-count:focus {
    outline: none;
    border-color: #ffd700;
}

.preset-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.preset-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: 2px solid #4a4e69;
    border-radius: 8px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #ffd700;
    color: #ffd700;
}

#confirm-jump-count {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s;
}

#confirm-jump-count:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

/* 점프 카운트 표시 */
#jump-count-display {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ff6b6b;
}

/* 결과 화면 */
#result-screen {
    text-align: center;
    color: white;
}

#result-screen h1 {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
}

#result-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 60px;
    margin-bottom: 30px;
}

.result-label {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 10px;
}

.result-height {
    font-size: 72px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
}

.result-jumps {
    font-size: 18px;
    color: #888;
}

#restart-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s;
}

#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}
