/* 글꼴 설정 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* 변수 설정 */
:root {
    --primary-color: #FF7979;
    --secondary-color: #FFD700;
    --background-color: #f9f7f2;
    --text-color: #333;
    --card-bg: #f9f9f9;
    --footer-bg: #333;
    --footer-color: white;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 0;
    margin: 0;
}

/* 로딩 화면 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 언어 전환 버튼 */
.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.lang-switch:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    color: var(--primary-color);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lang-btn:hover:not(.active) {
    background-color: rgba(255, 121, 121, 0.1);
}

/* 헤더 섹션 */
header {
    background: linear-gradient(135deg, var(--primary-color), #FF9E9E);
    color: white;
    text-align: center;
    padding: 2.5rem 1rem;
    position: relative;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 설명 섹션 */
.game-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.game-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* 게임 이미지 */
.game-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.game-image:hover {
    transform: scale(1.02);
}

/* 게임 준비물 */
.materials {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.material-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    flex: 1 1 200px;
    max-width: 200px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.material-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.material-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    fill: var(--primary-color);
}

/* 게임 단계 */
.game-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    flex: 1 1 300px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number {
    position: absolute;
    top: -15px;
    left: -15px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.step-card h3 {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.3rem;
}

/* 게임 팁 리스트 */
.game-section ul {
    list-style-type: none;
    padding-left: 0;
}

.game-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.game-section ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
}

/* 게임 설명 일러스트 */
.game-illustration {
    width: 100%;
    text-align: center;
    margin: 2rem 0;
}

svg.game-diagram {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

svg.game-diagram:hover {
    transform: scale(1.02);
}

/* 푸터 */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-color);
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }

    .game-section {
        padding: 1.5rem;
    }
    
    .game-steps {
        gap: 1.5rem;
    }
    
    .step-card {
        flex: 1 1 100%;
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
    
    .material-item {
        flex: 1 1 150px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .game-section h2 {
        font-size: 1.5rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .material-icon {
        width: 60px;
        height: 60px;
    }
    
    .material-item {
        padding: 1rem;
    }
    
    .lang-btn {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
}

/* 인쇄 스타일 */
@media print {
    .lang-switch {
        display: none;
    }
    
    body {
        background-color: white;
    }
    
    .game-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    header {
        background: none;
        color: var(--text-color);
        box-shadow: none;
        border-bottom: 2px solid var(--primary-color);
    }
}