.scry-go-btn:active {
    background: linear-gradient(135deg, #5fa6e6 0%, #7bbcff 100%);
    color: #0a1830;
    box-shadow: 0 1px 4px rgba(120,180,255,0.18);
    transform: scale(0.97);
}

/* Admin: Yellow highlight for events with title/description issues */
.event-issue-highlight {
    background-color: #fffacd;
    border-left: 4px solid #ffeb3b;
    padding-left: 12px;
    margin-left: -16px;
    padding-right: 0;
    margin-right: 0;
}
@media (max-width: 600px) {
    .filter-controls,
    .filter-controls.loading-message {
        min-height: 110px !important;
    }
}
@media (max-width: 600px) {
    .mk-loading-animated {
        display: block;
        text-align: center;
        margin: 0 auto;
    }
}
/* Keep filter bar height stable during loading */
.filter-controls.loading-message {
    min-height: 126.8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Animated loading text for Mage Knight */
.mk-loading-animated {
    display: inline-block;
    font-weight: bold;
    letter-spacing: 1.5px;
    font-size: 1.18em;
    background: linear-gradient(90deg, #d4af37 0%, #e6d3b3 20%, #7bbcff 40%, #d4af37 60%, #e6d3b3 80%, #7bbcff 100%);
    background-size: 600% 100%;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: mk-loading-gradient 0.6s linear infinite;
}

@keyframes mk-loading-gradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.filter-controls.scrying-active .filter-btn:not(.active):not(:disabled):hover {
    background: linear-gradient(135deg, #2d2520 0%, #1f1915 100%) !important;
    border-color: #5a4a3a !important;
    color: #111 !important;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}
.scry-go-btn:disabled {
    background: #b2b8c2 !important;
    color: #6a6e7a !important;
    border: none !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: grayscale(0.25) brightness(0.95);
    transition: background 0.2s, color 0.2s, border 0.2s, opacity 0.2s, filter 0.2s;
}
.scry-icon-btn-pressed {
    box-shadow: 0 0 0 3px #ffd70099, 0 2px 8px rgba(120,180,255,0.08);
    background: #225c3a !important;
    outline: none;
    border: 2px solid #ffd700 !important;
    color: #ffd700;
    filter: brightness(1.08);
    transition: box-shadow 0.18s, background 0.18s, border 0.18s;
}

.scry-icon-btn-pressed .scry-icon-img {
    max-width: 38px;
    max-height: 38px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 1px 4px rgba(120,180,255,0.10);
    background: #fff8;
    position: relative;
    z-index: 1;
}
/* Timeline line goes behind filter controls when not scrying */
.timeline-line {
    z-index: 0;
}
.filter-controls {
    position: relative;
    z-index: 2;
}
.timeline-container {
    border-radius: 22px;
    /* overflow: hidden; Only enable when scrying for glow effect */
    transition: border-radius 0.2s;
    position: relative;
}
.timeline-bg-wrapper.scrying-active .timeline-container {
    overflow: hidden;
}

/* Allow timeline line to extend above the container visually */
.timeline-container::before {
    display: none;
}
.timeline-container.show-top-line::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -60px;
    width: 6px;
    height: 60px;
    background: linear-gradient(to bottom, #8b7355 0%, #d4af37 50%, #8b7355 100%);
    transform: translateX(-50%);
    z-index: 0;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4), inset 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}
/* Green glow for timeline container while scrying */
.timeline-bg-wrapper.scrying-active .timeline-container {
    box-shadow: 0 0 48px 12px rgba(120,255,180,0.22), 0 0 0 4px rgba(120,255,180,0.10);
    background: linear-gradient(135deg, rgba(120,255,180,0.13) 0%, rgba(120,255,180,0.08) 100%) !important;
    transition: box-shadow 0.5s, background 0.5s;
}
/* Soft green glow background for timeline page while scrying */
.timeline-bg-wrapper.scrying-active {
    background: radial-gradient(ellipse at 50% 20%, rgba(120,255,180,0.18) 0%, rgba(120,255,180,0.08) 60%, transparent 100%) !important;
    transition: background 0.5s;
}
.timeline-bg-wrapper {
    transition: background 0.5s;
}
/* While scrying, make all filter button text black for clarity */
.filter-controls.scrying-active .filter-btn {
    color: #111 !important;
}
/* Disabled filter buttons: dark, muted, not clickable */
.filter-btn:disabled {
    background: #b2b8c2 !important;
    color: #6a6e7a !important;
    border-color: #a0a4b0 !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: grayscale(0.25) brightness(0.95);
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s, opacity 0.2s, filter 0.2s;
}
/* SCRY ICON GRID */
.scry-icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 18px 0 22px 0;
    justify-items: center;
}
.scry-icon-btn {
    background: #18402a;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: background 0.18s, border 0.18s, box-shadow 0.18s;
    font-size: 1.08rem;
    color: #1a2340;
    min-width: 0;
    min-height: 0;
    box-shadow: 0 2px 8px rgba(120,180,255,0.08);
    position: relative;
    overflow: visible;
}
.scry-icon-btn:hover, .scry-icon-btn:focus {
    background: rgba(120,180,255,0.22);
    border-color: #7bbcff;
    outline: none;
}
.scry-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
}
.scry-icon-label {
    font-size: 0.92rem;
    opacity: 0.85;
}
.scry-icon-img {
    display: block;
    max-width: 38px;
    max-height: 38px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 1px 4px rgba(120,180,255,0.10);
    background: #fff8;
    position: relative;
    z-index: 1;
}
.scry-input-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
    align-items: center;
}
.scry-input {
    flex: 1 1 0;
    min-width: 120px;
    max-width: 220px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid #7bbcff;
    font-size: 1.08rem;
    background: rgba(255,255,255,0.7);
    color: #1a2340;
    outline: none;
    box-shadow: 0 1px 4px rgba(120,180,255,0.08);
}
.scry-go-btn {
    background: linear-gradient(135deg, #7bbcff 0%, #b3d6ff 100%);
    color: #1a2340;
    border: none;
    border-radius: 8px;
    padding: 8px 22px;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(120,180,255,0.10);
    transition: background 0.18s, color 0.18s;
}
.scry-go-btn:hover, .scry-go-btn:focus {
    background: linear-gradient(135deg, #b3d6ff 0%, #7bbcff 100%);
    color: #0a1830;
}
/* SCRY MODAL STYLES */
.scry-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 80, 200, 0.18);
    z-index: 1001;
}
.scry-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}
.scry-modal-content {
    background: linear-gradient(135deg, rgba(20,40,80,0.78) 0%, rgba(10,60,40,0.62) 100%);
    /* fallback for old browsers */
    background-color: rgba(20,40,80,0.78);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(30,80,200,0.18), 0 2px 8px rgba(0,0,0,0.10);
    padding: 32px 28px 24px 28px;
    min-width: 260px;
    max-width: 420px;
    width: 96vw;
    min-height: 120px;
    color: #e3eaff;
    position: relative;
    text-align: center;
    font-size: 1.18rem;
    font-family: 'Georgia', serif;
    transition: max-width 0.2s, width 0.2s;
}

@media (max-width: 600px) {
    .scry-modal-content {
        min-width: 0;
        max-width: 96vw;
        width: 96vw;
        padding: 10px 2vw 14px 2vw;
    }
    .scry-icon-grid {
        gap: 8px;
    }
}
.scry-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #1a2340;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 1;
}
.scry-modal-close:hover {
    opacity: 1;
}
/* SCRY button: vivid green, faint glow, more visible */
/* SCRY button: pale transparent green background, subtle border, less text glow */
/* SCRY button base style */
.filter-btn.scry-btn, .filter-row:last-child .filter-btn.scry-btn {
    background: linear-gradient(135deg, rgba(120,255,180,0.32) 0%, rgba(120,255,180,0.19) 100%) !important;
    border: 2px solid rgba(60,255,120,0.22) !important;
    color: #3cff78 !important;
    box-shadow: 0 0 8px 1px rgba(60,255,120,0.10) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: 0 0 2px #3cff78 !important;
    transition: background 0.2s, border 0.2s, color 0.2s, box-shadow 0.2s !important;
}

.filter-btn.scry-btn.scrying-active, .filter-row:last-child .filter-btn.scry-btn.scrying-active {
    background: linear-gradient(135deg, #3cff78 0%, #baffd7 100%) !important;
    border: 2.5px solid #3cff78 !important;
    color: #1a2340 !important;
    box-shadow: 0 0 18px 4px #3cff78, 0 0 8px 1px rgba(60,255,120,0.18) !important;
    text-shadow: 0 0 8px #3cff78, 0 0 2px #baffd7 !important;
    opacity: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 1.5px;
    filter: brightness(1.15) saturate(1.2);
    transition: background 0.2s, border 0.2s, color 0.2s, box-shadow 0.2s, filter 0.2s !important;
}
/* Optional: On hover, slightly increase opacity (if not disabled) */
.filter-btn.scry-btn:not(:disabled):hover, .filter-row:last-child .filter-btn.scry-btn:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(120,255,180,0.45) 0%, rgba(120,255,180,0.28) 100%) !important;
    border-color: #3cff78 !important;
    color: #baffd7 !important;
    opacity: 1 !important;
    box-shadow: 0 0 14px 3px rgba(60,255,120,0.18) !important;
    text-shadow: 0 0 4px #3cff78 !important;
}
.filter-row:last-child .filter-btn {
    border-radius: 999px;
    min-width: 120px;
    max-width: 260px;
    width: auto;
    height: 38px;
    padding-left: 22px;
    padding-right: 22px;
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-align: center;
    justify-content: center;
    align-items: center;
    display: flex;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .filter-btn {
        font-size: 1.15rem;
    }
}
@media (max-width: 900px) {
    .filter-row:first-child .filter-btn {
        min-height: 48px;
        height: 48px;
        align-items: center;
        display: flex;
        justify-content: center;
        line-height: 1.2;
        padding-top: 0;
        padding-bottom: 0;
    }
}
@media (max-width: 900px) {
    .filter-row {
        flex-wrap: wrap;
    }
    .filter-row:first-child .filter-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    .filter-row:last-child .filter-btn {
        flex: 0 0 auto;
        width: auto;
    }
}
/* Diagonal 'Coming Soon!' banner for disabled menu buttons */
.coming-soon-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-24deg);
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}
.coming-soon-banner span {
    display: inline-block;
    color: #e53935;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px #fff, 0 0 2px #fff;
    background: rgba(255,255,255,0.55);
    border-radius: 12px;
    padding: 0.18em 0.5em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
@media (max-width: 600px) {
    .coming-soon-banner span {
        font-size: 1.2rem;
        padding: 0.12em 0.3em;
    }
}
/* Image-based menu buttons for Menu.razor */
.menu-img-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    gap: 2.2rem;
}

.menu-img-btn {
    position: relative;
    width: 92vw;
    max-width: 420px;
    height: 120px;
    border: 3px solid #d4af37;
    padding: 0;
    background: none;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.18s;
    margin: 0;
    display: block;
}
.menu-img-btn:active:not(:disabled) {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.menu-img-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
.menu-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    filter: brightness(0.92) contrast(1.08);
    transition: filter 0.18s, box-shadow 0.18s;
    display: block;
    box-shadow: 0 0 0 3px #d4af37, 0 2px 8px rgba(0,0,0,0.13);
}
.menu-img-btn:disabled .menu-img {
    filter: grayscale(0.7) brightness(0.7) contrast(0.9);
}
.menu-img-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
    font-size: 2.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 2.5px;
    /* Removed text-stroke for better cross-browser consistency */
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0px  2px 4px #000;
    background: none;
    padding: 0.5em 1.2em;
    border-radius: 14px;
    letter-spacing: 1.5px;
    /* text-shadow removed */
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}
@media (max-width: 600px) {
    .menu-img-btn {
        height: 110px;
        max-width: 98vw;
        border-radius: 12px;
        border-width: 2px;
    }
    .menu-img {
        border-radius: 12px;
    }
    .menu-img-label {
        font-size: 1.6rem;
        padding: 0.4em 0.9em;
        border-radius: 10px;
    }
    .menu-img-btn-container {
        gap: 2.2rem;
    }
}

.boardgame-settings-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: 1rem;
}

.boardgame-settings-page h1 {
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px #000;
    margin: 0;
}

.boardgame-settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 92vw;
    max-width: 420px;
}

.boardgame-settings-btn {
    width: 100%;
    min-height: 120px;
    border: 3px solid #d4af37;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0px  2px 4px #000;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.18s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
}

.boardgame-settings-btn:not(:disabled):active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.boardgame-settings-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.selected-mage-knight-content {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.2rem;
}

.selected-mage-knight-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    object-fit: cover;
    background: #111;
}

.mk-picker-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mk-picker-modal-content {
    width: min(760px, 95vw);
    max-height: 90vh;
    overflow: auto;
    border: 3px solid #d4af37;
    border-radius: 18px;
    background: #111;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 1rem;
}

.mk-picker-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.mk-picker-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.mk-picker-close-btn {
    border: 2px solid #d4af37;
    background: transparent;
    color: #fff;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    font-size: 1.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mk-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.mk-picker-option-btn {
    border: 2px solid #d4af37;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 0.4rem;
    min-height: 140px;
}

.mk-picker-option-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    object-fit: cover;
    background: #111;
}

@media (max-width: 900px) {
    .mk-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .boardgame-settings-btn {
        min-height: 110px;
        font-size: 1.6rem;
    }
}
.modal-content.age-theme-breaking {
    background: linear-gradient(135deg, #2a0845 0%, #003c3c 100%);
    color: #d1c4e9;
    border-color: #2a0845;
}
.modal-content.age-theme-breaking .modal-header h2 {
    color: #b39ddb;
}
.modal-content.age-theme-breaking .modal-body {
    color: #d1c4e9;
}

.modal-content.age-theme-mageknights {
    background: linear-gradient(135deg, #4a1010 0%, #1976a7 100%);
    color: #d0e6f7;
    border-color: #4a1010;
}
.modal-content.age-theme-mageknights .modal-header h2 {
    color: #90caf9;
}
.modal-content.age-theme-mageknights .modal-body {
    color: #d0e6f7;
}
/* Age 7: The Breaking (Modal) */
.age-theme-breaking .modal-content {
    background: linear-gradient(135deg, #2a0845 0%, #003c3c 100%);
    color: #d1c4e9;
    border-color: #2a0845;
}
.age-theme-breaking .modal-content h2 {
    color: #b39ddb;
}

/* Age 8: Age of Mage Knights (Modal) */
.age-theme-mageknights .modal-content {
    background: linear-gradient(135deg, #4a1010 0%, #1976a7 100%);
    color: #d0e6f7;
    border-color: #4a1010;
}
.age-theme-mageknights .modal-content h2 {
    color: #90caf9;
}
/* Age 8: Age of Mage Knights (Dark Red & Light Blue Theme) */
.age-theme-mageknights {
    color: #e3f2fd;
}
.age-theme-mageknights .timeline-content,
.age-theme-mageknights .timeline-content.banner {
    background: linear-gradient(135deg, #4a1010 0%, #1976a7 100%);
    border-color: #1976a7;
    color: #d0e6f7;
    box-shadow: 0 4px 16px rgba(74,16,16,0.22), 0 0 24px rgba(25,118,167,0.15);
}
.age-theme-mageknights .timeline-marker {
    background: radial-gradient(circle, #6d1818 0%, #1976a7 100%);
    border-color: #4a1010;
}
.age-theme-mageknights .timeline-content h3 {
    color: #90caf9;
}
/* Age 7: The Breaking (Purple & Teal Theme) */
.age-theme-breaking {
    color: #e0e7ff;
    border-bottom: none;
}
.age-theme-breaking .timeline-content,
.age-theme-breaking .timeline-content.banner {
    background: linear-gradient(135deg, #2a0845 0%, #003c3c 100%);
    border-color: transparent;
    color: #d1c4e9;
    box-shadow: 0 4px 24px rgba(42,8,69,0.35), 0 0 32px rgba(0,60,60,0.18);
}
.age-theme-breaking .timeline-marker {
    background: radial-gradient(circle, #4b2067 0%, #005959 100%);
    border-color: #2a0845;
}
.age-theme-breaking .timeline-content h3 {
    color: #b39ddb;
}
/* Hero Banner Side Images (fade into center) */
.hero-banner {
    position: relative;
    overflow: hidden;
}

.hero-banner-side {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28vw;
    min-width: 90px;
    max-width: 400px;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: stretch;
}
.hero-banner-side.left {
    left: 0;
    justify-content: flex-start;
    /* Fade rightwards */
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
}
.hero-banner-side.right {
    right: 0;
    justify-content: flex-end;
    /* Fade leftwards */
    mask-image: linear-gradient(to left, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 70%, transparent 100%);
}
.hero-banner-side img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: cover;
    display: block;
}
.hero-banner-content {
    position: relative;
    z-index: 2;
}

@media (max-width: 900px) {
    .hero-banner-side {
        width: 32vw;
        min-width: 48px;
        max-width: 120px;
    }
    .hero-side-image {
        display: none !important;
    }
}
/* Footer Bar Styles */
.site-footer {
    width: 100%;
    position: static;
    left: unset;
    bottom: unset;
    z-index: 100;
}
.footer-bar {
    width: 100%;
    background: #222;
    color: #e0d5c7;
    text-align: center;
    padding: 10px 0;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
}
/* DEBUG: Force filter-controls bar visible and horizontal */
/* .filter-controls {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100vw !important;
    min-height: 60px !important;
    position: relative !important;
} */


/* @media (max-width: 900px) {
    .hero-side-image img {
        max-width: 120px;
        max-height: 80px;
    }
} */

@media (max-width: 900px) {
    .hero-banner-row {
        gap: 4px; /* Bring side images in tight */
        padding: 0 4px;
        margin-bottom: 28px;
    }
    .hero-side-image {
        width: 48px;
        height: 48px;
    }
    .hero-logo {
        width: 90px;
        height: 32px;
        min-width: 90px;
        min-height: 32px;
        max-width: 90px;
        max-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }
    .hero-logo img {
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }
    .hero-banner-content {
        padding-top: 24px;
    }
}
 
/* .hero-banner-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    width: 100%;
    margin-bottom: 12px;
}  */
/* Ensure Kastali signature always uses Dancing Script font */
.kastali-signature {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 2em;
    margin-bottom: 0;
}
.kastali-signature-svg text {
    font-family: 'Alex Brush', cursive !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    font-size: 48px !important;
    fill: #222 !important;
}
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Timeline Styles - Fantasy War Gaming Theme */
body {
    background: #1a1410;
    color: #e0d5c7;
}

body.modal-open {
    overflow: hidden;
}

.hero-banner {
    text-align: center;
    padding: 65px 20px 45px;
    background: linear-gradient(135deg, #2d1810 0%, #1a0f0a 50%, #0a0604 100%),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="50" opacity="0.03">⚔</text></svg>');
    color: #d4af37;
    margin-bottom: 0;
    border-bottom: 3px solid #8b7355;
    box-shadow: inset 0 -50px 100px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.hero-banner-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
        padding: 10px 20px 10px 20px;
    margin-bottom: 12px;
    height: 100%;
    max-height: 100%;
    color: #d4af37;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.hero-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 320px;
}

.hero-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
}


/* FINAL hero-side-image rules: mobile first, then desktop override */
.hero-side-image {
    position: relative;
    flex: 0 0 auto;
    height: 175px;
    max-height: 175px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-side-image img {
    position: relative;
    z-index: 1;
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: none;
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}
.hero-side-image img:hover {
    transform: scale(1.05);
}
.hero-side-image::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90%;
    height: 90%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    z-index: 0;
    pointer-events: none;
    filter: blur(18px);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(139,115,85,0.18) 60%, transparent 100%);
}
.hero-logo {
    width: 400px;
    height: 132px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 115, 85, 0.03) 2px,
        rgba(139, 115, 85, 0.03) 4px
    );
    pointer-events: none;
}

.hero-logo {
    margin-bottom: 20px;
    display: inline-block;
}

.hero-logo img {
    max-width: 462px;
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    display: block;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6))
            drop-shadow(0 0 30px rgba(212, 175, 55, 0.4));
}

.hero-logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8))
            drop-shadow(0 0 40px rgba(212, 175, 55, 0.5));
}

.hero-banner h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #c0c0c0 40%, #808080 60%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Georgia', serif;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.hero-banner p {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 20px 10px 20px;
    margin-bottom: 0;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(87, 87, 87, 0.65) 0%, rgba(32, 32, 32, 0.75) 100%);
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.filter-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.filter-btn {
    background: linear-gradient(135deg, #2d2520 0%, #1f1915 100%);
    border: 2px solid #5a4a3a;
    color: #b8a898;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    font-family: 'Georgia', serif;
}

/* Restore hover effect for deselected filter buttons */
.filter-btn:not(.active):not(:disabled):hover {
    background: linear-gradient(135deg, #3a2e25 0%, #2a211b 100%);
    border-color: #d4af37;
    color: #e6d3b3;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.18), 0 2px 8px rgba(0,0,0,0.18);
}


.filter-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #8b7355 100%);
    border-color: #d4af37;
    color: #1a0f0a;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(212, 175, 55, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #e5c047 0%, #9b8365 100%);
    transform: translateY(-2px);
}

.no-events-message {
    text-align: center;
    padding: 60px 20px;
    color: #8b7355;
    font-size: 1.2rem;
}

.no-events-message p {
    margin: 10px 0;
}

.no-events-message p:first-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #d4af37;
}

.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 60px auto;
    padding: 40px 20px;
    background: radial-gradient(ellipse at center, #2a1f1a 0%, #1a1410 70%);
}

.timeline-line {
    position: absolute;
    width: 6px;
    background: linear-gradient(to bottom, 
        #8b7355 0%, 
        #d4af37 50%, 
        #8b7355 100%);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4),
                inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.timeline-item {
    display: flex;
    margin-bottom: 50px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    z-index: 1;
}

.timeline-item:hover {
    transform: scale(1.03);
}

.timeline-item.left {
    justify-content: flex-end;
    padding-right: calc(50% + 35px);
}

.timeline-item.right {

    .timeline-item.banner {
        justify-content: flex-start;
        padding-left: 50px;
        padding-right: 0;
    }
    justify-content: flex-start;
    padding-left: calc(50% + 35px);
}

.timeline-item.banner {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.timeline-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, #d4af37 0%, #8b7355 70%);
    border: 4px solid #2d1810;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    top: 20px;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3),
                0 0 20px rgba(212, 175, 55, 0.5),
                inset 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.timeline-item.age-header .timeline-marker {
    display: none;
}

.timeline-content {
    background: linear-gradient(135deg, #2d2520 0%, #1f1915 100%);
    padding: 25px;
    border-radius: 4px;
    border: 2px solid #5a4a3a;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(212, 175, 55, 0.1);
    max-width: 420px;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-content.banner {
    max-width: 900px;
    width: calc(100% - 120px);
}

/* Major events: stronger than events/diary, but below Age banners */
.timeline-item.major-event-banner,
.timeline-item.major-diary-banner {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin: 28px 0;
}

.timeline-item.major-event-banner .timeline-content,
.timeline-item.major-diary-banner .timeline-content {
    max-width: 820px;
    width: calc(100% - 120px);
    border-width: 2px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55),
                inset 0 1px 0 rgba(212, 175, 55, 0.08);
    padding-right: 88px;
}

.timeline-item.major-diary-banner .timeline-content {
    background: linear-gradient(135deg, #f0e2bf 0%, #e0c97f 100%);
    border-color: #c4a860;
}

.timeline-item.major-event-banner .timeline-content h3,
.timeline-item.major-diary-banner .timeline-content h3 {
    font-size: 1.25em;
}

.timeline-item.major-event-banner .timeline-marker,
.timeline-item.major-diary-banner .timeline-marker {
    width: 24px;
    height: 24px;
}

/* Diary Entry - Parchment and Ink styling */
.timeline-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%);
    border: 2px solid #c4a860;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 0 30px rgba(139, 115, 85, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Paper texture lines */
.timeline-content.diary-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 115, 85, 0.03) 2px,
            rgba(139, 115, 85, 0.03) 4px
        );
    pointer-events: none;
    border-radius: 2px;
}

.timeline-content.diary-entry .timeline-year {
    color: #2a2a2a;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.timeline-content.diary-entry h3 {
    color: #1a1a1a;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.timeline-content.diary-entry p {
    color: #2a2a2a;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.timeline-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.age-group {
    position: relative;
}

.age-group .timeline-line {
    top: -25px;
    bottom: -25px;
}

.age-group.first .timeline-line {
    top: -200px;
}

.age-group .timeline-content {
    border-color: #6a5a4a;
}


.age-theme-mists .timeline-content {
    background: linear-gradient(135deg, #d6dde6 0%, #b9c6d6 100%);
    border-color: #9fb1c4;
}

.age-theme-mists .timeline-year,
.age-theme-mists .age-toggle {
    color: #2a3a4a;
}

.age-theme-mists .timeline-content h3 {
    color: #1f2a34;
    text-shadow: none;
}

.age-theme-mists .timeline-content p {
    color: #2f3c4a;
}

.age-theme-mists .timeline-marker {
    background: radial-gradient(circle, #d6dde6 0%, #9fb1c4 70%);
}

.age-theme-battle .timeline-content {
    background: linear-gradient(135deg, #3b1e1a 0%, #26120f 100%);
    border-color: #b45a46;
}

.age-theme-battle .timeline-year,
.age-theme-battle .age-toggle {
    color: #d98b77;
}

.age-theme-battle .timeline-marker {
    background: radial-gradient(circle, #d98b77 0%, #b45a46 70%);
}

.age-theme-princes .timeline-content {
    background: linear-gradient(135deg, #243049 0%, #1a2234 100%);
    border-color: #6f8fbf;
}

.age-theme-princes .timeline-year,
.age-theme-princes .age-toggle {
    color: #b9c9e6;
}

.age-theme-princes .timeline-marker {
    background: radial-gradient(circle, #b9c9e6 0%, #6f8fbf 70%);
}

.age-theme-tezla .timeline-content {
    background: linear-gradient(135deg, #203a37 0%, #152421 100%);
    border-color: #4aa08e;
}

.age-theme-tezla .timeline-year,
.age-theme-tezla .age-toggle {
    color: #9fd6c9;
}

.age-theme-tezla .timeline-marker {
    background: radial-gradient(circle, #9fd6c9 0%, #4aa08e 70%);
}

/* Timeline line colors per age */
.age-theme-mists .timeline-line {
    background: linear-gradient(to bottom, #9fb1c4 0%, #d6dde6 50%, #9fb1c4 100%);
    box-shadow: 0 0 10px rgba(159, 177, 196, 0.4);
}

.age-theme-battle .timeline-line {
    background: linear-gradient(to bottom, #b45a46 0%, #d87a66 50%, #b45a46 100%);
    box-shadow: 0 0 10px rgba(180, 90, 70, 0.4);
}

.age-theme-princes .timeline-line {
    background: linear-gradient(to bottom, #6f8fbf 0%, #b9c9e6 50%, #6f8fbf 100%);
    box-shadow: 0 0 10px rgba(111, 143, 191, 0.4);
}

.age-theme-tezla .timeline-line {
    background: linear-gradient(to bottom, #4aa08e 0%, #9fd6c9 50%, #4aa08e 100%);
    box-shadow: 0 0 10px rgba(74, 160, 142, 0.4);
}

.age-theme-chaos .timeline-content {
    background: linear-gradient(135deg, #2a1f16 0%, #1a120a 100%);
    border-color: #b87333;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8),
                0 0 20px rgba(184, 115, 51, 0.3);
}

.age-theme-chaos .timeline-year,
.age-theme-chaos .age-toggle {
    color: #d4af37;
}

.age-theme-chaos .timeline-content h3 {
    color: #e8c96f;
}

.age-theme-chaos .timeline-content p {
    color: #c9a55f;
}

.age-theme-chaos .timeline-marker {
    background: radial-gradient(circle, #d4af37 0%, #b87333 70%);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6),
                0 0 22px rgba(184, 115, 51, 0.5);
}

.age-theme-chaos .timeline-line {
    background: linear-gradient(to bottom, #b87333 0%, #d4af37 50%, #b87333 100%);
    box-shadow: 0 0 15px rgba(184, 115, 51, 0.5);
}

/* Age of Power theme (purple and orange palette) */
.age-theme-power .timeline-content {
    background: linear-gradient(135deg, #a259ff 0%, #ff7e2d 100%);
    border-color: #ff7e2d;
    box-shadow: 0 8px 16px rgba(162, 89, 255, 0.3),
                0 0 20px rgba(255, 125, 45, 0.2);
}

.age-theme-power .timeline-year,
.age-theme-power .age-toggle {
    color: #a259ff;
}

.age-theme-power .timeline-content h3 {
    color: #a259ff;
    text-shadow: 0 1px 2px rgba(255, 125, 45, 0.2);
}

.age-theme-power .timeline-content p {
    color: #6a1b9a;
}

.age-theme-power .timeline-marker {
    background: radial-gradient(circle, #a259ff 0%, #ff7e2d 70%);
    box-shadow: 0 0 12px rgba(162, 89, 255, 0.4),
                0 0 22px rgba(255, 125, 45, 0.3);
}

.age-theme-power .timeline-line {
    background: linear-gradient(to bottom, #a259ff 0%, #ff7e2d 50%, #ff7e2d 100%);
    box-shadow: 0 0 15px rgba(162, 89, 255, 0.3);
}

/* Age of Power modal styles */
.modal-content.age-theme-power {
    background: linear-gradient(135deg, #a259ff 0%, #ff7e2d 100%);
    border-color: #ff7e2d;
}
.modal-content.age-theme-power .modal-year,
.modal-content.age-theme-power .modal-header h2 {
    color: #051d80;
}
.modal-content.age-theme-power .modal-body {
    color: #051d80;
}

/* Override age themes for diary entries - higher specificity */
.age-theme-mists .timeline-content.diary-entry,
.age-theme-battle .timeline-content.diary-entry,
.age-theme-princes .timeline-content.diary-entry,
.age-theme-tezla .timeline-content.diary-entry,
.age-theme-chaos .timeline-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 0 30px rgba(139, 115, 85, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.age-theme-power .timeline-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 0 30px rgba(139, 115, 85, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.age-theme-mists .timeline-content.diary-entry .timeline-year,
.age-theme-battle .timeline-content.diary-entry .timeline-year,
.age-theme-princes .timeline-content.diary-entry .timeline-year,
.age-theme-tezla .timeline-content.diary-entry .timeline-year,
.age-theme-chaos .timeline-content.diary-entry .timeline-year {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.age-theme-power .timeline-content.diary-entry .timeline-year {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.age-theme-mists .timeline-content.diary-entry h3,
.age-theme-battle .timeline-content.diary-entry h3,
.age-theme-princes .timeline-content.diary-entry h3,
.age-theme-tezla .timeline-content.diary-entry h3,
.age-theme-chaos .timeline-content.diary-entry h3 {
    color: #1a1a1a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.age-theme-power .timeline-content.diary-entry h3 {
    color: #1a1a1a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.age-theme-mists .timeline-content.diary-entry p,
.age-theme-battle .timeline-content.diary-entry p,
.age-theme-princes .timeline-content.diary-entry p,
.age-theme-tezla .timeline-content.diary-entry p,
.age-theme-chaos .timeline-content.diary-entry p {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.age-theme-power .timeline-content.diary-entry p {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.modal-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%);
    border-color: #c4a860;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7),
                inset 0 0 25px rgba(120, 80, 40, 0.12);
}

.modal-content.age-theme-power.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7),
                inset 0 0 25px rgba(120, 80, 40, 0.12);
}

.modal-content.diary-entry .modal-year {
    color: #2a2a2a;
    text-shadow: none;
}

.modal-content.age-theme-power.diary-entry .modal-year {
    color: #2a2a2a !important;
    text-shadow: none !important;
}

.modal-content.diary-entry .modal-header h2 {
    color: #1a1a1a;
    text-shadow: none;
}

.modal-content.age-theme-power.diary-entry .modal-header h2 {
    color: #1a1a1a !important;
    text-shadow: none !important;
}

.modal-content.diary-entry .modal-body {
    color: #2a2a2a;
}

.modal-content.age-theme-power.diary-entry .modal-body {
    color: #2a2a2a !important;
}

/* Universal DiaryEntry override for all age themes */
[class*='age-theme-'] .timeline-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 0 30px rgba(139, 115, 85, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
[class*='age-theme-'] .timeline-content.diary-entry .timeline-year {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}
[class*='age-theme-'] .timeline-content.diary-entry h3 {
    color: #1a1a1a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}
[class*='age-theme-'] .timeline-content.diary-entry p {
    color: #2a2a2a !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}
[class*='age-theme-'] .modal-content.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7),
                inset 0 0 25px rgba(120, 80, 40, 0.12);
}
[class*='age-theme-'] .modal-content.diary-entry .modal-year {
    color: #2a2a2a !important;
    text-shadow: none !important;
}
[class*='age-theme-'] .modal-content.diary-entry .modal-header h2 {
    color: #1a1a1a !important;
    text-shadow: none !important;
}
[class*='age-theme-'] .modal-content.diary-entry .modal-body {
    color: #2a2a2a !important;
}

/* Age-themed modals */
.modal-content.age-theme-mists {
    background: linear-gradient(135deg, #d6dde6 0%, #b9c6d6 100%);
    border-color: #9fb1c4;
}

.modal-content.age-theme-mists .modal-year {
    color: #2a3a4a;
}

.modal-content.age-theme-mists .modal-header h2 {
    color: #1f2a34;
}

.modal-content.age-theme-mists .modal-body {
    color: #2f3c4a;
}

.modal-content.age-theme-battle {
    background: linear-gradient(135deg, #3b1e1a 0%, #26120f 100%);
    border-color: #b45a46;
}

.modal-content.age-theme-battle .modal-year,
.modal-content.age-theme-battle .modal-header h2 {
    color: #d98b77;
}

.modal-content.age-theme-battle .modal-body {
    color: #e8bdb0;
}

.modal-content.age-theme-princes {
    background: linear-gradient(135deg, #243049 0%, #1a2234 100%);
    border-color: #6f8fbf;
}

.modal-content.age-theme-princes .modal-year,
.modal-content.age-theme-princes .modal-header h2 {
    color: #b9c9e6;
}

.modal-content.age-theme-princes .modal-body {
    color: #d9e6f5;
}

.modal-content.age-theme-tezla {
    background: linear-gradient(135deg, #203a37 0%, #152421 100%);
    border-color: #4aa08e;
}

.modal-content.age-theme-tezla .modal-year,
.modal-content.age-theme-tezla .modal-header h2 {
    color: #9fd6c9;
}

.modal-content.age-theme-tezla .modal-body {
    color: #c9f5ea;
}

.modal-content.age-theme-chaos {
    background: linear-gradient(135deg, #2a1f15 0%, #1a130c 100%);
    border-color: #d4af37;
}

.modal-content.age-theme-chaos .modal-year,
.modal-content.age-theme-chaos .modal-header h2 {
    color: #d4af37;
}

.modal-content.age-theme-chaos .modal-body {
    color: #f0e6d2;
}

/* Diary entries override age themes */
.modal-content.age-theme-mists.diary-entry,
.modal-content.age-theme-battle.diary-entry,
.modal-content.age-theme-princes.diary-entry,
.modal-content.age-theme-tezla.diary-entry,
.modal-content.age-theme-chaos.diary-entry {
    background: linear-gradient(135deg, #f4e8c8 0%, #e8d090 100%) !important;
    border-color: #c4a860 !important;
}

.modal-content.age-theme-mists.diary-entry .modal-year,
.modal-content.age-theme-battle.diary-entry .modal-year,
.modal-content.age-theme-princes.diary-entry .modal-year,
.modal-content.age-theme-tezla.diary-entry .modal-year,
.modal-content.age-theme-chaos.diary-entry .modal-year,
.modal-content.age-theme-mists.diary-entry .modal-header h2,
.modal-content.age-theme-battle.diary-entry .modal-header h2,
.modal-content.age-theme-princes.diary-entry .modal-header h2,
.modal-content.age-theme-tezla.diary-entry .modal-header h2,
.modal-content.age-theme-chaos.diary-entry .modal-header h2 {
    color: #1a1a1a !important;
}

.modal-content.age-theme-mists.diary-entry .modal-body,
.modal-content.age-theme-battle.diary-entry .modal-body,
.modal-content.age-theme-princes.diary-entry .modal-body,
.modal-content.age-theme-tezla.diary-entry .modal-body,
.modal-content.age-theme-chaos.diary-entry .modal-body {
    color: #2a2a2a !important;
}

.age-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.age-header-row .timeline-year {
    margin-bottom: 0;
}

.age-toggle {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(139, 115, 85, 0.25));
    color: #d4af37;
    border: 2px solid #8b7355;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
    position: relative;
}

.age-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 7px;
    pointer-events: none;
}

.age-toggle:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(139, 115, 85, 0.35));
    border-color: #d4af37;
    box-shadow: 
        0 0 15px rgba(212, 175, 55, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #d4af37 0%, transparent 50%, #8b7355 100%);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.timeline-item:hover .timeline-content {
    border-color: #d4af37;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8),
                0 0 30px rgba(212, 175, 55, 0.3),
                inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

.timeline-item:hover .timeline-content::before {
    opacity: 0.15;
}

.timeline-item:hover .timeline-content.diary-entry {
    border-color: #a0826d;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(212, 175, 55, 0.2),
                inset 0 0 30px rgba(139, 115, 85, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.timeline-year {
    color: #d4af37;
    font-weight: bold;
    font-size: 1.3rem;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    font-family: 'Georgia', serif;
}

.timeline-year-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-year-detail {
    color: #e6c98f;
    font-size: 0.95rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.timeline-content.diary-entry .timeline-year-detail {
    color: #6b3f26;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.25);
}

.timeline-content h3 {
    margin: 10px 0;
    color: #e0d5c7;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Georgia', serif;
}

.timeline-content p {
    color: #b8a898;
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
}

.timeline-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 2px;
    margin-top: 15px;
    border: 2px solid #5a4a3a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6),
                inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-thumbnail {
    border-color: #8b7355;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.8),
                0 0 20px rgba(212, 175, 55, 0.2);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 6, 4, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(3px);
    overscroll-behavior: contain;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #2d2520 0%, #1f1915 100%);
    border-radius: 4px;
    border: 3px solid #5a4a3a;
    max-width: 850px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 45px;
    position: relative;
    animation: slideUp 0.3s ease;
    transition: opacity 0.16s ease, transform 0.16s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9),
                0 0 50px rgba(212, 175, 55, 0.2),
                inset 0 1px 0 rgba(212, 175, 55, 0.1);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Webkit browsers */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(26, 21, 16, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(90, 74, 58, 0.7);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 115, 85, 0.9);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    background: rgba(45, 29, 16, 0.8);
    border: 2px solid #5a4a3a;
    cursor: pointer;
    color: #d4af37;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #2d1810;
    border-color: #d4af37;
    color: #fff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.modal-nav-prev,
.modal-nav-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    background: rgba(45, 29, 16, 0.95);
    border: 2px solid #5a4a3a;
    cursor: pointer;
    color: #d4af37;
    line-height: 1;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
    z-index: 10001;
    border-radius: 8px;
    touch-action: manipulation;
}

.modal-nav-prev {
    left: max(16px, calc(50% - 485px));
}

.modal-nav-next {
    right: max(16px, calc(50% - 485px));
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
    background: #2d1810;
    border-color: #d4af37;
    color: #fff;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-50%) scale(1.1);
}


.modal-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #5a4a3a;
    padding-bottom: 20px;
}

.modal-year {
    color: #d4af37;
    font-weight: bold;
    font-size: 1.4rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    font-family: 'Georgia', serif;
}

.modal-year-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-year-detail {
    color: #e6c98f;
    font-size: 1.05rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.modal-content.diary-entry .modal-year-detail {
    color: #6b3f26;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.25);
}

.modal-header h2 {
    margin: 0;
    color: #e0d5c7;
    font-size: 2.3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Georgia', serif;
}

.modal-body {
    color: #c5b8a8;
    line-height: 1.9;
    font-size: 1.1rem;
}

.modal-body p {
    white-space: pre-line;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.modal-gallery img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 2px;
    border: 2px solid #5a4a3a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6),
                inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.modal-gallery img:hover {
    transform: scale(1.05);
    border-color: #8b7355;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8),
                0 0 25px rgba(212, 175, 55, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-banner h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

@media (max-width: 900px) {
    .hero-banner-row {
        gap: 2px; /* Reduce space between logo and hero image */
        /* padding: 8px 8px; */
    }
}

    .hero-logo {
        flex: 0 1 462px;
        min-width: 300px;
        max-width: 462px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }
    .hero-logo img {
        height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        transition: all 0.3s ease;
        display: block;
        filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6))
                drop-shadow(0 0 30px rgba(212, 175, 55, 0.4));
    }

        .filter-controls {
        gap: 8px;
        padding: 8px 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-controls::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        letter-spacing: 0.4px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .filter-btn {
        min-width: 0;
        font-size: 0.75rem;
        padding: 4px 2px;
        white-space: normal;
        flex: 1 1 0;
        max-width: 90px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
        line-height: 1.1;
        height: auto;
    }

    .timeline-line {
        left: 30px;
    }

    .timeline-item.left,
    .timeline-item.right {
        justify-content: flex-start;
        padding-left: 70px;
        padding-right: 20px;
    }

    .timeline-marker {
        left: 30px;
    }

    .timeline-content {
        max-width: 100%;
    }

    .timeline-content.banner {
        width: 100%;
    }
    
    .timeline-item.major-event-banner,
    .timeline-item.major-diary-banner {
        justify-content: flex-start;
        padding-left: 70px;
        padding-right: 20px;
    }
    
    .timeline-item.major-event-banner .timeline-content,
    .timeline-item.major-diary-banner .timeline-content {
        width: 100%;
        max-width: 100%;
    }

    .age-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .age-toggle {
        position: absolute;
        bottom: 16px;
        right: 16px;
        margin-top: 0;
    }

    .timeline-content.banner {
        padding-bottom: 50px;
    }

    .modal-content {
        padding: 30px 20px;
        width: calc(100% - 80px);
    }
    
    .modal-nav-prev,
    .modal-nav-next {
        font-size: 1.8rem;
        padding: 12px 8px;
    }
    
    .modal-nav-prev {
        left: 6px;
    }
    
    .modal-nav-next {
        right: 6px;
    }

    .modal-header {
        gap: 10px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-gallery {
        grid-template-columns: 1fr;
    }

    .no-events-message {
        padding: 40px 15px;
        font-size: 1rem;
    }
    
    .no-events-message p:first-child {
        font-size: 1.2rem;
    }
}

.modal-content.modal-switching {
    opacity: 1;
    transform: none;
    transition: none;
}

/* Ensure font fixes apply to both modal and event for Age of Power */
.age-theme-power .timeline-content,
.age-theme-power .modal-content {
    color: #051d80;
}
.age-theme-power .timeline-content h3,
.age-theme-power .modal-content h2 {
    color: #051d80;
    text-shadow: none;
}
.age-theme-power .timeline-year,
.age-theme-power .age-toggle,
.age-theme-power .modal-year,
.age-theme-power .modal-header h2 {
    color: #051d80;
    text-shadow: none;
}
.age-theme-power .modal-year-detail {
    color: #051d80;
}
.age-theme-power .timeline-content p,
.age-theme-power .modal-content p {
    color: #051d80;
}

/* Menu page main nav buttons */
.menu-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    gap: 2rem;
}
.menu-btn {
    width: 92vw;
    max-width: 420px;
    height: 100px;
    font-size: 2.2rem;
    font-weight: 700;
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
    background: linear-gradient(90deg, #1976d2 0%, #64b5f6 100%);
    color: #fff;
    border: none;
    transition: background 0.18s, transform 0.18s;
    display: block;
    letter-spacing: 1.5px;
    margin: 0;
    position: relative;
    overflow: hidden;
}
.menu-btn.img-bg {
    background: none;
}
.menu-btn.bg-timeline {
    background-image: url("/images/sitedesign/buttons/TLbutton.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
.menu-btn.bg-boardgame {
    background-image: url("/images/sitedesign/buttons/BGhelper.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
.menu-btn.bg-tabletop {
    background-image: url("/images/sitedesign/buttons/TThelper.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
.menu-btn.img-bg .menu-btn-label {
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.45);
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 12px;
}
.menu-btn:disabled {
    background: linear-gradient(90deg, #bdbdbd 0%, #e0e0e0 100%);
    color: #888;
    opacity: 0.8;
}
.menu-btn.img-bg:disabled {
    background-color: #bdbdbd;
    background-blend-mode: multiply;
}
.menu-btn:not(:disabled):active {
    background: linear-gradient(90deg, #1565c0 0%, #1976d2 100%);
    transform: scale(0.98);
}
@media (max-width: 600px) {
    .menu-btn {
        font-size: 1.3rem;
        height: 70px;
        max-width: 98vw;
    }
    .menu-btn-container {
        gap: 1.2rem;
    }
}

/* BoardGameHelper Page */
.bgh-page {
    min-height: 100vh;
    background: #10131a;
    color: #f5f7ff;
    padding: 0.75rem;
}

.bgh-topbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.bgh-btn {
    border: 1px solid #3a4663;
    background: #1a2233;
    color: #f5f7ff;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.bgh-btn:hover:not(:disabled) {
    background: #2a3857;
}

.bgh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bgh-count {
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
}

.bgh-exit {
    margin-left: auto;
    background: #3b1a1a;
    border-color: #774444;
}

.bgh-exit:hover {
    background: #5b2a2a;
}

.bgh-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.bgh-slot {
    min-height: 300px;
}

.bgh-tracker-stack {
    display: grid;
    gap: 0.6rem;
}

.bgh-slot,
.bgh-tracker-stack,
.bgh-tracker-stack .bg-tracker-card,
.bgh-placeholder {
    height: 100%;
}

.bgh-slot-left,
.bgh-slot-right {
    display: none;
}

@media (min-width: 768px) {
    .bgh-workspace {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (min-width: 1200px) {
    .bgh-workspace {
        grid-template-columns: repeat(3, minmax(320px, 1fr));
        align-items: stretch;
    }

    .bgh-slot-left,
    .bgh-slot-right {
        display: block;
    }
}

.bgh-placeholder {
    background: transparent;
    border: 1px solid rgba(229, 235, 255, 0.12);
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* BoardGameTracker Card */
.bg-tracker-card {
    background: #182033;
    border: 2px solid #33425e;
    border-radius: 12px;
    overflow: hidden;
}

.bg-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #141b2b;
    border-bottom: 1px solid #33425e;
}

.bg-tracker-title {
    font-weight: 700;
    color: #f5f7ff;
}

.bg-tracker-label {
    font-size: 0.75rem;
    background: #3a4663;
    color: #f5f7ff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.bg-tracker-content {
    padding: 0.75rem;
}

/* MK Card Layout */
.bg-mk-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bg-mk-card-top-section {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.bg-mk-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* BoardGameElement Styles */
.bg-element-player-icon {
    width: 70px;
    height: 70px;
    background: #c98bd1;
    border: 2px solid #a86bb1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bg-element-player-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.bg-element-character-name {
    background: #b8944d;
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.bg-element-fame-level {
    display: flex;
    gap: 0.5rem;
}

.bg-element-stat-box {
    flex: 1;
    background: #2a5a9e;
    border: 2px solid #1a3a7e;
    border-radius: 6px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.3rem;
    padding: 0.4rem;
    align-items: center;
    color: #fff;
    font-weight: 700;
}

.bg-stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    grid-column: 1 / -1;
}

.bg-stat-arrow {
    width: 0;
    height: 0;
    padding: 0;
    background: transparent;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    cursor: pointer;
    justify-self: center;
    transition: filter 0.15s ease;
}

.bg-stat-arrow-left {
    border-left: 0;
    border-right: 10px solid #fff;
}

.bg-stat-arrow-right {
    border-right: 0;
    border-left: 10px solid #fff;
}

.bg-stat-arrow:hover {
    filter: brightness(1.3);
}

.bg-stat-arrow:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.bg-stat-display {
    text-align: center;
    font-size: 1rem;
}

.bg-next-level-hint {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1;
    opacity: 0.85;
    margin-top: -1px;
}

.bg-level-readonly .bg-stat-display {
    grid-column: 1 / -1;
}

.bg-influence-readonly .bg-stat-display {
    grid-column: 1 / -1;
}

.bg-element-reputation-influence {
    display: flex;
    gap: 0.5rem;
}

.bg-reputation {
    background: #b82a2a !important;
    border-color: #881a1a !important;
}

.bg-influence {
    background: #b8642a !important;
    border-color: #885a1a !important;
}

.bg-element-tactic {
    background: #ffd700;
    border: 2px solid #ccaa00;
    border-radius: 6px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    color: #000;
    font-weight: 700;
}

.bg-tactic-marker {
    width: 30px;
    height: 30px;
    background: #000;
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.bg-tactic-content {
    flex: 1;
}

.bg-tactic-name {
    font-size: 0.85rem;
}

.bg-tactic-description {
    font-size: 0.7rem;
    opacity: 0.9;
}

.bg-element-hexagon {
    width: 70px;
    height: 70px;
    background: #a86bb1;
    border: 2px solid #8a4a95;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.bg-hex-top {
    font-size: 1rem;
}

.bg-hex-middle {
    display: flex;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.bg-hex-label {
    font-size: 0.6rem;
    opacity: 0.8;
}

.bg-mk-card-crystals,
.bg-mk-card-tokens {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid #3a4663;
    padding-top: 0.75rem;
}

.bg-mk-card-mana {
    padding-top: 0.75rem;
}

.bg-element-mana {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
}

.bg-mana-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f5f7ff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.bg-mana-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
}

.bg-mana-item-container {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.25rem;
    position: relative;
}

.bg-mana-item {
    width: 100%;
    height: 100%;
    border: 2px solid;
    transition: all 0.2s;
    user-select: none;
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-mana-item.active {
    opacity: 1;
    box-shadow: 0 0 8px currentColor, inset 0 0 4px rgba(0, 0, 0, 0.3);
}

/* Crystal shape - hexagon using clip-path */
.bg-mana-crystal {
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
}

/* Token shape - circle */
.bg-mana-token {
    border-radius: 50%;
}

/* Red mana */
.bg-mana-red {
    background: #cc2020;
    border-color: #aa1010;
    color: #fff;
}

.bg-mana-red:hover {
    background: #dd3030;
    border-color: #cc2020;
}

/* Blue mana */
.bg-mana-blue {
    background: #2060cc;
    border-color: #1050aa;
    color: #fff;
}

.bg-mana-blue:hover {
    background: #3070dd;
    border-color: #2060cc;
}

/* Green mana */
.bg-mana-green {
    background: #20aa30;
    border-color: #108820;
    color: #fff;
}

.bg-mana-green:hover {
    background: #30bb40;
    border-color: #20aa30;
}

/* White mana */
.bg-mana-white {
    background: #f0f0f0;
    border-color: #c0c0c0;
    color: #333;
}

.bg-mana-white:hover {
    background: #ffffff;
    border-color: #d0d0d0;
}

/* Gold mana */
.bg-mana-gold {
    background: #d4af37;
    border-color: #aa8a20;
    color: #333;
}

.bg-mana-gold:hover {
    background: #e4bf47;
    border-color: #d4af37;
}

/* Black mana */
.bg-mana-black {
    background: #1a1a1a;
    border-color: #000000;
    color: #fff;
}

.bg-mana-black:hover {
    background: #2a2a2a;
    border-color: #1a1a1a;
}

/* Mana count display on crystals/tokens */
.bg-mana-count {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6), 1px 1px 2px rgba(0, 0, 0, 1);
    pointer-events: none;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Mana Modal */
.mana-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.mana-modal-content {
    background: #2a3a5a;
    border: 2px solid #4a6a9a;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.2s ease-out;
}

.mana-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #f5f7ff;
}

.mana-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.mana-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mana-modal-counter {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mana-modal-count {
    font-size: 2rem;
    font-weight: 700;
    color: #f5f7ff;
    min-width: 3rem;
    text-align: center;
}

.mana-modal-max-message {
    font-size: 0.85rem;
    color: #f5f7ff;
    opacity: 0.8;
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 200, 100, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(255, 200, 100, 0.3);
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.mana-modal-max-message.hidden {
    opacity: 0;
    visibility: hidden;
}

.mana-modal-max-message.visible {
    opacity: 0.8;
    visibility: visible;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}









