:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --dark-color: #292F36;
    --light-color: #F7FFF7;
    --accent-color: #FFE66D;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    transition: all 0.3s ease;
}

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

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

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

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

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

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

.game-rules {
    margin: 1.5rem 0;
}

.game-rules ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.game-rules li {
    margin-bottom: 1rem;
}

.game-image-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    text-align: center;
}

.game-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.illustration {
    text-align: center;
    margin: 2rem auto;
    max-width: 100%;
}

.svg-container {
    max-width: 600px;
    margin: 0 auto;
}

.materials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.material-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.material-item:hover {
    transform: translateY(-5px);
}

.material-item img {
    max-width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
}

.material-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #3ab7af;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem 0;
    color: #888;
    font-size: 0.9rem;
}

/* Language switcher */
.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;
}

.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);
}

/* Loading spinner */
.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.9);
    z-index: 1000;
}

.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); }
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .game-section {
        padding: 1.5rem;
    }
    
    .materials {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.7rem;
    }
    
    .container {
        width: 95%;
        padding: 10px;
    }
    
    .game-section {
        padding: 1rem;
    }
    
    .materials {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* 애니메이션 효과 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.highlight {
    animation: pulse 2s infinite;
    background-color: var(--accent-color);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

/* 사람 일어서고 앉는 애니메이션 */
@keyframes standUp {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.person {
    transition: all 0.3s ease;
}

.person:hover {
    cursor: pointer;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* 다크 모드 */
.dark-mode {
    background-color: #222;
    color: #f0f0f0;
}

.dark-mode .game-section, 
.dark-mode .material-item {
    background-color: #333;
    color: #f0f0f0;
}

.dark-mode h2 {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.dark-mode .material-item h3 {
    color: #f0f0f0;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}