/**
 * Lord of Chains - Main Stylesheet
 * Dark Forest Green Theme
 */

/* ==========================================================================
   0. Loading Screen
   ========================================================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #020502 0%, #041006 50%, #020502 100%);
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.loading-throne {
    max-width: 90%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.loading-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

.loading-content {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    padding: 1.5rem 2.5rem;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(34, 197, 94, 0.1);
}

.loading-bar-container {
    width: 280px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
    border-radius: 4px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8), 0 0 20px rgba(34, 197, 94, 0.4);
}

.loading-text {
    margin-top: 1rem;
    margin-bottom: 0;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    letter-spacing: 1px;
}

/* ==========================================================================
   1. Variables & Reset
   ========================================================================== */

:root {
    /* Primary Green Palette */
    --color-primary: #22c55e;
    --color-primary-dark: #16a34a;
    --color-primary-light: #4ade80;
    --color-primary-glow: rgba(34, 197, 94, 0.4);
    
    /* Secondary */
    --color-secondary: #475569;
    --color-secondary-dark: #334155;
    
    /* Status Colors */
    --color-success: var(--color-primary);
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    /* Shorthand aliases */
    --success: var(--color-success);
    --danger: var(--color-danger);
    --warning: var(--color-warning);
    --info: var(--color-info);
    
    /* Dark Backgrounds */
    --color-bg: #0a0f0a;
    --color-bg-light: #0f1a0f;
    --color-bg-lighter: #152015;
    --color-bg-card: #0d140d;
    
    /* Text */
    --color-text: #e8f5e9;
    --color-text-muted: #94a3b8;
    --color-text-dark: #64748b;
    
    /* Borders */
    --color-border: #1e3a1e;
    --color-border-light: #2d5a2d;
    
    /* Fonts */
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Layout */
    --sidebar-width: 220px;
    --header-height: 75px;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px var(--color-primary-glow);
    
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-y: scroll;
    min-height: calc(100% + 1px);
}

/* Custom Scrollbar - Always visible */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border: 3px solid var(--color-bg-light);
    border-radius: 6px;
}

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

::-webkit-scrollbar-corner {
    background: var(--color-bg-light);
}

/* Firefox scrollbar - use auto width to prevent hiding */
html {
    scrollbar-width: auto;
    scrollbar-color: var(--color-border-light) var(--color-bg-light);
}

body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    max-width: 100vw;
}

/* Global overflow prevention */
*, *::before, *::after {
    max-width: 100%;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Word breaking for long content */
p, h1, h2, h3, h4, h5, h6, li, td, th, label, span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--color-text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

code {
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.875em;
    background: var(--color-bg-lighter);
    padding: 0.125em 0.375em;
    border-radius: 4px;
}

kbd {
    display: inline-block;
    padding: 0.125em 0.375em;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.75em;
    background: var(--color-bg-lighter);
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--color-border);
}

small, .text-sm { font-size: 0.8125rem; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }
.text-offense { color: #ef4444; }
.text-defense { color: #3b82f6; }

/* ==========================================================================
   3. Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.game-layout { min-height: 100vh; }

.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(180deg, var(--color-bg-lighter) 0%, var(--color-bg-light) 100%);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.game-container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.game-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-bg-light);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 1rem 0;
    z-index: 90;
}

.game-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    min-height: calc(100vh - var(--header-height));
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

.page-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    background: var(--color-bg-light);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #000;
    border-color: var(--color-primary);
    box-shadow: 0 2px 10px var(--color-primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    color: #000;
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

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

.btn-secondary:hover {
    background: var(--color-secondary-dark);
    color: var(--color-text);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #dc2626 100%);
    color: #fff;
    border-color: var(--color-danger);
}

.btn-outline {
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light);
}

.btn-outline:hover {
    background: var(--color-bg-lighter);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
}

.btn-ghost:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text);
}

/* Quick select buttons for bank/forms */
.btn-quick {
    background: var(--color-bg-light) !important;
    color: var(--color-text-muted) !important;
    border: 1px solid var(--color-border-light) !important;
}

.btn-quick:hover {
    background: var(--color-bg-lighter) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    text-shadow: 0 0 20px var(--color-primary-glow);
}

.logo:hover { color: var(--color-primary-light); }
.logo-icon { font-size: 1.5rem; }
.logo-short { display: none; }

/* ==========================================================================
   5. Forms
   ========================================================================== */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow), 0 0 20px var(--color-primary-glow);
}

.form-control::placeholder {
    color: var(--color-text-dark);
}

select.form-control { cursor: pointer; }
textarea.form-control { min-height: 100px; resize: vertical; }

.form-help {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Custom File Upload */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--color-bg-lighter) 0%, var(--color-bg-light) 100%);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.file-upload-input:focus + .file-upload-btn {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.file-upload-icon {
    font-size: 1rem;
}

.file-upload-name {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-name.has-file {
    color: var(--color-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
}

/* Selection Cards */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.selection-card { display: block; cursor: pointer; }
.selection-card input { display: none; }

.selection-content {
    padding: 1.25rem;
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.selection-card input:checked + .selection-content {
    border-color: var(--color-primary);
    background: var(--color-primary-glow);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.selection-card:hover .selection-content {
    border-color: var(--color-border-light);
}

.selection-name { font-weight: 600; margin-bottom: 0.5rem; }

.selection-bonus {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.selection-bonus .bonus {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: var(--color-bg-lighter);
}

.selection-bonus .bonus.offense { color: var(--color-danger); }
.selection-bonus .bonus.defense { color: var(--color-info); }
.selection-bonus .bonus.income { color: var(--color-success); }
.selection-bonus .bonus.intel { color: var(--color-warning); }

.selection-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   6. Tables
   ========================================================================== */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: max-content;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--color-text-muted);
    background: var(--color-bg-lighter);
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--color-bg-light);
}

td.actions { white-space: nowrap; }
td.actions .btn { margin-right: 0.25rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.pagination-info {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   7. Cards & Panels
   ========================================================================== */

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

.card-header {
    padding: 1rem 1.25rem;
    background: var(--color-bg-lighter);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

.card-header-with-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.header-filter-form .filter-select {
    min-width: 140px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    cursor: pointer;
}

.header-filter-form .filter-select:hover {
    border-color: var(--color-border-light);
}

.header-filter-form .filter-select:focus {
    border-color: var(--color-primary);
    outline: none;
}

.header-filter-form .filter-clear-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

/* Hide mobile sort controls on desktop */
.mobile-sort-controls {
    display: none;
}

/* Responsive visibility utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    .mobile-sort-controls {
        display: block;
        margin-bottom: 1rem;
    }
}

.card-body { padding: 1.25rem; }

/* Collapsible Card (using details/summary) */
.collapsible-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-card);
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    user-select: none;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapsible-header h2 {
    margin: 0;
}

.collapse-icon {
    font-size: 0.8em;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.collapsible-card[open] .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-header:hover {
    background: var(--color-bg-lighter);
}

.card-footer {
    padding: 1rem 1.25rem;
    background: var(--color-bg-lighter);
    border-top: 1px solid var(--color-border);
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-light) 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    text-shadow: 0 0 30px var(--color-primary-glow);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Panels */
.panel {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

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

.panel-title { font-size: 1rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.25rem; }

.panel-footer {
    padding: 1rem 1.25rem;
    background: var(--color-bg-lighter);
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   8. Alerts & Badges
   ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-icon { flex-shrink: 0; font-size: 1.125rem; }

.alert-success {
    background: var(--color-primary-glow);
    border: 1px solid var(--color-primary);
    color: var(--color-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--color-info);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.badge-success { background: var(--color-primary-glow); color: var(--color-success); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: var(--color-info); }
.badge-secondary { background: rgba(148, 163, 184, 0.2); color: var(--color-text-muted); }

/* ==========================================================================
   9. Navigation
   ========================================================================== */

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.player-stats-bar {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
}

/* Clickable stat items */
a.stat-item {
    text-decoration: none;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

a.stat-item:hover {
    background: var(--color-primary-glow);
    transform: translateY(-1px);
}

a.stat-item:active {
    transform: translateY(0);
}

.stat-icon { font-size: 1rem; }
.stat-value { font-weight: 600; color: var(--color-text); }

.header-icon {
    position: relative;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

.header-icon:hover { color: var(--color-primary); }

.header-icon .header-icon-img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.stat-icon-img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.header-icon .badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.625rem;
    background: var(--color-danger);
    color: #fff;
    border-radius: 9px;
}

/* Sidebar Navigation */
.nav-section { margin-bottom: 1.5rem; }

.nav-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dark);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-bg-lighter);
}

.nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-glow);
    border-left-color: var(--color-primary);
}

.nav-icon { font-size: 1.125rem; width: 25px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon-img { width: 25px; height: 25px; vertical-align: middle; }

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--color-danger);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.page-title { font-size: 1.5rem; margin: 0; }

/* ==========================================================================
   10. Auth Pages
   ========================================================================== */

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(34, 197, 94, 0.05) 0%, transparent 50%),
        var(--color-bg);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-primary);
    margin-top: 0.5rem;
    text-shadow: 0 0 30px var(--color-primary-glow);
}

.auth-card {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-light) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.auth-links a { color: var(--color-primary); }

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-dark);
}

/* ==========================================================================
   11. Landing Page
   ========================================================================== */

.landing-page {
    background: var(--color-bg);
    overflow-x: hidden;
}

.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 15, 10, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.landing-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.landing-main {
    padding-top: 72px;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 197, 94, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(34, 197, 94, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-stats .stat {
    text-align: center;
    padding: 1.5rem;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.hero-stats .stat:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-4px);
}

.hero-stats .stat-number {
    display: block;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--color-primary);
    text-shadow: 0 0 30px var(--color-primary-glow);
    margin-bottom: 0.25rem;
}

.hero-stats .stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* Features Section */
.features {
    padding: 6rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-light) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-icon-img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    display: block;
    object-fit: contain;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.feature-card p {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Races & Classes */
.races-classes {
    padding: 6rem 1.5rem;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-light) 50%, var(--color-bg) 100%);
}

.selection-preview {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.preview-group h3 {
    margin-bottom: 1.25rem;
    color: var(--color-primary);
    font-size: 1.25rem;
}

.preview-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-item {
    padding: 1rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.preview-item:hover {
    border-color: var(--color-border-light);
    background: var(--color-bg-light);
}

.preview-item strong {
    color: var(--color-primary);
}

/* CTA Section */
.cta {
    padding: 6rem 1.5rem;
    text-align: center;
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.landing-footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-dark);
}

/* ==========================================================================
   12. Game-specific Components
   ========================================================================== */

/* Dashboard Page Styles */
.dashboard-page {
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard Hero Card */
.dashboard-hero-card {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-lighter) 100%);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.dashboard-hero-icon {
    font-size: 3.5rem;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 50%;
    border: 2px solid var(--color-border);
    overflow: hidden;
}

.dashboard-hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-hero-info {
    flex: 1;
}

.dashboard-hero-info h2 {
    margin: 0 0 0.25rem 0;
    font-size: 2rem;
    color: var(--color-text);
}

.dashboard-tagline {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.dashboard-ranks {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.dashboard-ranks .rank-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-lighter);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 45px;
}

.dashboard-ranks .rank-badge:hover {
    background: var(--color-bg-card);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.dashboard-ranks .rank-badge.rank-overall {
    background: linear-gradient(135deg, var(--color-primary-glow) 0%, transparent 100%);
    border-color: var(--color-primary-glow);
}

.dashboard-ranks .rank-badge.rank-overall:hover {
    border-color: var(--color-primary);
}

.dashboard-ranks .rank-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-muted);
}

.dashboard-ranks .rank-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
}

.dashboard-hero-level {
    text-align: center;
}

.level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.level-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.level-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.5px;
}

/* Dashboard Experience Section */
.dashboard-exp-section {
    padding: 1rem 1.5rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

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

.exp-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.exp-numbers {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.exp-bar-large {
    position: relative;
    height: 24px;
    background: var(--color-bg-lighter);
    border-radius: 12px;
    overflow: hidden;
}

.exp-bar-large .exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.exp-bar-large .exp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.dashboard-stat-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.dashboard-stat-icon {
    font-size: 1.75rem;
}

.dashboard-stat-info {
    display: flex;
    flex-direction: column;
}

.dashboard-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.dashboard-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Combat Power Grid */
.combat-power-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.combat-power-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.combat-power-box .power-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.combat-power-box .power-icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.combat-power-box .power-info {
    display: flex;
    flex-direction: column;
}

.combat-power-box .power-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.combat-power-box .power-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.combat-power-box.offense .power-value { color: var(--danger); }
.combat-power-box.defense .power-value { color: var(--info); }
.combat-power-box.spy-offense .power-value { color: var(--warning); }
.combat-power-box.spy-defense .power-value { color: var(--success); }

/* Fort Status Display */
.fort-status-display {
    margin-bottom: 1rem;
}

.fort-health-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fort-health-info .fort-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.fort-health-info .fort-separator {
    color: var(--color-text-muted);
}

.fort-health-info .fort-max {
    color: var(--color-text-muted);
}

.fort-warning-box, .fort-ok-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.fort-warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.fort-warning-box .warning-icon {
    font-size: 1.25rem;
}

.fort-warning-box .warning-text {
    color: var(--warning);
    font-size: 0.875rem;
}

.fort-ok-box {
    background: var(--color-primary-glow);
    border: 1px solid var(--color-primary);
}

.fort-ok-box .ok-icon {
    font-size: 1.25rem;
    color: var(--success);
}

.fort-ok-box .ok-text {
    color: var(--success);
    font-size: 0.875rem;
}

/* Economy Display */
.economy-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.economy-main {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.economy-primary, .economy-secondary {
    text-align: center;
}

.economy-big-label, .economy-daily-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.economy-big-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--warning);
}

.economy-daily-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--success);
}

.economy-breakdown-list {
    display: flex;
    flex-direction: column;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.breakdown-item:last-child {
    border-bottom: none;
}

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

.breakdown-value {
    font-weight: 500;
}

/* Army & Equipment Lists */
.army-list, .equipment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.army-item, .equipment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.army-name, .equipment-name {
    font-weight: 500;
    color: var(--color-text);
}

.army-qty, .equipment-qty {
    font-weight: 600;
    color: var(--color-primary);
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    color: var(--color-primary);
    font-size: 0.875rem;
    text-decoration: none;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 1.5rem;
}

.empty-state .empty-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    background: var(--color-bg-lighter);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.quick-action-btn .qa-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.quick-action-btn .qa-icon-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.msg-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.dashboard-stat-icon-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.quick-action-btn .qa-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
}

.quick-action-btn.attack:hover { border-color: var(--danger); }
.quick-action-btn.train:hover { border-color: var(--info); }
.quick-action-btn.bank:hover { border-color: var(--success); }
.quick-action-btn.armory:hover { border-color: var(--warning); }

/* Clan Display */
.clan-display {
    text-align: center;
}

.clan-badge {
    margin-bottom: 0.75rem;
}

.clan-badge .clan-tag {
    font-weight: 700;
    color: var(--color-primary);
}

.clan-badge .clan-name {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 0.25rem;
}

.clan-rank {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.clan-rank .rank-label {
    color: var(--color-text-muted);
}

.clan-rank .rank-value {
    font-weight: 600;
    color: var(--warning);
}

.no-clan {
    text-align: center;
    padding: 1rem 0;
}

.no-clan .no-clan-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-clan p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Messages */
.message-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
}

.message-alert .message-icon {
    font-size: 1.5rem;
}

.message-alert .message-info {
    flex: 1;
}

.message-alert .message-count {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--info);
}

.message-alert .message-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.no-messages {
    text-align: center;
    padding: 1rem 0;
}

.no-messages .no-msg-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.25rem;
    opacity: 0.5;
}

/* Battle List */
.battle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.battle-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.battle-item .battle-result {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.battle-item.victory .battle-result {
    background: var(--color-primary-glow);
    color: var(--success);
}

.battle-item.defeat .battle-result {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.battle-item .battle-info {
    flex: 1;
    min-width: 0;
}

.battle-item .battle-direction {
    display: block;
    font-size: 0.625rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.battle-item .battle-target {
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battle-item .battle-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.no-attacks {
    text-align: center;
    padding: 1rem 0;
}

.no-attacks .no-attack-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.25rem;
    opacity: 0.5;
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

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

.news-item .news-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    color: var(--color-text);
}

.news-item .news-excerpt {
    margin: 0 0 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.news-item .news-date {
    font-size: 0.75rem;
    color: var(--color-text-dark);
}

/* ==========================================================================
   Overview Page - Intelligence Dossier Style
   ========================================================================== */

.overview-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* Dossier Header */
.dossier-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid var(--color-primary);
    position: relative;
    overflow: hidden;
}

.dossier-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.dossier-badge {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    flex-shrink: 0;
}

.dossier-badge .badge-icon {
    font-size: 2rem;
}

.dossier-title-section {
    flex: 1;
}

.dossier-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.dossier-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

.dossier-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.dossier-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.dossier-meta .meta-icon {
    font-size: 0.875rem;
}

.dossier-meta .meta-divider {
    color: var(--color-border);
}

.dossier-stamp {
    position: absolute;
    top: 1rem;
    right: 1rem;
    transform: rotate(12deg);
    padding: 0.35rem 1rem;
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    opacity: 0.6;
}

.dossier-stamp .stamp-text {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(239, 68, 68, 0.8);
}

/* Tabbed Navigation */
.dossier-tabs {
    display: flex;
    background: var(--color-bg-card);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    overflow-x: auto;
}

.dossier-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dossier-tab:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.dossier-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg);
}

.dossier-tab .tab-icon {
    font-size: 1.125rem;
}

/* Power Rating Bar */
.power-rating-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}

.power-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.875rem 0.5rem;
    border-right: 1px solid var(--color-border);
    position: relative;
}

.power-segment:last-child {
    border-right: none;
}

.power-segment::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.power-segment.offense::before { background: #e57373; }  /* muted red */
.power-segment.defense::before { background: #64b5f6; }  /* muted blue */
.power-segment.spy-off::before { background: #ffb74d; }  /* muted orange */
.power-segment.spy-def::before { background: #81c784; }  /* muted green */

.power-segment .segment-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.power-segment .segment-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
}

.power-segment.offense .segment-value { color: #e57373; }  /* muted red */
.power-segment.defense .segment-value { color: #64b5f6; }  /* muted blue */
.power-segment.spy-off .segment-value { color: #ffb74d; }  /* muted orange */
.power-segment.spy-def .segment-value { color: #81c784; }  /* muted green */

/* Dossier Content Area */
.dossier-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1.5rem;
}

.tab-panel {
    display: none;
}

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

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Dossier Sections */
.dossier-section {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.dossier-section.full-width {
    grid-column: 1 / -1;
}

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

.section-header h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

.section-action {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.section-action:hover {
    background: var(--color-primary);
    color: white;
}

/* Empty Section State */
.empty-section {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

.empty-section .empty-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-section p {
    margin: 0 0 1rem 0;
}

/* Army Breakdown */
.army-breakdown {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.army-type-block {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.type-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg-lighter);
    border-bottom: 1px solid var(--color-border);
}

.type-header .type-icon {
    font-size: 1rem;
}

.type-header .type-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.type-header .type-total {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.type-units {
    padding: 0.5rem;
}

.unit-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

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

.unit-row .unit-name {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.unit-row .unit-qty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    min-width: 50px;
    text-align: center;
}

.unit-row .unit-stat {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.unit-stat.off {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.unit-stat.def {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.unit-stat.income {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Army Totals */
.army-totals {
    margin: 0 1rem 1rem;
    padding: 0.875rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}

.totals-row .totals-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.totals-row .totals-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Combat Records */
.combat-records {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.record-block {
    padding: 1rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.record-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.record-type .record-icon {
    font-size: 1.25rem;
}

.record-type .record-title {
    font-weight: 600;
    color: var(--color-text);
}

.record-stats .win-loss {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.win-loss .wins { color: var(--success); }
.win-loss .losses { color: var(--danger); }
.win-loss .separator { color: var(--color-text-muted); }

.win-rate-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.win-rate-bar .win-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #22c55e);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.win-rate-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.equipment-category-block {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-lighter);
    border-bottom: 1px solid var(--color-border);
}

.category-title .cat-icon {
    font-size: 1rem;
}

.category-title .cat-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.category-title .cat-count {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.category-items {
    padding: 0.5rem;
}

.equip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.375rem;
    border-bottom: 1px solid var(--color-border);
}

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

.equip-row .equip-name {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.equip-row .equip-qty {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.equip-row .equip-bonus {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.equip-bonus.off {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.equip-bonus.def {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* Equipment Totals */
.equipment-totals {
    display: flex;
    gap: 1rem;
    padding: 0 1rem 1rem;
}

.equip-total-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.equip-total-item .total-icon {
    font-size: 1.25rem;
}

.equip-total-item .total-label {
    flex: 1;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.equip-total-item .total-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text);
}

/* Upgrades List */
.upgrades-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.upgrade-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.upgrade-block .upgrade-icon {
    font-size: 1.5rem;
}

.upgrade-block .upgrade-info {
    flex: 1;
}

.upgrade-block .upgrade-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
}

.upgrade-block .upgrade-type {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.upgrade-block .upgrade-value {
    font-weight: 700;
    font-size: 1rem;
}

/* Fort Display */
.fort-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.fort-visual {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.fort-visual .fort-icon-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    z-index: 1;
}

.fort-health-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--fort-color) calc(var(--fort-percent) * 1%),
        var(--color-bg-lighter) calc(var(--fort-percent) * 1%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fort-health-ring::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: var(--color-bg);
    border-radius: 50%;
}

.fort-health-ring .fort-percent {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-bg);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.fort-details {
    flex: 1;
}

.fort-hp {
    margin-bottom: 0.5rem;
}

.fort-hp .hp-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.fort-hp .hp-max {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.fort-damage-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: var(--danger);
    font-size: 0.8125rem;
}

.fort-ok-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    color: var(--success);
    font-size: 0.8125rem;
}

/* Buildings List */
.buildings-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.building-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.building-row .building-icon {
    font-size: 1.25rem;
}

.building-row .building-info {
    flex: 1;
}

.building-row .building-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text);
}

.building-row .building-effect {
    font-size: 0.6875rem;
    color: var(--success);
}

.building-row .building-level {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.resource-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.resource-block .res-icon {
    font-size: 1.75rem;
}

.resource-block .res-info {
    display: flex;
    flex-direction: column;
}

.resource-block .res-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.resource-block .res-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.resource-block .res-note {
    font-size: 0.6875rem;
}

/* Proficiency Chart */
.proficiency-chart {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prof-bar-row {
    display: grid;
    grid-template-columns: 30px 90px 1fr 40px auto;
    align-items: center;
    gap: 0.75rem;
}

.prof-bar-row .prof-icon {
    font-size: 1.25rem;
    text-align: center;
}

.prof-bar-row .prof-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}

.prof-bar {
    height: 8px;
    background: var(--color-bg-lighter);
    border-radius: 4px;
    overflow: hidden;
}

.prof-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.prof-fill.prof-danger { background: var(--danger); }
.prof-fill.prof-info { background: var(--info); }
.prof-fill.prof-warning { background: var(--warning); }
.prof-fill.prof-success { background: var(--success); }
.prof-fill.prof-primary { background: var(--color-primary); }

.prof-bar-row .prof-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
}

.prof-bar-row .prof-bonus {
    font-size: 0.6875rem;
    white-space: nowrap;
}

/* Unspent Alert */
.unspent-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1rem 1rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
}

.unspent-alert .alert-icon {
    font-size: 1.25rem;
}

.unspent-alert .alert-text {
    flex: 1;
    font-weight: 600;
    color: var(--warning);
    font-size: 0.875rem;
}

/* Heritage Cards */
.heritage-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.heritage-card {
    padding: 1rem;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

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

.heritage-header .heritage-type {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.heritage-header .heritage-name {
    font-weight: 600;
    color: var(--color-text);
}

.heritage-bonus {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.heritage-bonus .bonus-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.heritage-bonus .bonus-type {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.heritage-card .no-bonus {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-style: italic;
}

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

/* Experience Display */
.experience-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.exp-level-badge {
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 50%;
    flex-shrink: 0;
}

.exp-level-badge .level-num {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.exp-level-badge .level-text {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.exp-progress {
    flex: 1;
}

.exp-progress .exp-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.exp-progress .exp-current {
    font-weight: 600;
    color: var(--color-text);
}

.exp-progress .exp-needed {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.experience-display .exp-bar-large {
    height: 12px;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.experience-display .exp-bar-large .exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.exp-progress .exp-percent {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Responsive Overview */
@media (max-width: 900px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .dossier-section.full-width {
        grid-column: 1;
    }

    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .heritage-cards {
        grid-template-columns: 1fr;
    }

    .equipment-totals {
        flex-direction: column;
    }

    .prof-bar-row {
        grid-template-columns: 30px 70px 1fr 35px auto;
    }
}

@media (max-width: 600px) {
    .dossier-header {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .dossier-stamp {
        position: static;
        transform: none;
        margin-top: 0.5rem;
    }

    .dossier-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .dossier-tab .tab-text {
        display: none;
    }

    .dossier-tab .tab-icon {
        font-size: 1.25rem;
    }

    .power-rating-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .power-segment {
        border-bottom: 1px solid var(--color-border);
    }

    .power-segment:nth-child(2) {
        border-right: none;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .fort-display {
        flex-direction: column;
        text-align: center;
    }

    .experience-display {
        flex-direction: column;
        text-align: center;
    }

    .exp-progress .exp-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .prof-bar-row {
        grid-template-columns: 25px 1fr 35px;
        gap: 0.5rem;
    }

    .prof-bar-row .prof-name {
        display: none;
    }

    .prof-bar-row .prof-bonus {
        display: none;
    }
}

/* Legacy Dashboard Grid Support */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.dashboard-grid .panel { margin-bottom: 0; }

/* Resource & Economy Display (Legacy) */
.resource-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.resource-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.resource-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.resource-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.resource-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.economy-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.economy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.economy-row.economy-total {
    border-top: 2px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

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

.economy-value {
    font-weight: 500;
    color: var(--text-primary);
}

.economy-total .economy-value {
    font-size: 1.125rem;
    color: var(--warning);
}

/* Friends Page */
.friend-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.friend-item.pending {
    border-left: 3px solid var(--warning);
}

.friend-item.blocked {
    opacity: 0.7;
}

.friend-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 1.5rem;
}

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

.friend-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.friend-name:hover {
    color: var(--color-primary);
}

.friend-details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Avatar preview in settings */
.current-avatar {
    margin-bottom: 0.5rem;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

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

.unit-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all var(--transition-fast);
}

.unit-card:hover {
    border-color: var(--color-border-light);
}

.progress {
    height: 8px;
    background: var(--color-bg-lighter);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary));
    border-radius: 4px;
    transition: width var(--transition-normal);
}

/* ==========================================================================
   12.5 Fort & Combat Stats
   ========================================================================== */

/* Fort Health Bar */
.fort-bar {
    width: 100%;
    height: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.fort-fill {
    height: 100%;
    transition: width var(--transition-normal);
    border-radius: var(--radius-sm);
}

.fort-fill.fort-green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.fort-fill.fort-yellow { background: linear-gradient(90deg, #eab308, #ca8a04); }
.fort-fill.fort-red { background: linear-gradient(90deg, #ef4444, #dc2626); }

.fort-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.fort-hp {
    color: var(--text-primary);
}

.fort-damaged {
    color: var(--danger);
    font-size: 0.75rem;
}

/* Fort Page */
.fort-page .card { margin-bottom: 1.5rem; }
.fort-page .card:last-child { margin-bottom: 0; }

/* Fort Hero Section */
.fort-overview-card {
    overflow: hidden;
}

.fort-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-lighter) 100%);
    border-bottom: 1px solid var(--color-border);
}

.fort-hero-icon {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.fort-hero-info h2 {
    margin: 0 0 0.25rem 0;
    color: var(--color-warning);
}

.fort-tagline {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Fort Stats Grid */
.fort-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.fort-stat-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.fort-stat-icon {
    font-size: 1.5rem;
}

.fort-stat-info {
    display: flex;
    flex-direction: column;
}

.fort-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.fort-stat-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Fort Health Display */
.fort-health-display {
    margin-bottom: 1.25rem;
}

.fort-bar-large {
    position: relative;
    width: 100%;
    height: 2rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.fort-bar-large .fort-fill {
    height: 100%;
    transition: width var(--transition-normal);
}

.fort-bar-large .fort-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.fort-health-numbers {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 1.25rem;
}

.fort-current {
    font-weight: 700;
}

.fort-separator {
    color: var(--color-text-muted);
}

.fort-max {
    color: var(--color-text-muted);
}

/* Fort Status Boxes */
.fort-status-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.fort-status-box .status-icon {
    font-size: 1.5rem;
}

.fort-status-box .status-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.fort-status-box .status-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.fort-status-healthy {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.fort-status-healthy strong {
    color: var(--color-success);
}

.fort-status-damaged {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.fort-status-damaged strong {
    color: var(--color-danger);
}

/* Repair Section */
.repair-info-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.repair-info-icon {
    font-size: 1.5rem;
}

.repair-info-content strong {
    display: block;
    color: var(--color-warning);
}

.repair-info-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.repair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.repair-box {
    background: var(--color-bg);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.repair-box-full {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.repair-box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.repair-box-icon {
    font-size: 1.25rem;
}

.repair-box-header h4 {
    margin: 0;
    color: var(--color-warning);
}

.repair-box-full .repair-box-header h4 {
    color: var(--color-success);
}

.repair-box-desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
}

.repair-cost-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.repair-cost-display .cost-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.repair-cost-display .cost-value {
    font-weight: 600;
    color: var(--color-warning);
}

.repair-summary {
    margin-bottom: 1rem;
}

.repair-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.repair-summary-row:last-child {
    border-bottom: none;
}

.repair-total-row {
    font-weight: 600;
}

.repair-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-warning);
}

/* Info Sections in Sidebar */
.info-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.info-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.info-section p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==========================================================================
   Bank Page
   ========================================================================== */

.bank-page .card { margin-bottom: 1.5rem; }

/* Bank Hero Section */
.bank-hero-card {
    overflow: hidden;
}

.bank-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-lighter) 100%);
    border-bottom: 1px solid var(--color-border);
}

.bank-hero-icon {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.bank-hero-info h2 {
    margin: 0 0 0.25rem 0;
    color: var(--color-warning);
}

.bank-tagline {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Bank Stats Grid */
.bank-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.bank-stat-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.bank-stat-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.bank-stat-success {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.bank-stat-icon {
    font-size: 2rem;
}

.bank-stat-info {
    display: flex;
    flex-direction: column;
}

.bank-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.bank-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.bank-stat-note {
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

/* Bank Action Info Boxes */
.bank-action-info {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.bank-action-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.action-info-icon {
    font-size: 1.5rem;
}

.action-info-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.action-info-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Amount Buttons */
.amount-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.amount-buttons-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-right: 0.5rem;
}

.amount-buttons .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Bank Form Summary */
.bank-form-summary {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.bank-form-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.bank-form-summary .summary-row:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

/* Bank Limit Reached */
.bank-limit-reached {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
}

.bank-limit-reached .limit-icon {
    font-size: 2rem;
}

.bank-limit-reached .limit-content strong {
    display: block;
    color: var(--color-warning);
    margin-bottom: 0.25rem;
}

.bank-limit-reached .limit-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Bank Empty State */
.bank-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.bank-empty-state .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Deposit Limit Display */
.deposit-limit-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.deposit-limit-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.1);
    border: 3px solid var(--color-success);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.deposit-limit-circle.depleted {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
}

.deposit-limit-circle .deposit-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.deposit-limit-circle .deposit-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.deposit-limit-info {
    flex: 1;
}

.deposit-limit-info .deposit-used {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.deposit-progress {
    height: 8px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
}

.deposit-progress-fill {
    height: 100%;
    background: var(--color-warning);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Reset Timer */
.reset-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: 6px;
    font-size: 0.875rem;
}

.reset-timer .reset-icon {
    font-size: 1rem;
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: var(--color-bg);
    border-radius: 6px;
}

.transaction-item .tx-icon {
    font-size: 1rem;
}

.transaction-item .tx-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.transaction-item .tx-type-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.transaction-item .tx-date {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.transaction-item .tx-amount {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Form Control Large */
.form-control-lg {
    font-size: 1.125rem;
    padding: 0.75rem 1rem;
}

/* Button Large */
.btn-lg {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
}

/* Two Column Layout */
.row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.col-main {
    min-width: 0;
}

.col-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 900px) {
    .row {
        grid-template-columns: 1fr;
    }
}

/* Gold Display */
.gold-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.gold-display .gold-icon {
    font-size: 2rem;
}

/* Info List */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.info-list li:last-child {
    border-bottom: none;
}

/* Buildings Page */
.buildings-page .card { margin-bottom: 1.5rem; }

.building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
}

.building-card {
    background: var(--color-bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.building-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.building-card.locked {
    opacity: 0.8;
}

/* Upgrade available badge on building card */
.building-upgrade-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    z-index: 10;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.building-card {
    position: relative;
}

/* Image placeholder - ready for future images */
.building-image-placeholder {
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-lighter) 100%);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
}

.building-icon-large {
    font-size: 3.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Header section */
.building-header {
    padding: 1rem 1.25rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.building-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
}

.building-tagline {
    display: block;
    font-size: 0.8rem;
    color: var(--color-primary);
    font-style: italic;
    padding-bottom: 0.5rem;
}

/* Info section */
.building-info {
    padding: 1rem 1.25rem 1.25rem;
}

.building-description {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

/* Benefit highlight */
.building-benefit {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid var(--color-success);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}

.benefit-icon {
    color: var(--color-success);
    font-weight: bold;
}

.benefit-text {
    font-size: 0.8rem;
    color: var(--color-success);
}

/* Status section */
.building-status {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: 6px;
}

.status-level, .status-bonus {
    flex: 1;
}

.status-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.status-value {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Upgrade section */
.upgrade-section {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.upgrade-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

.upgrade-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.upgrade-value {
    font-weight: 600;
}

.upgrade-cost {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.cost-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-right: 0.5rem;
}

.upgrade-requirements {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

.req-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.req-item {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Max level section */
.max-level-section {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
    text-align: center;
}

.final-bonus {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
}

.final-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-right: 0.5rem;
}

.final-value {
    font-weight: 600;
}

/* Combat Stats Grid */
.combat-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.combat-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    min-width: 80px;
}

.combat-stat .combat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.combat-stat .combat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.combat-stat .combat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.combat-stat.offense .combat-value { color: var(--danger); }
.combat-stat.defense .combat-value { color: var(--info); }
.combat-stat.spy-off .combat-value { color: var(--warning); }
.combat-stat.spy-def .combat-value { color: var(--success); }

/* Overview Page */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.overview-section {
    margin-bottom: 1.5rem;
}

.overview-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-block .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-block .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.stat-block .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-block.offense .stat-value { color: var(--danger); }
.stat-block.defense .stat-value { color: var(--info); }
.stat-block.spy-off .stat-value { color: var(--warning); }
.stat-block.spy-def .stat-value { color: var(--success); }

/* Proficiency List */
.prof-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prof-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.prof-name {
    font-weight: 500;
}

.prof-value {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-primary);
}

.prof-effect {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.prof-unspent {
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--warning);
    text-align: center;
    font-weight: 500;
}

/* Record Grid */
.record-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.record-section {
    text-align: center;
}

.record-section h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.record-stats {
    font-family: var(--font-display);
    font-size: 1rem;
}

.record-stats .wins {
    color: var(--success);
    font-weight: 600;
}

.record-stats .losses {
    color: var(--danger);
    font-weight: 600;
}

.record-stats .separator {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

/* Bonus Tags */
.bonus-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bonus-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--color-primary);
    border: 1px solid var(--border);
}

/* Character Info */
.character-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.info-row .label {
    color: var(--text-muted);
}

.info-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==========================================================================
   12.6 Mobile Elements (Hidden on Desktop)
   ========================================================================== */

/* Hide mobile-only elements on desktop */
.mobile-menu-toggle,
.sidebar-overlay,
.mobile-stats-bar {
    display: none;
}

/* ==========================================================================
   13. Utilities
   ========================================================================== */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.hidden { display: none !important; }

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .combat-power-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .game-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        width: 280px;
    }
    
    .game-sidebar.open {
        transform: translateX(0);
    }
    
    .game-main {
        margin-left: 0;
        padding: 1rem;
    }
    
    .player-stats-bar,
    .header-center {
        display: none;
    }
    
    .dashboard-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Dashboard responsive */
    .dashboard-hero {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .dashboard-hero-level {
        order: -1;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .dashboard-stat-box {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }

    .dashboard-stat-icon {
        font-size: 1.5rem;
    }

    .dashboard-stat-value {
        font-size: 1rem;
    }

    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .quick-action-btn {
        padding: 0.75rem 0.25rem;
    }

    .quick-action-btn .qa-icon {
        font-size: 1.25rem;
    }

    .quick-action-btn .qa-label {
        font-size: 0.625rem;
    }

    /* Overview responsive */
    .overview-hero {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .overview-hero-level {
        order: -1;
    }

    .overview-bonuses {
        justify-content: center;
    }

    .overview-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .overview-stat-box {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }

    .buildings-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .selection-preview {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-links .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   Player Profile Page
   ========================================================================== */

.player-profile-page .profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-profile-page .profile-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.player-profile-page .profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
}

.player-profile-page .profile-avatar .avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-bg-lighter);
    border-radius: 50%;
    font-size: 2.5rem;
    border: 3px solid var(--color-border);
}

.player-profile-page .profile-title {
    flex: 1;
}

.player-profile-page .profile-title h2 {
    margin-bottom: 0.25rem;
}

.player-profile-page .clan-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-lighter);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
}

.player-profile-page .clan-badge:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.player-profile-page .profile-bio {
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}

.player-profile-page .profile-bio p {
    margin: 0;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Profile Stats Table Layout */
.player-profile-page .profile-stats-table {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.player-profile-page .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--color-border);
}

.player-profile-page .stats-row:last-child {
    border-bottom: none;
}

.player-profile-page .stats-row-full {
    grid-template-columns: 1fr;
}

.player-profile-page .stats-cell {
    padding: 1rem 1.25rem;
    background: var(--color-bg-lighter);
    border-right: 1px solid var(--color-border);
}

.player-profile-page .stats-cell:last-child {
    border-right: none;
}

.player-profile-page .stats-cell-wide {
    grid-column: 1 / -1;
}

.player-profile-page .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.player-profile-page .stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.player-profile-page .clan-link {
    color: var(--color-primary);
    text-decoration: none;
}

.player-profile-page .clan-link:hover {
    text-decoration: underline;
}

.player-profile-page .fort-hp-bar {
    position: relative;
    height: 28px;
    background: var(--color-bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.player-profile-page .fort-hp-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.player-profile-page .fort-hp-fill.fort-green {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.player-profile-page .fort-hp-fill.fort-yellow {
    background: linear-gradient(90deg, #eab308, #ca8a04);
}

.player-profile-page .fort-hp-fill.fort-red {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.player-profile-page .fort-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* Responsive for smaller screens */
@media (max-width: 600px) {
    .player-profile-page .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .player-profile-page .stats-cell:nth-child(2) {
        border-right: none;
    }

    .player-profile-page .stats-cell:nth-child(3) {
        grid-column: 1 / -1;
        border-top: 1px solid var(--color-border);
    }
}

.player-profile-page .profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.player-profile-page .profile-actions .inline {
    display: inline;
}

/* Friends list compact (sidebar) */
.friend-list-compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.friend-list-compact li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.friend-list-compact li:last-child {
    border-bottom: none;
}

.friend-list-compact a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
}

.friend-list-compact a:hover {
    color: var(--color-primary);
}

.friend-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-level {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Stat rows for sidebar */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

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

/* Player Profile - Rank Display */
.rank-display {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--color-border);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-item.rank-overall {
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 2px solid var(--color-border-light);
}

.rank-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.rank-value {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-weight: 600;
}

.rank-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1rem;
}

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

.rank-overall .rank-link {
    font-size: 1.25rem;
}

.rank-total {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: normal;
}

.rank-item.rank-networth {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--color-border-light);
    border-bottom: none;
}

.networth-value {
    color: var(--color-warning);
    font-size: 0.9rem;
}

/* ==========================================================================
   Rankings Page
   ========================================================================== */

/* Ranking Type Selector */
.ranking-types {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ranking-type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.ranking-type-btn:hover {
    background: var(--color-bg-lighter);
    color: var(--color-text);
    border-color: var(--color-border-light);
}

.ranking-type-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

.ranking-type-btn .type-icon {
    font-size: 1.25rem;
}

.ranking-type-btn .type-label {
    font-weight: 500;
}

/* Card Header Info */
.card-header .header-info {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: normal;
}

/* Rankings Podium */
.rankings-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, var(--color-bg-lighter) 0%, transparent 100%);
    border-radius: 12px;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.podium-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-fast);
    min-width: 140px;
}

.podium-player:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.podium-medal {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.podium-1 .podium-medal {
    font-size: 3rem;
}

.podium-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.podium-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.podium-level {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.podium-clan {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    margin-top: 0.25rem;
}

.podium-base {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
}

.podium-base-1 {
    background: linear-gradient(180deg, #ffd700 0%, #b8860b 100%);
    color: #1a1a1a;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podium-base-2 {
    background: linear-gradient(180deg, #c0c0c0 0%, #808080 100%);
    color: #1a1a1a;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podium-base-3 {
    background: linear-gradient(180deg, #cd7f32 0%, #8b4513 100%);
    color: #1a1a1a;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rankings List */
.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.ranking-row:hover {
    background: var(--color-bg-light);
}

.ranking-row.is-you {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-primary);
}

.ranking-position {
    min-width: 50px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: center;
}

.position-top10 {
    color: var(--color-primary);
    font-size: 1.1rem;
}

.ranking-player {
    flex: 1;
    min-width: 0;
}

.ranking-player .player-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.ranking-player .player-name:hover {
    color: var(--color-primary);
}

.ranking-player .player-details {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.ranking-player .detail-sep {
    color: var(--color-text-dark);
}

.ranking-player .player-clan {
    color: var(--color-primary);
    text-decoration: none;
}

.ranking-player .player-clan:hover {
    text-decoration: underline;
}

.ranking-stats {
    display: flex;
    gap: 0.75rem;
}

.ranking-stats .stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--color-bg-card);
    border-radius: 6px;
    min-width: 50px;
}

.ranking-stats .stat-label {
    font-size: 0.65rem;
    color: var(--color-text-dark);
    text-transform: uppercase;
}

.ranking-stats .stat-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.ranking-stats .stat-wins .stat-value {
    color: var(--color-success);
}

.ranking-actions {
    flex-shrink: 0;
}

/* Your Rank Card */
.your-rank-card .card-body {
    padding: 1rem;
}

.your-ranks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.your-rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.your-rank-item:hover {
    background: var(--color-bg-light);
}

.your-rank-item.active {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--color-primary);
}

.your-rank-item .rank-type-icon {
    font-size: 1.25rem;
}

.your-rank-item .rank-info {
    display: flex;
    flex-direction: column;
}

.your-rank-item .rank-type-name {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.your-rank-item .rank-position {
    font-weight: 600;
    color: var(--color-primary);
}

.your-rank-item .rank-position-value {
    font-weight: 600;
    color: var(--color-warning);
    font-size: 0.85rem;
}

.your-rank-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.your-rank-current .current-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.your-rank-current .current-rank {
    font-weight: 600;
    font-size: 1.1rem;
}

.your-rank-current .current-rank small {
    font-weight: normal;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* Jump buttons */
.jump-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ranking Info List */
.ranking-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-info-list .info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ranking-info-list .info-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ranking-info-list .info-text {
    display: flex;
    flex-direction: column;
}

.ranking-info-list .info-text strong {
    font-size: 0.875rem;
    color: var(--color-text);
}

.ranking-info-list .info-text span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Responsive Rankings */
@media (max-width: 768px) {
    .ranking-types {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .ranking-type-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
    }

    .ranking-type-btn .type-label {
        display: none;
    }

    .rankings-podium {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
    }

    .podium-spot {
        width: 100%;
        max-width: 200px;
    }

    .podium-1 {
        order: -1;
    }

    .podium-base {
        height: auto !important;
        padding: 0.5rem;
    }

    .ranking-row {
        flex-wrap: wrap;
    }

    .ranking-stats {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--color-border);
    }

    .ranking-actions {
        order: 2;
    }

    .your-ranks-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Tabs Component
   ========================================================================== */

.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-lighter);
}

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

.tab-content {
    display: none;
}

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

/* Stat tags for armory */
.stat-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.stat-tag.offense {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.stat-tag.defense {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stat-tag.spy {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.stat-tag.sentry {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Armory page specifics */
.armory-page .inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.armory-page .qty-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    text-align: center;
}

.armory-page tr.disabled {
    opacity: 0.6;
}

.armory-page tr.disabled td {
    color: var(--color-text-muted);
}

/* Charisma Bonus Display */
.charisma-bonus-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(167, 139, 250, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.charisma-icon {
    font-size: 2rem;
}

.charisma-info {
    display: flex;
    flex-direction: column;
}

.charisma-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #a78bfa;
}

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

.gold-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.gold-icon {
    font-size: 1.5rem;
}

.gold-value {
    color: var(--color-warning);
}

/* Section titles for sub-sections */
.section-title {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.section-title:first-child {
    margin-top: 0;
}

/* Item actions in armory */
.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Training Page
   ========================================================================== */

.training-page .table td {
    vertical-align: middle;
}

.training-page .stat-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.training-page .stat-tag.offense {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

.training-page .stat-tag.defense {
    background: rgba(40, 167, 69, 0.2);
    color: #51cf66;
}

.training-page .stat-tag.spy {
    background: rgba(111, 66, 193, 0.2);
    color: #b197fc;
}

.training-page .stat-tag.production {
    background: rgba(255, 193, 7, 0.2);
    color: var(--color-warning);
}

.training-page .cost {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.train-form {
    margin: 0;
}

.train-controls {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.train-qty-input {
    width: 70px;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.train-qty-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.train-qty-input::-webkit-inner-spin-button,
.train-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.train-qty-input[type="number"] {
    -moz-appearance: textfield;
}

.max-btn {
    padding: 0.375rem 0.625rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
}

.training-page tr.disabled {
    opacity: 0.5;
}

.training-page tr.disabled td {
    color: var(--color-text-muted);
}

/* ==========================================================================
   Toggle Switch (Modern Checkbox Style)
   ========================================================================== */

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    min-width: 44px;
    height: 24px;
    background: var(--color-bg-lighter);
    border: 2px solid var(--color-border);
    border-radius: 24px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.toggle-switch:hover .toggle-slider {
    border-color: var(--color-border-light);
}

.toggle-switch input:checked:hover + .toggle-slider {
    border-color: var(--color-primary-light);
}

.toggle-label {
    color: var(--color-text);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Online Status Indicator
   ========================================================================== */

.online-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.online-status.online {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success), 0 0 12px var(--color-success);
    animation: pulse-online 2s ease-in-out infinite;
}

.online-status.offline {
    background: var(--color-danger);
    opacity: 0.7;
}

.online-status.hidden {
    background: var(--color-text-dark);
    opacity: 0.5;
}

@keyframes pulse-online {
    0%, 100% {
        box-shadow: 0 0 8px var(--color-success), 0 0 12px var(--color-success);
    }
    50% {
        box-shadow: 0 0 12px var(--color-success), 0 0 20px var(--color-success);
    }
}

/* Status Badges for Player Profile */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.status-online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

.status-badge.status-online::before {
    background: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-badge.status-offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.status-badge.status-offline::before {
    background: var(--color-danger);
    opacity: 0.7;
}

.status-badge.status-hidden {
    background: rgba(100, 116, 139, 0.15);
    color: var(--color-text-muted);
}

.status-badge.status-hidden::before {
    background: var(--color-text-dark);
    opacity: 0.5;
}

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

/* (You) Badge */
.you-badge {
    font-size: 0.7em;
    font-weight: normal;
    color: var(--color-primary);
    opacity: 0.8;
    margin-left: 0.25rem;
}

/* User Menu & Logout */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.user-name:hover {
    color: var(--color-primary);
}

.header-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.header-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-link:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Improved Turns Select Dropdown */
.turns-select {
    width: auto;
    min-width: 55px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    background: var(--color-bg-lighter);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    appearance: auto;
}

.turns-select:hover {
    border-color: var(--color-primary);
}

.turns-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* ==========================================================================
   Messages / Email System
   ========================================================================== */

/* Message List (Inbox/Sent) */
.messages-page .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.messages-page .header-actions {
    display: flex;
    gap: 0.5rem;
}

.message-list {
    display: flex;
    flex-direction: column;
}

.message-item {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition-fast);
    align-items: center;
}

.message-item:hover {
    background: var(--color-bg-lighter);
}

.message-item:last-child {
    border-bottom: none;
}

.message-item.unread {
    background: rgba(34, 197, 94, 0.05);
    border-left: 3px solid var(--color-primary);
    margin-left: -3px;
    padding-left: calc(1.25rem + 3px);
}

.message-item.unread .message-from,
.message-item.unread .message-to,
.message-item.unread .message-subject {
    font-weight: 600;
    color: var(--color-text);
}

.message-from,
.message-to {
    font-size: 0.875rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-content {
    min-width: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.message-content:hover .message-subject {
    color: var(--color-primary);
}

.message-item .player-link {
    color: var(--color-primary);
    text-decoration: none;
}

.message-item .player-link:hover {
    text-decoration: underline;
}

.message-subject {
    font-size: 0.875rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.message-preview {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Message View Page */
.message-view-page .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message-view-page .header-actions {
    display: flex;
    gap: 0.5rem;
}

.message-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.message-header .message-subject {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    white-space: normal;
    overflow: visible;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.message-meta .message-from a {
    color: var(--color-primary);
    font-weight: 500;
}

.message-meta .message-from a:hover {
    text-decoration: underline;
}

.message-meta .message-date {
    color: var(--color-text-muted);
}

.message-body {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
    min-height: 150px;
}

.message-body p {
    margin-bottom: 1rem;
}

.message-body p:last-child {
    margin-bottom: 0;
}

/* Compose Page */
.compose-page .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compose-page .form-group label {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.compose-page textarea.form-control {
    min-height: 200px;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

/* Responsive adjustments for messages */
@media (max-width: 768px) {
    .message-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .message-item .message-date {
        order: -1;
        font-size: 0.75rem;
    }

    .message-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   Mobile Bottom Spacer - Hidden on Desktop
   ========================================================================== */
.mobile-bottom-spacer {
    display: none;
}

/* Mobile stats bar - hidden on desktop */
.mobile-stats-bar {
    display: none;
}

/* ==========================================================================
   Advanced Stats Page
   ========================================================================== */

.stats-page-advanced {
    max-width: 1200px;
    margin: 0 auto;
}

/* Stats Hero Section */
.stats-hero {
    background: linear-gradient(135deg, var(--color-bg-card) 0%, var(--color-bg-lighter) 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stats-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stats-hero-title h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    color: var(--color-text);
}

.stats-hero-subtitle {
    color: var(--color-text-muted);
    margin: 0;
}

.stats-hero-summary {
    display: flex;
    gap: 2rem;
}

.summary-stat {
    text-align: center;
    padding: 0.75rem 1.5rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.summary-stat.highlight {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--color-primary);
}

.summary-stat .summary-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-display);
}

.summary-stat.highlight .summary-value {
    color: var(--color-primary);
}

.summary-stat .summary-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bonuses Grid */
.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.bonus-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.bonus-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--color-primary);
}

.bonus-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.bonus-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bonus-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-display);
    line-height: 1;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 20px var(--color-primary-glow);
}

.bonus-card-effect {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.effect-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.effect-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.bonus-card-bar {
    height: 4px;
    background: var(--color-bg-lighter);
    border-radius: 2px;
    overflow: hidden;
}

.bonus-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Allocation Section */
.allocation-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.allocation-title h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
}

.allocation-title p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.allocation-counter {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.counter-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-display);
}

.counter-max {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Allocation Grid */
.allocation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.allocation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.allocation-item:hover {
    border-color: var(--color-primary);
}

.allocation-stat-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.allocation-icon {
    font-size: 1.5rem;
}

.allocation-details {
    display: flex;
    flex-direction: column;
}

.allocation-name {
    font-weight: 600;
    color: var(--color-text);
}

.allocation-current {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.allocation-current .new-value {
    color: var(--color-text);
    transition: color 0.2s;
}

.allocation-current .new-value.changed {
    color: var(--color-primary);
    font-weight: 600;
}

/* Allocation Controls */
.allocation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alloc-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-lighter);
    color: var(--color-text);
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alloc-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

.alloc-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--color-border);
    background: var(--color-bg-lighter);
    color: var(--color-text);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.alloc-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* Allocation Actions */
.allocation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.allocation-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-warning);
}

.warning-icon {
    font-size: 1rem;
}

/* No Points Message */
.no-points-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.no-points-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-points-message h3 {
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.no-points-message p {
    margin: 0 0 1rem 0;
    color: var(--color-text-muted);
}

.next-level-info {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-primary);
}

/* Stats Info Section */
.stats-info-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.info-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.info-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-card-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.info-card-content p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
    .bonuses-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-info-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .bonuses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .stats-hero-summary {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .bonuses-grid {
        grid-template-columns: 1fr;
    }

    .bonus-card {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }

    .bonus-card-icon {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .bonus-card-content {
        flex: 1;
    }

    .bonus-card-value {
        font-size: 1.75rem;
    }

    .bonus-card-effect {
        flex-direction: row;
        justify-content: space-between;
    }

    .stats-hero-summary {
        flex-direction: row;
        gap: 1rem;
    }

    .summary-stat {
        padding: 0.5rem 1rem;
    }

    .summary-stat .summary-value {
        font-size: 1.25rem;
    }

    .allocation-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .allocation-item {
        flex-direction: column;
        gap: 1rem;
    }

    .allocation-actions {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stats-info-section {
        grid-template-columns: 1fr;
    }

    .info-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Mode Switcher (Battle Logs / Spy Logs)
   ========================================================================== */

.mode-switcher {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-lighter);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mode-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.mode-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

.mode-btn .badge {
    margin-left: 0.25rem;
}

.mode-icon {
    font-size: 1.1rem;
}

/* ==========================================================================
   Log Tabs (Incoming/Outgoing)
   ========================================================================== */

.log-tabs,
.battle-logs-page .tabs,
.spy-logs-page .tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 0;
}

.log-tabs .tab,
.battle-logs-page .tab,
.spy-logs-page .tab {
    padding: 0.75rem 1.5rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-tabs .tab:hover,
.battle-logs-page .tab:hover,
.spy-logs-page .tab:hover {
    color: var(--color-text);
}

.log-tabs .tab.active,
.battle-logs-page .tab.active,
.spy-logs-page .tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-count {
    font-size: 0.8rem;
    background: var(--color-bg-lighter);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* ==========================================================================
   Intel Report (Spy Detail View)
   ========================================================================== */

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.intel-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.intel-section {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem;
}

.intel-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

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

.intel-item {
    background: var(--color-bg-lighter);
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
}

.intel-item.highlight-offense {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.intel-item.highlight-defense {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.intel-item.highlight-gold {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.intel-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.intel-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Type badges for unit/item types */
.type-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: capitalize;
}

.type-badge.type-offense { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.type-badge.type-defense { background: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.type-badge.type-spy_offense { background: rgba(168, 85, 247, 0.3); color: #d8b4fe; }
.type-badge.type-spy_defense { background: rgba(20, 184, 166, 0.3); color: #5eead4; }
.type-badge.type-production { background: rgba(234, 179, 8, 0.3); color: #fde047; }

/* Buildings grid */
.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.building-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 4px;
}

.building-name {
    color: var(--color-text);
}

.building-level {
    color: var(--color-primary);
    font-weight: 500;
}

/* Report actions */
.report-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Filter Panel (Logs)
   ========================================================================== */

.filters-panel {
    background: var(--color-bg-lighter);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid var(--color-border);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.filter-group input::placeholder {
    color: var(--color-text-dark);
}

.filter-group select {
    cursor: pointer;
}

.filter-group input[type="date"] {
    min-width: 140px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.results-info {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

/* ==========================================================================
   Operation Costs Display
   ========================================================================== */

.operation-costs {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.cost-item {
    color: var(--color-text-muted);
}

/* ==========================================================================
   Spy/Log Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .mode-switcher {
        flex-direction: column;
    }

    .mode-btn {
        justify-content: center;
    }

    .intel-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .report-actions {
        flex-direction: column;
    }

    .operation-costs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1;
    }

    .buildings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Income Breakdown (Overview Page)
   ========================================================================== */

.income-breakdown {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.income-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--color-border);
}

.income-icon {
    font-size: 1.25rem;
}

.income-title {
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
}

.income-total {
    font-weight: 700;
    color: var(--color-warning);
    font-size: 1.1rem;
}

.income-details {
    padding: 0.5rem 0;
}

.income-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

.income-row.subtotal {
    border-top: 1px dashed var(--color-border);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
}

.income-row.bonus {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.income-row.total {
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

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

.income-row.total .income-label {
    color: var(--color-text);
}

.income-value {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 80px;
}

/* ==========================================================================
   Sidebar Clocks - Hidden on Desktop
   ========================================================================== */

.sidebar-clocks {
    display: none;
}

.sidebar-header {
    display: none;
}

/* ==========================================================================
   Mercenaries Page - Hire Controls
   ========================================================================== */

/* Desktop hire controls styling */
.hire-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.merc-qty-input {
    width: 80px;
    text-align: center;
}

/* Unit info wrapper - desktop defaults to block */
.unit-info {
    display: block;
}

/* Availability info wrapper - desktop defaults to block */
.availability-info {
    display: block;
}

/* ==========================================================================
   Desktop Stats Bar Labels
   ========================================================================== */

/* Make stat items display as column to stack icon, value, and label */
.player-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.625rem 0.75rem;
}

.player-stats-bar .stat-icon {
    font-size: 1rem;
    line-height: 1;
}

.player-stats-bar .stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.1;
}

/* Style for stat labels - small, subtle text */
.player-stats-bar .stat-label {
    font-size: 0.5625rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-top: 0.1rem;
}

/* ==========================================================================
   Clan Profile & Management Styles
   ========================================================================== */

/* Clan Profile Card */
.clan-profile-card {
    margin-bottom: 1.5rem;
}

.clan-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.clan-avatar-wrapper {
    flex-shrink: 0;
}

.clan-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--color-border-light);
}

.clan-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-bg-lighter), var(--color-bg-light));
    border: 2px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clan-avatar-text {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.clan-profile-info {
    flex: 1;
}

.clan-profile-info .clan-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.clan-profile-info .clan-title h2 {
    margin: 0;
    font-size: 1.5rem;
}

.clan-profile-info .clan-tag {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1rem;
}

.clan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.clan-meta-item {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.clan-meta-item strong {
    color: var(--color-text);
}

.clan-meta-item a {
    color: var(--color-primary);
}

.clan-profile-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
}

/* Clan Activity List */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

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

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    display: block;
    color: var(--color-text);
    font-size: 0.875rem;
}

.activity-detail {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.activity-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--color-text-dark);
}

/* Clan Description */
.clan-description {
    line-height: 1.6;
    color: var(--color-text);
}

/* Clan Search List */
.clan-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.clan-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color var(--transition-fast);
}

.clan-list-item:hover {
    border-color: var(--color-border-light);
}

.clan-list-info {
    flex: 1;
}

.clan-list-name {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.clan-list-name:hover {
    color: var(--color-primary);
}

.clan-list-name .clan-tag {
    color: var(--color-primary);
    font-weight: 700;
}

.clan-list-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.clan-list-action {
    flex-shrink: 0;
}

/* Invite Form */
.invite-form .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.invite-form .flex-grow {
    flex: 1;
}

/* Rank indicator text */
.text-sm {
    font-size: 0.75rem;
}

/* Disabled button style */
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Two-Factor Authentication
   ========================================================================== */

.two-factor-status {
    padding: 1rem 0;
}

.two-factor-status.enabled .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary-glow);
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    margin-bottom: 1rem;
}

.two-factor-status.enabled .status-icon {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.2em;
}

.two-factor-status.enabled .status-text {
    color: var(--color-primary);
    font-weight: 600;
}

.two-factor-status .status-description {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.backup-codes-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-lighter);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.backup-codes-info .backup-label {
    color: var(--color-text-muted);
}

.backup-codes-info .backup-count {
    font-weight: bold;
    color: var(--color-primary);
}

.backup-codes-info .backup-count.low {
    color: var(--color-warning);
}

.backup-codes-info .backup-warning {
    width: 100%;
    color: var(--color-warning);
    font-size: 0.85em;
    margin-top: 0.25rem;
}

.two-factor-actions .inline-form {
    margin-bottom: 1rem;
}

.two-factor-actions .form-group-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.two-factor-actions .form-control-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 150px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.two-factor-actions .form-control-sm:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.two-factor-actions .form-control-sm::placeholder {
    color: var(--color-text-muted);
}

.two-factor-actions .divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

.two-factor-actions .disable-warning {
    color: var(--color-text-muted);
    font-size: 0.9em;
    margin-bottom: 0.75rem;
}

.two-factor-actions .form-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.two-factor-actions .form-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.two-factor-actions .form-row .form-control {
    width: 100%;
}

.two-factor-actions .btn-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    white-space: nowrap;
}

.two-factor-actions .btn-danger:hover {
    background: #b91c1c;
}

.two-factor-status.disabled .benefits-list {
    margin: 1rem 0 1.5rem;
}

.two-factor-status.disabled .benefit {
    padding: 0.4rem 0;
    color: var(--color-text);
}

.two-factor-status.disabled .benefit:before {
    color: var(--color-primary);
    margin-right: 0.5rem;
}

/* ==========================================================================
   Armory Page - Equipment Status
   ========================================================================== */

/* Tab badges for unit counts */
.armory-page .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.armory-page .unit-badge {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: normal;
}

/* Equipment Status Box in tab content */
.equipment-status-box {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.equipment-status-box .equip-stat {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.equipment-status-box .label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.equipment-status-box .value {
    font-weight: 600;
}

/* Equipment Overview in sidebar */
.equip-overview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.equip-overview .equip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--color-border);
}

.equip-overview .equip-row:last-child {
    border-bottom: none;
}

.equip-overview .type-label {
    font-size: 0.9rem;
}

.equip-overview .type-value {
    font-size: 0.85rem;
    text-align: right;
}

/* Buy/Sell Mode Toggle */
.armory-page .mode-toggle {
    display: flex;
    gap: 0;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    padding: 2px;
}

.armory-page .mode-toggle .mode-btn {
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.armory-page .mode-toggle .mode-btn:hover {
    color: var(--color-text);
}

.armory-page .mode-toggle .mode-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Armory Modes */
.armory-page .armory-mode {
    display: none;
}

.armory-page .armory-mode.active {
    display: block;
}

/* Sell mode styling */
.armory-page .sell-mode .btn-outline {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.armory-page .sell-mode .btn-outline:hover {
    background: var(--color-warning);
    color: #000;
}

/* Armory Controls */
.armory-page .armory-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.armory-page .armory-controls .qty-input {
    width: 80px;
}

.armory-page .armory-controls .max-btn {
    white-space: nowrap;
}

/* Armory Equipment Status Box */
.armory-page .equipment-status-box {
    background: var(--color-bg-tertiary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
}
.armory-page .equip-units {
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.armory-page .equip-units .units-count {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-text);
}
.armory-page .equip-units .units-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.armory-page .equip-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.armory-page .slot-box {
    background: var(--color-bg-secondary);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    border: 2px solid var(--color-success);
}
.armory-page .slot-box.has-unused {
    border-color: var(--color-warning);
}
.armory-page .slot-box .slot-label {
    display: block;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.armory-page .slot-box .slot-value {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-text);
}
.armory-page .slot-box .slot-unused {
    display: block;
    font-size: 0.65rem;
    color: var(--color-warning);
    margin-top: 2px;
}

/* Armory Sidebar Equipment Status */
.armory-page .sidebar-equip-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.armory-page .sidebar-equip-row:last-child {
    border-bottom: none;
}
.armory-page .sidebar-equip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.armory-page .sidebar-equip-header span:first-child {
    font-weight: bold;
}
.armory-page .sidebar-units {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.armory-page .sidebar-slots {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

/* Armory Mode Toggle */
.armory-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 1rem;
    width: fit-content;
}
.armory-mode-toggle .mode-btn {
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}
.armory-mode-toggle .mode-btn:hover {
    color: var(--color-text);
}
.armory-mode-toggle .mode-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Armory Upgrade Rows */
.armory-page .upgrade-row {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid var(--color-success);
}
.armory-page .upgrade-row td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.armory-page .upgrade-label {
    font-weight: 500;
    color: var(--color-success);
}
.armory-page .upgrade-cost {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Tier Toggle Controls (Armory) */
.armory-page .tier-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    margin-bottom: 1rem;
}
.armory-page .tier-controls .tier-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.armory-page .tier-controls .tier-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.armory-page .tier-controls .tier-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    min-width: 32px;
    text-align: center;
}
.armory-page .tier-controls .tier-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}
.armory-page .tier-controls .tier-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.armory-page .tier-controls .tier-btn.hidden-tier {
    background: var(--color-bg);
    color: var(--color-text-muted);
    opacity: 0.6;
}
.armory-page .tier-controls .tier-btn.hidden-tier:hover {
    opacity: 1;
}

/* Armory Tier & Mode Visibility */
.armory-page .tier-row.tier-hidden {
    display: none !important;
}
.armory-page .sell-row.mode-hidden,
.armory-page .buy-row.mode-hidden,
.armory-page .sell-header.mode-hidden,
.armory-page .buy-header.mode-hidden,
.armory-page .upgrade-header.mode-hidden {
    display: none;
}
.armory-page .upgrade-row {
    display: none;
}
.armory-page .upgrade-row.show {
    display: table-row;
}

/* Training Page Mode Toggle */
.training-page .mode-toggle {
    display: flex;
    gap: 0;
    background: var(--color-bg-lighter);
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 1rem;
    width: fit-content;
}
.training-page .mode-btn {
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}
.training-page .mode-btn:hover {
    color: var(--color-text);
}
.training-page .mode-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Training Page Upgrade Rows */
.training-page .upgrade-row {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid var(--color-success);
}
.training-page .upgrade-row td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.training-page .upgrade-label {
    font-weight: 500;
    color: var(--color-success);
}
.training-page .upgrade-cost {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Tier Toggle Controls (Training) */
.training-page .unit-type-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.training-page .unit-type-card .card-header h2 {
    margin: 0;
}
.training-page .tier-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.training-page .tier-controls .tier-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.training-page .tier-controls .tier-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.training-page .tier-controls .tier-btn {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease;
    min-width: 24px;
    text-align: center;
}
.training-page .tier-controls .tier-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}
.training-page .tier-controls .tier-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.training-page .tier-controls .tier-btn.hidden-tier {
    background: var(--color-bg);
    color: var(--color-text-muted);
    opacity: 0.6;
}
.training-page .tier-controls .tier-btn.hidden-tier:hover {
    opacity: 1;
}

/* Training Page Tier & Mode Visibility */
.training-page .tier-row.tier-hidden {
    display: none !important;
}
.training-page .upgrade-row {
    display: none;
}
.training-page .upgrade-row.show {
    display: table-row;
}
.training-page .train-row.mode-hidden {
    display: none;
}

/* Pagination with page numbers */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.5rem 0;
}
.pagination .btn {
    min-width: 32px;
    padding: 0.25rem 0.5rem;
}
.pagination .pagination-current {
    cursor: default;
}
.pagination .pagination-ellipsis {
    padding: 0 0.25rem;
    color: var(--color-text-muted);
}
.pagination .pagination-info {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Spy Result Cards */
.spy-result-card {
    margin-bottom: 1rem;
}
.spy-result-card .card-body {
    text-align: center;
    padding: 1.5rem;
}
.spy-result-card .result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.spy-result-card .result-icon {
    font-size: 1.5rem;
}
.spy-result-card .result-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.spy-result-card .result-message {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}
.spy-result-card .result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.spy-result-card .result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.spy-result-card .result-stat .stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.spy-result-card .result-stat .stat-value {
    font-size: 1.25rem;
    font-weight: bold;
}
.spy-result-card .result-stat.positive .stat-value {
    color: var(--color-success);
}
.spy-result-card .result-stat.negative .stat-value {
    color: var(--color-danger);
}
.spy-result-card.result-success {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.05);
}
.spy-result-card.result-success .result-header h3 {
    color: var(--color-success);
}
.spy-result-card.result-failure {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.05);
}
.spy-result-card.result-failure .result-header h3 {
    color: var(--color-danger);
}

/* Table row highlighting for logs */
.table tr.row-success {
    background: rgba(34, 197, 94, 0.05);
}
.table tr.row-success:hover {
    background: rgba(34, 197, 94, 0.1);
}
.table tr.row-danger {
    background: rgba(239, 68, 68, 0.05);
}
.table tr.row-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Form Control Small & Quantity Inputs (Dark Theme)
   ========================================================================== */

.form-control-sm,
.qty-input,
.train-qty-input,
.merc-qty-input,
input[type="number"].form-control-sm {
    display: inline-block;
    width: auto;
    min-width: 60px;
    max-width: 80px;
    padding: 0.375rem 0.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.form-control-sm:focus,
.qty-input:focus,
.train-qty-input:focus,
.merc-qty-input:focus,
input[type="number"].form-control-sm:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* Remove spinner arrows on number inputs for cleaner look */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button,
.train-qty-input::-webkit-outer-spin-button,
.train-qty-input::-webkit-inner-spin-button,
.merc-qty-input::-webkit-outer-spin-button,
.merc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type="number"],
.train-qty-input[type="number"],
.merc-qty-input[type="number"] {
    -moz-appearance: textfield;
}

/* Armory Controls Styling */
.armory-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.armory-controls .qty-input {
    text-align: center;
}

/* Train Controls Styling */
.train-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.train-controls .train-qty-input {
    text-align: center;
}

/* Mercenary / Hire Controls Styling */
.hire-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hire-controls .merc-qty-input {
    text-align: center;
}

/* Battle Upgrades Controls Styling */
.upgrade-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upgrade-controls .qty-input {
    text-align: center;
}

/* ==========================================================================
   OAuth / Social Login Buttons
   ========================================================================== */

.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.oauth-divider span {
    padding: 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--oauth-bg, #fff);
    color: var(--oauth-text, #333);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-oauth:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

.btn-oauth:active {
    transform: translateY(0);
}

.oauth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.oauth-icon svg {
    width: 20px;
    height: 20px;
}

.oauth-label {
    flex: 1;
    text-align: center;
}

/* Google Button - White with colored logo */
.btn-oauth-google {
    background: #ffffff;
    color: #757575;
    border: 1px solid #dadce0;
}

.btn-oauth-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Discord Button */
.btn-oauth-discord {
    background: #5865F2;
    color: #ffffff;
    border: none;
}

.btn-oauth-discord:hover {
    background: #4752c4;
}

/* Connected Accounts in Settings */
.connected-accounts {
    margin-top: 2rem;
}

.connected-account {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.connected-account-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    margin-right: 1rem;
}

.connected-account-icon svg {
    width: 24px;
    height: 24px;
}

.connected-account-info {
    flex: 1;
}

.connected-account-name {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.connected-account-email {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.connected-account-date {
    font-size: 0.75rem;
    color: var(--color-text-dark);
    margin-top: 0.25rem;
}

.connected-account-actions {
    display: flex;
    gap: 0.5rem;
}

.connected-account.not-connected {
    opacity: 0.7;
    border-style: dashed;
}

.connected-account.not-connected .connected-account-icon {
    opacity: 0.5;
}

/* Password Status Card */
.password-status {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.password-status-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-lighter);
    border-radius: 8px;
    margin-right: 1rem;
    font-size: 1.25rem;
}

.password-status-info {
    flex: 1;
}

.password-status-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.password-status-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.password-status.has-password .password-status-icon {
    color: var(--color-success);
}

.password-status.no-password .password-status-icon {
    color: var(--color-warning);
}

/* ========================================
   Discord Integration
   ======================================== */
.discord-connected-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.discord-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

.discord-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.discord-avatar-default {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5865f2;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}

.discord-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.discord-username {
    font-weight: 600;
    font-size: 1.1em;
}

.discord-status {
    font-size: 0.85em;
    color: var(--color-success, #28a745);
}

.discord-options {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

.discord-options .toggle-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.discord-options .toggle-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.discord-options .toggle-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.discord-options .toggle-label {
    font-weight: 500;
}

.discord-sync-info {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.discord-not-connected {
    text-align: center;
    padding: 1rem;
}

.discord-not-connected p {
    margin-bottom: 1rem;
}

.discord-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.discord-features-list li {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.discord-features-list li::before {
    content: '✓';
    color: var(--color-success, #28a745);
    font-weight: bold;
}

.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #5865f2;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-discord:hover {
    background: #4752c4;
    color: white;
}

.btn-discord svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   FORCED RESPONSIVE OVERRIDES
   These apply based on actual viewport width, even when users enable
   "Request Desktop Site" on mobile browsers
   ========================================================================== */

/* Tablet viewport override (769px - 1024px actual width) */
@media screen and (max-width: 1024px) {
    /* Stack sidebar below main content */
    .row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.25rem !important;
    }

    .row .col-main {
        width: 100% !important;
    }

    .row .col-side {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
}

/* Mobile viewport override (768px and below actual width) */
@media screen and (max-width: 768px) {
    /* Force mobile sidebar behavior */
    .game-sidebar {
        position: fixed !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1000 !important;
        transition: left 0.3s ease !important;
    }

    .game-sidebar.open {
        left: 0 !important;
    }

    .game-main {
        margin-left: 0 !important;
        padding: 1rem !important;
        padding-bottom: 100px !important;
    }

    /* Stack sidebar cards vertically on mobile */
    .row .col-side {
        grid-template-columns: 1fr !important;
    }

    /* Compact tables */
    th, td {
        padding: 0.5rem !important;
        font-size: 0.8125rem !important;
    }

    /* Compact armory/training controls */
    .armory-controls,
    .train-controls {
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }

    .qty-input,
    .train-qty-input {
        width: 50px !important;
    }

    /* Stack tier controls */
    .tier-controls {
        flex-wrap: wrap !important;
    }

    /* Compact tabs */
    .tabs {
        flex-wrap: wrap !important;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    /* Hide unit badge text on small screens */
    .tab-btn .unit-badge {
        font-size: 0.7rem !important;
    }
}
