/* ============================================
   COMMANDER HÁBITOS v2.0 - DESIGN SYSTEM
   Medieval Fantasy Theme
   ============================================ */

:root {
    /* Fontes */
    --font-display: 'Cinzel', serif;
    --font-body: 'Crimson Text', serif;
    --font-system: system-ui, -apple-system, sans-serif;
    
    /* Cores base */
    --bg-dark: #0c0a09;
    --bg-card: #1c1917;
    --bg-card-hover: #292524;
    --bg-elevated: #44403c;
    
    /* Cores de texto */
    --text-primary: #fafaf9;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;
    
    /* Cores de destaque */
    --gold: #fbbf24;
    --gold-light: #fde68a;
    --gold-dark: #b45309;
    --amber: #f59e0b;
    --orange: #f97316;
    --red: #ef4444;
    --green: #22c55e;
    --blue: #3b82f6;
    --purple: #a855f7;
    
    /* Cores de taverna */
    --tavern-wood: #2c1810;
    --tavern-wood-light: #4a2c1a;
    --tavern-fire: #ff6b35;
    --tavern-parchment: #f4e4bc;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 30px rgba(251, 191, 36, 0.3);
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Bordas */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg-dark);
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ============ TAVERN SCENE (Login) ============ */
.tavern-scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tavern-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.tavern-layer {
    position: absolute;
    inset: 0;
}

.tavern-back {
    background: 
        linear-gradient(180deg, #0d0805 0%, #1a0f08 50%, #2c1810 100%);
}

.tavern-fire {
    background: 
        radial-gradient(ellipse 60% 40% at 50% 90%, rgba(255, 107, 53, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 80% 30% at 50% 100%, rgba(255, 165, 0, 0.1) 0%, transparent 50%);
    animation: fireGlow 3s ease-in-out infinite alternate;
}

@keyframes fireGlow {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.tavern-particles {
    background-image: 
        radial-gradient(1px 1px at 20% 30%, rgba(255, 200, 150, 0.4), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255, 200, 150, 0.3), transparent),
        radial-gradient(1px 1px at 80% 50%, rgba(255, 200, 150, 0.2), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255, 200, 150, 0.3), transparent),
        radial-gradient(2px 2px at 90% 40%, rgba(255, 200, 150, 0.2), transparent);
    animation: particlesFloat 25s linear infinite;
}

@keyframes particlesFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100vh); }
}

.tavern-shadows {
    background: 
        linear-gradient(90deg, rgba(0,0,0,0.5) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.5) 100%);
}

/* Tochas */
.torch {
    position: fixed;
    top: 15%;
    width: 30px;
    height: 100px;
    z-index: 5;
}

.torch-left { left: 8%; }
.torch-right { right: 8%; }

.torch::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 60px;
    background: linear-gradient(to bottom, #4a2c1a 0%, #2c1810 100%);
    border-radius: 4px;
}

.torch-flame {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 35px;
    background: 
        radial-gradient(ellipse at bottom, #fff7ed 0%, #fbbf24 20%, #f97316 50%, #dc2626 80%, transparent 100%);
    border-radius: 50% 50% 30% 30%;
    animation: flameDance 0.4s ease-in-out infinite alternate;
    filter: blur(1px);
}

.torch-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.3) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes flameDance {
    0% { transform: translateX(-50%) scaleX(1) scaleY(1); }
    50% { transform: translateX(-48%) scaleX(0.95) scaleY(1.05); }
    100% { transform: translateX(-52%) scaleX(1.05) scaleY(0.95); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* Placa da taverna */
.tavern-sign {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.sign-board {
    background: linear-gradient(145deg, var(--tavern-wood-light) 0%, var(--tavern-wood) 100%);
    border: 4px solid #1a0f08;
    border-radius: var(--radius-lg);
    padding: 25px 20px 20px;
    box-shadow: 
        var(--shadow-lg),
        inset 0 2px 0 rgba(255,255,255,0.1),
        inset 0 -2px 0 rgba(0,0,0,0.3);
    position: relative;
}

.sign-board::before,
.sign-board::after {
    content: '';
    position: absolute;
    top: -15px;
    width: 4px;
    height: 25px;
    background: linear-gradient(to bottom, #666 0%, #444 100%);
    border-radius: 2px;
}

.sign-board::before { left: 30%; }
.sign-board::after { right: 30%; }

.sign-emblem {
    font-size: 2.5rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
    animation: emblemFloat 3s ease-in-out infinite;
}

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

.tavern-sign h1 {
    color: var(--gold);
    text-shadow: 
        2px 2px 0 #000,
        0 0 20px rgba(251, 191, 36, 0.5);
    font-size: 1.8rem;
    letter-spacing: 0.05em;
}

.sign-subtitle {
    color: var(--tavern-parchment);
    font-family: var(--font-body);
    font-style: italic;
    opacity: 0.9;
    margin-top: 5px;
}

/* Login Card */
.login-card {
    background: linear-gradient(145deg, rgba(28, 25, 23, 0.98) 0%, rgba(12, 10, 9, 0.98) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.card-ornament {
    color: var(--gold);
    opacity: 0.6;
    font-size: 0.8rem;
}

.card-header h2 {
    color: var(--gold-light);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-body {
    padding: 25px;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.input-icon {
    font-size: 1rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
    background: rgba(0, 0, 0, 0.6);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #1a0f08;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md), 0 0 20px rgba(251, 191, 36, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(251, 191, 36, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(251, 191, 36, 0.1);
}

.btn-ghost {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-ghost:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--gold);
    font-family: var(--font-display);
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition-fast);
}

.btn-link:hover {
    color: var(--gold-light);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Message */
.message {
    text-align: center;
    padding: 12px;
    margin-top: 15px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    min-height: 20px;
}

.message:not(:empty) {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--gold-light);
}

.message.error:not(:empty) {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Form Toggle */
.form-toggle {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-toggle span {
    color: var(--text-muted);
    margin-right: 8px;
}

/* Card Footer */
.card-footer {
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.footer-decor {
    color: var(--gold);
    opacity: 0.5;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.card-footer small {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-style: italic;
}

/* Exit Door */
.exit-door {
    position: fixed;
    bottom: 30px;
    left: 30px;
    text-decoration: none;
    z-index: 20;
    transition: var(--transition-normal);
}

.exit-door:hover {
    transform: scale(1.05);
}

.door-frame {
    width: 50px;
    height: 70px;
    background: linear-gradient(to bottom, #3d2817 0%, #2c1810 100%);
    border: 3px solid #1a0f08;
    border-radius: 8px 8px 0 0;
    position: relative;
    box-shadow: var(--shadow-md);
}

.door-wood {
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 48%, rgba(0,0,0,0.2) 50%, transparent 52%),
        linear-gradient(to bottom, #4a2c1a 0%, #3d2817 100%);
    border-radius: 5px 5px 0 0;
}

.door-handle {
    position: absolute;
    right: 8px;
    top: 50%;
    color: var(--gold);
    font-size: 10px;
}

.door-label {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 5px;
    font-family: var(--font-display);
}

/* Audio Toggle */
.audio-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: var(--bg-card);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.audio-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.audio-toggle .audio-off { display: none; }
.audio-toggle.muted .audio-on { display: none; }
.audio-toggle.muted .audio-off { display: block; }

/* ============ APP SCENE ============ */
.app-scene {
    min-height: 100vh;
}

.app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(251, 191, 36, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #0c0a09 0%, #1c1917 100%);
}

.bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23fbbf24' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(12, 10, 9, 0.95);
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 5px;
}

.nav-item {
    background: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    opacity: 0.6;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.nav-item.active {
    background: rgba(251, 191, 36, 0.15);
    opacity: 1;
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.audio-toggle {
    position: relative;
    width: auto;
    height: auto;
    border-radius: var(--radius-md);
}

/* App Header */
.app-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(28, 25, 23, 0.9) 0%, rgba(12, 10, 9, 0.9) 100%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.character-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.character-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-glow);
}

.character-details h1 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.character-details p {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-box.xp-box {
    grid-column: span 1;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--gold-light);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xp-bar {
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--amber) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.xp-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: xpShimmer 2s infinite;
}

@keyframes xpShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.xp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-family: var(--font-display);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* App Main */
.app-main {
    padding: 20px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.panel-header h2 {
    color: var(--gold);
    font-size: 1.1rem;
}

.panel-tools {
    display: flex;
    gap: 10px;
}

.panel-desc {
    padding: 15px 20px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Quest Form */
.quest-form {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quest-form.collapsed {
    display: none;
}

.form-row {
    margin-bottom: 15px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.flex-grow {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn-primary {
    flex: 1;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
}

/* Search & Filter */
.search-input {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 150px;
}

.filter-select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Quest Board */
.quest-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.quest-column {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    min-height: 300px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.column-icon {
    font-size: 1.1rem;
}

.column-header h3 {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.column-count {
    background: rgba(251, 191, 36, 0.2);
    color: var(--gold);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-display);
}

.column-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

/* Quest Card */
.quest-card {
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    padding: 12px;
    border-left: 4px solid var(--amber);
    transition: var(--transition-fast);
}

.quest-card:hover {
    transform: translateX(4px);
    background: var(--bg-elevated);
}

.quest-card.priority-alta { border-left-color: var(--red); }
.quest-card.priority-baixa { border-left-color: var(--blue); }

.quest-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.quest-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.quest-tag.tag-alta { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.quest-tag.tag-media { background: rgba(249, 115, 22, 0.2); color: #fdba74; }
.quest-tag.tag-baixa { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.quest-tag.tag-daily { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.quest-tag.tag-assigned { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }

.quest-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.quest-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quest-actions select {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    flex: 1;
}

.quest-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-complete {
    background: var(--green);
    color: white;
}

.btn-complete:hover {
    background: #16a34a;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Characters Grid */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.char-card {
    background: var(--bg-card-hover);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition-fast);
}

.char-card:hover {
    border-color: rgba(251, 191, 36, 0.3);
}

.char-card.active {
    border-color: var(--gold);
    box-shadow: var(--shadow-glow);
}

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

.char-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.char-info h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.char-info p {
    color: var(--gold);
    font-size: 0.85rem;
}

.char-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.char-stat {
    text-align: center;
    flex: 1;
}

.char-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold-light);
}

.char-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.char-actions {
    display: flex;
    gap: 8px;
}

.char-actions button {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

/* Classes List */
.classes-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.class-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.class-item.unlocked {
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.class-item.current {
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-glow);
}

.class-item.locked {
    opacity: 0.5;
}

.class-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.class-info {
    flex: 1;
}

.class-info h4 {
    color: var(--text-primary);
    margin-bottom: 3px;
}

.class-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.class-level {
    font-family: var(--font-display);
    color: var(--gold);
    font-size: 0.9rem;
}

/* Admin */
.admin-tabs {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-tab {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-display);
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.admin-content {
    padding: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.admin-table td {
    color: var(--text-primary);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.modal-header h3 {
    color: var(--gold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
}

.modal-footer button {
    flex: 1;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--green);
    color: var(--text-primary);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1001;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: var(--red);
}

/* FX Canvas */
.fx-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .quest-board {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-box.xp-box {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .nav-brand .brand-text {
        display: none;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .app-header {
        padding: 15px;
    }
    
    .character-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .character-details h1 {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-box {
        padding: 10px;
    }
    
    .stat-icon {
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .panel-tools {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .torch {
        display: none;
    }
    
    .exit-door {
        bottom: 20px;
        left: 20px;
    }
    
    .door-frame {
        width: 40px;
        height: 55px;
    }
}

/* Safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .app-main {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .toast {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
