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

:root {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #f1f5f9;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --accent: #d97706;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: blur(12px);
    
    /* New theme tokens for resources and table */
    --resources-bg: rgba(0, 0, 0, 0.05);
    --table-header-bg: #e2e8f0;
    --table-text-header: var(--text-heading);
    --table-row-hover: rgba(0, 0, 0, 0.02);
    --table-stripe: rgba(0, 0, 0, 0.01);
    --table-bg: #ffffff;
}

body.night-mode {
    --bg-main: #060913;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-sidebar: #0b0f1d;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #f59e0b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-heading: #ffffff;
    --glass-bg: rgba(15, 23, 42, 0.45);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    
    /* New theme tokens for resources and table */
    --resources-bg: rgba(255, 255, 255, 0.05);
    --table-header-bg: rgba(15, 23, 42, 0.8);
    --table-text-header: var(--text-heading);
    --table-row-hover: rgba(255, 255, 255, 0.02);
    --table-stripe: rgba(255, 255, 255, 0.01);
    --table-bg: rgba(15, 23, 42, 0.4);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Page Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand h1 span {
    color: var(--accent);
}

.sidebar-menu {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-grow: 1;
}

.menu-section-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 8px;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item a:hover,
.menu-item.active a {
    background-color: var(--glass-bg);
    color: var(--primary);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.menu-item a .icon {
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Sidebar Simulator Widget */
.sidebar-simulator {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(6, 9, 19, 0.5);
}

.simulator-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-heading);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.simulator-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.simulator-select,
.simulator-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
}

.simulator-select:focus,
.simulator-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-main);
}

/* Top Navbar */
.top-navbar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 10;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-main);
}

.breadcrumb a {
    color: var(--text-main);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    margin: 0 8px;
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 500;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-speed-badge {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--primary);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.simulator-badge {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--accent);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* Content Body */
.content-body {
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.25rem;
    letter-spacing: -0.03em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

h2 {
    font-size: 1.5rem;
    margin-top: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

h3 {
    font-size: 1.2rem;
    margin-top: 24px;
    margin-bottom: 12px;
}

p {
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.troop-resources {
    display: flex;
    justify-content: space-between;
    background: var(--resources-bg);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.res-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.res-item img, .res-icon {
    width: 18px !important;
    height: 12px !important;
    display: inline-block;
    vertical-align: middle;
}

/* Glassmorphism Card Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--glass-blur);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Interactive elements styles */
.simulator-hero {
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent), var(--bg-card);
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.simulator-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 200px;
}

.form-group-inline label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Table Styling */
.table-responsive {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    background: var(--table-bg);
}
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

th {
    background-color: var(--table-header-bg);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--table-text-header);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--table-row-hover);
}

tr:nth-child(even) td {
    background-color: var(--table-stripe);
}

/* Dynamic updates highlight style */
.stat-highlight {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Columns for troop layout (independent vertical stacking) */
.troops-columns {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}
.troops-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}
@media (max-width: 768px) {
    .troops-columns {
        flex-direction: column;
        gap: 24px;
    }
}

.troop-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 16px;
    transition: all 0.3s ease;
}

.troop-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

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

.troop-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.troop-id-badge {
    background-color: var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.troop-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
}

.troop-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.troop-stat-label {
    color: var(--text-muted);
}

.troop-stat-value {
    font-weight: 500;
    color: var(--text-main);
}

.troop-training-times {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    background: rgba(245, 158, 11, 0.05);
    border: 1px dashed rgba(245, 158, 11, 0.15);
    padding: 10px;
    border-radius: 8px;
}

/* Layout Columns System (Wikipedia Style) */
.wiki-page-grid {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.wiki-main-column {
    flex: 1;
    min-width: 0;
}

.wiki-side-column {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    z-index: 5;
}

/* Info Box / Wikipedia Info Card */
.info-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: var(--glass-blur);
    margin-bottom: 24px;
}

/* Theme Toggle Switch (from indexm.php / tutorialm.php) */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 20px;
    transition: background .2s;
}

.theme-toggle:hover {
    background: rgba(201, 147, 58, 0.12);
}

.theme-lbl {
    font-size: 14px;
    line-height: 1;
    transition: opacity .25s;
}

.theme-lbl.sun {
    opacity: 1;
}

.theme-lbl.moon {
    opacity: .35;
}

.theme-toggle.night-active .theme-lbl.sun {
    opacity: .35;
}

.theme-toggle.night-active .theme-lbl.moon {
    opacity: 1;
}

.theme-track {
    position: relative;
    width: 46px;
    height: 24px;
    background: linear-gradient(135deg, #f0c96a, #c9933a);
    border-radius: 12px;
    border: 1.5px solid rgba(201, 147, 58, 0.55);
    transition: background .3s, border-color .3s;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

.theme-toggle.night-active .theme-track {
    background: linear-gradient(135deg, #0d1e3e, #1a3a7a);
    border-color: rgba(58, 140, 220, 0.5);
}

.theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.theme-toggle.night-active .theme-thumb {
    transform: translateX(22px);
}

body.night-mode .theme-toggle:hover {
    background: rgba(58, 140, 220, 0.1);
}

/* Accordion Menu Styles */
.accordion-item {
    margin-bottom: 8px;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-heading);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    text-align: left;
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.night-mode .accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-content {
    display: none;
    padding-left: 8px;
    margin-top: 4px;
}

.accordion-item.open .accordion-content {
    display: block;
}

.accordion-item.open .arrow {
    transform: rotate(180deg);
}

.arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    display: inline-block;
}

@media (max-width: 992px) {
    .wiki-page-grid {
        flex-direction: column;
        gap: 24px;
    }
    
    .wiki-side-column {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .content-body {
        padding: 20px;
    }
}

.info-card-header {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    background: rgba(56, 189, 248, 0.05);
    border-radius: 6px;
    padding: 6px;
}

.info-card-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
}

.info-card-row:last-child {
    border-bottom: none;
}

.info-card-label {
    font-weight: 600;
    color: var(--text-muted);
}

.info-card-value {
    text-align: right;
    color: var(--text-main);
}

/* Alert notifications box */
.wiki-alert {
    background: rgba(56, 189, 248, 0.05);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.wiki-alert-title {
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

/* Tabs system */
.tabs-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 8px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* Input group styling */
.btn-primary {
    background: var(--primary);
    border: none;
    color: #000000;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

/* Original Game Icons and Illustrations styling */
.res-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
}

.troop-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

.building-illustration {
    display: block;
    max-width: 140px;
    max-height: 120px;
    margin: 12px auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
}

.tribe-banner {
    display: block;
    max-width: 150px;
    height: auto;
    margin: 12px auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Custom tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-sidebar, #1f1f1f);
    color: var(--text-heading, #ffffff);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid var(--border-color, #444);
    z-index: 1000;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

/* On-Page Navigation Links (Table of Contents) */
.wiki-toc-link {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.wiki-toc-link:hover {
    background-color: var(--table-row-hover);
    color: var(--primary);
    text-decoration: none;
    padding-left: 14px;
}

/* Scroll target offset to prevent sticky header overlapping targets */
[id] {
    scroll-margin-top: 90px;
}

/* Tribe Teaser Cards on Homepage */
.tribe-teaser-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-sm);
    background-color: var(--table-row-hover) !important;
}

/* Server Timeline Styling (Horizontal on Desktop, Vertical on Mobile) */
.timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 24px 0 8px 0;
    margin-top: 16px;
    gap: 16px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-progress-bar {
    position: absolute;
    top: 32px;
    left: 10%;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
    z-index: 3;
    pointer-events: none;
    transition: width 0.3s ease, height 0.3s ease;
    width: calc(80% * var(--progress-percent, 0));
}

.timeline-progress-marker {
    position: absolute;
    right: -6px;
    top: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffd700;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 8px #ffd700;
    z-index: 3;
    animation: pulse-gold-marker 2s infinite;
}

@keyframes pulse-gold-marker {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.timeline-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    min-width: 0;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.timeline-dot.dot-completed {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.timeline-dot.dot-current {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.timeline-dot.dot-future {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.timeline-dot.dot-end-reached {
    border-color: #ef4444 !important;
    background: #ef4444 !important;
    box-shadow: 0 0 12px #ef4444 !important;
    animation: pulse-red-end 1.5s infinite !important;
}

@keyframes pulse-red-end {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.timeline-content {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

.timeline-time {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.timeline-title {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.timeline-desc {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Responsive Mobile Layout (Reverts to Vertical Timeline) */
@media (max-width: 992px) {
    .timeline-container {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 32px;
        margin-left: 8px;
        gap: 24px;
    }
    
    .timeline-container::before {
        left: 9px;
        top: 24px;
        bottom: 24px;
        width: 2px;
        height: auto;
        right: auto;
    }
    
    .timeline-progress-bar {
        left: 9px;
        top: 24px;
        width: 2px;
        height: calc((100% - 48px) * var(--progress-percent, 0));
        background: linear-gradient(180deg, #a855f7, #3b82f6);
    }
    
    .timeline-progress-marker {
        left: -5px;
        bottom: -6px;
        top: auto;
        right: auto;
    }
    
    .timeline-item {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }
    
    .timeline-dot {
        position: absolute;
        left: -41px;
        top: 6px;
        margin-bottom: 0;
    }
}

/* Hero Page Calculator Styling */
.hero-tribe-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.hero-tribe-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.hero-tribe-btn.active {
    background: rgba(59, 130, 246, 0.06);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

.hero-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.hero-unit-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.hero-unit-card img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.hero-unit-card span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.hero-unit-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--text-muted);
}

.hero-unit-card:hover span {
    color: var(--text-main);
}

.hero-unit-card.active {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.15);
}

.hero-unit-card.active span {
    color: var(--primary);
    font-weight: 600;
}

.hero-calc-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

@media (max-width: 768px) {
    .hero-calc-row {
        flex-direction: column;
    }
}

