/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 80px;
    overflow-x: hidden;
}

/* 네비게이션 메뉴 */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-brand h1 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 2px;
}

.nav-tagline {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.nav-menu {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #667eea;
}

.dropdown-icon {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.nav-item.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 5px;
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: #f8f9ff;
    border-left-color: #667eea;
}

.dropdown-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

.dropdown-item.disabled {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.dropdown-item.disabled:hover {
    background: #f5f5f5;
    border-left-color: transparent;
}

.badge-soon {
    display: inline-block;
    padding: 2px 8px;
    background: #ffd700;
    color: #333;
    font-size: 0.7em;
    border-radius: 10px;
    font-weight: bold;
    margin-left: 8px;
}

/* 모바일 토글 버튼 */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
}

/* 헤더 */
.game-header {
    text-align: center;
    margin-bottom: 25px;
}

.game-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.game-header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* 정보 패널 */
.info-panel {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info-item {
    text-align: center;
    color: white;
}

.info-item .label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.info-item .value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.info-item .value.countdown {
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.info-item .value.countdown.warning {
    color: #ff4444;
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 게임 영역 */
.game-area {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 100%);
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 아이콘 스타일 */
.icon {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.1s ease;
    animation: float 3s ease-in-out infinite;
    user-select: none;
}

.icon:hover {
    transform: scale(1.2) rotate(5deg);
}

.icon:active {
    transform: scale(0.8);
}

/* 아이콘 종류별 스타일 - 스프라이트 효과 */
.icon.mail {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.icon.mail::before {
    content: '📧';
    animation: pulse 2s ease-in-out infinite;
}

.icon.report {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.icon.report::before {
    content: '📊';
    animation: pulse 2s ease-in-out infinite;
}

/* 파괴 효과 애니메이션 */
@keyframes explode {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.icon.exploding {
    animation: explode 0.5s ease-out forwards;
    pointer-events: none;
}

/* 플로팅 애니메이션 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 펄스 애니메이션 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 점수 팝업 애니메이션 */
.score-popup {
    position: absolute;
    font-size: 1.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: scoreFloat 1s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

@keyframes scoreFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

/* 컨트롤 버튼 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #333;
}

/* 난이도 선택 */
.difficulty-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.difficulty-selector label {
    font-weight: bold;
    color: #333;
}

.diff-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.diff-btn:hover {
    background: #f0f0f0;
}

.diff-btn.active {
    background: #667eea;
    color: white;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.final-score, .final-destroyed {
    font-size: 1.3em;
    margin: 15px 0;
    color: #666;
}

.final-score span, .final-destroyed span {
    font-weight: bold;
    color: #667eea;
    font-size: 1.3em;
}

/* 순위판 섹션 */
.leaderboard-section {
    margin-top: 30px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* 순위판 탭 */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 25px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

/* 순위판 테이블 */
.leaderboard-content {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    font-weight: bold;
    font-size: 0.95em;
}

.leaderboard-table tbody tr {
    transition: background 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: #f8f9ff;
}

.leaderboard-table tbody tr.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: bold;
}

.leaderboard-table tbody tr.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    font-weight: bold;
}

.leaderboard-table tbody tr.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a355 100%);
    font-weight: bold;
}

.rank-medal {
    font-size: 1.3em;
}

.no-records {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
    display: none;
}

.no-records.show {
    display: block;
}

/* 이름 입력 모달 */
.name-input-group {
    margin: 20px 0;
}

.name-input-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.name-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.name-input-group input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
}

.final-time {
    font-size: 1.3em;
    margin: 15px 0;
    color: #666;
}

.final-time span {
    font-weight: bold;
    color: #667eea;
    font-size: 1.3em;
}

/* 기록 하이라이트 애니메이션 */
@keyframes highlight {
    0%, 100% {
        background: inherit;
    }
    50% {
        background: #fffacd;
    }
}

.new-record {
    animation: highlight 1s ease-in-out 3;
}

/* 푸터 스타일 */
.game-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 50px 20px 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.footer-section {
    text-align: left;
}

.footer-section h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.footer-section p {
    margin: 10px 0;
    opacity: 0.9;
    font-size: 0.95em;
    line-height: 1.6;
}

.footer-section kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.85em;
    margin-right: 8px;
}

.badge-easy {
    background: #4ecdc4;
    color: white;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

.badge-medium {
    background: #f093fb;
    color: white;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.4);
}

.badge-hard {
    background: #fa709a;
    color: white;
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd700;
}

.footer-bottom p {
    margin: 8px 0;
    opacity: 0.8;
    font-size: 0.9em;
}

/* 반응형 디자인 */
@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 600px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        margin: 10px 0;
        border-radius: 8px;
        border: 1px solid #eee;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
    
    .nav-container {
        height: 70px;
    }
    
    .nav-brand h1 {
        font-size: 1.2em;
    }
    
    .nav-tagline {
        font-size: 0.7em;
    }
    
    .game-header h1 {
        font-size: 1.8em;
    }
    
    .game-area {
        height: 400px;
    }
    
    .icon {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .leaderboard-table {
        font-size: 0.85em;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section {
        margin-bottom: 10px;
    }
    
    .footer-links {
        gap: 15px;
    }
}
