/* ==========================================================================
   بحار السلاطين - Game CSS
   RTL Arabic Strategy Game Theme
   ========================================================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Amiri:wght@400;700&display=swap');

/* ── CSS Variables ── */
:root {
    --primary: #c9a227;
    --primary-dark: #a17f1a;
    --primary-light: #e6c84d;
    --secondary: #1a3a5c;
    --secondary-dark: #0f2742;
    --secondary-light: #2a5a8c;
    --accent: #d4552a;
    --accent-light: #e8734d;
    --success: #28a745;
    --warning: #f0ad4e;
    --danger: #dc3545;
    --info: #17a2b8;
    --dark: #0d1b2a;
    --darker: #080f1a;
    --card-bg: rgba(26, 58, 92, 0.85);
    --card-border: rgba(201, 162, 39, 0.3);
    --glass-bg: rgba(13, 27, 42, 0.75);
    --glass-border: rgba(201, 162, 39, 0.2);
    --text-primary: #e8e0d0;
    --text-secondary: #a0a0b0;
    --text-gold: #c9a227;
    --text-light: #ffffff;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --resource-bar-height: 44px;
    --font-primary: 'Cairo', sans-serif;
    --font-decorative: 'Amiri', serif;
    --shadow-gold: 0 0 20px rgba(201, 162, 39, 0.15);
    --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--darker);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26, 58, 92, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(13, 27, 42, 0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--text-light);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--darker); }
::-webkit-scrollbar-thumb {
    background: var(--secondary-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(201, 162, 39, 0.3); }
    50% { box-shadow: 0 0 20px rgba(201, 162, 39, 0.6); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-right { animation: fadeInRight 0.5s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ── Top Navbar ── */
.game-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--topbar-height);
    background: linear-gradient(180deg, var(--secondary-dark) 0%, rgba(15, 39, 66, 0.95) 100%);
    border-bottom: 1px solid var(--card-border);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 20px;
    backdrop-filter: blur(12px);
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-decorative);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
    white-space: nowrap;
}

.game-logo i {
    font-size: 1.6rem;
    animation: float 3s ease-in-out infinite;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-user .user-info {
    text-align: left;
    line-height: 1.3;
}

.topbar-user .user-name {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.topbar-user .user-tribe {
    font-size: 0.75rem;
    color: var(--primary);
}

.topbar-notifications {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}

.topbar-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Resource Bar ── */
.resource-bar {
    position: fixed;
    top: var(--topbar-height);
    right: var(--sidebar-width);
    left: 0;
    height: var(--resource-bar-height);
    background: linear-gradient(180deg, rgba(15, 39, 66, 0.9) 0%, rgba(13, 27, 42, 0.85) 100%);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 1035;
    padding: 0 20px;
    backdrop-filter: blur(8px);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.resource-item:hover {
    background: rgba(201, 162, 39, 0.1);
    transform: scale(1.05);
}

.resource-item .resource-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.resource-icon.wood { color: #8B4513; }
.resource-icon.stone { color: #808080; }
.resource-icon.iron { color: #b0b0b0; }
.resource-icon.gold { color: #ffd700; }

.resource-value {
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

.resource-rate {
    font-size: 0.7rem;
    color: var(--success);
    margin-right: 2px;
}

.resource-capacity {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ── Sidebar ── */
.game-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary-dark) 0%, var(--dark) 100%);
    border-left: 1px solid var(--card-border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: calc(var(--topbar-height) + 10px);
}

.sidebar-section {
    padding: 5px 12px;
    margin-bottom: 5px;
}

.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    padding: 8px 16px 4px;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav a:hover {
    background: rgba(201, 162, 39, 0.1);
    color: var(--primary);
    transform: translateX(-3px);
}

.sidebar-nav a:hover::before {
    transform: scaleY(1);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.15) 0%, transparent 100%);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    transform: scaleY(1);
}

.sidebar-nav a i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.sidebar-nav a:hover i,
.sidebar-nav a.active i {
    opacity: 1;
}

.nav-badge {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* ── Main Content ── */
.game-content {
    margin-right: var(--sidebar-width);
    margin-top: calc(var(--topbar-height) + var(--resource-bar-height));
    padding: 25px;
    min-height: calc(100vh - var(--topbar-height) - var(--resource-bar-height));
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
    font-size: 1.3rem;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.page-breadcrumb a { color: var(--primary); }
.page-breadcrumb .separator { color: var(--text-secondary); opacity: 0.5; }

/* ── Cards ── */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease forwards;
}

.game-card:hover {
    border-color: rgba(201, 162, 39, 0.5);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.game-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.game-card-header h3 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-card-header h3 i {
    color: var(--primary);
}

/* ── Stat Cards ── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-light);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ── Building Grid ── */
.building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.building-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.building-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-gold);
    transform: translateY(-3px);
}

.building-card-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    position: relative;
}

.building-card-icon .level-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--dark);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
}

.building-card-body {
    padding: 15px;
}

.building-card-body h5 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: var(--text-light);
}

.building-card-body .category-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(201, 162, 39, 0.15);
    color: var(--primary);
    display: inline-block;
    margin-bottom: 8px;
}

.building-card-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.building-costs {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
}

.building-costs span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Timer ── */
.timer-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cairo', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--warning);
    background: rgba(240, 173, 78, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(240, 173, 78, 0.2);
}

.timer-display i {
    animation: pulse 1.5s infinite;
}

/* ── Queue Item ── */
.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.queue-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.queue-item .queue-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-item .queue-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    color: var(--primary);
    font-size: 1rem;
}

/* ── Progress Bar ── */
.progress-game {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-game .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    transition: width 1s linear;
    position: relative;
}

.progress-game .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

/* ── Map ── */
.map-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    background:
        radial-gradient(ellipse at center, rgba(26, 58, 92, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #0a1628 0%, #0d253f 25%, #0a1628 50%, #0d253f 75%, #0a1628 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 2px;
    padding: 10px;
    min-height: 600px;
}

.map-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    font-size: 1.2rem;
}

.map-cell.water {
    background: rgba(20, 60, 100, 0.3);
}

.map-cell.island {
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.map-cell.island:hover {
    background: rgba(201, 162, 39, 0.3);
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.4);
}

.map-cell.own-village {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.5);
}

/* ── Tables ── */
.game-table {
    width: 100%;
    border-collapse: collapse;
}

.game-table thead th {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
    border-bottom: 2px solid var(--card-border);
    white-space: nowrap;
}

.game-table tbody td {
    padding: 12px 15px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

.game-table tbody tr {
    transition: var(--transition);
}

.game-table tbody tr:hover {
    background: rgba(201, 162, 39, 0.05);
}

/* ── Buttons ── */
.btn-game {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-game-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--dark);
    box-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}

.btn-game-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.5);
    color: var(--dark);
}

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

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

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

.btn-game-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    color: #fff;
}

.btn-game-success {
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
    color: #fff;
}

.btn-game-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    color: #fff;
}

.btn-game-sm {
    padding: 5px 14px;
    font-size: 0.8rem;
}

/* ── Forms ── */
.form-game .form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.form-game .form-control,
.form-game .form-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 10px 15px;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.form-game .form-control:focus,
.form-game .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-light);
}

.form-game .form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ── Alert ── */
.alert-game {
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    border: 1px solid;
}

.alert-game-success {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
    color: #a3e4b8;
}

.alert-game-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f0a0a8;
}

.alert-game-warning {
    background: rgba(240, 173, 78, 0.15);
    border-color: rgba(240, 173, 78, 0.3);
    color: #f0d08e;
}

.alert-game-info {
    background: rgba(23, 162, 184, 0.15);
    border-color: rgba(23, 162, 184, 0.3);
    color: #80d4e0;
}

/* ── Village Grid ── */
.village-buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* ── Player Rank Badge ── */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.rank-badge.gold {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.rank-badge.silver {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.rank-badge.bronze {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.3);
}

/* ── Message List ── */
.message-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
}

.message-item:hover {
    background: rgba(201, 162, 39, 0.05);
}

.message-item.unread {
    background: rgba(201, 162, 39, 0.08);
    border-right: 3px solid var(--primary);
}

.message-item .msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Tribe Cards ── */
.tribe-card {
    background: var(--card-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tribe-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(201, 162, 39, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.tribe-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
}

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

.tribe-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, var(--card-bg) 100%);
    box-shadow: var(--shadow-gold);
}

.tribe-card .tribe-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.tribe-card h5 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tribe-card .tribe-bonus {
    font-size: 0.82rem;
    color: var(--success);
    font-weight: 600;
}

/* ── Alliance ── */
.alliance-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.alliance-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.4;
    margin-bottom: 15px;
}

.empty-state h4 {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Tooltip ── */
.game-tooltip {
    background: var(--dark) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-primary) !important;
    border-radius: var(--border-radius-sm) !important;
    padding: 8px 12px !important;
}

/* ── Pagination ── */
.pagination-game .page-item .page-link {
    background: var(--card-bg);
    border-color: var(--glass-border);
    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: var(--transition);
}

.pagination-game .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--dark);
}

.pagination-game .page-item .page-link:hover {
    background: rgba(201, 162, 39, 0.2);
    color: var(--primary);
}

/* ── Modal ── */
.modal-game .modal-content {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
}

.modal-game .modal-header {
    border-bottom-color: var(--glass-border);
    padding: 15px 20px;
}

.modal-game .modal-title {
    color: var(--primary);
    font-weight: 700;
}

.modal-game .btn-close {
    filter: invert(1);
}

.modal-game .modal-body {
    padding: 20px;
}

.modal-game .modal-footer {
    border-top-color: var(--glass-border);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .resource-bar { gap: 15px; }
    .resource-item { padding: 4px 8px; }
}

@media (max-width: 992px) {
    .game-sidebar {
        transform: translateX(100%);
        transition: var(--transition);
    }
    .game-sidebar.show {
        transform: translateX(0);
    }
    .game-content {
        margin-right: 0;
    }
    .resource-bar {
        right: 0;
        flex-wrap: wrap;
        height: auto;
        padding: 5px 10px;
        gap: 5px;
    }
    .resource-item { font-size: 0.78rem; }
    .game-content {
        margin-top: calc(var(--topbar-height) + 65px);
    }
}

@media (max-width: 768px) {
    .game-content { padding: 15px; }
    .building-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 576px) {
    .resource-bar { gap: 3px; }
    .resource-item { padding: 3px 6px; font-size: 0.72rem; }
    .game-topbar { padding: 0 10px; }
    .game-logo { font-size: 1.1rem; }
}

/* ── Print ── */
@media print {
    .game-sidebar,
    .game-topbar,
    .resource-bar {
        display: none !important;
    }
    .game-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}
