:root {
    --primary-color: #ff5252;
    --secondary-color: #212121;
    --accent-color: #ffeb3b;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --dark-bg: #121212;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', 'Roboto', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

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

header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    margin-bottom: 30px;
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.language-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.language-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    color: var(--secondary-color);
    border: none;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    font-size: 1.8rem;
}

.game-intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.intro-text {
    flex: 1;
}

.game-image {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.game-materials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.material-card {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.buy-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: auto;
    text-decoration: none;
    display: inline-block;
}

.buy-btn:hover {
    background-color: #e53935;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(255, 82, 82, 0.3);
}

.buy-btn:active {
    transform: translateY(-1px);
}

.game-rules {
    counter-reset: rule;
}

.rule-item {
    margin-bottom: 20px;
    position: relative;
    padding-left: 40px;
    transition: transform 0.2s ease;
}

.rule-item:hover {
    transform: translateX(5px);
}

.rule-item::before {
    counter-increment: rule;
    content: counter(rule);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.rule-item:hover::before {
    transform: scale(1.1);
}

.game-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.flow-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.flow-step {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.flow-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary-color);
    z-index: 1;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.flow-step:hover .step-number {
    transform: scale(1.1);
}

.illustration {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 30px auto;
    display: block;
}

.svg-container {
    max-width: 100%;
    overflow: hidden;
    margin: 20px 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

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

footer {
    text-align: center;
    padding: 20px;
    background-color: var(--secondary-color);
    color: white;
    margin-top: 30px;
}

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

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

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* Dark Mode */
body.dark-mode {
    background-color: var(--dark-bg);
    color: white;
}

body.dark-mode section {
    background-color: #1e1e1e;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

body.dark-mode .material-card {
    background-color: #2d2d2d;
    color: white;
}

body.dark-mode .flow-step {
    background-color: #2d2d2d;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .language-toggle, .theme-toggle {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        margin: 10px 5px;
    }
    
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .button-container {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }
    
    .flow-step:not(:last-child)::after {
        content: "↓";
        position: absolute;
        right: 50%;
        bottom: -20px;
        top: auto;
        transform: translateX(50%);
    }
    
    .game-intro {
        flex-direction: column;
    }
    
    .flow-container {
        flex-direction: column;
        align-items: center;
    }
    
    .flow-step {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    section {
        padding: 20px 15px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .game-materials {
        grid-template-columns: 1fr;
    }
    
    .game-image {
        margin: 15px auto;
    }
}