/* Skip Navigation */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.2s;
}

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

/* Theme Variables */
:root {
    /* Dark Theme (default) */
    --bg-primary: #1a252f;
    --bg-secondary: #2c3e50;
    --bg-tertiary: #34495e;
    --bg-card: #2c3e50;
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-accent: #ff6b35;
    --border-color: #34495e;
    --input-bg: #34495e;
    --input-border: #4a5f7a;
    --button-primary: #3498db;
    --button-primary-hover: #2980b9;
    --button-danger: #e74c3c;
    --button-danger-hover: #c0392b;
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(44, 62, 80, 0.9);
    --ivy-color: #8b1a1a;
    --ivy-color-light: #a52a2a;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-accent: #d63031;
    --border-color: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --button-primary: #007bff;
    --button-primary-hover: #0056b3;
    --button-danger: #dc3545;
    --button-danger-hover: #c82333;
    --shadow: rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(255, 255, 255, 0.95);
}

body { 
    font-family: Arial, sans-serif; 
    background: var(--bg-primary); 
    color: var(--text-primary);
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tabs { 
    display: flex; 
    background: var(--bg-secondary); 
}

.tab-button { 
    flex: 1; 
    padding: 12px; 
    color: var(--text-primary); 
    background: var(--bg-secondary); 
    border: none; 
    cursor: pointer; 
    font-weight: bold; 
    transition: background-color 0.3s ease;
}

.tab-button.active { 
    background: var(--bg-tertiary); 
}

.tab-content { 
    display: none; 
    padding: 20px; 
    background: var(--bg-primary);
}

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

/* Remove top padding from all tab content areas for cleaner appearance */
.tab-content {
    padding-top: 0;
}

/* PCs tab header styling */
.pcs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 15px 0;
    padding: 0 5px;
}

/* Image thumbnails */
.image-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-thumbnail:hover {
    opacity: 0.8;
}

/* Image modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.image-modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.image-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: none;
    border: none;
}

.image-modal-close:hover {
    opacity: 0.7;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 20px; 
    background: var(--bg-card);
}

th, td { 
    border: 1px solid var(--border-color); 
    padding: 8px; 
    text-align: center; 
    color: var(--text-primary);
}

th { 
    background: var(--bg-tertiary); 
    color: var(--text-primary); 
}

/* Active turn highlighting */
.active-turn {
    background: var(--text-accent) !important;
    color: #ffffff !important;
    font-weight: bold;
    box-shadow: 0 0 5px var(--text-accent);
}

.active-turn td {
    background: var(--text-accent) !important;
    color: #ffffff !important;
}

.active-turn input, 
.active-turn select, 
.active-turn button {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.rumor-box { 
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;

button { 
    padding: 8px 12px; 
    margin-top: 10px; 
}

.slider { 
    width: 100%; 
}

textarea { 
    width: 100%; 
}

.effect-cell {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: 160px;
}

.effect-inputs {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.effect-input-wrapper {
    margin-bottom: 4px;
}

.effect-input-wrapper:last-child {
    margin-bottom: 0;
}

.effect-name {
    width: 85px;
    font-size: 0.9em;
    flex-shrink: 0;
    height: 24px;
    padding: 3px 5px;
    box-sizing: border-box;
    margin: 0;
}

.effect-duration {
    width: 85px !important;
    font-weight: bold !important;
    text-align: center !important;
    flex-shrink: 0;
    height: 24px !important;
    padding: 3px 5px !important;
    box-sizing: border-box !important;
    font-size: 0.9em !important;
    margin: 0 !important;
}

input.effect-duration.expiring {
    background-color: #ff4444 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    border: 2px solid #cc0000 !important;
}

input.effect-duration.warning {
    background-color: #ffdd44 !important;
    color: #000000 !important;
    font-weight: bold !important;
    border: 2px solid #ccaa00 !important;
}

input.effect-duration.active {
    background-color: #44ff44 !important;
    color: #006600 !important;
    border: 2px solid #00cc00 !important;
}

.voice-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 5px;
}

.record-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.record-btn.recording {
    background-color: #c0392b;
    animation: pulse 1s infinite;
}

.play-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.play-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.thumbnail-large {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.image-upload {
    margin-top: 5px;
}

.image-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-left: 10px;
}

}

.campaign-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    border: 1px solid var(--border-color);
}

.campaign-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--text-accent);
    border: 1px solid var(--border-color);
}

.campaign-card:hover {
    background: var(--bg-tertiary);
    cursor: pointer;
}

.campaign-actions {
    display: flex;
    gap: 10px;
}

.campaign-selection-title {
    text-align: center;
    color: var(--text-secondary);
    font-weight: normal;
    margin-bottom: 20px;
}

/* Form containers */
.form-container {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Combined Bulk Actions Container */
.bulk-actions-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: stretch;
}

.bulk-effect-section {
    flex: 1;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    min-width: 0;
}

.bulk-damage-section {
    flex: 1.2;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 0;
}

.bulk-effect-section strong, 
.bulk-damage-section strong {
    color: var(--text-primary);
    font-size: 1em;
}

.bulk-damage-section input[type="number"] {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 6px 8px;
}

.bulk-damage-section button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

/* Make it responsive for smaller screens */
@media (max-width: 768px) {
    .bulk-actions-container {
        flex-direction: column;
    }
}

/* Old bulk effect container styles (keeping for compatibility) */
.bulk-effect-container {
    margin-bottom: 10px;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.content-container {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.header-bar {
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;    border-bottom: 3px solid #34495e;}

.header-bar h1 {
    margin: 0;
    font-size: 1.5em;
}

.back-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.back-btn:hover {
    background: #c0392b;
}

.session-btn {
    background: var(--text-accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.session-btn:hover {
    background: #e55a2b;
}

/* Unified Hamburger Menu - Works for all screen sizes */
.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.3s ease;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 24px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center center;
    position: absolute;
}

.hamburger-menu span:nth-child(1) {
    transform: translateY(-8px);
}

.hamburger-menu span:nth-child(2) {
    transform: translateY(0);
}

.hamburger-menu span:nth-child(3) {
    transform: translateY(8px);
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(0) rotate(45deg);
}

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

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
}

/* Hamburger Dropdown Menu */
.hamburger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 240px;
    z-index: 1000;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.hamburger-dropdown.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}

.menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.menu-item:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-item:active {
    background: var(--bg-tertiary);
}

.header-actions {
    position: relative;
}

#campaign-selection {
    display: none; /* Hidden by default */
}

#main-app {
    display: none;
}

#auth-view {
    display: block; /* Show auth by default */
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#auth-view h2 {
    text-align: center;
    color: var(--text-accent);
    margin-bottom: 20px;
}

#auth-view input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    box-sizing: border-box;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#auth-view input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

#auth-view button {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: var(--button-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#auth-view button:hover {
    background: var(--button-primary-hover);
    transform: translateY(-1px);
}

.auth-toggle {
    text-align: center;
    margin-top: 15px;
    color: #7f8c8d;
}

.auth-toggle a {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
}

.error-message {
    color: #e74c3c;
    padding: 10px;
    margin: 10px 0;
    background: #ffeaea;
    border-radius: 5px;
    display: none;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 10px;
    left: 20px;
    z-index: 1001;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--text-accent);
}

.theme-toggle-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

[data-theme="light"] .theme-toggle-icon {
    transform: rotate(180deg);
}

/* Enhanced theme support for existing components */
#campaign-selection, #main-app {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.campaign-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
}

input, textarea, select {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

button {
    background: var(--button-primary);
    color: white;
    transition: all 0.3s ease;
}

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

.back-btn {
    background: var(--button-danger);
}

.back-btn:hover {
    background: var(--button-danger-hover);
}

.error-message {
    background: var(--bg-card);
    border: 1px solid var(--text-accent);
    color: var(--text-accent);
}

.password-reset-success {
    background: rgba(26, 74, 42, 0.3);
    border: 1px solid #2a6a3a;
    color: #b8e0c8;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 2px;
    font-size: 0.95em;
}

.auth-toggle {
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--text-accent);
}

/* ============================================================================
   LANDING PAGE STYLES
   ============================================================================ */

#landing-page {
    display: block;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo svg {
    flex-shrink: 0;
}

.nav-brand {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.nav-login {
    background: transparent;
    color: var(--text-accent);
    border-color: var(--text-accent);
}

.nav-login:hover {
    background: var(--text-accent);
    color: white;
}

.nav-join {
    background: transparent;
    color: var(--success-color, #27ae60);
    border-color: var(--success-color, #27ae60);
}

.nav-join:hover {
    background: var(--success-color, #27ae60);
    color: white;
    transform: translateY(-1px);
}

.nav-trial {
    background: var(--text-accent);
    color: white;
    border-color: var(--text-accent);
}

.nav-trial:hover {
    background: #e55039;
    border-color: #e55039;
    transform: translateY(-1px);
}

/* Adjust landing header padding to account for nav */
.landing-header {
    padding-top: 20px;
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.landing-header {
    text-align: center;
    padding: 40px 0 60px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
}

.landing-subtitle {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 20px 0 0;
    letter-spacing: 1px;
}

.landing-tagline {
    font-size: 16px;
    color: var(--accent-primary);
    margin: 12px 0 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.features-section {
    margin-bottom: 80px;
}

.features-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: var(--text-accent);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--text-accent);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.pricing-section {
    margin-bottom: 80px;
    text-align: center;
}

.pricing-section h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-accent);
}

.pricing-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

.pricing-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pricing-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 30px;
    width: 300px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px var(--shadow);
}

.pricing-card.featured {
    border-color: var(--text-accent);
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-accent);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.pricing-header h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.price {
    margin-bottom: 10px;
}

.currency {
    font-size: 24px;
    vertical-align: top;
    color: var(--text-secondary);
}

.amount {
    font-size: 48px;
    font-weight: bold;
    color: var(--text-accent);
}

.period {
    font-size: 16px;
    color: var(--text-secondary);
}

.savings {
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 30px 0;
    text-align: left;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-btn {
    width: 100%;
    padding: 15px;
    background: var(--button-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.featured-btn {
    background: var(--text-accent);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.featured-btn:hover {
    background: #e55039;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.guarantee {
    margin-top: 40px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.guarantee p {
    margin: 0;
    color: var(--text-secondary);
}

.cta-section {
    text-align: center;
    padding: 60px 0;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow);
}

.cta-section h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--text-accent);
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-primary, .cta-secondary {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.cta-primary {
    background: var(--text-accent);
    color: white;
    border: 2px solid var(--text-accent);
}

.cta-primary:hover {
    background: #e55039;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.cta-secondary {
    background: transparent;
    color: var(--text-accent);
    border: 2px solid var(--text-accent);
}

.cta-secondary:hover {
    background: var(--text-accent);
    color: white;
    transform: translateY(-3px);
}

/* ============================================
   Building & Room Accordion Styles
   ============================================ */
.building-accordion-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    margin-bottom: 16px;
    overflow: hidden;
}

.building-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary);
    transition: background 0.15s;
}

.building-accordion-header:hover {
    background: var(--bg-tertiary);
}

.building-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.building-name {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.building-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.building-header-actions button {
    font-size: 0.85em;
    padding: 4px 10px;
}

.building-chevron {
    font-size: 0.9em;
    color: var(--text-secondary);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.building-accordion-body {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
}

.rooms-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-accordion-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.room-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.room-accordion-header:hover {
    background: var(--bg-tertiary);
}

.room-num {
    font-weight: bold;
    min-width: 28px;
    text-align: center;
    color: var(--text-accent);
    font-size: 0.95em;
}

.room-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.room-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.room-badge-npc {
    background: #3498db;
    color: white;
}

.room-status-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.room-status-label input[type="checkbox"] {
    cursor: pointer;
}

.room-chevron {
    font-size: 0.8em;
    color: var(--text-secondary);
    min-width: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.room-accordion-body {
    border-top: 1px solid var(--border-color);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.room-detail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.room-notes-preview {
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.15s;
}

.room-notes-preview:hover {
    background: var(--bg-primary);
}

.room-actions-row {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 8px 15px;
    }
    
    .nav-brand {
        font-size: 16px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    .landing-subtitle {
        font-size: 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pricing-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .features-section h2,
    .pricing-section h2,
    .cta-section h2 {
        font-size: 28px;
    }
    
    /* Mobile theme toggle - hide text and center in nav */
    .theme-toggle {
        left: 45%;
        top: .5%;
        transform: translateX(-50%);
        padding: 8px;
    }
    
    #theme-text {
        display: none;
    }
    
    /* Hamburger menu - no overrides needed, base styles handle it */
    
    .hamburger-dropdown {
        right: -10px;
        min-width: 180px;
    }
    
    .menu-item {
        padding: 14px 16px;
        font-size: 16px;
    }
    

    
    /* Header bar improvements for mobile */
    .header-bar {
        position: relative;
    }
    
    .header-actions {
        position: relative;
    }
    
    /* Mobile tab improvements */
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        font-size: 12px;
        padding: 8px 4px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .tab-content {
        padding: 15px 10px;
    }
    
    /* Mobile table improvements */
    table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border: 1px solid var(--border-color);
    }
    
    th, td {
        padding: 4px 6px;
        min-width: 60px;
    }
    
    /* Initiative table specific mobile improvements */
    #initiative-table {
        margin-bottom: 15px;
    }
    
    #initiative-table th:first-child,
    #initiative-table td:first-child {
        min-width: 40px; /* Select column */
    }
    
    #initiative-table th:nth-child(2),
    #initiative-table td:nth-child(2) {
        min-width: 80px; /* Name column */
    }
    
    #initiative-table th:nth-child(3),
    #initiative-table td:nth-child(3),
    #initiative-table th:nth-child(4),
    #initiative-table td:nth-child(4),
    #initiative-table th:nth-child(5),
    #initiative-table td:nth-child(5) {
        min-width: 50px; /* Init, HP, AC columns */
    }
    
    /* Effect columns on mobile - need more space for name + duration + button */
    #initiative-table th:nth-child(n+6),
    #initiative-table td:nth-child(n+6) {
        min-width: 160px;
        font-size: 11px;
    }
    
    /* Desktop effect columns - ensure adequate width */
    @media (min-width: 769px) {
        #initiative-table th:nth-child(n+6),
        #initiative-table td:nth-child(n+6) {
            min-width: 180px;
            font-size: inherit;
        }
    }
    
    /* Make effect inputs smaller on mobile */
    @media (max-width: 768px) {
        .effect-name {
            width: 80px;
            font-size: 0.8em;
        }
        
        .effect-duration {
            width: 35px;
            font-size: 0.8em;
        }
        
        .effect-cell button {
            padding: 1px 4px;
            font-size: 0.7em;
        }
        
        .effect-cell {
            gap: 2px;
        }
        
        .effect-inputs {
            gap: 6px;
        }
    }
    
    /* Form improvements for mobile */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Button improvements */
    button {
        font-size: 12px;
        padding: 6px 10px;
        margin: 2px;
    }
    
    /* Bulk effect container mobile */
    .bulk-effect-container {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .bulk-effect-container input {
        margin: 3px 0;
        width: 100px !important;
    }
    
    /* Mobile card layouts for NPCs and PCs */
    .mobile-card {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .mobile-card h3 {
        margin: 0 0 10px 0;
        color: var(--text-primary);
    }
    
    .mobile-card-stats {
        display: flex;
        gap: 15px;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }
    
    .mobile-card-stat {
        font-size: 12px;
    }
    
    .mobile-card-actions {
        margin-top: 10px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .mobile-card-actions button {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Hide regular tables on mobile for PC/NPC sections */
    #pc-table,
    #npc-table {
        display: none;
    }
    
    /* Mobile container for cards */
    .mobile-cards-container {
        display: block;
    }
    
    /* Responsive text inputs */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    textarea,
    select {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Form sections on mobile */
    .form-section {
        margin-bottom: 20px;
    }
    
    /* Building accordion mobile */
    .building-accordion-header {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .building-header-actions {
        gap: 4px;
    }

    .building-header-actions button {
        font-size: 0.78em;
        padding: 3px 7px;
    }

    .building-accordion-body {
        padding: 10px 12px;
    }

    /* Room accordion mobile */
    .room-accordion-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }

    .room-name {
        min-width: 60%;
    }

    .room-badges {
        order: 10;
    }

    .room-status-label {
        font-size: 0.75em;
    }

    .room-accordion-body {
        padding: 10px;
    }
    
    /* Edit forms mobile */
    .edit-form {
        padding: 15px 10px;
    }
    
    .edit-form .form-group {
        margin-bottom: 15px;
    }
}

/* Desktop-only styles - hide mobile cards on desktop */
@media (min-width: 769px) {
    .mobile-card,
    .mobile-cards-container {
        display: none;
    }
    
    /* Desktop navigation - show desktop elements, hide mobile menu */
    .desktop-only {
        display: inline-block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* Notes System Styling */
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.search-container {
    flex: 1;
    max-width: 400px;
    margin-top: 15px;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-container input::placeholder {
    color: var(--text-secondary);
}

.note-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow);
}

.note-form h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

/* Narrow field widths for compact layout */
.form-group input.field-small {
    width: 80px;
}

.form-group input.field-medium {
    width: 120px;
}

.form-group input.field-large {
    width: 200px;
}

.form-group input.field-half {
    width: 50%;
}

.form-group input.field-quarter {
    width: 25%;
}

.form-group input.field-fifteen {
    width: 15%;
}

.form-group select.field-fifteen {
    width: 15%;
}

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

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

.btn-primary,
.btn-secondary,
.btn-add {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text-accent);
    color: white;
}

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

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-link {
    background: none;
    border: none;
    color: var(--button-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 4px;
}

.btn-link:hover {
    color: var(--button-primary-hover);
    text-decoration: none;
}

.btn-add {
    background: #27ae60;
    color: white;
}

.btn-add:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* Note Accordion Cards */
.note-accordion-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease;
}

.note-accordion-card:hover {
    box-shadow: 0 2px 6px var(--shadow);
}

.note-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.note-accordion-header:hover {
    background: var(--bg-secondary);
    border-radius: 8px;
}

.note-header-info {
    flex: 1;
    min-width: 0;
}

.note-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.note-preview {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.note-date {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.note-chevron {
    font-size: 0.85em;
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

.note-accordion-body {
    padding: 0 15px 15px 15px;
    border-top: 1px solid var(--border-color);
}

.note-content {
    color: var(--text-primary);
    line-height: 1.5;
    margin: 12px 0 10px 0;
    white-space: pre-wrap;
}

.note-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-edit:hover {
    background: #e67e22;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.notes-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.search-results-info {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 15px;
}

.note-highlight {
    background-color: rgba(255, 235, 59, 0.3);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Mobile responsive for notes */
@media (max-width: 768px) {
    .notes-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-container {
        max-width: none;
    }

    .btn-add {
        align-self: center;
    }

    .note-accordion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .note-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .note-preview {
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }
}

/* Role Selection Styles */
.role-option {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 300px;
    flex: 1;
    min-width: 280px;
}

.role-option:hover {
    border-color: var(--button-primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow);
}

.role-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.role-option h3 {
    color: var(--text-primary);
    margin: 15px 0 10px 0;
    font-size: 1.5rem;
}

.role-option p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.role-option .btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .role-option {
        min-width: 100%;
        margin-bottom: 15px;
    }
}

/* Session Interface */
.session-interface {
    position: relative;
    z-index: 1000;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow);
    min-height: 400px;
    width: 90%;
    display: block !important;
}

.session-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.session-header h2 {
    color: var(--text-primary);
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.session-info {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.session-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.leave-session-btn {
    background: var(--button-danger);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.leave-session-btn:hover {
    background: var(--button-danger-hover);
}

.refresh-btn {
    background: var(--button-primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

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

.session-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.player-character-info, .session-chat {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.player-character-info h3, .session-chat h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.session-events {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Rejoin Interface */
.rejoin-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.rejoin-container {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 8px 25px var(--shadow);
    max-width: 400px;
    margin: 20px;
}

.rejoin-container h2 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 20px;
}

.rejoin-container p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.rejoin-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.rejoin-btn {
    background: var(--button-primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

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

.dismiss-btn {
    background: var(--button-danger);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.dismiss-btn:hover {
    background: var(--button-danger-hover);
}

@media (max-width: 768px) {
    .session-content {
        grid-template-columns: 1fr;
    }
    
    .session-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .rejoin-actions {
        flex-direction: column;
    }
    
    .rejoin-btn, .dismiss-btn {
        width: 100%;
    }
}

/* ============================================================================
   CHARACTER DEATH AND REPLACEMENT SYSTEM STYLES
   ============================================================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: var(--bg-tertiary);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--button-danger);
    color: white;
}

.modal-header button.close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-header button.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    background: var(--bg-tertiary);
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

/* Form Styles for Character Replacement */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

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

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Button Styles */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--button-primary);
    color: white;
}

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

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

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

/* Character Status Indicators */
.character-status-dead {
    background: #e74c3c !important;
    color: white !important;
}

.character-status-retired {
    background: #f39c12 !important;
    color: white !important;
}

.character-status-missing {
    background: #95a5a6 !important;
    color: white !important;
}

.character-status-alive {
    background: #27ae60 !important;
    color: white !important;
}

/* Character Replacement History Styles */
.replacement-record {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    transition: transform 0.2s ease;
}

.replacement-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.replacement-record strong {
    color: var(--text-accent);
}

/* ============================================================================
   BULK DAMAGE/HEALING SYSTEM STYLES
   ============================================================================ */

.bulk-damage-container {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.bulk-damage-container strong {
    color: var(--text-primary);
    font-size: 1em;
}

.bulk-damage-container input[type="number"] {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 6px 8px;
}

.bulk-damage-container button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.bulk-damage-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bulk-damage-container label {
    color: var(--text-primary);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Status Indicators */
.unconscious-status {
    background: #8e44ad !important;
    color: white !important;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    margin-left: 5px;
}

.death-saves {
    font-size: 0.7em;
    color: #e74c3c;
    margin-left: 5px;
}

/* Damage History */
.damage-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.damage-history.expanded {
    max-height: 200px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================================
   VIRTUAL TABLETOP STYLES
   ============================================================================ */

.map-management-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.map-controls .form-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.maps-list-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.maps-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
}

.map-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.map-item:hover {
    background: var(--bg-tertiary);
}

.map-item.active {
    background: var(--button-primary);
    color: white;
}

.map-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

.map-info {
    flex: 1;
}

.map-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.map-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.map-details {
    font-size: 0.8em;
    color: var(--text-secondary);
}

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

.btn-map-action {
    padding: 6px 12px;
    font-size: 0.85em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-map-activate {
    background: var(--button-primary);
    color: white;
}

.btn-map-activate:hover {
    background: var(--button-primary-hover);
}

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

.btn-map-edit:hover {
    background: var(--bg-primary);
}

.btn-map-delete {
    background: var(--button-danger);
    color: white;
}

.btn-map-delete:hover {
    background: var(--button-danger-hover);
}

.map-preview {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

/* Tabletop Display */
.tabletop-container {
    margin-top: 30px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.tabletop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Main content area that holds map and token panel */
.tabletop-main-content {
    display: flex;
    flex-wrap: wrap;
    min-height: 400px;
    align-items: stretch;
}

/* On larger screens, display side by side */
@media (min-width: 1200px) {
    .tabletop-main-content {
        flex-wrap: nowrap;
        align-items: stretch;
    }
    
    .map-canvas-container {
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }
    
}

/* On smaller screens, stack vertically */
@media (max-width: 1199px) {
    .tabletop-main-content {
        flex-direction: column;
    }
    
    .map-canvas-container {
        width: 100%;
        border-right: none;
    }
    
}

.tabletop-controls h3 {
    margin: 0;
    color: var(--text-accent);
}

.tabletop-actions {
    display: flex;
    gap: 10px;
}

/* DM Map Fullscreen */
.dm-map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--bg-primary) !important;
    display: flex;
    flex-direction: column;
    border: none !important;
    border-image: none !important;
}

.dm-map-fullscreen .tabletop-controls {
    flex-shrink: 0;
}

.dm-map-fullscreen .tabletop-layout {
    flex: 1;
    overflow: hidden;
}

.dm-map-fullscreen .tabletop-main-content {
    height: 100%;
}

.dm-map-fullscreen .map-canvas-container {
    height: 100% !important;
    max-height: none !important;
}

.dm-map-fullscreen .tabletop-canvas {
    max-height: none !important;
}

.map-canvas-container {
    /* Base positioning and layout */
    position: relative;
    overflow: auto;
    background: var(--bg-primary);
    min-height: 200px;

    /* Flexbox properties for responsive layout */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Border and styling */
    border: 2px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;

    /* Ensure it takes available space properly */
    width: 100%;
    max-width: 100%;
}

.tabletop-canvas {
    display: block;
    cursor: crosshair;
    border: none;
    background: var(--bg-primary) !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#tabletop-canvas {
    background-color: var(--bg-primary) !important;
    /* Touch-friendly interactions */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#player-tabletop-canvas {
    /* Touch-friendly interactions */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Token Management Panel - REMOVED (integrated into sidebar) */

/* Grid Settings Modal */
.grid-settings-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.grid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.grid-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.grid-control-group label {
    font-weight: bold;
    font-size: 0.9em;
}

.grid-control-group input {
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Player View Styles */
.player-tabletop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.player-tabletop-header {
    background: var(--bg-secondary);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.player-tabletop-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.player-canvas-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
}

/* Token Animations */
.token-moving {
    transition: transform 0.3s ease-out;
}

.token-highlight {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
    animation: tokenPulse 1s infinite alternate;
}

@keyframes tokenPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Responsive Design for Maps */
@media (max-width: 768px) {
    .map-management-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tabletop-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .tabletop-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .map-canvas-container {
        max-height: 400px;
    }
    
    .grid-controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Loading States */
.map-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-secondary);
    font-style: italic;
}

.map-error {
    background: var(--button-danger);
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* ============================================================================
   VIRTUAL TABLETOP STYLES
   ============================================================================ */

.tabletop-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.tabletop-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.tabletop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.tabletop-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.tabletop-controls {
    display: flex;
    gap: 10px;
}

.tabletop-controls button {
    padding: 6px 12px;
    font-size: 0.9em;
}

.tabletop-controls button.active {
    background: var(--button-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tabletop-controls button:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tabletop-main {
    display: flex;
    gap: 20px;
}



#map-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.token-panel {
    width: 500px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}

.token-panel h5 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1em;
}

.tokens-list {
    max-height: 400px;
    overflow-y: auto;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 8px;
    background: var(--bg-card);
    cursor: pointer;
}

.token-item:hover {
    background: var(--bg-secondary);
}

.token-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #000;
    flex-shrink: 0;
}

.token-info {
    flex: 1;
}

.token-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.9em;
}

.token-position {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.no-map-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.no-map-message p {
    margin: 0;
    font-size: 1.1em;
}

/* Token selection highlight */
.token-item.selected {
    background: var(--button-primary);
    color: white;
}

.token-item.selected .token-name,
.token-item.selected .token-position {
    color: white;
}

/* Player Tabletop Styles */
.player-tabletop {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
}

.player-tabletop h3 {
    margin: 0;
    padding: 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-accent);
}

.player-tabletop-container {
    display: flex;
    flex-direction: column;
}

.player-tabletop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.player-tabletop-controls h4 {
    margin: 0;
    color: var(--text-primary);
}

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

.player-tabletop-main-content {
    display: flex;
    flex-wrap: wrap;
    min-height: 300px;
    align-items: stretch;
}

.player-map-canvas-container {
    flex: 1;
    min-width: 300px;
    position: relative;
    overflow: auto;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.player-tabletop-canvas {
    display: block;
    cursor: default;
    border: none;
    background: var(--bg-primary);
}

.player-token-panel {
    width: 300px;
    min-width: 250px;
    flex-shrink: 0;
    padding: 15px;
}

/* Player Split Screen Layout */
.player-split-layout {
    display: flex;
    height: 85vh;
    min-height: 600px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.player-map-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
}

.player-sidebar-column {
    width: 420px;
    min-width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow-y: auto;
    padding: 20px;
    gap: 25px;
}

/* Optimize for large screens */
@media (min-width: 1400px) {
    .player-sidebar-column {
        width: 480px;
        min-width: 450px;
    }
}

/* Initiative Display in Split Layout */
.player-sidebar-column .initiative-display {
    flex: 1;
    min-height: 350px;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.player-sidebar-column .initiative-list {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    padding: 12px;
}

.player-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.player-map-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.player-map-controls {
    display: flex;
    gap: 6px;
}

.player-map-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-tabletop-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Player Token Controls */
.player-token-controls {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
}

.player-token-controls h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.token-rotation-section {
    margin-top: 10px;
}

.token-rotation-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rotation-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}

.rotation-help {
    text-align: center;
    color: var(--text-secondary);
}

.rotation-help small {
    font-size: 11px;
}

.btn-rotate {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-width: 50px;
    text-align: center;
}

.btn-rotate:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-accent);
    color: var(--text-accent);
}

.btn-rotate:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 900px) {
    .player-split-layout {
        flex-direction: column;
        height: auto;
        min-height: 700px;
    }
    
    .player-map-column {
        height: 450px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .player-sidebar-column {
        width: auto;
        max-height: 500px;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .player-sidebar-column {
        padding: 10px;
        gap: 15px;
    }
    
    .player-map-column {
        height: 300px;
    }
    
    .rotation-buttons {
        justify-content: space-between;
    }
    
    .btn-rotate {
        flex: 1;
        margin: 2px;
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .rotation-help {
        display: none; /* Hide keyboard shortcuts on mobile */
    }
}

/* Fullscreen Map */
.player-map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--bg-primary) !important;
    flex-direction: column !important;
}

.player-map-fullscreen .player-map-column {
    flex: 1 !important;
    border: none !important;
}

.player-map-fullscreen .player-sidebar-column {
    position: absolute;
    top: 60px;
    right: 0;
    width: 300px;
    height: calc(100vh - 60px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.player-map-fullscreen .player-sidebar-column:hover {
    transform: translateX(0);
}

/* Fullscreen Map Styles */
.player-map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--bg-primary) !important;
}

.player-map-fullscreen .player-map-container {
    height: calc(100vh - 60px) !important;
}

.player-map-fullscreen .player-token-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--border-color);
    padding: 10px 15px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .player-combined-interface {
        flex-direction: column;
    }
    
    .player-map-section {
        height: 400px;
    }
    
    .player-map-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .player-map-actions .btn-secondary,
    .player-map-actions .btn-primary {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .rotation-buttons {
        justify-content: space-between;
    }
    
    .btn-rotate {
        flex: 1;
        margin: 2px;
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .player-tokens-list h5 {
        font-size: 12px;
    }
    
    .rotation-help {
        display: none; /* Hide keyboard shortcuts on mobile */
    }
}

@media (max-width: 480px) {
    .player-map-section {
        height: 300px;
    }
    
    .player-map-header {
        padding: 8px 10px;
    }
    
    .player-map-header h4 {
        font-size: 14px;
    }
    
    .player-token-controls {
        padding: 10px;
    }
    
    .token-rotation-controls label {
        font-size: 11px;
    }
}
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.player-token-panel h5 {
    margin: 0 0 10px 0;
    color: var(--text-accent);
}

.player-token-panel .token-list {
    flex: 1;
    min-height: 200px;
}

/* Responsive layout for player tabletop */
@media (max-width: 900px) {
    .player-tabletop-main-content {
        flex-direction: column;
    }
    
    .player-map-canvas-container {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .player-token-panel {
        width: 100%;
    }
}

/* ============================================================================ */
/* PLAYER NOTE MODAL */
/* ============================================================================ */

#player-note-modal.modal {
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#player-note-modal .modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    margin: 0;
}

#player-note-modal .modal-body {
    max-height: calc(80vh - 160px);
    overflow-y: auto;
}

#player-note-modal .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

#player-note-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#player-note-modal .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 8px 8px;
}

#player-note-modal .form-group {
    margin-bottom: 20px;
}

#player-note-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

#player-note-modal .note-title-input,
#player-note-modal .note-content-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

#player-note-modal .note-title-input:focus,
#player-note-modal .note-content-input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#player-note-modal .note-content-input {
    resize: vertical;
    min-height: 200px;
}

/* ============================================================================ */
/* PLAYER SIDEBAR LAYOUT OPTIMIZATION */
/* ============================================================================ */

/* Prioritize initiative display height in player sidebar */
.player-sidebar-column .initiative-display {
    flex: 3; /* Give initiative more space priority */
    min-height: 400px;
    max-height: none; /* Remove max-height constraint */
    display: flex;
    flex-direction: column;
}

.player-sidebar-column .initiative-list {
    flex: 1;
    overflow-y: auto;
    max-height: none; /* Allow it to grow with container */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    padding: 12px;
}

/* Make player notes compact and non-growing */
.player-sidebar-column .player-notes {
    flex: 0 0 auto; /* Don't grow, use minimal space */
    max-height: 250px; /* Limit notes section height */
    display: flex;
    flex-direction: column;
}

.player-sidebar-column .player-notes-list {
    max-height: 150px; /* Compact notes list */
    overflow-y: auto;
    flex: 1;
}

/* Make character stats and token controls compact */
.player-sidebar-column .character-stats-mini,
.player-sidebar-column .player-token-controls {
    flex: 0 0 auto; /* Don't grow */
}

/* Ensure sidebar uses full height */
.player-split-layout {
    height: calc(100vh - 100px);
}

.player-sidebar-column {
    height: 100%;
    overflow-y: auto;
}

/* ============================================================================ */
/* COMPACT TOKEN CONTROLS */
/* ============================================================================ */

/* Make token controls more compact in sidebar */
.player-sidebar-column .player-token-controls {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.player-sidebar-column .player-token-controls h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-sidebar-column .token-rotation-section {
    margin-top: 0;
}

.player-sidebar-column .token-rotation-section label {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.player-sidebar-column .rotation-buttons {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 0;
}

/* Hide the help text to save space */
.player-sidebar-column .rotation-help {
    display: none;
}

/* Make buttons more compact */
.player-sidebar-column .btn-rotate {
    padding: 4px 6px;
    font-size: 14px;
    min-width: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.player-sidebar-column .btn-rotate:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-accent);
}

/* ============================================================================ */
/* COMPACT CHARACTER STATS */
/* ============================================================================ */

/* Make character stats more compact in sidebar */
.player-sidebar-column .character-stats-mini {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.player-sidebar-column .stat-block {
    gap: 10px;
}

.player-sidebar-column .stat-item {
    gap: 4px;
}

.player-sidebar-column .stat-item label {
    font-size: 11px;
    margin-bottom: 0;
}

.player-sidebar-column .hp-input {
    width: 60px;
    padding: 6px;
    font-size: 14px;
}

.player-sidebar-column .hp-controls {
    gap: 6px;
}

.player-sidebar-column .hp-separator {
    font-size: 14px;
}

.player-sidebar-column .max-hp {
    font-size: 14px;
}

/* ============================================================================ */
/* MAXIMIZE INITIATIVE TRACKER HEIGHT */
/* ============================================================================ */

/* Further increase initiative display height */
.player-sidebar-column .initiative-display {
    flex: 5 1 auto; /* Even higher priority for space */
    min-height: 500px; /* Increased from 400px */
    max-height: none;
    display: flex;
    flex-direction: column;
}

.player-sidebar-column .initiative-display h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    flex-shrink: 0; /* Don't compress the heading */
}

.player-sidebar-column .initiative-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 450px; /* Ensure it's tall */
    max-height: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    padding: 10px;
}

/* Make sure the sidebar gives maximum height to initiative */
.player-sidebar-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px; /* Reduced from 25px */
}

/* Current turn indicator - keep compact */
.player-sidebar-column #player-current-turn {
    flex-shrink: 0;
    padding: 8px;
    margin-top: 8px;
}

/* ============================================================================ */
/* COLLAPSIBLE INITIATIVE SIDEBAR FOR MAP TAB */
/* ============================================================================ */

/* Layout container for map and sidebar */
.tabletop-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 200px);
    position: relative;
    overflow: hidden;
}

/* Main content area (map + tokens) */
.tabletop-layout .tabletop-main-content {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
    transition: margin-right 0.3s ease;
}

/* Initiative sidebar */
.initiative-sidebar {
    width: 630px;
    min-width: 630px;
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 100;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
}

/* Sidebar open state */
.initiative-sidebar.open {
    transform: translateX(0);
}

/* Sidebar header */
.initiative-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.initiative-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

/* Close button in sidebar */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

/* Sidebar content */
.initiative-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0; /* Allow flex child to shrink properly */
}

/* Initiative list in sidebar */
.initiative-sidebar #sidebar-initiative-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    height: auto;
}

/* Make initiative items more compact in sidebar */
.initiative-sidebar .initiative-item {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.initiative-sidebar .initiative-item.current-turn {
    border-color: var(--text-accent);
    background: rgba(74, 144, 226, 0.1);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Sidebar initiative cards (new interactive layout) */
.sidebar-initiative-card {
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.sidebar-initiative-card:hover {
    border-color: var(--text-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-initiative-card.current-turn {
    border-color: var(--text-accent);
    background: rgba(74, 144, 226, 0.1);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.sidebar-initiative-card input[type="number"],
.sidebar-initiative-card input[type="text"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
}

.sidebar-initiative-card input[type="number"]:focus,
.sidebar-initiative-card input[type="text"]:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.sidebar-initiative-card .combatant-select {
    cursor: pointer;
}

.sidebar-initiative-card label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle button active state */
#toggle-initiative-btn.active {
    background: var(--text-accent);
    color: white;
}

/* No initiative message */
.initiative-sidebar .no-initiative {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Sidebar button styling */
.sidebar-btn {
    padding: 6px 8px;
    font-size: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-accent);
}

.sidebar-btn:active {
    transform: translateY(1px);
}

/* Sidebar section containers */
.sidebar-section {
    font-size: 12px;
}

.sidebar-section input[type="number"],
.sidebar-section input[type="text"],
.sidebar-section select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 3px;
}

.sidebar-section input[type="number"]:focus,
.sidebar-section input[type="text"]:focus,
.sidebar-section select:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.sidebar-section input[type="checkbox"] {
    cursor: pointer;
}

/* DM Activity Log Modal */
.dm-activity-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive behavior */
@media (max-width: 1400px) {
    .initiative-sidebar {
        width: 540px;
        min-width: 540px;
    }
}

@media (max-width: 1200px) {
    .initiative-sidebar {
        width: 480px;
        min-width: 480px;
    }
}

/* Tablets and smaller laptops (e.g., 15" laptops at 1366px) */
@media (max-width: 1440px) {
    .initiative-sidebar {
        width: 500px;
        min-width: 500px;
    }

    .tabletop-layout {
        height: calc(100vh - 160px); /* More vertical space on smaller screens */
    }
}

/* Small laptops and tablets (portrait) */
@media (max-width: 1024px) {
    .initiative-sidebar {
        width: 400px;
        min-width: 400px;
    }

    .tabletop-layout {
        height: calc(100vh - 140px);
    }

    .map-canvas-container {
        padding: 10px;
    }
}

/* Mobile: full screen sidebar */
@media (max-width: 900px) {
    .initiative-sidebar {
        width: 100%;
        min-width: 100%;
    }

    .tabletop-layout {
        flex-direction: column;
        height: auto;
    }

    .map-canvas-container {
        height: 60vh;
        min-height: 400px;
    }
}

/* ============================================================================
   SUBSCRIPTION BADGE & PROFILE STYLES
   ============================================================================ */

.subscription-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.subscription-free {
    background: var(--bg-tertiary, #333);
    color: var(--text-secondary, #aaa);
}

.subscription-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.subscription-inactive {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.profile-section {
    margin-bottom: 16px;
}

.profile-section label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary, #aaa);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #fff);
    font-size: 14px;
    box-sizing: border-box;
}

/* ============================================================================
   DICE ROLLER - FAB + PANEL + OVERLAY
   ============================================================================ */

/* Full-page transparent overlay for Fantastic Dice rendering */
#dice-box-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10003;
    pointer-events: none;
}

/* Ensure Fantastic Dice canvas fills container */
#dice-box-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* FAB wrapper - fixed bottom-right (below dice canvas so dice roll over the tray) */
#dice-fab-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* FAB button */
.dice-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    user-select: none;
    touch-action: none;
}

.dice-fab:active {
    cursor: grabbing;
}

.dice-fab:hover {
    box-shadow: 0 6px 16px rgba(192, 57, 43, 0.6);
    transform: scale(1.05);
}

.dice-fab.active {
    transform: rotate(45deg);
}

/* Expanding panel above the FAB */
.dice-fab-panel {
    width: 280px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    background: var(--bg-secondary, #252525);
    border: 1px solid var(--border-color, #444);
    border-radius: 12px;
    margin-bottom: 12px;
    opacity: 0;
    padding: 0 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dice-fab-panel.open {
    max-height: 700px;
    opacity: 1;
    padding: 14px;
}

/* Panel header */
.dice-panel-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
}

/* Dice type selection grid */
.dice-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.dice-type-btn {
    position: relative;
    padding: 8px 4px;
    border: 1px solid var(--border-color, #444);
    border-radius: 8px;
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-align: center;
    font-family: inherit;
    user-select: none;
}

.dice-type-btn:hover {
    background: var(--bg-hover, #333);
    border-color: #c0392b;
}

/* Count badge on dice type button */
.dice-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Pool summary */
.dice-pool-summary {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    text-align: center;
    margin-bottom: 10px;
}

/* Quick roll shortcuts */
.dice-quick-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.dice-quick-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary, #fff);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.dice-quick-btn:hover {
    background: var(--bg-hover, #333);
    border-color: #c0392b;
}

/* Modifier row */
.dice-modifier-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-primary, #fff);
}

.dice-modifier-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #fff);
    font-size: 13px;
    text-align: center;
}

/* Secret roll row */
.dice-secret-row {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    margin-bottom: 10px;
}

.dice-secret-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Dice customization */
.dice-customize-row {
    margin-bottom: 10px;
}

.dice-customize-toggle {
    background: none;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: color 0.2s, border-color 0.2s;
}

.dice-customize-toggle:hover {
    color: var(--text-primary, #fff);
    border-color: var(--text-secondary, #aaa);
}

.dice-customize-panel {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-primary, #1a1a1a);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dice-customize-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dice-customize-field label {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    white-space: nowrap;
}

.dice-customize-field input[type="color"] {
    width: 36px;
    height: 28px;
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    background: none;
    cursor: pointer;
    padding: 2px;
}

.dice-customize-field select {
    flex: 1;
    padding: 4px 6px;
    font-size: 12px;
    background: var(--bg-secondary, #252525);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    cursor: pointer;
}

/* Roll + Clear action buttons */
.dice-action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.dice-roll-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.dice-roll-btn:hover {
    opacity: 0.9;
}

.dice-clear-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color, #444);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.dice-clear-btn:hover {
    background: var(--bg-hover, #333);
}

/* Results display */
.dice-results {
    text-align: center;
    min-height: 40px;
    margin-bottom: 8px;
}

.dice-result-total {
    font-size: 32px;
    font-weight: 700;
    color: #e74c3c;
    line-height: 1.2;
}

.dice-result-breakdown {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    margin-top: 2px;
}

/* Roll history */
.dice-history {
    border-top: 1px solid var(--border-color, #444);
    padding-top: 8px;
}

.dice-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dice-history-clear-btn {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-family: inherit;
}

.dice-history-clear-btn:hover {
    background: var(--bg-hover, #333);
    color: var(--text-primary, #fff);
}

.dice-history-list {
    max-height: 120px;
    overflow-y: auto;
}

.dice-history-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dice-history-expr {
    opacity: 0.7;
}

.dice-history-result {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dice-fab {
        width: 48px;
        height: 48px;
        font-size: 14px;
    }

    .dice-fab-panel {
        width: 260px;
    }

    #dice-fab-wrapper {
        bottom: 12px;
        right: 12px;
    }
}

/* ============================================
   Ivy Border — Fantasy D&D Decorative Borders
   ============================================ */

/* --- Ivy border applied to all major UI elements --- */
.campaign-container,
.campaign-card,
.form-container,
.bulk-effect-section,
.bulk-damage-section,
.bulk-effect-container,
.content-container,
.feature-card,
.pricing-card,
.cta-section,
.guarantee,
.building-accordion-card,
.room-accordion-card,
.note-form,
.rumor-box,
.hamburger-dropdown,
.dice-fab-panel,
.mobile-card,
.modal-content,
table,
.tab-content.active {
    border: 12px solid transparent;
    border-image: url('ivy-border.svg') 30 fill stretch;
    border-radius: 0 !important;
}

/* Header bar gets a bottom-only ivy accent */
.header-bar {
    border-bottom: 3px solid var(--ivy-color) !important;
}

/* --- Hover effects: subtle red glow --- */
.campaign-card:hover,
.feature-card:hover,
.pricing-card:hover,
.building-accordion-card:hover,
.room-accordion-card:hover,
.mobile-card:hover {
    box-shadow: 0 0 12px rgba(139, 26, 26, 0.4), 0 4px 15px var(--shadow);
}

/* Featured pricing card keeps ivy border but with glow */
.pricing-card.featured {
    box-shadow: 0 0 20px rgba(139, 26, 26, 0.5);
}

/* --- Fix inner elements that inherit border-radius --- */
.building-accordion-header,
.room-accordion-header,
.modal-header {
    border-radius: 0 !important;
}

/* Modal header uses ivy-colored bottom border */
.modal-header {
    border-bottom-color: var(--ivy-color);
}

/* --- Accordion body top border uses ivy color --- */
.building-accordion-body {
    border-top-color: var(--ivy-color);
}

/* --- Table ivy adjustments --- */
table {
    margin-bottom: 20px;
}

th, td {
    border-color: var(--ivy-color);
}

/* Active table row glow uses ivy color */
tr.active-turn td {
    box-shadow: 0 0 5px var(--ivy-color-light);
}

/* --- Tab styling with ivy accents --- */
.tabs {
    border-bottom: 2px solid var(--ivy-color);
}

.tab-button.active {
    border-bottom: 3px solid var(--ivy-color);
}

/* --- Landing page refinements --- */
.landing-header {
    border-bottom-color: var(--ivy-color);
}

/* --- Dice FAB panel with ivy border --- */
.dice-fab-panel.open {
    border: 12px solid transparent;
    border-image: url('ivy-border.svg') 30 fill stretch;
    border-radius: 0 !important;
}

/* --- Mobile: thinner ivy borders to save space --- */
@media (max-width: 768px) {
    .campaign-container,
    .campaign-card,
    .form-container,
    .bulk-effect-section,
    .bulk-damage-section,
    .bulk-effect-container,
    .content-container,
    .feature-card,
    .pricing-card,
    .cta-section,
    .guarantee,
    .building-accordion-card,
    .room-accordion-card,
    .note-form,
    .rumor-box,
    .hamburger-dropdown,
    .dice-fab-panel,
    .mobile-card,
    .modal-content,
    table,
    .tab-content.active {
        border-width: 8px;
        border-image: url('ivy-border.svg') 30 fill stretch;
    }
}

/* ============================================
   Initiative Tracker — Fantasy Theme
   ============================================ */

/* Section heading */
.init-heading {
    color: #e8d5b7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
}

/* Combat controls panel */
.init-combat-controls {
    margin-bottom: 15px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%);
    border: 1px solid var(--ivy-color);
    border-radius: 0;
}

.init-round-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.init-round-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.init-round-num {
    font-size: 1.2em;
    font-weight: bold;
    color: #f0e0c8;
    text-shadow: 0 0 6px rgba(139, 26, 26, 0.5);
}

.init-turn-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.init-turn-indicator {
    font-size: 1.1em;
    font-weight: bold;
    margin-right: 15px;
    color: #f0e0c8;
}

.init-hint {
    color: #9a8a7a;
    font-size: 0.85em;
}

/* --- Initiative buttons --- */
.init-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%);
    color: #e8d5b7;
    border: 1px solid var(--ivy-color);
    border-radius: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.init-btn:hover {
    background: linear-gradient(180deg, #4a2222 0%, #3a1616 100%);
    border-color: var(--ivy-color-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(139, 26, 26, 0.4);
    transform: translateY(-1px);
    color: #f0e0c8;
}

.init-btn:active {
    background: linear-gradient(180deg, #2a0e0e 0%, #1e0808 100%);
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Advance / Next Round — green-tinted */
.init-btn-advance {
    background: linear-gradient(180deg, #1a4a2a 0%, #0e2a18 100%);
    color: #b8e0c8;
    border-color: #2a6a3a;
}

.init-btn-advance:hover {
    background: linear-gradient(180deg, #2a5a3a 0%, #1a3a22 100%);
    border-color: #3a8a4a;
    box-shadow: 0 0 10px rgba(42, 106, 58, 0.5);
}

/* Reset round — amber */
.init-btn-reset {
    background: linear-gradient(180deg, #5a3a10 0%, #3a2508 100%);
    color: #f0d8a0;
    border-color: #7a5520;
}

.init-btn-reset:hover {
    background: linear-gradient(180deg, #6a4a18 0%, #4a3010 100%);
    border-color: #9a6a28;
    box-shadow: 0 0 10px rgba(180, 120, 40, 0.4);
}

/* Previous turn — muted */
.init-btn-prev {
    background: linear-gradient(180deg, #2a2a2a 0%, #1e1e1e 100%);
    color: #a0988a;
    border-color: #4a4a4a;
}

.init-btn-prev:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #c0b8a8;
    border-color: #5a5a5a;
    box-shadow: 0 0 8px rgba(100, 100, 100, 0.3);
}

/* Next turn — primary action blue-maroon */
.init-btn-next {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%);
    color: #f0e0c8;
    border: 2px solid var(--ivy-color);
    font-weight: bold;
}

.init-btn-next:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%);
    box-shadow: 0 0 15px rgba(139, 26, 26, 0.5);
}

/* Damage button — blood red */
.init-btn-damage {
    background: linear-gradient(180deg, #5a1010 0%, #3a0808 100%);
    color: #f0c0b0;
    border-color: #7a1a1a;
}

.init-btn-damage:hover {
    background: linear-gradient(180deg, #7a1515 0%, #4a0c0c 100%);
    border-color: #9a2020;
    box-shadow: 0 0 10px rgba(160, 30, 30, 0.5);
}

/* Heal button — verdant green */
.init-btn-heal {
    background: linear-gradient(180deg, #1a4a2a 0%, #0e2a18 100%);
    color: #b8e0c8;
    border-color: #2a6a3a;
}

.init-btn-heal:hover {
    background: linear-gradient(180deg, #2a5a3a 0%, #1a3a22 100%);
    border-color: #3a8a4a;
    box-shadow: 0 0 10px rgba(42, 106, 58, 0.5);
}

/* Undo button — gold/amber */
.init-btn-undo {
    background: linear-gradient(180deg, #5a3a10 0%, #3a2508 100%);
    color: #f0d8a0;
    border-color: #7a5520;
}

.init-btn-undo:hover {
    background: linear-gradient(180deg, #6a4a18 0%, #4a3010 100%);
    border-color: #9a6a28;
    box-shadow: 0 0 10px rgba(180, 120, 40, 0.4);
}

/* Add PC/NPC — standard */
.init-btn-add {
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%);
    color: #e8d5b7;
}

/* Danger: Clear All */
.init-btn-danger {
    background: linear-gradient(180deg, #5a1010 0%, #3a0808 100%);
    color: #f0c0b0;
    border-color: #7a1a1a;
}

.init-btn-danger:hover {
    background: linear-gradient(180deg, #7a1515 0%, #4a0c0c 100%);
    border-color: #9a2020;
    box-shadow: 0 0 10px rgba(160, 30, 30, 0.5);
}

/* End Combat — prominent danger */
.init-btn-end-combat {
    background: linear-gradient(180deg, #7a1010 0%, #4a0505 100%);
    color: #f0d0c0;
    border: 2px solid #9a2020;
    font-weight: bold;
    padding: 8px 16px;
}

.init-btn-end-combat:hover {
    background: linear-gradient(180deg, #9a1515 0%, #5a0808 100%);
    border-color: #c03030;
    box-shadow: 0 0 18px rgba(180, 30, 30, 0.6);
}

/* Start Combat — primary call-to-action */
.init-btn-start-combat {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%);
    color: #f0e0c8;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid var(--ivy-color);
    font-size: 1em;
    letter-spacing: 0.5px;
}

.init-btn-start-combat:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%);
    box-shadow: 0 0 20px rgba(139, 26, 26, 0.6);
    transform: translateY(-2px);
}

/* Table action row */
.init-table-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Inline form rows */
.init-inline-form {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Combat Setup Wizard panel */
.init-wizard-panel {
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%);
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid var(--ivy-color);
    border-radius: 0;
}

.init-wizard-title {
    margin: 0 0 10px 0;
    color: #e8d5b7;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.init-wizard-desc {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #9a8a7a;
}

.init-wizard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.init-wizard-select {
    flex: 1;
    min-width: 200px;
}

.init-wizard-hint {
    margin: 10px 0 0 0;
    font-size: 0.85em;
    color: #7a6a5a;
}

/* Manual add section */
.init-manual-add {
    margin-top: 10px;
}

.init-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Divider */
.init-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--ivy-color);
}

/* ============================================
   Fantasy-Themed Buttons
   ============================================ */

/* --- Base button reskin --- */
button {
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%);
    color: #e8d5b7;
    border: 1px solid var(--ivy-color);
    border-radius: 2px;
    font-family: inherit;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

button:hover {
    background: linear-gradient(180deg, #4a2222 0%, #3a1616 100%);
    border-color: var(--ivy-color-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(139, 26, 26, 0.4);
    transform: translateY(-1px);
    color: #f0e0c8;
}

button:active {
    background: linear-gradient(180deg, #2a0e0e 0%, #1e0808 100%);
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* --- Primary action buttons (blue → deep maroon) --- */
#auth-view button,
.nav-trial,
.rejoin-btn,
.cta-primary {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%);
    color: #f0e0c8;
    border: 2px solid var(--ivy-color);
    border-radius: 2px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 3px 8px rgba(0, 0, 0, 0.4);
}

#auth-view button:hover,
.nav-trial:hover,
.rejoin-btn:hover,
.cta-primary:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%);
    border-color: var(--ivy-color-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 15px rgba(139, 26, 26, 0.5);
    transform: translateY(-2px);
}

/* --- Secondary / outline buttons --- */
.nav-login,
.cta-secondary {
    background: transparent;
    color: #e8d5b7;
    border: 2px solid var(--ivy-color);
    border-radius: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.nav-login:hover,
.cta-secondary:hover {
    background: rgba(139, 26, 26, 0.2);
    border-color: var(--ivy-color-light);
    color: #f0e0c8;
    box-shadow: 0 0 10px rgba(139, 26, 26, 0.3);
}

/* --- Danger buttons (delete, back, dismiss) --- */
.back-btn,
.dismiss-btn,
button[onclick*="delete"],
button[onclick*="Delete"],
button[onclick*="remove"],
button[onclick*="Remove"] {
    background: linear-gradient(180deg, #5a1010 0%, #3a0808 100%);
    color: #f0c0b0;
    border: 1px solid #7a1a1a;
}

.back-btn:hover,
.dismiss-btn:hover,
button[onclick*="delete"]:hover,
button[onclick*="Delete"]:hover,
button[onclick*="remove"]:hover,
button[onclick*="Remove"]:hover {
    background: linear-gradient(180deg, #7a1515 0%, #4a0c0c 100%);
    border-color: #9a2020;
    box-shadow: 0 0 10px rgba(160, 30, 30, 0.4);
}

/* --- Success buttons (save, confirm, join) --- */
.nav-join,
.btn-save,
button[onclick*="save"],
button[onclick*="Save"],
button[onclick*="confirm"],
button[onclick*="Confirm"] {
    background: linear-gradient(180deg, #1a4a2a 0%, #0e2a18 100%);
    color: #b8e0c8;
    border: 1px solid #2a6a3a;
}

.nav-join:hover,
.btn-save:hover,
button[onclick*="save"]:hover,
button[onclick*="Save"]:hover,
button[onclick*="confirm"]:hover,
button[onclick*="Confirm"]:hover {
    background: linear-gradient(180deg, #2a5a3a 0%, #1a3a22 100%);
    border-color: #3a8a4a;
    box-shadow: 0 0 10px rgba(42, 106, 58, 0.4);
    color: #d0f0d8;
}

/* --- Session button (accent) --- */
.session-btn {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%);
    color: #f0e0c8;
    border: 1px solid var(--ivy-color);
    border-radius: 2px;
}

.session-btn:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%);
    box-shadow: 0 0 10px rgba(139, 26, 26, 0.4);
}

/* --- Tab buttons --- */
.tab-button {
    background: linear-gradient(180deg, #2a1a1a 0%, #1e0e0e 100%);
    color: #c0a888;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: linear-gradient(180deg, #3a2222 0%, #2a1414 100%);
    color: #e8d5b7;
    transform: none;
}

.tab-button.active {
    background: linear-gradient(180deg, #4a2828 0%, #3a1a1a 100%);
    color: #f0e0c8;
    border-bottom: 3px solid var(--ivy-color);
    box-shadow: inset 0 -2px 4px rgba(139, 26, 26, 0.2);
}

/* --- Cancel / muted buttons --- */
.btn-cancel {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #b0a898;
    border: 1px solid #555;
}

.btn-cancel:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
    color: #d0c8b8;
}

/* --- Small utility buttons (copy, add note) --- */
.btn-copy,
.btn-add-note {
    border-radius: 2px;
}

.btn-add-note {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%);
    border: 1px solid var(--ivy-color);
}

.btn-add-note:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%);
}

/* --- Bulk damage section buttons --- */
.bulk-damage-section button {
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%);
    color: #e8d5b7;
    border: 1px solid var(--ivy-color);
    border-radius: 2px;
}

.bulk-damage-section button:hover {
    background: linear-gradient(180deg, #4a2222 0%, #3a1616 100%);
    border-color: var(--ivy-color-light);
}

/* --- Active turn buttons (keep readable) --- */
.active-turn button {
    background: linear-gradient(180deg, #e8d5b7 0%, #d0c0a0 100%) !important;
    color: #2a0e0e !important;
    border: 1px solid var(--ivy-color) !important;
    text-shadow: none !important;
}

.active-turn button:hover {
    background: linear-gradient(180deg, #f0e0c8 0%, #e0d0b0 100%) !important;
}

/* --- Hamburger menu stays minimal --- */
.hamburger-menu {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.hamburger-menu:hover {
    background: none !important;
    box-shadow: none !important;
    transform: scale(1.1);
}

.hamburger-menu:active {
    background: none !important;
}

/* Light theme: header + hamburger contrast */
[data-theme="light"] .header-bar {
    background: #f0e0c8;
    color: #2a0e0e;
    border-bottom-color: var(--ivy-color) !important;
}

[data-theme="light"] .header-bar h1 {
    color: #2a0e0e;
}

[data-theme="light"] .hamburger-menu span {
    background: #2a0e0e;
}

/* --- Ensure sharp corners on all buttons --- */
button,
.nav-btn,
.cta-primary,
.cta-secondary,
.back-btn,
.session-btn,
.rejoin-btn,
.dismiss-btn,
.btn-save,
.btn-cancel,
.btn-sm {
    border-radius: 2px !important;
}

/* ============================================
   Fantasy-Themed Utility Button Classes
   (.btn-primary, .btn-secondary, .btn-danger,
    .btn-add, .btn-link — used across Maps tab,
    tabletop controls, modals, etc.)
   ============================================ */

.btn-primary,
.btn-secondary,
.btn-add {
    border-radius: 2px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

/* Primary — deep maroon CTA */
.btn-primary {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%) !important;
    color: #f0e0c8 !important;
    border: 2px solid var(--ivy-color) !important;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #8b1a1a 0%, #5a1212 100%) !important;
    border-color: var(--ivy-color-light) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 12px rgba(139, 26, 26, 0.5) !important;
    transform: translateY(-1px);
}

/* Secondary — dark neutral */
.btn-secondary {
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%) !important;
    color: #e8d5b7 !important;
    border: 1px solid var(--ivy-color) !important;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #4a2222 0%, #3a1616 100%) !important;
    border-color: var(--ivy-color-light) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(139, 26, 26, 0.4) !important;
    transform: translateY(-1px);
}

/* Danger — blood red */
.btn-danger {
    background: linear-gradient(180deg, #5a1010 0%, #3a0808 100%);
    color: #f0c0b0;
    border: 1px solid #7a1a1a;
    border-radius: 2px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #7a1515 0%, #4a0c0c 100%);
    border-color: #9a2020;
    box-shadow: 0 0 12px rgba(160, 30, 30, 0.5);
    transform: translateY(-1px);
}

/* Add — forest green */
.btn-add {
    background: linear-gradient(180deg, #1a4a2a 0%, #0e2a18 100%) !important;
    color: #b8e0c8 !important;
    border: 1px solid #2a6a3a !important;
}

.btn-add:hover {
    background: linear-gradient(180deg, #2a5a3a 0%, #1a3a22 100%) !important;
    border-color: #3a8a4a !important;
    box-shadow: 0 0 10px rgba(42, 106, 58, 0.4) !important;
}

/* Link buttons — parchment-colored underline */
.btn-link {
    color: #c09070 !important;
    text-shadow: none;
}

.btn-link:hover {
    color: #e8d5b7 !important;
}

/* ============================================
   Maps Tab & Tabletop — Fantasy Overrides
   ============================================ */

/* Map management containers */
.maps-list-container,
.map-controls .form-container {
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%) !important;
    border: 1px solid var(--ivy-color) !important;
    border-radius: 0 !important;
}

.maps-list {
    border-color: var(--ivy-color) !important;
    border-radius: 0 !important;
    background: #1a1210 !important;
}

.map-item {
    border-bottom-color: rgba(139, 26, 26, 0.3);
}

.map-item:hover {
    background: rgba(139, 26, 26, 0.1);
}

/* Tabletop controls bar */
.tabletop-controls {
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%) !important;
    border-bottom-color: var(--ivy-color) !important;
}

.tabletop-controls h3 {
    color: #e8d5b7 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Tabletop container */
.tabletop-container {
    border: 1px solid var(--ivy-color);
    border-radius: 0;
}

/* No map message */
.no-map-message {
    color: #9a8a7a;
}

/* Map preview image */
.map-preview {
    border-color: var(--ivy-color) !important;
    border-radius: 0 !important;
}

/* Tabletop controls active/inactive button states */
.tabletop-controls button.active {
    background: linear-gradient(180deg, #6b1515 0%, #4a0e0e 100%) !important;
    color: #f0e0c8 !important;
    border: 1px solid var(--ivy-color) !important;
    box-shadow: 0 0 8px rgba(139, 26, 26, 0.4);
}

.tabletop-controls button:not(.active) {
    background: linear-gradient(180deg, #2a1a1a 0%, #1e0e0e 100%) !important;
    color: #a09080 !important;
    border: 1px solid rgba(139, 26, 26, 0.4) !important;
}

.tabletop-controls button:not(.active):hover {
    background: linear-gradient(180deg, #3a2222 0%, #2a1414 100%) !important;
    color: #e8d5b7 !important;
}

/* Maps search input */
.maps-search-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid var(--ivy-color);
    border-radius: 0;
    background: #1a1210;
    color: var(--text-primary);
}

.maps-search-input:focus {
    outline: none;
    border-color: var(--ivy-color-light);
    box-shadow: 0 0 8px rgba(139, 26, 26, 0.3);
}

/* ============================================
   Admin Dashboard
   ============================================ */

.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h2 {
    margin: 0;
    color: #e8d5b7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Metrics grid */
.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.admin-metric-card {
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%);
    border: 1px solid var(--ivy-color);
    padding: 20px;
    text-align: center;
}

.metric-value {
    font-size: 2em;
    font-weight: bold;
    color: #f0e0c8;
    text-shadow: 0 0 8px rgba(139, 26, 26, 0.4);
}

.metric-label {
    font-size: 0.85em;
    color: #9a8a7a;
    margin-top: 5px;
}

/* Users section */
.admin-users-section {
    margin-bottom: 25px;
}

.admin-users-section h3 {
    color: #e8d5b7;
    margin-bottom: 10px;
}

.admin-search-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid var(--ivy-color);
    border-radius: 0;
    background: #1a1210;
    color: var(--text-primary);
    margin-bottom: 15px;
    box-sizing: border-box;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--ivy-color-light);
    box-shadow: 0 0 8px rgba(139, 26, 26, 0.3);
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%);
    border: 1px solid var(--ivy-color);
}

.admin-users-table th {
    background: linear-gradient(180deg, #3a1a1a 0%, #2a0e0e 100%);
    color: #e8d5b7;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--ivy-color);
}

.admin-users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 26, 26, 0.2);
    color: var(--text-primary);
    font-size: 0.9em;
}

.admin-users-table tr:hover td {
    background: rgba(139, 26, 26, 0.1);
}

/* Badges */
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 2px;
}

.admin-badge-free {
    background: rgba(100, 100, 100, 0.3);
    color: #a0988a;
    border: 1px solid #555;
}

.admin-badge-paid {
    background: rgba(139, 26, 26, 0.3);
    color: #f0c0b0;
    border: 1px solid var(--ivy-color);
}

.admin-badge-active {
    background: rgba(26, 74, 42, 0.3);
    color: #b8e0c8;
    border: 1px solid #2a6a3a;
}

.admin-badge-inactive {
    background: rgba(90, 16, 16, 0.3);
    color: #f0b0a0;
    border: 1px solid #7a1a1a;
}

/* User detail panel */
.admin-user-detail {
    background: linear-gradient(180deg, #1e1210 0%, #2a1814 100%);
    border: 2px solid var(--ivy-color);
    padding: 20px;
    margin-top: 20px;
}

.admin-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ivy-color);
}

.admin-detail-header h3 {
    margin: 0;
    color: #e8d5b7;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.admin-detail-field {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(139, 26, 26, 0.2);
}

.admin-detail-field label {
    display: block;
    font-size: 0.75em;
    color: #9a8a7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.admin-detail-field span {
    color: #e8d5b7;
    font-size: 0.9em;
    word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
