:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --background: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.glass-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    padding: 2rem 1.5rem 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

main {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-screen {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.welcome-screen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.welcome-screen p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.bottom-nav {
    height: 80px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-item.active {
    color: var(--primary-light);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.learning-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease-out;
}

.char-display {
    font-size: 8rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.char-display.small {
    font-size: 5rem;
}

.roman-display {
    font-size: 2rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.quiz-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease-out;
}

.quiz-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quiz-opt {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-opt:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-light);
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    margin: 2rem 0;
    color: var(--secondary);
}

/* News Section Styles */
.news-section {
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 1.2rem;
    border: 1px solid var(--glass-border);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.lang-selector {
    display: flex;
    gap: 0.5rem;
}

.lang-chip {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.lang-chip.active {
    background: var(--primary-light);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.lang-chip:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.section-tag {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--secondary);
}

.news-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.news-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-title {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-item:hover .news-title {
    color: var(--primary-light);
}

/* Level Selection Styles */
.level-select-screen h2 {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.3rem;
}

.level-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.level-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

.level-card:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    transform: translateX(5px);
}

.level-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.level-num {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.level-card h3 {
    margin-bottom: 0.5rem;
}

.level-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.lock-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* Modal / Premium UI */
.modal {
    background: rgba(15, 23, 42, 0.9);
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--primary-light);
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.premium-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 1.5rem 0;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    margin-top: 1.5rem;
    cursor: pointer;
    text-decoration: underline;
}

.meaning-display {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}