/* ========================================
   전역 스타일 초기화
   ======================================== */
/* 모든 요소의 기본 여백 제거 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 기본 바디 스타일 */
body {
    font-family: 'Arial', sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: all 0.5s ease;
}

/* ========================================
   배경 효과
   ======================================== */
/* 검은 우주 배경 */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -2;
}

/* 반짝이는 별 컨테이너 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* 개별 별 스타일 */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

/* 별 반짝임 애니메이션 */
@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 제거된 효과들 */
.nebula {
    display: none; /* 성운 효과 제거 */
}

.shooting-star {
    display: none; /* 유성 효과 제거 */
}

/* 테마 시스템 - 현재 모두 검은색으로 통일 */
body.theme-1::before,
body.theme-2::before,
body.theme-3::before,
body.theme-4::before,
body.theme-5::before { 
    background: #000;
}

/* ========================================
   보너스 별 시스템 (데스크탑)
   ======================================== */
/* 별 컨테이너 위치 */
.bonus-star-container {
    position: fixed;
    left: 150px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

/* 별 레이아웃 */
.bonus-star {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 별 아이콘 스타일 */
.bonus-star-icon {
    font-size: 60px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: all 0.5s ease;
    line-height: 1;
}

/* 별 게이지 텍스트 */
.bonus-star-gauge {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 별 완성 상태 효과 */
.bonus-star.full .bonus-star-icon {
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: starSpin 3s linear infinite;
}

/* 별 완성 후 특수 효과들 */
/* 네온 효과 */
.bonus-star.neon .bonus-star-icon {
    animation: neonFlash 0.5s ease-in-out infinite;
}

/* 회전 효과 */
.bonus-star.rotating .bonus-star-icon {
    animation: starRotate 4s linear infinite;
}

/* 무지개 효과 */
.bonus-star.rainbow .bonus-star-icon {
    animation: rainbowColor 3s linear infinite;
}

/* ========================================
   별 애니메이션 정의
   ======================================== */
/* 네온 깜빡임 */
@keyframes neonFlash {
    0%, 100% { 
        text-shadow: 0 0 20px rgba(255, 215, 0, 1);
    }
    50% { 
        text-shadow: 0 0 40px rgba(255, 255, 0, 1);
    }
}

/* 별 회전 */
@keyframes starRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 무지개 색상 변화 */
@keyframes rainbowColor {
    0% { color: #ff0000; }
    16.66% { color: #ff8800; }
    33.33% { color: #ffff00; }
    50% { color: #00ff00; }
    66.66% { color: #0088ff; }
    83.33% { color: #8800ff; }
    100% { color: #ff0000; }
}

/* 네온 펄스 효과 */
@keyframes neonPulse {
    0%, 100% { 
        color: #ffd700;
        text-shadow: 0 0 10px #ffd700;
    }
    50% { 
        color: #ffff00;
        text-shadow: 0 0 20px #ffff00;
    }
}

/* 별 회전 애니메이션 */
@keyframes starSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   공지 시스템
   ======================================== */
/* 상단 공지 컨테이너 */
.announcement-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 50px;
    z-index: 100;
    pointer-events: none;
}

/* 하단 랭킹 컨테이너 */
.ranking-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 50px;
    z-index: 100;
    pointer-events: none;
}

/* 공지 트랙 */
.announcement-track,
.ranking-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 공지 스타일 */
.announcement,
.ranking {
    position: absolute;
    padding: 12px 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: transparent;
    font-size: 14px;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

/* 공지 텍스트 */
.announcement-text,
.ranking-text {
    display: inline-block;
    animation: textFadeIn 0.5s ease forwards;
}

.announcement-text {
    color: #fff;
}

.ranking-text {
    color: #aaa;
}

/* 특별 공지 스타일 */
.announcement.special {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

.announcement.special .announcement-text {
    color: #ffd700;
}

/* 하이라이트 랭킹 */
.ranking.highlight {
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.ranking.highlight .ranking-text {
    color: #fff;
}

/* 텍스트 페이드 효과 */
.announcement-text.fade-out,
.ranking-text.fade-out {
    animation: textFadeOut 0.5s ease forwards;
}

/* 텍스트 애니메이션 */
@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========================================
   게임 컨테이너
   ======================================== */
/* 메인 게임 박스 */
.game-container {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 0 50px rgba(255, 255, 255, 0.2),
        inset 0 0 50px rgba(255, 255, 255, 0.02);
    min-width: 500px;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: all 0.5s ease;
}

/* 게임 헤더 영역 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

/* 도움말 버튼 */
.help-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.help-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* 게임 타이틀 */
.game-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 0%, #888 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: titlePulse 2s ease-in-out infinite;
}

/* 레벨 표시 */
.level-display {
    display: inline-block;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.level-number {
    font-size: 36px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* ========================================
   프로그레스 바
   ======================================== */
/* 프로그레스 컨테이너 */
.progress-container {
    width: 100%;
    height: 30px;
    background: #0a0a0a;
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* 프로그레스 바 채우기 */
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #666 0%, #888 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* 프로그레스 빛 효과 */
.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

/* 프로그레스 텍스트 */
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

/* ========================================
   버튼 시스템
   ======================================== */
/* 버튼 래퍼 */
.button-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

/* 버튼 컨테이너 */
.button-container {
    position: relative;
    display: inline-block;
}

/* 레벨업 버튼 기본 스타일 */
.level-up-button {
    color: white;
    border: none;
    padding: 30px 70px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: #1a1a1a;
    border: 2px solid #333;
}

/* 레벨별 버튼 스타일 변화 */
/* 레벨 1-2: 기본 */
.level-up-button.level-1,
.level-up-button.level-2 {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

/* 레벨 3-4: 회색 테두리 */
.level-up-button.level-3,
.level-up-button.level-4 {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #666;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

/* 레벨 5-6: 펄스 효과 */
.level-up-button.level-5,
.level-up-button.level-6 {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border: 2px solid #888;
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: buttonPulse 2s infinite;
}

/* 레벨 7-8: 빛나는 효과 */
.level-up-button.level-7,
.level-up-button.level-8 {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border: 2px solid #aaa;
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.2);
}

.level-up-button.level-7::before,
.level-up-button.level-8::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: fire 1s ease-in-out infinite alternate;
    z-index: -1;
}

/* 레벨 9+: 최종 형태 */
.level-up-button.level-9 {
    background: linear-gradient(135deg, #4a4a4a 0%, #8a8a8a 100%);
    border: 3px solid #fff;
    box-shadow: 
        0 0 60px rgba(255, 255, 255, 0.5),
        0 0 120px rgba(255, 255, 255, 0.2),
        inset 0 0 60px rgba(255, 255, 255, 0.3);
    animation: finalForm 1s infinite alternate;
}

/* 버튼 애니메이션 */
@keyframes buttonPulse {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.2),
            inset 0 0 30px rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(255, 255, 255, 0.4),
            inset 0 0 40px rgba(255, 255, 255, 0.2);
    }
}

@keyframes fire {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.1) translateY(-5px); }
}

@keyframes finalForm {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    100% { 
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

/* 버튼 호버/액티브 효과 */
.level-up-button:hover {
    transform: translateY(-3px) scale(1.05);
}

.level-up-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* 버튼 내부 요소들 */
.button-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 버튼 파편 (폭발 효과용) */
.button-piece {
    position: absolute;
    width: 50%;
    height: 50%;
    background: inherit;
    opacity: 0;
    border: inherit;
}

/* 파편 위치 설정 */
.button-piece[data-piece="1"] { top: 0; left: 0; }
.button-piece[data-piece="2"] { top: 0; left: 50%; }
.button-piece[data-piece="3"] { top: 50%; left: 0; }
.button-piece[data-piece="4"] { top: 50%; left: 50%; }
.button-piece[data-piece="5"] { top: 25%; left: 25%; width: 50%; height: 50%; }
.button-piece[data-piece="6"] { top: 0; left: 25%; width: 50%; height: 25%; }
.button-piece[data-piece="7"] { top: 75%; left: 25%; width: 50%; height: 25%; }
.button-piece[data-piece="8"] { top: 25%; left: 0; width: 25%; height: 50%; }

/* 버튼 텍스트 */
.button-text {
    position: relative;
    z-index: 2;
}

/* ========================================
   효과 시스템
   ======================================== */
/* 충격파 효과 */
.shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.shockwave.active {
    animation: shockwaveExpand 1s ease-out;
}

@keyframes shockwaveExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* 균열 효과 */
.crack-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crack {
    position: absolute;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    transform-origin: center;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: crackAppear 0.3s ease-out forwards;
}

@keyframes crackAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   파티클 시스템
   ======================================== */
/* 파티클 컨테이너 */
.particle-container,
.explosion-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 파티클 기본 스타일 */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* 성공 파티클 */
.particle.success {
    width: 6px;
    height: 6px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    animation: successParticle 1s ease-out forwards;
}

/* 실패 파티클 */
.particle.fail {
    width: 8px;
    height: 8px;
    background: #666;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: failParticle 1.5s ease-out forwards;
}

/* 유지 파티클 */
.particle.maintain {
    width: 7px;
    height: 7px;
    background: #888;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    animation: maintainParticle 1s ease-out forwards;
}

/* 프로그레스 파티클 */
.particle.progress {
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #ffff00, #ffd700);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    pointer-events: none;
}

/* 버튼 폭발 효과 */
.button-explode {
    animation: buttonShatter 0.8s ease-out forwards;
}

@keyframes buttonShatter {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 버튼 파편 폭발 */
.button-piece.explode {
    animation: pieceExplode 1.2s ease-out forwards;
    opacity: 1 !important;
}

@keyframes pieceExplode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--rotation)) scale(0);
        opacity: 0;
    }
}

/* 폭발 링 효과 */
.explosion-ring {
    position: absolute;
    border: 3px solid;
    border-radius: 50%;
    animation: explodeRing 0.8s ease-out forwards;
}

@keyframes explodeRing {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ========================================
   통계 표시
   ======================================== */
/* 통계 컨테이너 */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* 개별 통계 아이템 */
.stat-item {
    background: rgba(20, 20, 20, 0.8);
    padding: 20px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

/* 통계 타입별 스타일 */
.stat-item.success-stat {
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-item.maintain-stat {
    border-color: rgba(200, 200, 200, 0.3);
}

.stat-item.fail-stat {
    border-color: rgba(150, 150, 150, 0.3);
}

/* 통계 호버 효과 */
.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 5px 30px rgba(255, 255, 255, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

/* 통계 라벨 */
.stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

/* 통계 값 */
.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ========================================
   모달 시스템
   ======================================== */
/* 모달 오버레이 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

/* 모달 콘텐츠 */
.modal-content {
    background: rgba(10, 10, 10, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 50px rgba(255, 255, 255, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease;
    position: relative;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

/* 모달 닫기 버튼 */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* 모달 제목 */
.modal-title {
    font-size: 36px;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    font-weight: 900;
    letter-spacing: 2px;
}

/* ========================================
   도움말 모달
   ======================================== */
/* 도움말 모달 레이아웃 */
.help-modal {
    text-align: left;
}

.help-content {
    margin-top: 30px;
}

/* 도움말 섹션 */
.help-section {
    background: rgba(20, 20, 20, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.help-section:hover {
    background: rgba(30, 30, 30, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.help-section h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.help-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 8px;
    font-size: 15px;
}

/* 경고 섹션 */
.help-section.warning {
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(200, 200, 200, 0.3);
}

.help-section.warning h3 {
    color: #fff;
}

/* ========================================
   게임 종료 모달
   ======================================== */
/* 결과 표시 */
.final-result {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.result-item {
    background: rgba(20, 20, 20, 0.8);
    padding: 20px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.result-label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.game-over-message {
    color: #888;
    font-size: 16px;
    margin-top: 20px;
}

/* ========================================
   티어 시스템
   ======================================== */
/* 티어 표시 */
.tier-display {
    margin: 20px 0;
    text-align: center;
}

.tier-label {
    display: block;
    font-size: 16px;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tier-value {
    display: block;
    font-size: 48px;
    font-weight: 900;
    text-shadow: 0 0 20px currentColor;
    letter-spacing: 3px;
}

/* 티어별 색상 */
.tier-value.tier-f { color: #808080; }
.tier-value.tier-d { color: #cd7f32; }
.tier-value.tier-c { color: #c0c0c0; }
.tier-value.tier-b { color: #ffd700; }
.tier-value.tier-a { color: #00ff00; }
.tier-value.tier-s { color: #00ffff; }
.tier-value.tier-ss { color: #ff00ff; }
.tier-value.tier-sss { 
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text 2s linear infinite;
}

/* 무지개 텍스트 애니메이션 */
@keyframes rainbow-text {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* 운 순위 표시 */
.luck-rank {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
}

/* 상위 운 */
.luck-rank.top {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
    color: #ffd700;
}

/* 하위 운 */
.luck-rank.bottom {
    border-color: rgba(255, 100, 100, 0.3);
    background: rgba(255, 100, 100, 0.05);
    color: #ff6666;
}

/* 자랑하기 버튼 */
.share-button {
    margin: 20px auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* ========================================
   재방문 화면
   ======================================== */
/* 재방문 컨테이너 */
.revisit-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* 재방문 콘텐츠 */
.revisit-content {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 0 50px rgba(255, 255, 255, 0.2),
        inset 0 0 50px rgba(255, 255, 255, 0.02);
    text-align: center;
    max-width: 500px;
}

.revisit-title {
    font-size: 28px;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.revisit-info {
    margin: 30px 0;
}

.revisit-stats {
    margin-top: 20px;
    font-size: 18px;
    color: #ccc;
}

.revisit-stats p {
    margin: 10px 0;
}

.revisit-message {
    font-size: 16px;
    color: #aaa;
    margin-top: 20px;
}

/* ========================================
   애니메이션 효과
   ======================================== */
/* 레벨업 플래시 */
.level-up-flash {
    animation: levelUpFlash 0.8s ease;
}

@keyframes levelUpFlash {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.3);
        filter: brightness(1.5);
    }
    100% { 
        transform: scale(1);
        filter: brightness(1);
    }
}

/* 회전 애니메이션 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 프로그레스 빛 애니메이션 */
@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 파티클 애니메이션 */
@keyframes successParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

@keyframes failParticle {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * 0.5)) scale(1.2) rotate(360deg);
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

@keyframes maintainParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * 0.5)) scale(1.2);
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 페이드 인/아웃 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 타이틀 펄스 */
@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========================================
   모바일 레이아웃
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    /* 보너스 별 숨김 */
    .bonus-star-container {
        display: none;
    }
    
    /* 공지 컨테이너 조정 */
    .announcement-container {
        top: 20px;
        width: 90%;
        left: 5%;
        transform: none;
    }
    
    .ranking-container {
        bottom: 20px;
        width: 90%;
        left: 5%;
        transform: none;
    }
    
    /* 게임 컨테이너 */
    .game-container {
        min-width: unset;
        width: 100%;
        max-width: 400px;
        padding: 30px 20px;
        margin: 0 auto;
    }
    
    .game-title {
        font-size: 32px;
        letter-spacing: 2px;
    }
    
    .level-display {
        padding: 12px 30px;
        font-size: 20px;
    }
    
    .level-number {
        font-size: 28px;
    }
    
    /* 모바일 별 게이지 바 */
    .mobile-star-gauge {
        display: block;
        width: 100%;
        height: 30px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        margin: 20px 0;
        overflow: hidden;
        position: relative;
        border: 1px solid rgba(255, 215, 0, 0.3);
    }
    
    .mobile-star-fill {
        height: 100%;
        background: linear-gradient(90deg, #ffd700, #ffed4e);
        width: 0%;
        transition: width 0.5s ease;
        border-radius: 15px;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
    
    .mobile-star-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #fff;
        font-size: 14px;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
        z-index: 2;
    }
    
    /* 버튼 크기 조정 */
    .level-up-button {
        padding: 25px 60px;
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    /* 통계 컨테이너 */
    .stats-container {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .stat-item {
        min-width: unset;
        width: 100%;
        padding: 15px 20px;
    }
    
    /* 모달 조정 */
    .modal-content {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 28px;
    }
    
    .tier-value {
        font-size: 36px;
    }
    
    .final-result {
        flex-direction: column;
        gap: 20px;
    }
    
    /* 도움말 모달 */
    .help-modal {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .help-section {
        padding: 15px;
    }
    
    .help-section h3 {
        font-size: 18px;
    }
    
    .help-section p {
        font-size: 14px;
    }
    
    /* 재방문 화면 */
    .revisit-content {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .revisit-title {
        font-size: 24px;
    }
}

/* 더 작은 모바일 */
@media (max-width: 480px) {
    .game-container {
        padding: 25px 15px;
    }
    
    .game-title {
        font-size: 28px;
    }
    
    .level-up-button {
        padding: 20px 50px;
        font-size: 18px;
    }
    
    .announcement {
        font-size: 12px;
        padding: 10px 20px;
    }
    
    .ranking {
        font-size: 12px;
        padding: 10px 20px;
    }
}

/* 데스크탑에서만 별 게이지 숨김 */
@media (min-width: 769px) {
    .mobile-star-gauge {
        display: none;
    }
}
