:root {
    --primary-color: #4a6da7;
    --secondary-color: #f9a826;
    --background-color: #f5f5f5;
    --text-color: #333333;
    --card-color: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

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

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

h2 {
    font-size: 1.8rem;
    margin: 30px 0 15px;
    color: var(--primary-color);
}

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

.game-card {
    background-color: var(--card-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
}

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

@media (min-width: 768px) {
    .game-intro {
        flex-direction: row;
        align-items: center;
    }
}

.game-intro-text {
    flex: 1;
}

.game-image-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    width: 100%;
}

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

.rules {
    margin-top: 20px;
}

.rules ol {
    margin-left: 25px;
    margin-top: 10px;
}

.rules li {
    margin-bottom: 10px;
}

.content-btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.content-btn:hover {
    background-color: #e09415;
}

.topic-list {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: #e9f0f9;
    border-radius: 8px;
}

.topic-item {
    background-color: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.examples {
    margin-top: 30px;
}

.tips {
    margin-top: 30px;
}

.tips ul {
    margin-left: 25px;
    margin-top: 10px;
}

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

footer {
    margin-top: 50px;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Enhanced hand animation styles */
.finger-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    perspective: 800px;
}

.hand {
    position: relative;
    width: 250px;
    height: 300px;
    transform-style: preserve-3d;
}

.finger {
    position: absolute;
    width: 30px;
    background-color: #ffdbac;
    border-radius: 15px;
    transform-origin: bottom center;
    transition: transform 0.5s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.finger.folded {
    transform: rotateX(90deg);
}

.finger-1 {
    height: 120px;
    bottom: 80px;
    left: 30px;
}

.finger-2 {
    height: 140px;
    bottom: 80px;
    left: 70px;
}

.finger-3 {
    height: 150px;
    bottom: 80px;
    left: 110px;
}

.finger-4 {
    height: 130px;
    bottom: 80px;
    left: 150px;
}

.finger-5 {
    height: 100px;
    bottom: 100px;
    left: 190px;
    transform: rotate(-15deg);
    transform-origin: bottom left;
}

.finger-5.folded {
    transform: rotate(70deg);
}

.palm {
    position: absolute;
    width: 180px;
    height: 100px;
    background-color: #ffdbac;
    border-radius: 30px;
    bottom: 0;
    left: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.finger:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 20px;
    background-color: #f0c8a0;
    border-radius: 10px;
    top: 0;
}

.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    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 (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .game-card {
        padding: 20px;
    }
    
    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
    }
    
    .finger-container {
        transform: scale(0.8);
    }
}