/**
 * style.css - 단어 맞추기 게임 메인 스타일시트
 * Cosmic 컬러 스킴 + 밀리의서재 참조 디자인
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Primary Colors - Cosmic Theme */
    --primary: #667eea;
    --primary-light: #7c8ff0;
    --primary-dark: #5468d4;
    --secondary: #764ba2;
    --secondary-light: #8b5fb7;
    --secondary-dark: #5f3a85;
    --accent: #f093fb;
    --accent-light: #f5b0fc;
    --accent-dark: #d76ee3;

    /* Gradient Cosmic Colors */
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-cosmic-reverse: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    --gradient-aurora: linear-gradient(135deg, #667eea 0%, #f093fb 50%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-ocean: linear-gradient(135deg, #667eea 0%, #00d4ff 100%);
    --gradient-emerald: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-gold: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);

    /* Background Colors - Millie's Library Inspired */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-tertiary: #f0f2f7;
    --bg-dark: #1a1b2e;
    --bg-darker: #0f1021;

    /* Text Colors */
    --text-primary: #1e2139;
    --text-secondary: #4a4f6a;
    --text-muted: #7a7f9a;
    --text-light: #a0a5bb;
    --text-white: #ffffff;
    --text-dark: #0d0e17;

    /* Game Colors */
    --game-success: #10b981;
    --game-success-light: #34d399;
    --game-warning: #f59e0b;
    --game-warning-light: #fbbf24;
    --game-error: #ef4444;
    --game-error-light: #f87171;
    --game-info: #3b82f6;
    --game-info-light: #60a5fa;
    --game-gold: #ffc107;
    --game-silver: #94a3b8;
    --game-bronze: #cd7f32;
    --game-exp: #8b5cf6;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Typography */
    --font-sans: 'Noto Sans KR', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Poppins', 'Noto Sans KR', sans-serif;

    --font-xs: 12px;
    --font-sm: 14px;
    --font-base: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-2xl: 24px;
    --font-3xl: 30px;
    --font-4xl: 36px;
    --font-5xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-cosmic: 0 10px 40px rgba(102, 126, 234, 0.3);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.4);

    /* Z-Index */
    --z-dropdown: 100;
    --z-header: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-loader: 500;

    /* Layout */
    --header-height: 64px;
    --bottom-nav-height: 72px;
    --max-width: 1200px;
    --game-max-width: 500px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1b2e;
        --bg-secondary: #242640;
        --bg-tertiary: #2e3052;
        --text-primary: #f0f2f7;
        --text-secondary: #c0c4d8;
        --text-muted: #8a8faa;
    }
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-md);
    z-index: var(--z-loader);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   Page Loader
   ============================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-cosmic);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loader);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-icon {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.loader-icon .letter {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    font-weight: 800;
    font-family: var(--font-display);
    animation: letterBounce 1.2s ease-in-out infinite;
}

.loader-icon .letter:nth-child(1) { animation-delay: 0s; }
.loader-icon .letter:nth-child(2) { animation-delay: 0.1s; }
.loader-icon .letter:nth-child(3) { animation-delay: 0.2s; }
.loader-icon .letter:nth-child(4) { animation-delay: 0.3s; }

@keyframes letterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.loader-text {
    font-size: var(--font-lg);
    opacity: 0.9;
}

/* ============================================
   App Container
   ============================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

/* ============================================
   Header
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: var(--z-header);
    transition: all var(--transition-base);
}

.app-header.scrolled {
    box-shadow: var(--shadow-lg);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 800;
    font-size: var(--font-xl);
    font-family: var(--font-display);
    color: var(--text-primary);
}

.logo-icon {
    font-size: 28px;
}

.logo-accent {
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop Navigation */
.nav-desktop {
    display: none;
}

.nav-list {
    display: flex;
    gap: var(--space-xl);
}

.nav-list a {
    font-weight: 500;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-cosmic);
    transition: width var(--transition-base);
}

.nav-list a:hover::after,
.nav-list a.active::after {
    width: 100%;
}

.nav-list a.active {
    color: var(--primary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.user-badge:hover {
    background: var(--gradient-cosmic);
    color: white;
}

.user-level {
    background: var(--gradient-cosmic);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 700;
}

.user-badge:hover .user-level {
    background: rgba(255, 255, 255, 0.2);
}

/* Menu Toggle */
.menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    visibility: hidden;
    opacity: 0;
    transition: all var(--transition-base);
}

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85%;
    height: 100%;
    background: var(--bg-primary);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--bg-tertiary);
    font-weight: 700;
    font-size: var(--font-lg);
}

.mobile-menu-header .close-menu {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    color: var(--text-muted);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--gradient-cosmic);
    color: white;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-level {
    font-weight: 700;
    font-size: var(--font-sm);
}

.user-nickname {
    font-weight: 600;
    font-size: var(--font-lg);
}

.user-score {
    font-size: var(--font-sm);
    opacity: 0.9;
}

.mobile-nav {
    flex: 1;
    padding: var(--space-md);
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
}

.mobile-nav li.divider {
    height: 1px;
    background: var(--bg-tertiary);
    margin: var(--space-md) 0;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.mobile-nav a span {
    font-size: 20px;
}

.mobile-menu-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--bg-tertiary);
}

/* ============================================
   Main Content
   ============================================ */
.app-main {
    flex: 1;
    margin-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: calc(100vh - var(--header-height));
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: var(--z-header);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.bottom-nav-item .nav-icon {
    font-size: 24px;
    transition: transform var(--transition-bounce);
}

.bottom-nav-item .nav-label {
    font-size: var(--font-xs);
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active .nav-icon {
    transform: scale(1.15);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-base);
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-cosmic);
    color: white;
    box-shadow: var(--shadow-cosmic);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--gradient-emerald);
    color: white;
}

.btn-warning {
    background: var(--gradient-gold);
    color: var(--text-dark);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-small {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-sm);
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-lg);
}

.btn-full {
    width: 100%;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   Section Styles
   ============================================ */
.section {
    padding: var(--space-2xl) var(--space-lg);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--font-base);
    color: var(--text-muted);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: var(--space-3xl) 0 calc(var(--space-2xl) + var(--bottom-nav-height));
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-section h3 {
    font-size: var(--font-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-md);
}

.footer-section h4 {
    font-size: var(--font-base);
    font-weight: 600;
    color: white;
    margin-bottom: var(--space-md);
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.7;
}

.footer-section ul li {
    margin-bottom: var(--space-sm);
}

.footer-section ul a {
    color: var(--text-light);
    font-size: var(--font-sm);
}

.footer-section ul a:hover {
    color: white;
}

.footer-stats {
    display: flex;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.footer-stats .stat {
    font-size: var(--font-sm);
}

.footer-stats strong {
    color: white;
    font-weight: 700;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    font-size: var(--font-sm);
    color: var(--text-light);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    visibility: hidden;
    opacity: 0;
    transition: all var(--transition-base);
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 400px;
    padding: var(--space-2xl);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-bounce);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--game-error);
    color: white;
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.modal-icon {
    font-size: 56px;
    display: block;
    margin-bottom: var(--space-md);
}

.modal-header h2 {
    font-size: var(--font-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.modal-header p {
    color: var(--text-muted);
}

.modal-note {
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--space-lg);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--font-base);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.input-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.input-error {
    color: var(--game-error);
}

/* ============================================
   Toast Messages
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 400px;
    padding: 0 var(--space-lg);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: toastSlideIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    background: var(--game-success);
}

.toast.error {
    background: var(--game-error);
}

.toast.warning {
    background: var(--game-warning);
    color: var(--text-dark);
}

.toast.info {
    background: var(--game-info);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: var(--font-sm);
    font-weight: 500;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.fade-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================
   Achievement Popup
   ============================================ */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: var(--z-modal);
    background: var(--gradient-cosmic);
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    text-align: center;
    color: white;
    box-shadow: var(--shadow-2xl);
    opacity: 0;
    transition: all var(--transition-bounce);
}

.achievement-popup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-icon-large {
    font-size: 72px;
    margin-bottom: var(--space-md);
    animation: achievementBounce 0.6s ease;
}

@keyframes achievementBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.achievement-title {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.achievement-desc {
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.achievement-points {
    font-size: var(--font-lg);
    font-weight: 700;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: inline-block;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    font-size: var(--font-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-primary {
    background: var(--gradient-cosmic);
    color: white;
}

.badge-success {
    background: var(--game-success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--game-warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--game-error-light);
    color: #991b1b;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #744210;
}

.badge-silver {
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    color: #334155;
}

.badge-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: white;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-cosmic);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-fill.success {
    background: var(--gradient-emerald);
}

.progress-fill.warning {
    background: var(--gradient-gold);
}
