/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B5CF6;
    --secondary-color: #EC4899;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --dark-bg: #1F2937;
    --light-bg: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.07);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 스타일 */
header {
    text-align: center;
    padding: 40px 0;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* 섹션 공통 스타일 */
section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

section h2 i {
    font-size: 1.3rem;
}

/* 플레이어 통계 섹션 */
.player-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.player-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.player-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.95;
}

/* 테이블 스타일 */
.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    background: var(--light-bg);
    padding: 5px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--light-bg);
    transform: scale(1.01);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

td:first-child:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 체크박스 스타일 */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

input[type="checkbox"]:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* 완료율 표시 */
.completion-rate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.completion-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.completion-low {
    background: #FEE2E2;
    color: #DC2626;
}

.completion-medium {
    background: #FEF3C7;
    color: #D97706;
}

.completion-high {
    background: #D1FAE5;
    color: #059669;
}

.completion-full {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
}

/* 아직 플레이하지 않은 게임 섹션 */
.unplayed-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.unplayed-game-card {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.unplayed-game-card:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.unplayed-game-card i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.unplayed-game-card p {
    font-weight: 500;
    color: var(--text-secondary);
}

/* 새 게임 추가 폼 */
.add-game-form {
    display: flex;
    gap: 15px;
    max-width: 500px;
}

.add-game-form input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.add-game-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-game-form button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-game-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
}

#modalGameTitle {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

#modalGameImage {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
}

#modalGameInfo {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .player-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .table-wrapper {
        padding: 0;
    }

    th, td {
        padding: 8px;
        font-size: 0.85rem;
    }

    .add-game-form {
        flex-direction: column;
    }

    .add-game-form button {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .player-stats {
        grid-template-columns: 1fr;
    }

    section h2 {
        font-size: 1.2rem;
    }

    th, td {
        padding: 6px;
        font-size: 0.8rem;
    }

    input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}