:root {
    --bg-dark: #0f1115;
    --bg-panel: rgba(26, 29, 36, 0.85);
    --primary: #c39b5b; /* Gloomhaven Gold */
    --primary-hover: #daba8a;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(195, 155, 91, 0.3);
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1e222a 0%, #0f1115 100%);
}

h1, .brand {
    font-family: 'Cinzel', serif;
}

/* Modal / Login */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.text-left {
    text-align: left !important;
}

.modal-content h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.2rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 6px;
    color: white;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(195, 155, 91, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn.primary {
    background: var(--primary);
    color: #000;
    width: 100%;
    margin-top: 1rem;
}

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.icon-btn {
    background: var(--primary);
    color: #000;
    padding: 0.5rem 1rem;
}

.btn.icon-btn:hover {
    background: var(--primary-hover);
}

.btn.icon-btn.outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-main);
    padding: 0.5rem;
}
.btn.icon-btn.outline:hover {
    background: rgba(255,255,255,0.1);
}

.btn.outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-main);
}
.btn.outline:hover {
    background: rgba(255,255,255,0.1);
}

.error-msg {
    color: var(--error);
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 1.2rem;
}

/* App Layout */
#app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#app-layout.hidden {
    display: none;
}

.app-header {
    height: 60px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.brand {
    font-size: 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-display {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.app-content {
    flex: 1;
    position: relative;
}

#storyline-frame {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    border-left: 4px solid var(--success);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
}

.toast i {
    color: var(--success);
}

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

.toast.hidden {
    transform: translateX(120%);
    opacity: 0;
}

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

/* Mobile Responsiveness */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: inline !important;
    }
    .app-header {
        padding: 0 0.8rem;
    }
    .brand {
        font-size: 1.1rem;
    }
    .actions {
        gap: 0.5rem;
    }
    .btn {
        padding: 0.5rem 0.8rem;
    }
    .btn.icon-btn {
        padding: 0.5rem;
    }
}
