:root {
    --primary-color: #4A55A2;
    --secondary-color: #7895CB;
    --accent-color: #A0BFE0;
    --light-color: #C5DFF8;
    --text-color: #333;
    --light-text: #666;
    --white: #fff;
}

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

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

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

header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px 0;
    text-align: center;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.section {
    background-color: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

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

.highlight {
    background-color: var(--light-color);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.game-illustration {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.svg-container {
    max-width: 100%;
    margin-bottom: 20px;
}

.simulator {
    padding: 25px;
    background-color: var(--light-color);
    border-radius: 15px;
    text-align: center;
    margin-top: 20px;
}

.input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

label {
    font-weight: 500;
    margin-right: 10px;
}

input[type="number"] {
    width: 60px;
    padding: 8px 12px;
    border: 2px solid var(--secondary-color);
    border-radius: 5px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--secondary-color);
}

.result {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 15px;
    min-height: 60px;
}

.steps {
    list-style-type: none;
    counter-reset: step-counter;
}

.steps li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 15px;
}

.steps li:before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--secondary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.tips {
    background-color: var(--accent-color);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.tips h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.tips ul {
    padding-left: 20px;
}

.tips li {
    margin-bottom: 8px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--light-text);
    font-size: 0.9rem;
}

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

.game-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.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 animation */
.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 (min-width: 768px) {
    .game-illustration {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .svg-container {
        width: 50%;
    }
    
    .steps-container {
        width: 45%;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .section {
        padding: 20px;
    }
    
    .svg-container {
        width: 100%;
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
}