/*
 * MASTER Wars - Style principal
 * Theme medieval immersif — "Salle de guerre royale"
 * Parchemin, or, bordures ornementales, profondeur visuelle
 */

/* ============================================================
   1. VARIABLES ET FONDATIONS
   ============================================================ */

:root {
    /* Palette principale */
    --primary-color: #7c2421;
    --primary-dark: #5b1a19;
    --primary-light: #a03530;
    --secondary-color: #a17d4f;
    --secondary-dark: #7a5e3b;
    --secondary-light: #c4a06a;
    --tertiary-color: #354f52;
    --tertiary-dark: #2a3f41;
    --accent-color: #d4af37;
    --accent-dark: #b49531;
    --accent-light: #e6c84d;

    /* Titres sur fond sombre (modals, headers) */
    --title-on-dark: #f5e6c8;

    /* Parchemin et surfaces */
    --parchment: #f5f0e1;
    --parchment-dark: #e8dcc8;
    --parchment-darker: #d9cbb0;
    --parchment-warm: #f0e6d0;
    --ink-color: #2f3e46;
    --ink-light: #4a5c63;
    --leather: #5c3a1e;
    --leather-light: #7a5535;
    --wood-dark: #3b2a1a;
    --stone: #5a5a5a;
    --stone-light: #8a8a7a;

    /* Surfaces et fonds */
    --dark-color: #2f3e46;
    --light-color: #f5f0e1;
    --surface-card: rgba(245, 240, 225, 0.97);
    --surface-elevated: rgba(255, 252, 242, 0.95);

    /* Ombres et profondeur */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow-gold: 0 0 15px rgba(212, 175, 55, 0.3);
    --shadow-inset: inset 0 2px 6px rgba(0, 0, 0, 0.1);

    /* Bordures */
    --border-radius: 6px;
    --border-radius-lg: 10px;
    --border-ornate: 2px solid var(--secondary-color);
    --border-gold: 2px solid var(--accent-color);

    /* Transitions */
    --transition-speed: 0.3s;
    --transition-fast: 0.15s;
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   2. BASE ET TYPOGRAPHIE
   ============================================================ */

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

body {
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--ink-color);
    background-color: var(--parchment);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 36, 33, 0.03) 0%, transparent 50%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    color: var(--ink-color);
    line-height: 1.3;
}

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

a:hover {
    color: var(--accent-color);
}

.text-muted {
    color: var(--ink-light) !important;
}

/* .text-muted sur fond sombre (headers, modals) */
.dashboard-hero .text-muted,
.game-header .text-muted,
.modal-header .text-muted,
.profile-header .text-muted {
    color: var(--title-on-dark) !important;
}

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

/* Container responsive */
.container-responsive {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main content area */
.main-content {
    flex: 1;
}

/* ============================================================
   3. HEADER ET NAVIGATION
   ============================================================ */

.main-header {
    background: linear-gradient(180deg, #2a2018 0%, var(--wood-dark) 40%, #2d2215 100%);
    color: var(--light-color);
    padding: 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--accent-color);
    position: relative;
    z-index: 100;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-color) 15%,
        var(--accent-light) 50%,
        var(--accent-color) 85%,
        transparent 100%
    );
}

/* Main-header repliable (uniquement sur la page de jeu) */
.main-header .header-content {
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.main-header.collapsed .header-content {
    max-height: 0 !important;
    opacity: 0;
    padding: 0 !important;
}

.main-header.collapsed {
    border-bottom-color: transparent;
    box-shadow: none;
}

.main-header.collapsed::after {
    opacity: 0;
}

/* Bouton toggle du main-header — visible uniquement sur la page de jeu */
.main-header-toggle {
    display: none;
}

body:has(.game-board-container) .main-header-toggle {
    display: flex;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
    width: 40px;
    height: 20px;
    border: none;
    border-radius: 0 0 20px 20px;
    background: var(--wood-dark);
    border: 1px solid var(--accent-color);
    border-top: none;
    color: var(--accent-light);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}

.main-header-toggle:hover {
    background: #4a3525;
}

.main-header-toggle .toggle-arrow {
    display: block;
    transition: transform 0.3s ease;
}

.main-header.collapsed .main-header-toggle .toggle-arrow {
    transform: rotate(180deg);
}

.main-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    gap: 1rem;
}

.main-header .logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.main-header .logo-container a {
    display: flex;
    align-items: center;
    transition: filter var(--transition-speed);
}

.main-header .logo-container a:hover {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.main-header .logo {
    max-width: 120px;
    height: auto;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a,
.main-nav a.nav-item {
    color: var(--parchment-dark);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) var(--ease-out);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.nav-item:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-light);
    border-color: rgba(212, 175, 55, 0.3);
}

.main-nav a img,
.main-nav a.nav-item img {
    width: 26px;
    height: 26px;
    filter: brightness(1.2);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1;
}

.nav-badge.success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

/* ============================================================
   4. PAGES D'AUTHENTIFICATION (Login, Register, Reset)
   ============================================================ */

body.login-page {
    background: url('../img/background.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
}

body.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(43, 32, 24, 0.85) 0%,
        rgba(47, 62, 70, 0.8) 50%,
        rgba(59, 42, 26, 0.85) 100%
    );
    z-index: 0;
}

.auth-container {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--surface-card);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl), var(--shadow-glow-gold);
    position: relative;
    overflow: hidden;
}

/* Ornements de coins */
.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-color);
    opacity: 0.5;
}

.auth-container::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
    border-radius: 4px 0 0 0;
}

.auth-container::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
}

.auth-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 1rem;
}

.auth-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.auth-logo {
    display: block;
    max-width: 160px;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--parchment-darker);
}

.auth-links a {
    color: var(--tertiary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.auth-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.auth-links p {
    margin: 0.5rem 0;
}

/* ============================================================
   5. FORMULAIRES
   ============================================================ */

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

.medieval-form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--ink-color);
    font-size: 0.9rem;
}

.medieval-form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    background-color: var(--surface-elevated);
    color: var(--ink-color);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.medieval-form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2), var(--shadow-sm);
    background-color: white;
}

.medieval-form-control::placeholder {
    color: var(--stone-light);
}

.medieval-form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.medieval-form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.medieval-form-check-label {
    font-size: 0.9rem;
    color: var(--ink-light);
    cursor: pointer;
}

/* Form styles generiques (utilises dans modals et profil) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 600;
    color: var(--ink-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.form-control {
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface-elevated);
    color: var(--ink-color);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: white;
}

.form-help {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 1.5rem;
}

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

/* ============================================================
   6. BOUTONS
   ============================================================ */

.btn-medieval {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--light-color);
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) var(--ease-out);
    text-decoration: none;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.btn-medieval::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s;
}

.btn-medieval:hover::after {
    left: 100%;
}

.btn-medieval img {
    width: 18px;
    height: 18px;
}

.btn-medieval-primary {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: 2px solid var(--primary-dark);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-medieval-primary:hover {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.btn-medieval-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-medieval-secondary {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    border: 2px solid var(--secondary-dark);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-medieval-secondary:hover {
    background: linear-gradient(180deg, var(--secondary-light) 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.btn-medieval-accent {
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    border: 2px solid var(--accent-dark);
    color: var(--wood-dark);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-medieval-accent:hover {
    background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow-gold);
    color: var(--wood-dark);
    text-decoration: none;
}

.btn-medieval.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-medieval:disabled,
.btn-medieval[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    filter: grayscale(30%);
}

.btn-medieval:disabled:hover,
.btn-medieval[disabled]:hover {
    transform: none !important;
}

.w-100 {
    width: 100%;
}

/* ============================================================
   7. ALERTES THEMATIQUES
   ============================================================ */

.alert {
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    position: relative;
    border-left: 4px solid transparent;
}

.alert-heading {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.alert-success {
    color: #1a4a2a;
    background: linear-gradient(135deg, #d4edda 0%, #c8e6c9 100%);
    border-color: #2e7d32;
    border-left-color: #2e7d32;
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    color: #5a1a20;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #c0392b;
    border-left-color: #c0392b;
    box-shadow: var(--shadow-sm);
}

.alert-info {
    color: #1a3a4a;
    background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
    border-color: #2980b9;
    border-left-color: #2980b9;
    box-shadow: var(--shadow-sm);
}

.alert-warning {
    color: #5a4a14;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #d4a017;
    border-left-color: #d4a017;
    box-shadow: var(--shadow-sm);
}

.alert .btn-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0.2rem;
    line-height: 1;
}

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

.smart-alert {
    border-width: 2px;
    font-weight: 500;
}

/* ============================================================
   8. CARTES MEDIEVALES ET SECTIONS
   ============================================================ */

.medieval-card {
    background: var(--surface-card);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.75rem;
    overflow: hidden;
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
    position: relative;
}

.medieval-card:hover {
    box-shadow: var(--shadow-lg);
}

.medieval-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--light-color);
    padding: 1rem 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent-color);
    position: relative;
}

.medieval-card-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
    opacity: 0.5;
}

.medieval-card-header h2,
.medieval-card-header h3,
.medieval-card-header h5 {
    margin: 0;
    font-family: 'Cinzel', serif;
    color: var(--light-color);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.03em;
}

.medieval-card-header img {
    width: 22px;
    height: 22px;
    filter: brightness(1.3);
}

.medieval-card-body {
    padding: 1.5rem;
    background-image:
        linear-gradient(rgba(245, 240, 225, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 240, 225, 0.4) 1px, transparent 1px);
    background-size: 40px 40px;
}

.medieval-card-footer {
    background-color: rgba(161, 125, 79, 0.08);
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--parchment-darker);
}

/* Section cards (game list, profile) */
.section-card {
    background: var(--surface-card);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--light-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent-color);
}

.section-header h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    color: var(--light-color);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.03em;
}

.section-header img {
    width: 22px;
    height: 22px;
    filter: brightness(1.3);
}

.section-stats {
    display: flex;
    align-items: center;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-light);
}

.section-body {
    padding: 1.5rem;
}

/* ============================================================
   9. DASHBOARD
   ============================================================ */

/* --- Hero header --- */
.dashboard-hero,
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, #3a1515 100%);
    color: var(--light-color);
    padding: 2.5rem 0 2rem;
    margin-bottom: 2rem;
    position: relative;
    border-bottom: 3px solid var(--accent-color);
    overflow: hidden;
}

.dashboard-hero::before,
.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.dashboard-hero::after,
.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
    opacity: 0.6;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
}

.dashboard-title {
    font-family: 'Cinzel', serif;
    margin: 0 0 0.4rem 0;
    font-size: 1.8rem;
    letter-spacing: 0.04em;
    color: var(--title-on-dark);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard-hero p,
.dashboard-header p {
    margin: 0;
    opacity: 0.85;
    font-size: 1.05rem;
}

.hero-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-subtitle img {
    opacity: 0.8;
}

.hero-stats-summary {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.hero-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--title-on-dark);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.hero-stat-pill img {
    width: 16px;
    height: 16px;
    opacity: 0.85;
}

.hero-stat-active {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.4);
}

/* --- Game Spotlight (active game) --- */
.game-spotlight {
    background: var(--surface-card);
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md), 0 0 20px rgba(212, 175, 55, 0.1);
    overflow: hidden;
    animation: fadeIn 0.4s ease forwards;
}

.spotlight-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.03));
    border-bottom: 1px solid var(--parchment-darker);
}

.spotlight-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

.spotlight-game-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin: 0 0 0.4rem 0;
    color: var(--ink-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spotlight-game-name img {
    width: 24px;
    height: 24px;
}

.spotlight-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--ink-light);
    background: var(--parchment-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.spotlight-badge img {
    width: 14px;
    height: 14px;
}

.spotlight-badge-player {
    background: var(--primary-color);
    color: var(--light-color);
    font-weight: 600;
}

.btn-spotlight {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.btn-spotlight img {
    width: 20px;
    height: 20px;
}

/* Spotlight stats bar */
.spotlight-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.spotlight-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--parchment-darker);
    transition: background var(--transition-fast);
}

.spotlight-stat:last-child {
    border-right: none;
}

.spotlight-stat:hover {
    background: rgba(212, 175, 55, 0.06);
}

.spotlight-stat-icon {
    flex-shrink: 0;
}

.spotlight-stat-icon img {
    width: 28px;
    height: 28px;
}

.spotlight-stat-data {
    display: flex;
    flex-direction: column;
}

.spotlight-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink-color);
    line-height: 1.1;
}

.spotlight-stat-label {
    font-size: 0.75rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* --- Empty spotlight (no active game) --- */
.empty-spotlight {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    background: var(--surface-card);
    border: 2px dashed var(--parchment-darker);
    border-radius: var(--border-radius-lg);
    animation: fadeIn 0.4s ease forwards;
}

.empty-spotlight-icon {
    margin-bottom: 1rem;
}

.empty-spotlight-icon img {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.empty-spotlight h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: var(--ink-color);
}

.empty-spotlight p {
    color: var(--ink-light);
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
}

/* --- Dashboard two-column grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.dashboard-section {
    min-width: 0;
}

/* Card header count badge */
.card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    color: var(--wood-dark);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    font-family: 'Cinzel', serif;
}

/* Empty state inside cards */
.empty-state-small {
    text-align: center;
    padding: 1.5rem 1rem;
}

.empty-state-small p {
    color: var(--ink-light);
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

/* Sous-sections dans le bloc parties (en attente / disponibles) */
.game-list-section {
    padding: 0;
}

.game-list-section + .game-list-section {
    border-top: 2px solid var(--parchment-darker);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.game-list-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.25rem;
    border-radius: 4px;
}

.game-list-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.game-list-section-label img {
    width: 14px;
    height: 14px;
}

.game-list-section-waiting {
    color: var(--accent-dark);
}

.game-list-section-available {
    color: var(--tertiary-color);
}

.game-list-section-count {
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--parchment-dark);
    color: var(--ink-light);
}

/* Bordure laterale pour differencier les types */
.game-item-waiting {
    border-left: 3px solid var(--accent-color);
    padding-left: 0.75rem;
    border-radius: 2px;
}

.game-item-available {
    border-left: 3px solid var(--tertiary-color);
    padding-left: 0.75rem;
    border-radius: 2px;
}

/* Game lists in dashboard */
.game-list {
    display: flex;
    flex-direction: column;
}

.game-item {
    padding: 1rem 0.25rem;
}

.game-item .game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

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

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--ink-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.badge-recent {
    display: inline-block;
    font-family: 'Lato', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: var(--wood-dark);
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
}

.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.score-pill img {
    width: 12px;
    height: 12px;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.game-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.stat-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-light);
    background: var(--parchment-dark);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.stat-mini img {
    width: 16px;
    height: 16px;
}

.game-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.game-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--ink-light);
    flex-shrink: 0;
    white-space: nowrap;
}

.game-date img {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.game-separator {
    border: none;
    border-top: 1px solid var(--parchment-darker);
    margin: 0;
}

.game-item-small {
    padding: 0.5rem 0;
}

.game-item-small .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-item-small .game-info {
    flex: 1;
}

/* --- Other active games row --- */
.other-active-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.other-game-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-elevated);
    border: 2px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--ink-color);
    transition: all var(--transition-speed) var(--ease-out);
}

.other-game-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--ink-color);
    text-decoration: none;
}

.other-game-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.other-game-name {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.other-game-map {
    font-size: 0.8rem;
    color: var(--ink-light);
}

.other-game-stats {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* mt utility */
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* ============================================================
   10. LISTE DES PARTIES (game_list.php)
   ============================================================ */

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

.game-card {
    background: var(--surface-card);
    border: 2px solid var(--parchment-darker);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-speed) var(--ease-out);
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.game-card.available-game {
    border-color: var(--tertiary-color);
}

.game-card.available-game:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
}

.game-card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(124, 36, 33, 0.06) 0%, rgba(161, 125, 79, 0.06) 100%);
    border-bottom: 1px solid var(--parchment-darker);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.game-title-section {
    flex: 1;
    min-width: 0;
}

.game-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--ink-color);
    font-weight: 700;
}

.game-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-waiting {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #d4a017;
}

.status-active {
    background: linear-gradient(135deg, #d4edda, #c8e6c9);
    color: #1a5c2a;
    border: 1px solid #28a745;
}

.status-finished {
    background: linear-gradient(135deg, #d1ecf1, #b8daff);
    color: #1a3a5c;
    border: 1px solid #2980b9;
}

.status-cancelled {
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
    color: #383d41;
    border: 1px solid #6c757d;
}

.player-indicator,
.players-count {
    flex-shrink: 0;
}

.player-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-dark));
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.players-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.players-badge.available {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.players-badge.full {
    background: linear-gradient(135deg, #dc3545, #bd2130);
    color: white;
}

.game-card-body {
    padding: 1.25rem;
    flex: 1;
}

.game-description {
    margin-bottom: 1rem;
}

.game-description p {
    margin: 0;
    font-size: 0.9rem;
}

.game-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.game-info-grid .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.4rem;
}

.info-label {
    color: var(--ink-light);
    font-weight: 500;
    white-space: nowrap;
}

.info-value {
    color: var(--ink-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.info-value img {
    width: 16px;
    height: 16px;
}

.resource-value {
    color: var(--accent-dark);
}

.turns-value {
    color: var(--tertiary-color);
}

.game-timeline {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--parchment-darker);
}

.timeline-item small {
    font-size: 0.8rem;
}

.game-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--parchment-darker);
    background: rgba(161, 125, 79, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.game-card-footer .game-meta {
    text-align: center;
    margin-top: 0.25rem;
}

/* Info notice */
.info-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    border: 1px solid #aed6f1;
    border-radius: var(--border-radius);
    border-left: 4px solid #2980b9;
}

.notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    color: #2980b9;
}

.notice-content {
    font-size: 0.9rem;
    color: #1a3a5c;
    line-height: 1.5;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ink-light);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-icon img {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.empty-state h5 {
    font-family: 'Cinzel', serif;
    color: var(--ink-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.25rem;
}

/* ============================================================
   11. PROFIL
   ============================================================ */

.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 60%, #3a1515 100%);
    color: var(--light-color);
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-light);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.avatar-initials {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--wood-dark);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);
}

.profile-info {
    flex: 1;
}

.profile-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin: 0 0 0.25rem 0;
    color: var(--light-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-subtitle {
    margin: 0 0 0.5rem 0;
    opacity: 0.8;
    font-size: 0.95rem;
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-badge.role-admin {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: var(--wood-dark);
}

.profile-badge.role-player {
    background: rgba(255, 255, 255, 0.2);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-badge.experience {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Stats grid */
.stats-section {
    margin-bottom: 0;
}

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

.stats-grid .stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
    background: var(--surface-elevated);
    border: 1px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.stats-grid .stat-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.stats-grid .stat-icon {
    font-size: 1.3rem;
    margin: 0;
    flex-shrink: 0;
}

.stats-grid .stat-icon img {
    width: 28px;
    height: 28px;
}

.stats-grid .stat-content {
    flex: 1;
}

.stats-grid .stat-value {
    font-size: 1.3rem;
    margin: 0;
}

.stats-grid .stat-label {
    font-size: 0.8rem;
}

/* Profile two-column layout */
.profile-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-section,
.security-section {
    min-width: 0;
}

/* Info grid in profile */
.section-body .info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section-body .info-grid .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--parchment-darker);
}

.section-body .info-grid .info-item:last-child {
    border-bottom: none;
}

.section-body .info-grid .info-label {
    font-weight: 500;
    color: var(--ink-light);
    font-size: 0.9rem;
}

.section-body .info-grid .info-value {
    font-weight: 600;
    color: var(--ink-color);
    font-size: 0.9rem;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.validated {
    background: linear-gradient(135deg, #d4edda, #c8e6c9);
    color: #1a5c2a;
    border: 1px solid #28a745;
}

.status-badge.pending {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #d4a017;
}

/* Activity section */
.activity-section {
    margin-top: 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--parchment-darker);
    transition: background var(--transition-fast);
}

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

.activity-item:hover {
    background: rgba(212, 175, 55, 0.04);
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--parchment-dark);
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-icon img {
    width: 20px;
    height: 20px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.activity-status {
    padding: 0.1rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
}

.activity-status.status-active {
    background: rgba(40, 167, 69, 0.15);
    color: #1e7e34;
}

.activity-status.status-finished {
    background: rgba(41, 128, 185, 0.15);
    color: #2471a3;
}

.activity-status.status-waiting {
    background: rgba(212, 160, 23, 0.15);
    color: #9a7d0a;
}

.activity-status.status-cancelled {
    background: rgba(108, 117, 125, 0.15);
    color: #495057;
}

.activity-date {
    color: var(--ink-light);
}

.activity-action {
    flex-shrink: 0;
}

.activity-footer {
    text-align: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--parchment-darker);
}

/* ============================================================
   12. PLATEAU DE JEU (game_board.php)
   ============================================================ */

.game-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--light-color);
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    position: relative;
}

.game-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.game-header .game-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin: 0;
    color: var(--light-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    margin: 0.2rem 0 0 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Player stats (compact) */
.player-stats-compact {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-shrink: 0;
}

.stats-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.stats-row .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stats-row .stat-item img {
    width: 18px;
    height: 18px;
}

.stats-row .stat-item strong {
    color: var(--accent-light);
}

.stats-row .stat-item.turns-available {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.3);
}

.stats-row .stat-item.turns-exhausted {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
}

.income-indicator {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.8rem !important;
}

.countdown-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.countdown-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.85;
}

.countdown-item img {
    width: 14px;
    height: 14px;
}

.countdown-item .countdown-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent-light);
    font-size: 0.85rem;
}

/* Layout plein ecran pour la page de jeu — pas de scroll vertical sur body */
body:has(.game-board-container) {
    height: 100vh;
    overflow: hidden;
}

body:has(.game-board-container) .main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

body:has(.game-board-container) .main-header {
    flex-shrink: 0;
}

body:has(.game-board-container) .game-header {
    flex-shrink: 0;
}

body:has(.game-board-container) .alert {
    flex-shrink: 0;
}

/* Game board container */
.game-container {
    padding: 0.75rem;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.game-board-container {
    margin-top: 0.5rem;
    flex: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.game-board {
    overflow: hidden;
    position: relative;
    flex: 1;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.game-board.dragging {
    cursor: grabbing;
}

/* Masquer les scrollbars du plateau (navigation par drag) */
.game-board::-webkit-scrollbar {
    display: none;
}

.hex-grid-wrapper {
    display: block;
    width: fit-content;
    min-width: fit-content;
    margin: auto;
}

.hex-grid {
    --hex-size: 94px;
    --hex-gap: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Masquer le footer sur la page de jeu */
body:has(.game-board-container) .main-footer {
    display: none;
}

/* Hex grid layout */
.hex-row {
    display: flex;
    gap: var(--hex-gap);
    margin-bottom: calc(var(--hex-size) * -0.256);
}

.hex-row.odd {
    margin-left: calc((var(--hex-size) + var(--hex-gap)) / 2);
}

/* Hexagones */
.game-hex {
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.163);
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease;
    touch-action: manipulation;
    flex-shrink: 0;
}

.game-hex:hover {
    transform: scale(1.05);
    z-index: 10;
}

.hex-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: #888;
    z-index: 1;
}

.hex-inner {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Hex avec texture de fond : les batiments restent visibles avec une ombre renforcee */
.hex-inner.hex-textured img {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.6));
}

.hex-inner img {
    width: calc(var(--hex-size) * 0.36);
    height: calc(var(--hex-size) * 0.36);
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 2;
}

.hex-inner > span.game-icon {
    font-size: calc(var(--hex-size) * 0.36);
    position: relative;
    z-index: 2;
}

.hex-inner.hex-starting-building img {
    width: calc(var(--hex-size) * 0.625);
    height: calc(var(--hex-size) * 0.625);
    transform: translateY(-20%);
}

.hex-inner.hex-starting-building > span.game-icon {
    font-size: calc(var(--hex-size) * 0.625);
    transform: translateY(-20%);
}

/* Batiment construit (non-depart) : remplace l'icone du terrain */
.hex-inner.hex-has-building img {
    width: calc(var(--hex-size) * 0.475);
    height: calc(var(--hex-size) * 0.475);
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.4));
    transform: translateY(-20%);
}

.hex-inner.hex-has-building > span.game-icon {
    font-size: calc(var(--hex-size) * 0.475);
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.4));
    transform: translateY(-20%);
}

/* Hex controlled states */
.game-hex.controlled .hex-border {
    background-color: var(--primary-color);
}

.game-hex.my-territory .hex-border {
    background-color: #1565c0;
}

.game-hex.player-1 .hex-border { background-color: #1565c0; }
.game-hex.player-2 .hex-border { background-color: #c62828; }
.game-hex.player-3 .hex-border { background-color: #2e7d32; }
.game-hex.player-4 .hex-border { background-color: #f9a825; }
.game-hex.player-5 .hex-border { background-color: #6a1b9a; }
.game-hex.player-6 .hex-border { background-color: #e65100; }

/* Voile de couleur du joueur sur les cases controlees (par-dessus la texture) */
.game-hex[class*="player-"] .hex-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 1;
    pointer-events: none;
}
.game-hex.player-1 .hex-inner::after { background-color: rgba(21, 101, 192, 0.25); }
.game-hex.player-2 .hex-inner::after { background-color: rgba(198, 40, 40, 0.25); }
.game-hex.player-3 .hex-inner::after { background-color: rgba(46, 125, 50, 0.25); }
.game-hex.player-4 .hex-inner::after { background-color: rgba(249, 168, 37, 0.25); }
.game-hex.player-5 .hex-inner::after { background-color: rgba(106, 27, 154, 0.25); }
.game-hex.player-6 .hex-inner::after { background-color: rgba(230, 81, 0, 0.25); }


/* Hex troops */
.hex-troops {
    position: absolute;
    bottom: calc(var(--hex-size) * 0.12);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: calc(var(--hex-size) * 0.023);
    z-index: 4;
    max-width: 90%;
}

.hex-troops .troop-icon {
    display: flex;
    align-items: center;
    gap: calc(var(--hex-size) * 0.01);
    background: rgba(0, 0, 0, 0.6);
    border-radius: calc(var(--hex-size) * 0.03);
    padding: calc(var(--hex-size) * 0.01) calc(var(--hex-size) * 0.025);
    max-width: calc(var(--hex-size) * 0.5);
    max-height: calc(var(--hex-size) * 0.28);
    overflow: hidden;
}

.hex-troops .troop-icon.my-troop {
    background: rgba(21, 101, 192, 0.7);
    border: calc(var(--hex-size) * 0.01) solid rgba(21, 101, 192, 0.9);
}

.hex-troops .troop-icon.enemy-troop {
    background: rgba(198, 40, 40, 0.7);
    border: calc(var(--hex-size) * 0.01) solid rgba(198, 40, 40, 0.9);
}

.hex-troops .troop-icon img {
    width: calc(var(--hex-size) * 0.22);
    height: calc(var(--hex-size) * 0.22);
}

.hex-troops .troop-icon > span.game-icon {
    font-size: calc(var(--hex-size) * 0.22);
}

.troop-count {
    font-size: clamp(5px, calc(var(--hex-size) * 0.15), 14px);
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* Badge overflow "+N" */
.troop-overflow {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: calc(var(--hex-size) * 0.03);
    padding: calc(var(--hex-size) * 0.01) calc(var(--hex-size) * 0.03);
    color: #ffd700;
    font-size: clamp(5px, calc(var(--hex-size) * 0.13), 12px);
    font-weight: 700;
    cursor: default;
    border: calc(var(--hex-size) * 0.01) solid rgba(255, 215, 0, 0.4);
}

/* Popup détail des troupes au survol */
.troop-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    padding: 6px 8px;
    z-index: 100;
    white-space: nowrap;
    pointer-events: auto;
    margin-bottom: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.hex-troops:hover .troop-popup {
    display: block;
}

.troop-popup-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.troop-popup-row.popup-my {
    color: #64b5f6;
}

.troop-popup-row.popup-enemy {
    color: #ef9a9a;
}

.troop-popup-row img,
.troop-popup-row > span.game-icon {
    width: 14px;
    height: 14px;
    font-size: 14px;
    flex-shrink: 0;
}

.troop-popup-name {
    font-size: 11px;
}

.troop-popup-qty {
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
    padding-left: 8px;
}

/* Indicateur de combat actif sur un hex */
.hex-combat-indicator {
    position: absolute;
    top: calc(var(--hex-size) * 0.05);
    right: calc(var(--hex-size) * 0.05);
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(180, 30, 30, 0.85);
    color: #fff;
    font-size: clamp(6px, calc(var(--hex-size) * 0.13), 12px);
    font-weight: 700;
    padding: calc(var(--hex-size) * 0.02) calc(var(--hex-size) * 0.04);
    border-radius: calc(var(--hex-size) * 0.04);
    z-index: 5;
    pointer-events: none;
    border: 1px solid rgba(255, 80, 80, 0.6);
    animation: combatPulse 1.5s ease-in-out infinite;
}

.hex-combat-indicator img,
.hex-combat-indicator > span.game-icon {
    width: calc(var(--hex-size) * 0.16);
    height: calc(var(--hex-size) * 0.16);
    font-size: calc(var(--hex-size) * 0.16);
}

.game-hex.has-active-combat .hex-border {
    animation: combatBorderPulse 1.5s ease-in-out infinite;
}

@keyframes combatPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

@keyframes combatBorderPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

/* Historique des rounds dans le modal combat */
.combat-round-log {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    border-left: 3px solid var(--accent-color, #d4af37);
}

.combat-round-log strong {
    font-size: 0.85rem;
    color: var(--accent-color, #d4af37);
}

.combat-round-log span {
    font-size: 0.8rem;
}

.combat-round-log .small {
    opacity: 0.7;
}

/* Estimation de combat (avant attaque) */
.combat-estimate {
    margin: 0.5rem 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color, #d4af37);
}
.estimate-label {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
    text-align: center;
}
.estimate-bar-container {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.estimate-bar {
    height: 100%;
    transition: width 0.3s ease;
}
.estimate-bar-attacker {
    border-radius: 4px 0 0 4px;
}
.estimate-bar-defender {
    border-radius: 0 4px 4px 0;
}
.estimate-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    gap: 6px;
}
.estimate-details span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.estimate-bonuses {
    font-size: 0.72rem;
    opacity: 0.6;
    text-align: center;
    margin-top: 2px;
}
.estimate-note {
    font-size: 0.7rem;
    opacity: 0.5;
    text-align: center;
    font-style: italic;
    margin-top: 2px;
}

/* Countdown states */
.countdown-value.countdown-ready {
    color: #28a745 !important;
    font-weight: 700;
}

.countdown-value.countdown-waiting {
    color: var(--accent-light);
}

/* ============================================================
   13. PAGE D'AIDE
   ============================================================ */

.terrain-example {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast);
}

.terrain-example:hover {
    border-color: var(--secondary-color);
}

.terrain-example img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.terrain-example strong {
    color: var(--primary-color);
    font-family: 'Cinzel', serif;
    margin-right: 0.25rem;
}

.troop-example {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--parchment-darker);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast);
}

.troop-example:hover {
    border-color: var(--secondary-color);
}

.troop-example img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.troop-example strong {
    color: var(--primary-color);
    font-family: 'Cinzel', serif;
    margin-right: 0.25rem;
}

.troop-stats {
    margin-left: auto;
}

.troop-stats small {
    color: var(--ink-light);
    font-style: italic;
}

.action-example {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface-elevated);
    border: 1px solid var(--parchment-darker);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.action-example img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.action-example strong {
    color: var(--primary-color);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    width: 100%;
    flex-basis: calc(100% - 50px);
}

.action-example p {
    width: 100%;
    margin: 0.25rem 0;
}

.action-example ul {
    width: 100%;
    margin: 0.25rem 0 0 0;
    padding-left: 1.5rem;
}

/* Legend */
.legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--ink-color);
}

.legend-item img {
    width: 20px;
    height: 20px;
}

/* ============================================================
   14. BADGES (Bootstrap override)
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #bd2130) !important;
    color: white;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-dark)) !important;
    color: white;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d, #545b62) !important;
    color: white;
}

.badge.bg-info {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    color: white;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #3d2d00;
}

/* ============================================================
   15. PIED DE PAGE
   ============================================================ */

.main-footer {
    background: linear-gradient(180deg, var(--wood-dark) 0%, #2a2018 100%);
    color: var(--parchment-dark);
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 3px solid var(--accent-color);
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
    opacity: 0.5;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-logo {
    max-width: 120px;
    height: auto;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--parchment-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copy {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ============================================================
   16. PARCHMENT TEXTURE
   ============================================================ */

.parchment {
    background-color: var(--light-color);
    background-image:
        linear-gradient(rgba(245, 240, 225, 0.8) 2px, transparent 2px),
        linear-gradient(90deg, rgba(245, 240, 225, 0.8) 2px, transparent 2px);
    background-size: 50px 50px;
    background-position: -2px -2px;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--secondary-color);
}

/* ============================================================
   17. UTILITAIRES
   ============================================================ */

.d-grid {
    display: grid;
}

.gap-2 {
    gap: 0.5rem;
}

.d-block {
    display: block;
}

/* ============================================================
   18. RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
    .flex-responsive,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

    .spotlight-stat:nth-child(2) {
        border-right: none;
    }

    .spotlight-stat:nth-child(3),
    .spotlight-stat:nth-child(4) {
        border-top: 1px solid var(--parchment-darker);
    }

    .profile-sections {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Header */
    .main-header .header-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        gap: 0.15rem;
    }

    .main-nav a,
    .main-nav a.nav-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .main-nav a span:not(.nav-badge) {
        display: none;
    }

    .main-nav a img {
        width: 22px;
        height: 22px;
    }

    .main-header .logo {
        max-width: 100px;
    }

    /* Dashboard hero */
    .dashboard-hero,
    .dashboard-header {
        padding: 1.5rem 0 1.25rem;
    }

    .hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dashboard-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-stats-summary {
        align-self: flex-start;
    }

    .hero-stat-pill {
        font-size: 0.78rem;
        padding: 0.25rem 0.6rem;
    }

    /* Dashboard spotlight */
    .spotlight-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .btn-spotlight {
        text-align: center;
    }

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

    .spotlight-stat {
        padding: 0.75rem 1rem;
    }

    .spotlight-stat:nth-child(2) {
        border-right: none;
    }

    .spotlight-stat:nth-child(3),
    .spotlight-stat:nth-child(4) {
        border-top: 1px solid var(--parchment-darker);
    }

    .spotlight-stat-value {
        font-size: 1.2rem;
    }

    /* Other active games */
    .other-active-games {
        grid-template-columns: 1fr;
    }

    /* Game cards */
    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-info-grid {
        grid-template-columns: 1fr;
    }

    /* Profile */
    .profile-header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-title {
        font-size: 1.4rem;
    }

    .profile-badges {
        justify-content: center;
    }

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

    /* Game board */
    .game-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .countdown-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    /* Hex - tailles responsives via --hex-size */
    .hex-grid {
        --hex-size: 56px;
        --hex-gap: 1px;
    }

    /* Auth */
    .auth-container {
        margin: 1.5rem auto;
        padding: 1.75rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* General spacing */
    .container-responsive {
        padding: 0 1rem;
    }

    .section-body,
    .medieval-card-body {
        padding: 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .hex-grid {
        --hex-size: 76px;
        --hex-gap: 1px;
    }
}

/* Large screens constraint */
@media (min-width: 1800px) {
    .container-responsive {
        max-width: 1600px;
    }
}

/* ============================================================
   19. CLASSEMENT FINAL & PARTIES TERMINEES
   ============================================================ */

/* Bandeau partie terminee */
.game-finished-banner {
    padding: 1rem 0;
}

/* Tableau de classement */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    background-color: #354f52;
    color: #f5f0e1;
    padding: 10px 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
}

.ranking-table tbody td {
    padding: 10px 8px;
}

.ranking-table tbody tr {
    border-bottom: 1px solid rgba(124, 36, 33, 0.1);
}

.ranking-table tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.08);
}

.ranking-first td {
    background-color: rgba(212, 175, 55, 0.15);
    font-weight: bold;
}

/* Mise en evidence de la derniere partie terminee dans le dashboard */
.game-item-highlighted {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-left: 3px solid #d4af37;
    padding-left: 12px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .ranking-table {
        font-size: 0.85rem;
    }

    .ranking-table thead th,
    .ranking-table tbody td {
        padding: 6px 4px;
    }

    .ranking-table small {
        display: block;
        font-size: 0.7rem;
    }
}

/* ============================================================
   20. ANIMATIONS
   ============================================================ */

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

.medieval-card,
.section-card,
.stat-card,
.game-card {
    animation: fadeIn 0.4s ease forwards;
}

/* Staggered card animations */
.dashboard-stats .stat-card:nth-child(1) { animation-delay: 0s; }
.dashboard-stats .stat-card:nth-child(2) { animation-delay: 0.05s; }
.dashboard-stats .stat-card:nth-child(3) { animation-delay: 0.1s; }
.dashboard-stats .stat-card:nth-child(4) { animation-delay: 0.15s; }

.games-grid .game-card:nth-child(1) { animation-delay: 0s; }
.games-grid .game-card:nth-child(2) { animation-delay: 0.05s; }
.games-grid .game-card:nth-child(3) { animation-delay: 0.1s; }
.games-grid .game-card:nth-child(4) { animation-delay: 0.15s; }
.games-grid .game-card:nth-child(5) { animation-delay: 0.2s; }
.games-grid .game-card:nth-child(6) { animation-delay: 0.25s; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
