@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-primary: #0a0812;
    --bg-secondary: #131022;
    --bg-card: rgba(24, 20, 38, 0.75);
    --bg-card-hover: rgba(36, 31, 56, 0.9);
    --bg-input: #1a162a;
    --border-color: rgba(212, 175, 55, 0.15);
    --border-gold: #d4af37;
    --border-gold-glow: rgba(212, 175, 55, 0.4);
    --accent-red: #c83f49;
    --accent-red-hover: #e04a55;
    --accent-red-glow: rgba(200, 63, 73, 0.3);
    --accent-gold: #d4af37;
    --accent-gold-hover: #f3cf65;
    --text-primary: #f4ebd0; /* Parchment white */
    --text-secondary: #a9a4b8; /* Muted silver-purple */
    --text-dark: #0a0812;
    --text-green: #4ade80;
    --text-blue: #60a5fa;
    --text-orange: #fb923c;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.15);
    --shadow-glow-red: 0 0 15px rgba(200, 63, 73, 0.25);
    --font-fantasy: 'Cinzel', serif;
    --font-sans: 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    display: flex;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Hide native scrollbars for special containers but allow scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-fantasy);
    letter-spacing: 0.05em;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- App Layout --- */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: var(--accent-red);
    filter: drop-shadow(0 0 6px var(--accent-red-glow));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--text-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: auto;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item a:hover, .nav-item.active a {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
}

.nav-item.active a {
    border-left: 3px solid var(--accent-gold);
    box-shadow: var(--shadow-glow);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: var(--transition);
}

.nav-item:hover svg, .nav-item.active svg {
    fill: var(--accent-gold);
}

/* Current User Profile Badge in Sidebar */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-gold);
    box-shadow: var(--shadow-glow);
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-tag {
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-family: var(--font-fantasy);
}

/* Main Viewport Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1400px;
    width: calc(100% - var(--sidebar-width));
}

/* Tab Panels Visibility */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-panel.active {
    display: block;
}

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

/* --- Common UI Components --- */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
}

.page-title span {
    color: var(--accent-gold);
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-fantasy);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background-color: var(--accent-red);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow-red);
}

.btn-primary:hover {
    background-color: var(--accent-red-hover);
    box-shadow: 0 0 20px var(--accent-red-glow);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--border-gold-glow);
    transform: translateY(-2px);
}

.btn-gold {
    background-color: transparent;
    color: var(--accent-gold);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-glow);
}

.btn-gold:hover {
    background-color: var(--accent-gold);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--border-gold-glow);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: transparent;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #ef4444;
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Glassmorphic Card Container */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(16px);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-gold-glow);
    box-shadow: var(--shadow-glow), var(--shadow-main);
}

/* Badge/Tag */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.tag-dm {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    border-color: rgba(212, 175, 55, 0.3);
}

.tag-player {
    background: rgba(96, 165, 250, 0.1);
    color: var(--text-blue);
    border-color: rgba(96, 165, 250, 0.3);
}

.tag-pending {
    background: rgba(251, 146, 60, 0.1);
    color: var(--text-orange);
    border-color: rgba(251, 146, 60, 0.3);
}

.tag-success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--text-green);
    border-color: rgba(74, 222, 128, 0.3);
}

/* --- DASHBOARD VIEW --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Next Game Spotlight Card */
.spotlight-card {
    background: linear-gradient(135deg, rgba(35, 20, 30, 0.8) 0%, rgba(20, 16, 30, 0.9) 100%);
    border: 1px solid var(--border-gold-glow);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.1), var(--shadow-main);
    position: relative;
    overflow: hidden;
}

.spotlight-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(200, 63, 73, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.spotlight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.spotlight-label {
    font-family: var(--font-fantasy);
    color: var(--accent-gold);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.spotlight-title {
    font-size: 1.8rem;
    margin-top: 0.25rem;
}

.spotlight-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.spotlight-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-icon {
    width: 20px;
    height: 20px;
    fill: var(--accent-gold);
}

.detail-text h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.detail-text p {
    font-weight: 500;
    color: var(--text-primary);
}

/* Party List inside next game spotlight */
.spotlight-party {
    background: rgba(10, 8, 18, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.party-title {
    font-family: var(--font-fantasy);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--accent-gold);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.25rem;
}

.party-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}

.party-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
}

.member-role-label {
    font-size: 0.75rem;
    font-weight: 600;
}

.spotlight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

/* Countdown Clock */
.countdown-container {
    display: flex;
    gap: 10px;
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(10, 8, 18, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 50px;
    padding: 0.4rem;
}

.countdown-num {
    font-family: var(--font-fantasy);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.countdown-unit {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Stats Summary Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1.25rem;
}

.stat-icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 22px;
    height: 22px;
    fill: var(--accent-gold);
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-fantasy);
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Side Widget Panels */
.side-panels {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-link {
    font-size: 0.75rem;
    color: var(--accent-gold);
    text-decoration: none;
    text-transform: uppercase;
    font-family: var(--font-fantasy);
}

.widget-link:hover {
    text-decoration: underline;
}

/* Activity Feed */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 18px;
    height: 18px;
    fill: var(--accent-red);
    margin-top: 2px;
}

.activity-text p {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.activity-text span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Campaign List Card */
.campaign-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campaign-mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 8, 18, 0.4);
    border: 1px solid var(--border-color);
    padding: 0.85rem;
    border-radius: var(--radius-md);
}

.campaign-mini-info h4 {
    font-size: 1rem;
}

.campaign-mini-info p {
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

/* --- CALENDAR VIEW --- */
.calendar-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.calendar-wrapper {
    padding: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.current-month-year {
    font-size: 1.5rem;
    min-width: 180px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.weekday-header {
    text-align: center;
    font-family: var(--font-fantasy);
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1.2;
    background: rgba(10, 8, 18, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day:hover {
    background: var(--bg-secondary);
    border-color: var(--border-gold-glow);
    transform: scale(1.03);
    z-index: 2;
}

.calendar-day.empty {
    opacity: 0.25;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    background: rgba(10, 8, 18, 0.4);
    border-color: var(--border-color);
}

.day-number {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.calendar-day.today .day-number {
    color: var(--accent-gold);
    text-shadow: 0 0 8px var(--border-gold-glow);
}

.calendar-day.today {
    border-color: var(--border-gold);
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.day-sessions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.calendar-session-dot {
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background-color: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
    align-self: center;
}

.calendar-session-pill {
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--accent-red);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-fantasy);
}

/* Side Info for Selected Day */
.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.selected-day-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.selected-date-title {
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-day-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-day-placeholder svg {
    width: 36px;
    height: 36px;
    fill: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.75rem;
}

/* Calendar Event Card */
.cal-event-card {
    background: rgba(10, 8, 18, 0.5);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.cal-event-card:hover {
    border-color: var(--border-gold-glow);
    background: rgba(26, 22, 44, 0.5);
}

.cal-event-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cal-event-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- CAMPAIGNS & CHAT VIEW --- */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 180px);
}

.campaigns-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
    height: 100%;
}

.campaign-search {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.campaign-search:focus {
    outline: none;
    border-color: var(--border-gold-glow);
}

.campaign-items-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-campaign-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.chat-campaign-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.chat-campaign-item.active {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    border-left: 3px solid var(--accent-gold);
}

.chat-campaign-name {
    font-family: var(--font-fantasy);
    font-size: 1rem;
    color: var(--text-primary);
}

.chat-campaign-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-top: 0.25rem;
}

.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 0.75rem 1rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-campaign-title {
    font-size: 1.4rem;
}

.chat-members-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Chat bubble styling */
.message-wrapper {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.message-wrapper.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-sender-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border-gold);
    flex-shrink: 0;
}

.message-content-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.message-sender-name {
    font-weight: 600;
    color: var(--accent-gold);
}

.message-sender-class {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-style: italic;
}

.message-time {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    word-break: break-word;
}

.message-wrapper.outgoing .message-bubble {
    background: rgba(200, 63, 73, 0.15);
    border-color: rgba(200, 63, 73, 0.3);
    border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
}

.system-message {
    align-self: center;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-family: var(--font-fantasy);
    letter-spacing: 0.03em;
    max-width: 90%;
    text-align: center;
}

.chat-input-bar {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chat-text-input {
    flex-grow: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.chat-text-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* --- SESSIONS VIEW --- */
.sessions-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sessions-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-tabs {
    display: flex;
    gap: 1rem;
}

.filter-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-fantasy);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: var(--transition);
}

.filter-tab:hover, .filter-tab.active {
    color: var(--accent-gold);
}

.filter-tab.active {
    border-bottom: 2px solid var(--accent-gold);
    text-shadow: 0 0 6px var(--border-gold-glow);
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

/* Game Session Detailed Card */
.session-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.session-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.session-card-campaign {
    font-family: var(--font-fantasy);
    color: var(--accent-gold);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.session-card-title {
    font-size: 1.3rem;
    margin-top: 0.25rem;
    line-height: 1.2;
}

.session-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.session-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.session-grid-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    background: rgba(10, 8, 18, 0.3);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.session-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.session-meta-icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-gold);
}

/* Party roles inside session card */
.session-roles-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-header-line {
    font-family: var(--font-fantasy);
    font-size: 0.85rem;
    color: var(--accent-gold);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

.role-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.role-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(10, 8, 18, 0.4);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: 1px solid transparent;
}

.role-slot-item.claimed {
    border-color: rgba(255, 255, 255, 0.05);
}

.role-slot-item.unclaimed {
    border-style: dashed;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.slot-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.slot-label {
    font-weight: 600;
}

.role-label-badge {
    font-size: 0.7rem;
    font-family: var(--font-fantasy);
    text-transform: uppercase;
}

.role-label-badge.dm {
    color: var(--accent-gold);
}

.role-label-badge.player {
    color: var(--text-blue);
}

.session-card-actions {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.session-card-actions .btn {
    flex-grow: 1;
}

/* --- LOCATIONS VIEW --- */
.locations-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.location-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.location-type-badge {
    align-self: flex-start;
    margin-bottom: 0.75rem;
}

.location-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.location-address {
    font-size: 0.85rem;
    color: var(--text-blue);
    word-break: break-all;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.location-address:hover {
    text-decoration: underline;
}

.location-address svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.location-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.location-notes-box {
    background: rgba(10, 8, 18, 0.4);
    border-left: 3px solid var(--accent-gold);
    padding: 0.6rem 0.8rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.location-notes-box h5 {
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-bottom: 2px;
}

/* --- MODALS (DIALOGS) --- */
dialog {
    background: transparent;
    border: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 500px;
    width: calc(100% - 2rem);
}

dialog[open] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

dialog::backdrop {
    background-color: var(--bg-overlay);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

dialog[open]::backdrop {
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.2), var(--shadow-main);
    padding: 2rem;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--accent-red);
}

.modal-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-family: var(--font-fantasy);
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 1.75rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-main);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 320px;
}

.toast.success {
    border-left-color: var(--text-green);
}

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

@keyframes slideIn {
    from { transform: translateX(100%) translateY(20px); opacity: 0; }
    to { transform: translateX(0) translateY(0); opacity: 1; }
}

.toast.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

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

/* Mobile Navigation Bar (hidden on desktop) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nav-list {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 0.5rem 0;
}

.mobile-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
}

.mobile-nav-item.active a, .mobile-nav-item a:hover {
    color: var(--accent-gold);
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .chat-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 60px; /* space for mobile-nav */
    }
    .sidebar {
        display: none;
    }
    .mobile-nav {
        display: block;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem 1rem;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .stat-icon-wrapper {
        width: 36px;
        height: 36px;
    }
    .stat-val {
        font-size: 1.2rem;
    }
    .stat-lbl {
        font-size: 0.6rem;
    }
    .chat-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 200px);
    }
    .campaigns-sidebar {
        display: none; /* simple toggle can be implemented, or default to chat area only */
        border-right: none;
        padding-right: 0;
    }
    /* In mobile chat show campaign title & a back button to see groups */
    .spotlight-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .countdown-container {
        justify-content: center;
    }
}

/* --- Profile Class Editor & Custom Checkbox Styles --- */
.class-editor-row, .join-class-row {
    display: flex !important;
    gap: 8px !important;
    align-items: flex-end !important;
    grid-template-columns: none !important;
    margin-bottom: 0.75rem;
}

.class-editor-select, .join-class-select {
    flex-grow: 1;
    min-width: 120px;
}

.class-editor-custom, .join-class-custom {
    flex-grow: 1.5;
    min-width: 140px;
}

.class-editor-level, .join-class-level {
    width: 70px !important;
    text-align: center;
}

/* Custom Checkbox Accents */
input[type="checkbox"] {
    accent-color: var(--accent-gold);
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

#join-class-profile-options label {
    user-select: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* --- Mobile Device & Safe Area Adaptations --- */
.btn, .calendar-day, .nav-item a, .mobile-nav-item a {
    touch-action: manipulation;
}

.btn, .nav-item, .mobile-nav-item, .calendar-day {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.chat-messages-container, .campaign-items-list, .party-list {
    -webkit-overflow-scrolling: touch;
}

/* Adjust page padding top for status bar safe areas (notches) */
.main-content {
    padding-top: calc(2.5rem + env(safe-area-inset-top));
}

/* Offset mobile bottom nav bar for bottom safe areas (home indicator swipes) */
.mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* --- Phone OS Push Notification Simulator Banner --- */
.phone-banner {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 380px;
    background: rgba(24, 20, 38, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    padding: 0.75rem 1rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(16px);
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.phone-banner.show {
    top: calc(1rem + env(safe-area-inset-top));
}

.phone-banner-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
}

.phone-banner-content {
    flex-grow: 1;
    overflow: hidden;
}

.phone-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-family: var(--font-fantasy);
    margin-bottom: 2px;
}

.phone-banner-body {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
