:root {
    --key-point-label: "핵심";
    --primary-color: #5f87ff;
    --secondary-color: #7bb4fe;
    --background-color: #f5f8ff;
    --text-color: #333;
    --card-bg: #fff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --highlight-color: #ffecb3;
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 60px;
}

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

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    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: 2.5rem;
    margin-bottom: 10px;
    position: relative;
}

h2 {
    font-size: 1.8rem;
    margin: 25px 0 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
}

h3 {
    font-size: 1.3rem;
    margin: 20px 0 10px;
    color: var(--primary-color);
}

p {
    margin-bottom: 15px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.stage-card {
    margin-top: 20px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.stage-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.stage-number {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.stage-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.steps-list {
    list-style-type: none;
    counter-reset: step-counter;
    margin-bottom: 20px;
}

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

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

.key-point {
    background-color: var(--highlight-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.key-point::before {
    content: var(--key-point-label);
    position: absolute;
    top: -10px;
    left: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.illustration {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.svg-container {
    max-width: 100%;
    height: auto;
}

.rules-list {
    list-style-type: none;
    padding-left: 20px;
    margin-bottom: 20px;
}

.rules-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
}

.rules-list li::before {
    content: "!";
    position: absolute;
    left: 0;
    top: 2px;
    width: 25px;
    height: 25px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.supplies {
    margin-top: 30px;
}

.supplies-list {
    list-style-type: none;
    padding: 0;
}

.supply-item {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.supply-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

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

.supply-content {
    flex-grow: 1;
}

.supply-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.buy-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.buy-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.summary-table th, 
.summary-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.summary-table th {
    background-color: var(--primary-color);
    color: white;
}

.summary-table tr:nth-child(even) {
    background-color: #f8f9ff;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.footer {
    text-align: center;
    margin-top: 50px;
    color: #777;
    font-size: 0.9rem;
}

.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    margin: 20px 0;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* 언어 전환 버튼 스타일 */
.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(95, 135, 255, 0.1);
}

/* 로딩 애니메이션 */
.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); }
}

.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);
    transition: transform 0.3s ease;
}

.game-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.video-link {
    text-align: center;
    margin: 20px 0;
}

.video-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.video-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .stage-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stage-number {
        margin-bottom: 10px;
    }

    .supply-item {
        flex-direction: column;
        text-align: center;
    }

    .supply-icon {
        margin: 0 0 15px 0;
    }
    
    .summary-table th, 
    .summary-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .card, .stage-card {
        padding: 15px;
    }
    
    .steps-list li {
        padding-left: 35px;
    }
    
    .steps-list li::before {
        width: 25px;
        height: 25px;
    }
    
    .lang-switch {
        padding: 4px 8px;
    }
    
    .lang-btn {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
}

/* Print styling */
@media print {
    .lang-switch, .buy-button {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .card, .stage-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    header {
        background: none;
        color: black;
        box-shadow: none;
        border-bottom: 2px solid var(--primary-color);
    }
}
