/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #9b59b6;
    --accent-color: #e74c3c;
    --background-color: #f0f8ff;
    --text-color: #333;
    --white-color: #ffffff;
    --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* 로딩 화면 */
.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: var(--white-color);
    padding: 8px 16px;
    border-radius: 30px;
    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: var(--white-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lang-btn:hover:not(.active) {
    background-color: rgba(52, 152, 219, 0.1);
}

/* 헤더 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    text-align: center;
    padding: 40px 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    position: relative;
    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: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

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

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

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    text-align: center;
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.highlight {
    font-weight: bold;
    color: var(--accent-color);
}

/* 이미지 컨테이너 */
.image-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.game-illustration {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.game-illustration:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* 규칙 섹션 */
.rules {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.rules.visible {
    opacity: 1;
    transform: translateY(0);
}

.rule-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.rule-icon {
    background-color: var(--primary-color);
    color: var(--white-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rule-text {
    flex: 1;
}

/* 장난감 섹션 */
.toys-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin: 30px 0;
}

.toy-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    width: 300px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.toy-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.toy-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.toy-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* 팁 섹션 */
.tips {
    background-color: #e8f4f8;
    border-radius: var(--border-radius);
    padding: 30px;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tips.visible {
    opacity: 1;
    transform: translateY(0);
}

.tips ul {
    list-style-type: none;
    padding-left: 0;
}

.tips ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.tips ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 푸터 */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: var(--white-color);
    border-radius: var(--border-radius);
}

/* SVG 스타일 */
.svg-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

svg {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

svg:hover {
    transform: scale(1.03);
}

/* 애니메이션 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 버튼 스타일 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toy-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
    background-color: var(--accent-color);
    margin-top: 10px;
}

.toy-btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.center-text {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.center-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .game-description, .rules, .tips {
        padding: 20px;
    }
    
    .toy-card {
        width: 100%;
        max-width: 300px;
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .rule-icon {
        width: 25px;
        height: 25px;
    }
    
    .toy-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .lang-btn {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
}

/* 인쇄 스타일 */
@media print {
    .lang-switch, .btn {
        display: none;
    }
    
    body {
        background-color: white;
    }
    
    .game-description, .rules, .tips, .toy-card {
        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);
    }
}