/* ============================================================
   LIFE.EXE — Design System
   ============================================================ */

:root {
    --bg: #111827;
    --card: #1F2937;
    --card-light: #283344;
    --gold: #F4D66A;
    --blue: #3386EF;
    --cyan: #7CC1FF;
    --green: #34D399;
    --red: #EF4444;
    --purple: #8B5CF6;
    --text: #E5E7EB;
    --text-dim: #9CA3AF;
    --border: #374151;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px; }

/* ---------- Auth pages ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top, #1a2438 0%, #111827 70%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.logo { font-size: 1.7rem; text-align: center; color: var(--gold); }
.logo span { color: var(--cyan); }
.auth-subtitle { text-align: center; color: var(--text-dim); margin-bottom: 20px; }
.auth-card label { display: block; font-size: 0.85rem; margin: 14px 0 6px; color: var(--text-dim); }
.auth-card input[type=text],
.auth-card input[type=email],
.auth-card input[type=password],
.auth-card input[type=date],
.auth-card textarea,
.auth-card select {
    width: 100%;
    padding: 11px 12px;
    background: #0F1623;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
}
.auth-card input:focus, .auth-card textarea:focus, .auth-card select:focus {
    outline: none;
    border-color: var(--blue);
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.checkbox-row input { width: auto; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 0.85rem; color: var(--text-dim); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #0B1220; }
.btn-primary:hover { box-shadow: 0 0 16px rgba(124,193,255,0.5); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #ffe9a8); color: #2b2308; }
.btn-green { background: var(--green); color: #06281c; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-block { width: 100%; margin-top: 18px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.88rem; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid var(--red); color: #fca5a5; }
.alert-success { background: rgba(52,211,153,0.15); border: 1px solid var(--green); color: #6ee7b7; }
.alert-warning { background: rgba(244,214,106,0.15); border: 1px solid var(--gold); color: var(--gold); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: #0D1421;
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .logo { text-align: left; margin-bottom: 24px; font-size: 1.3rem; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text-dim); font-size: 0.9rem; margin-bottom: 4px;
}
.nav-link:hover, .nav-link.active { background: var(--card); color: var(--text); text-decoration: none; }
.nav-link.active { border-left: 3px solid var(--blue); }

.main-content { flex: 1; padding: 24px; max-width: 1200px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

/* ---------- Cards & Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.card-title { font-size: 0.95rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }

/* ---------- Character header ---------- */
.char-header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.char-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; border: 3px solid var(--gold);
    object-fit: cover;
}
.char-meta .level-badge { color: var(--gold); font-weight: 700; }
.char-meta .title-text { color: var(--cyan); font-size: 0.85rem; }

/* ---------- Progress bars ---------- */
.progress-bar-track {
    width: 100%; height: 14px; background: #0F1623;
    border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.progress-bar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    transition: width 0.6s cubic-bezier(.22,1,.36,1);
}
.progress-bar-fill.gold { background: linear-gradient(90deg, var(--gold), #fff3c4); }
.progress-bar-fill.green { background: linear-gradient(90deg, #1f9d6e, var(--green)); }
.progress-bar-fill.red { background: linear-gradient(90deg, #b91c1c, var(--red)); }

.stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.85rem; }
.stat-row .stat-label { width: 110px; flex-shrink: 0; color: var(--text-dim); }
.stat-row .stat-value { width: 32px; text-align: right; color: var(--text); font-weight: 600; }

/* ---------- Quest list ---------- */
.quest-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border-radius: 10px; background: var(--card-light);
    margin-bottom: 8px; gap: 10px; flex-wrap: wrap;
}
.quest-item.completed { opacity: 0.55; text-decoration: line-through; }
.quest-info { flex: 1; min-width: 180px; }
.quest-title { font-weight: 600; font-size: 0.92rem; }
.quest-sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-tiny { background: #374151; color: #cbd5e1; }
.badge-easy { background: rgba(52,211,153,0.2); color: var(--green); }
.badge-medium { background: rgba(51,134,239,0.2); color: var(--blue); }
.badge-hard { background: rgba(139,92,246,0.2); color: var(--purple); }
.badge-epic { background: rgba(244,214,106,0.2); color: var(--gold); }
.badge-legendary { background: rgba(239,68,68,0.2); color: var(--red); }

/* ---------- Achievements ---------- */
.ach-card { text-align: center; padding: 16px 10px; }
.ach-icon { font-size: 2rem; margin-bottom: 8px; }
.ach-name { font-weight: 700; font-size: 0.85rem; }
.ach-rarity { font-size: 0.7rem; text-transform: uppercase; margin-top: 4px; }
.rarity-common { color: #cbd5e1; }
.rarity-rare { color: var(--blue); }
.rarity-epic { color: var(--purple); }
.rarity-legendary { color: var(--gold); }
.rarity-mythic { color: var(--red); }

/* ---------- Animations ---------- */
@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}
.xp-toast {
    position: fixed; top: 20px; right: 20px; z-index: 999;
    background: var(--card); border: 1px solid var(--gold);
    border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow);
    animation: popIn 0.4s ease;
}
.level-up-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.level-up-card {
    background: var(--card); border: 2px solid var(--gold); border-radius: 18px;
    padding: 36px 48px; text-align: center; animation: popIn 0.5s ease;
}
.level-up-card .big-level { font-size: 3rem; color: var(--gold); font-weight: 800; }

/* ---------- Misc ---------- */
.text-dim { color: var(--text-dim); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.empty-state { color: var(--text-dim); font-size: 0.88rem; text-align: center; padding: 20px 0; }

/* ---------- Mobile-first responsive ---------- */
@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        display: flex; overflow-x: auto; gap: 4px; padding: 10px;
    }
    .sidebar .logo { display: none; }
    .nav-link { flex-shrink: 0; }
    .main-content { padding: 16px; }
}
