/* Guild Global Theme Styles */
/* Component-specific layout styles live in Svelte <style> blocks */

/* Design Tokens */
:root {
    /* Core palette */
    --color-bg-deep: #0f0f23;
    --color-bg-purple: #2d1b69;
    --color-gold: #ffd700;
    --color-gold-dim: rgba(255, 215, 0, 0.3);
    --color-gold-border: rgba(255, 215, 0, 0.5);

    /* Text */
    --color-text-primary: #f0f0f0;
    --color-text-secondary: #e0e0e0;
    --color-text-muted: #d0d0d0;
    --color-text-dim: #c0c0c0;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-bg-active: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    --glass-border-strong: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(10px);

    /* Modal overlay */
    --modal-bg: rgba(45, 27, 105, 0.95);
    --modal-overlay: rgba(0, 0, 0, 0.5);

    /* Shadows */
    --shadow-text: 1px 1px 2px rgba(0, 0, 0, 0.8);
    --shadow-text-light: 1px 1px 2px rgba(0, 0, 0, 0.6);
    --shadow-text-heavy: 2px 2px 4px rgba(0, 0, 0, 0.8);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-photo: 0 4px 12px rgba(0, 0, 0, 0.4);

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;

    /* Transitions */
    --transition-base: all 0.3s ease;
}

/* Global link styling – gold on purple for readability */
a {
    color: var(--color-gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ffffff;
}

/* Top navigation bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(45, 27, 105, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 45px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.top-nav .nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.top-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

.top-nav .nav-link.active {
    border-bottom: 2px solid #ffd700;
    padding-bottom: calc(0.5rem - 2px);
}

/* Base guild styling */
.guild-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d1b69 0%, #0f0f23 100%);
    font-family: 'Arial', sans-serif;
    color: #e0e0e0;
    line-height: 1.6;
}

.guild-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
    text-align: center;
}

.full-width-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
    text-align: center;
}

.hex-map-container {
    width: 100%;
    height: calc(100vh - 60px);
}

/* Guild name/title styling */
.guild-name {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    color: #f0f0f0;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 3rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    color: #f0f0f0;
}

/* Guild heraldry/sigil styling */
.heraldry {
    margin: 2rem 0;
}

.heraldry img {
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Guild content styling */
.guild-content {
    font-size: 1.2rem;
    color: #d0d0d0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    margin: 2rem 0;
}

.lore-content {
    font-size: 1.1rem;
    color: #d0d0d0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.lore-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.welcome-content p {
    margin-bottom: 1.5rem;
}

/* Guild greeting styling */
.greeting {
    font-size: 1.5rem;
    font-style: italic;
    margin: 2rem 0;
    color: #c0c0c0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.tagline {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: #d0d0d0;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Guild navigation styling */
.navigation {
    margin-top: 3rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    text-decoration: none;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

/* Guild form styling */
.registration-form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #f0f0f0;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: #a0a0a0;
    opacity: 0.8;
}

.form-submit {
    width: 100%;
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    margin-top: 1rem;
}

.form-submit:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Page header (title + back button) */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Filter bar — shared layout + styling for list-view filter forms.
   Rendered by cotsv/templates/bicolline/includes/filter_bar.html. */
.filter-bar {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.filter-bar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.filter-bar__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-shadow: var(--shadow-text);
    margin: 0;
}

.filter-bar__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-bar__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.filter-bar__field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-bar__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
    text-shadow: var(--shadow-text);
}

.filter-bar__field input[type="text"],
.filter-bar__field input[type="search"],
.filter-bar__field input[type="number"],
.filter-bar__field select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.filter-bar__field input[type="text"]:focus,
.filter-bar__field input[type="search"]:focus,
.filter-bar__field input[type="number"]:focus,
.filter-bar__field select:focus {
    outline: none;
    border-color: var(--color-gold-border);
    background: var(--glass-bg-hover);
}

.filter-bar__field select option {
    background: var(--color-bg-deep);
    color: var(--color-text-primary);
}

.filter-bar__field input[type="checkbox"] {
    width: auto;
    margin-right: 0.25rem;
}

.filter-bar__errors {
    color: #ff9a9a;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.filter-bar__active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.filter-bar__active-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-right: 0.25rem;
}

.filter-bar__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    background: var(--glass-bg-hover);
    border: 1px solid var(--glass-border-strong);
    border-radius: 999px;
    text-decoration: none;
    transition: var(--transition-base);
}

.filter-bar__badge:hover {
    background: var(--glass-bg-active);
    border-color: var(--color-gold-dim);
    color: var(--color-text-primary);
    text-decoration: none;
}

.filter-bar__apply {
    /* Inherits from .btn-action; kept separate hook for future tweaks. */
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

/* Pagination */
.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-nav__info {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Detail fields (label/value grid replacing Bootstrap row/col) */
.detail-fields {
    display: grid;
    grid-template-columns: minmax(120px, 25%) 1fr;
    gap: 0;
    text-align: left;
    margin-bottom: 1rem;
}

.detail-fields dt {
    padding: 0.4rem 0;
    font-weight: 600;
    color: var(--color-text-primary);
    text-shadow: var(--shadow-text);
}

.detail-fields dd {
    padding: 0.4rem 0;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .detail-fields {
        grid-template-columns: 1fr;
    }

    .detail-fields dt {
        padding-bottom: 0;
        font-weight: 700;
    }

    .detail-fields dd {
        padding-top: 0;
        margin-bottom: 0.5rem;
    }
}

/* Back button */
.btn-back {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-sm);
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-base);
}

.btn-back:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Primary action button */
.btn-action {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-bg-deep);
    background: var(--color-gold);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-base);
}

.btn-action:hover {
    background: #fff;
    color: var(--color-bg-deep);
    text-decoration: none;
}

/* Guild table */
.guild-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--color-text-secondary);
}

.guild-table thead th {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    font-weight: 600;
    text-shadow: var(--shadow-text);
    border-bottom: 2px solid var(--color-gold-dim);
    padding: 0.5rem;
    text-align: left;
}

.guild-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.guild-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.guild-table td a {
    color: var(--color-gold);
    text-decoration: none;
    transition: var(--transition-base);
}

.guild-table td a:hover {
    color: #fff;
    text-decoration: underline;
}

.guild-table--compact td,
.guild-table--compact th {
    padding: 0.25rem 0.5rem;
}

/* Guild card */
.guild-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.guild-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    text-shadow: var(--shadow-text);
}

/* Guild alert */
.guild-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    position: relative;
}

.guild-alert--error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.guild-alert--info {
    background: rgba(100, 149, 237, 0.15);
    border: 1px solid rgba(100, 149, 237, 0.3);
    color: #6495ed;
}

.guild-alert--success {
    background: rgba(107, 207, 127, 0.15);
    border: 1px solid rgba(107, 207, 127, 0.3);
    color: #6bcf7f;
}

.guild-alert--warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.guild-alert .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.guild-alert .close-btn:hover {
    opacity: 1;
}

/* Guild badge */
.guild-badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
}

.guild-badge--success {
    background: rgba(40, 167, 69, 0.3);
    color: #6bcf7f;
}

.guild-badge--warning {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.guild-badge--danger {
    background: rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

.guild-badge--secondary {
    background: var(--glass-bg);
    color: var(--color-text-muted);
}

.guild-badge--primary {
    background: var(--color-gold-dim);
    color: var(--color-gold);
}

/* Guild form elements */
.guild-form-label {
    color: var(--color-text-primary);
    font-weight: 600;
    text-shadow: var(--shadow-text);
    margin-bottom: 0.25rem;
    display: block;
}

.guild-form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    padding: 0.5rem;
}

.guild-form-select:focus {
    outline: none;
    border-color: var(--color-gold-border);
    box-shadow: 0 0 0 2px var(--color-gold-dim);
}

.guild-form-select option {
    background: var(--color-bg-purple);
    color: var(--color-text-secondary);
}

/* Entrance layout (auth pages) */
.entrance-layout {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Utility classes */
.u-text-center { text-align: center; }
.u-text-end { text-align: right; }
.u-text-muted { color: var(--color-text-muted); text-shadow: var(--shadow-text-light); }
.u-w-full { width: 100%; }
.u-m-0 { margin: 0; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-3 { margin-bottom: 1rem; }
.u-mb-4 { margin-bottom: 1.5rem; }
.u-flex { display: flex; }
.u-flex-grow { flex-grow: 1; }
.u-flex-wrap { flex-wrap: wrap; }
.u-flex-col { flex: 1; min-width: 280px; }
.u-gap-3 { gap: 1rem; }
.u-gap-4 { gap: 1.5rem; }
.u-items-center { align-items: center; }
.u-items-end { align-items: flex-end; }
.u-justify-center { justify-content: center; }
.u-img-fluid { max-width: 100%; height: auto; }
.u-rounded { border-radius: var(--radius-sm); }

/* Error and success messaging */
.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(255, 107, 107, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #ff6b6b;
}

.general-error {
    margin: 1rem auto;
    max-width: 500px;
    font-size: 1rem;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 107, 107, 0.15);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
}

.success-greeting {
    color: #6bcf7f;
    font-weight: bold;
}

.inviter-highlight {
    color: #f0f0f0;
    font-weight: bold;
    font-size: 1.3rem;
}

/* Role Squircles */
.member-roles {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.role-squircle {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000;
    text-shadow: none;
    line-height: 1;
}

/* Geopo Index Cards */
.geopo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    text-align: left;
}

.geopo-card {
    display: block;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    transition: var(--transition-base);
}

.geopo-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
}

.geopo-card h5 {
    color: var(--color-text-primary);
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: var(--shadow-text);
}

.geopo-card p {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 0.95rem;
    text-shadow: var(--shadow-text-light);
}

.guild-detail-title {
    margin-bottom: 0.5rem;
}

.guild-identity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.guild-detail-logo {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.entity-list-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Guild Detail Header */
.guild-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.guild-stats {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 1rem 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    flex-shrink: 0;
}

.guild-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.guild-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-text-primary);
    text-shadow: var(--shadow-text);
}

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

/* Guild Notes (collapsible) */
.guild-notes {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    backdrop-filter: var(--glass-blur);
}

.guild-notes summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-gold);
    text-shadow: var(--shadow-text);
    list-style: none;
}

.guild-notes summary::-webkit-details-marker {
    display: none;
}

.guild-notes summary::before {
    content: "\25B6";
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.guild-notes[open] summary::before {
    transform: rotate(90deg);
}

.guild-notes-body {
    padding: 0 1.5rem 1.25rem;
    color: var(--color-text-muted);
    text-shadow: var(--shadow-text-light);
    line-height: 1.7;
}

/* Resource production charts */
.resource-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.resource-chart {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    min-height: 360px;
}

.resource-chart canvas {
    max-width: 100%;
}

/* Province Cards */
.province-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    text-align: left;
}

.province-card h4 {
    margin: 0 0 1rem;
}

.province-card h4 a {
    color: var(--color-gold);
    text-decoration: none;
    text-shadow: var(--shadow-text);
    font-weight: 600;
}

.province-card h4 a:hover {
    color: #fff;
    text-decoration: underline;
}

.province-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.province-card ul li {
    padding: 0.3rem 0;
}

.province-card ul li a {
    color: var(--color-gold);
    text-decoration: none;
    transition: var(--transition-base);
}

.province-card ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Domaine Grid inside Province Cards */
.domaine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* Territory Nesting */
.territory-level {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--glass-border);
    margin-top: 0.75rem;
}

.territory-level h5 {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: var(--shadow-text);
}

.territory-level h5 a {
    color: var(--color-gold);
    text-decoration: none;
}

.territory-level h5 a:hover {
    color: #fff;
    text-decoration: underline;
}

.territory-level h6 {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: var(--shadow-text);
}

.territory-level h6 a {
    color: var(--color-gold);
    text-decoration: none;
}

.territory-level h6 a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Guild Title Labels (GitLab-style) */
.guild-title-label {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 10px;
    background: var(--color-gold-dim);
    color: var(--color-gold);
    border: 1px solid var(--color-gold-border);
    vertical-align: middle;
    text-decoration: none;
}

a.guild-title-label:hover {
    background: var(--color-gold-border);
    color: #fff;
    text-decoration: none;
}

/* Domaine Detail Header */
.domaine-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.domaine-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.domaine-header > a {
    position: absolute;
    right: 0;
}

.guild-label-logo {
    height: 1em;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 0.25rem;
    border-radius: 2px;
}

/* Sortable Table Headers */
table.sortable thead th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.25em;
}

table.sortable thead th::after {
    content: "\2195";
    position: absolute;
    right: 0.4em;
    opacity: 0.3;
    font-size: 0.8em;
}

table.sortable thead th.sort-asc::after {
    content: "\25B2";
    opacity: 0.9;
}

table.sortable thead th.sort-desc::after {
    content: "\25BC";
    opacity: 0.9;
}

/* Character Cards */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem;
    text-align: center;
}

.character-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    transition: var(--transition-base);
}

.character-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
}

.character-card-photo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-photo);
}

.character-detail-photo {
    max-height: 300px;
}

.character-detail-role-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.character-card-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed var(--glass-border-strong);
}

.character-card-role-icon {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg-purple);
    box-shadow: var(--shadow-photo);
}

.character-card-guild-icon {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg-purple);
    box-shadow: var(--shadow-photo);
    background: var(--glass-bg);
}

.character-card-religion-icon {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg-purple);
    box-shadow: var(--shadow-photo);
    background: var(--glass-bg);
}

.character-detail-religion-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.region-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.region-breakdown-table th,
.region-breakdown-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.region-breakdown-table th {
    color: var(--color-gold);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.region-breakdown-table tr.clickable-row {
    cursor: pointer;
    transition: var(--transition-base);
}

.region-breakdown-table tr.clickable-row:hover {
    background: var(--glass-bg-hover);
}

.region-breakdown-table td a {
    color: var(--color-text-primary);
    text-decoration: none;
    display: block;
    width: 100%;
}

.character-card-name {
    position: relative;
    z-index: 1;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: var(--shadow-text);
    margin-bottom: 0.25rem;
}

/* Hierarchy tree: High Priest on top, vertical dotted line, Cleric below */
.hierarchy-tree {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
}

.hierarchy-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hierarchy-connector {
    width: 2px;
    height: 40px;
    border-left: 2px dotted var(--glass-border-strong, rgba(255, 255, 255, 0.25));
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive design - global theme adjustments */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .top-nav .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .guild-container {
        padding: 4rem 1rem 2rem;
    }

    .full-width-container {
        padding: 4rem 1rem 2rem;
    }

    .guild-name {
        font-size: 2rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .heraldry img {
        max-width: 300px;
    }

    .guild-content {
        font-size: 1rem;
    }

    .lore-content {
        font-size: 1rem;
    }

    .lore-content p {
        text-align: left;
    }

    .greeting {
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .navigation {
        gap: 1rem;
    }

    .nav-link {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .registration-form {
        margin: 1.5rem auto;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .form-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .error-message {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .general-error {
        margin: 1rem;
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .guild-header {
        flex-direction: column;
    }

    .guild-stats {
        width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Info tooltip for resource output explanation */
.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--color-gold, #c8a84e);
    margin-left: 0.25rem;
    vertical-align: middle;
}

.info-tooltip .info-tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--color-bg-dark, #1a1a2e);
    border: 1px solid var(--color-gold, #c8a84e);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    color: #ddd;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus .info-tooltip-content {
    display: block;
}

/* Head-to-Head comparison */
.h2h-table {
    table-layout: fixed;
}

.h2h-table th:first-child,
.h2h-table td:first-child {
    width: 25%;
}

.h2h-table th:nth-child(2),
.h2h-table td:nth-child(2) {
    width: 50%;
}

.h2h-table th:last-child,
.h2h-table td:last-child {
    width: 25%;
}

.h2h-winner {
    background: rgba(40, 167, 69, 0.25) !important;
}

.h2h-section-header td {
    font-weight: bold;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--glass-border-strong);
    padding-top: 1rem;
    color: var(--color-gold);
}

.h2h-metric-label .h2h-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.h2h-metric-label .h2h-delta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.h2h-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.h2h-spinner-icon {
    width: 48px;
    height: 48px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: h2h-spin 0.8s linear infinite;
}

@keyframes h2h-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Building detail page */
.building-art-placeholder {
    width: 200px;
    height: 200px;
    background: var(--card-bg, #2a2a2a);
    border: 1px dashed var(--border-color, #555);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.85rem;
}
