/* ============================================================
   EHPAD GAMING — Black Ops 7 Theme
   La Résidence des Fraggers
   ============================================================ */

/* ----- FONTS & RESET ----- */
@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

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

:root {
    --bg:           #07090f;
    --bg2:          #0d1018;
    --bg3:          #141720;
    --surface:      #1a1e2a;
    --surface2:     #222736;
    --border:       #2a3045;
    --border2:      #3a4560;
    --text:         #dce0f0;
    --text2:        #8a94b0;
    --text3:        #556080;
    --primary:      #e63946;
    --primary-dim:  #8c1a22;
    --accent:       #c8a84b;
    --accent2:      #4361ee;
    --green:        #2d6a4f;
    --green-light:  #3a9a6e;
    --warning:      #f4a261;
    --danger:       #c1121f;
    --font-title:   'Black Ops One', cursive;
    --font-body:    'Rajdhani', sans-serif;
    --font-mono:    'Share Tech Mono', monospace;
    --radius:       6px;
    --radius-lg:    12px;
    --shadow:       0 4px 24px rgba(0,0,0,0.6);
    --shadow-lg:    0 8px 48px rgba(0,0,0,0.8);
    --glow-red:     0 0 20px rgba(230,57,70,0.4);
    --glow-blue:    0 0 20px rgba(67,97,238,0.4);
    --glow-green:   0 0 20px rgba(45,106,79,0.4);
    --transition:   0.2s ease;
}


html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 64px;    /* hauteur du header fixe */
    padding-bottom: 62px; /* hauteur du footer fixe */
}

/* ----- SCANLINES ----- */
.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0,0,0,0.07) 3px,
        rgba(0,0,0,0.07) 4px
    );
    animation: scanlineMove 8s linear infinite;
}
@keyframes scanlineMove {
    from { background-position: 0 0; }
    to   { background-position: 0 100vh; }
}

/* ----- BACKGROUND PARTICLES ----- */
.bg-particles {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-particles::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 20%, rgba(67,97,238,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 80% 80%, rgba(230,57,70,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 50% 50%, rgba(200,168,75,0.03) 0%, transparent 70%);
}

/* ----- GLITCH EFFECT ----- */
.glitch-text {
    position: relative;
    display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    overflow: hidden;
}
.glitch-text::before {
    color: var(--accent2);
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    animation: glitchTop 4s steps(1) infinite;
}
.glitch-text::after {
    color: var(--primary);
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    animation: glitchBot 4s steps(1) infinite 0.5s;
}
@keyframes glitchTop {
    0%,85%,100% { transform: none; opacity: 0; }
    87% { transform: translateX(-3px); opacity: 0.7; }
    89% { transform: translateX(3px); opacity: 0.7; }
    91% { transform: none; opacity: 0; }
}
@keyframes glitchBot {
    0%,75%,100% { transform: none; opacity: 0; }
    77% { transform: translateX(4px); opacity: 0.6; }
    79% { transform: translateX(-2px); opacity: 0.6; }
    81% { transform: none; opacity: 0; }
}

/* ----- FLASH MESSAGES ----- */
.flash {
    position: fixed;
    bottom: 24px; right: 20px;
    z-index: 9000;
    padding: 14px 20px;
    border-radius: var(--radius);
    border-left: 4px solid;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    animation: slideInRight 0.3s ease, fadeOut 0.5s ease 5s forwards;
    backdrop-filter: blur(10px);
}
.flash-success { background: rgba(45,106,79,0.9); border-color: var(--green-light); }
.flash-error   { background: rgba(193,18,31,0.9); border-color: var(--primary); }
.flash-icon    { font-size: 18px; }
.flash-close   { margin-left: auto; background: none; border: none; color: var(--text); cursor: pointer; font-size: 16px; opacity: 0.7; }
.flash-close:hover { opacity: 1; }
@keyframes slideInRight { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; pointer-events: none; } }

/* ----- HEADER ----- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-skull {
    font-size: 28px;
    animation: skullPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(230,57,70,0.6));
}
@keyframes skullPulse {
    0%,100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(230,57,70,0.6)); }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 16px rgba(230,57,70,0.9)); }
}
.logo-text { display: flex; flex-direction: column; }
.logo-main {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--primary);
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 0 12px rgba(230,57,70,0.5);
}
.logo-sub {
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Nav */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all var(--transition);
    position: relative;
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface);
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 14px; right: 14px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary);
}
.nav-icon { font-size: 16px; }

.badge-count {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
    0%,100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(230,57,70,0); }
}

/* Header user */
.header-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-numero {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: rgba(200,168,75,0.1);
    border: 1px solid rgba(200,168,75,0.2);
    padding: 2px 8px;
    border-radius: 3px;
}
.user-pseudo { font-weight: 700; font-size: 14px; color: var(--text); }
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text2);
    text-decoration: none;
    font-size: 18px;
    transition: all var(--transition);
    border: 1px solid var(--border);
}
.btn-logout:hover { color: var(--primary); border-color: var(--primary); background: var(--surface2); }

/* Presence toggle button */
.btn-presence {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: transparent;
    flex-shrink: 0;
}
.btn-presence-ready {
    border-color: #4caf50;
    color: #4caf50;
}
.btn-presence-ready:hover {
    background: rgba(76,175,80,0.15);
    box-shadow: 0 0 8px rgba(76,175,80,0.3);
}
.btn-presence-pause {
    border-color: #ff9800;
    color: #ff9800;
}
.btn-presence-pause:hover {
    background: rgba(255,152,0,0.15);
    box-shadow: 0 0 8px rgba(255,152,0,0.3);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
    display: block;
}

/* Mobile nav */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 8px 0;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
    padding: 12px 20px;
    color: var(--text2);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition);
}
.mobile-nav-link:hover { color: var(--text); background: var(--surface); }
.mobile-logout { color: var(--primary); }

/* ----- MAIN CONTENT ----- */
.main-content { position: relative; z-index: 1; flex: 1; }
.container { max-width: 1400px; margin: 0 auto; padding: 32px 20px; }

/* ----- PAGE HEADER ----- */
.page-header { margin-bottom: 28px; }
.page-title {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    line-height: 1.2;
}
.title-icon { font-size: 24px; }
.page-subtitle { color: var(--text2); font-size: 14px; margin-top: 6px; }
.game-timer {
    display: inline-block;
    font-size: 13px;
    color: var(--text2);
    margin-top: 6px;
    padding: 3px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: color 0.3s;
}

/* ----- BUTTONS ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: #f04850; box-shadow: var(--glow-red); }

.btn-success {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}
.btn-success:hover { background: var(--green-light); box-shadow: var(--glow-green); }

.btn-warning {
    background: rgba(244,162,97,0.2);
    color: var(--warning);
    border-color: rgba(244,162,97,0.4);
}
.btn-warning:hover { background: rgba(244,162,97,0.3); }

.btn-gold {
    background: #a06800;
    color: #fff;
    border-color: #a06800;
}
.btn-gold:hover { background: #b87800; box-shadow: 0 0 12px rgba(160,104,0,0.5); }

.btn-danger {
    background: rgba(193,18,31,0.2);
    color: #ff4444;
    border-color: rgba(193,18,31,0.5);
}
.btn-danger:hover { background: rgba(193,18,31,0.4); }

.btn-purple {
    background: rgba(168,85,247,0.18);
    color: #c084fc;
    border-color: rgba(168,85,247,0.45);
}
.btn-purple:hover { background: rgba(168,85,247,0.32); box-shadow: 0 0 8px rgba(168,85,247,0.3); }

.btn-outline {
    background: transparent;
    color: var(--text2);
    border-color: var(--border2);
}
.btn-outline:hover { color: var(--text); border-color: var(--text3); background: var(--surface); }

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-xs  { padding: 4px 9px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

.btn-glow {
    box-shadow: 0 0 0 rgba(230,57,70,0);
    animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
    0%,100% { box-shadow: 0 0 8px rgba(230,57,70,0.2); }
    50%      { box-shadow: 0 0 24px rgba(230,57,70,0.5), 0 0 40px rgba(230,57,70,0.2); }
}

.btn-generate {
    padding: 16px 24px;
    font-size: 16px;
    letter-spacing: 1px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, #8c1a22 100%);
}
.btn-generate:hover { background: linear-gradient(135deg, #f04850 0%, var(--primary) 100%); }
.spin-icon { display: inline-block; }
.btn-generate.loading .spin-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- BADGES ----- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-active       { background: rgba(45,106,79,0.25); color: #4ade80; border: 1px solid rgba(45,106,79,0.5); }
.badge-pending      { background: rgba(200,168,75,0.2); color: var(--accent); border: 1px solid rgba(200,168,75,0.4); }
.badge-inactive     { background: rgba(150,150,150,0.15); color: #888; border: 1px solid #444; }
.badge-admin        { background: rgba(255,209,102,0.15); color: #ffd166; border: 1px solid rgba(255,209,102,0.35); }
.badge-superadmin   { background: rgba(220,38,38,0.15); color: #f87171; border: 1px solid rgba(220,38,38,0.4); font-weight: 600; letter-spacing: 0.02em; }
.badge-visitor      { background: rgba(138,68,220,0.2); color: #c084fc; border: 1px solid rgba(138,68,220,0.4); }
.badge-sa-lock      { font-size: 11px; color: var(--text3); font-style: italic; padding: 2px 4px; }
.badge-passwordless { background: transparent; border: none; padding: 0 2px; color: var(--accent); }
.icon-lock-open { width: 13px; height: 13px; vertical-align: middle; display: inline-block; }

/* ----- FORMS ----- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text2);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.form-hint { font-size: 11px; font-weight: 400; color: var(--text3); display: block; margin-top: 2px; text-transform: none; }
.input-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
    pointer-events: none;
}
.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 11px 14px;
    transition: all var(--transition);
    outline: none;
    appearance: none;
}
.input-wrapper .form-input { padding-left: 40px; }
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.15);
    background: var(--surface2);
}
.form-input::placeholder { color: var(--text3); }
.form-input-sm { padding: 7px 12px; font-size: 13px; }
.input-with-btn { display: flex; gap: 6px; align-items: center; }
.input-with-btn .form-input { flex: 1; min-width: 0; }
select.form-input { cursor: pointer; }
option { background: var(--surface2); }
.toggle-password {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
    transition: opacity var(--transition);
}
.toggle-password:hover { opacity: 1; }

/* Password strength */
.password-strength { margin-top: 8px; }
.pwd-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.pwd-bar div { height: 100%; width: 0; border-radius: 2px; transition: all 0.3s ease; }
#pwdLabel { font-size: 11px; color: var(--text3); }

.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.check-input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; margin-top: 2px; }
.check-label { font-size: 14px; color: var(--text2); cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-full { grid-column: 1 / -1; }
.form-group-center { display: flex; align-items: flex-end; padding-bottom: 4px; }
.form-label-hint { font-size: 11px; color: var(--text3); font-weight: 400; text-transform: none; }
.form-hint-small { font-size: 11px; color: var(--text3); margin-top: 4px; }
.required { color: var(--primary); }

/* Toggle switch */
.form-label-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle-checkbox { display: none; }
.toggle-slider {
    position: relative; display: inline-block;
    width: 40px; height: 22px; flex-shrink: 0;
    background: var(--bg3); border-radius: 11px;
    border: 1px solid var(--border);
    transition: background 0.2s;
}
.toggle-slider::after {
    content: ''; position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    background: var(--text3); border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle-checkbox:checked + .toggle-slider { background: rgba(45,106,79,0.4); border-color: #4ade80; }
.toggle-checkbox:checked + .toggle-slider::after { transform: translateX(18px); background: #4ade80; }

/* Form section divider */
.form-section-divider {
    position: relative; text-align: center;
    margin: 16px 0 12px;
    color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.form-section-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    border-top: 1px solid var(--border); z-index: 0;
}
.form-section-divider span { background: var(--bg2); padding: 0 10px; position: relative; z-index: 1; }

/* Page header row (title + action button side by side) */
.page-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ----- ALERTS ----- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}
.alert-success { background: rgba(45,106,79,0.2); border: 1px solid rgba(45,106,79,0.5); color: #4ade80; }
.alert-error   { background: rgba(193,18,31,0.2); border: 1px solid rgba(193,18,31,0.5); color: #ff6b6b; }
.alert-warning { background: rgba(200,168,75,0.15); border: 1px solid rgba(200,168,75,0.4); color: var(--accent); }

/* ----- AUTH PAGES ----- */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent2), var(--primary));
    animation: borderSlide 3s linear infinite;
    background-size: 200%;
}
@keyframes borderSlide {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-skull {
    font-size: 56px;
    display: block;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(230,57,70,0.6));
    animation: floatSkulll 3s ease-in-out infinite;
}
@keyframes floatSkulll {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.auth-title {
    font-family: var(--font-title);
    font-size: 24px;
    color: var(--primary);
    letter-spacing: 3px;
    text-shadow: 0 0 16px rgba(230,57,70,0.4);
}
.auth-sub { color: var(--accent); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.auth-tagline { font-size: 12px; color: var(--text3); font-style: italic; margin-top: 8px; }
.auth-form-title {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: 1px;
}
.auth-desc { color: var(--text2); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
/* EHPAD stats block on login page */
.ehpad-stats {
    margin: 16px 0 20px;
    text-align: center;
}
.ehpad-stats-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text3);
    margin-bottom: 8px;
}
.ehpad-stats-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.ehpad-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface2);
}
.stat-count {
    font-family: var(--font-title);
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
}
.ehpad-stat-admin   { border-color: rgba(255,209,102,0.3); background: rgba(255,209,102,0.07); }
.ehpad-stat-admin   .stat-count { color: #ffd166; }
.ehpad-stat-resident { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.07); }
.ehpad-stat-resident .stat-count { color: #4ade80; }
.ehpad-stat-visitor  { border-color: rgba(192,132,252,0.3); background: rgba(192,132,252,0.07); }
.ehpad-stat-visitor  .stat-count { color: #c084fc; }

.auth-form { margin-top: 20px; }
.auth-teams-cta { margin-top: 20px; }
.auth-divider-line { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.auth-divider-line::before, .auth-divider-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-teams-btn {
    background: linear-gradient(135deg, #ffd166 0%, #f4a261 100%);
    color: #0d0e14;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 0 18px rgba(255,209,102,0.25);
    transition: box-shadow 0.2s, transform 0.15s;
}
.auth-teams-btn:hover { box-shadow: 0 0 28px rgba(255,209,102,0.45); transform: translateY(-1px); color: #0d0e14; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text2); font-size: 14px; }
.auth-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.dev-hint {
    margin-top: 16px;
    padding: 8px 12px;
    background: rgba(67,97,238,0.1);
    border: 1px dashed rgba(67,97,238,0.4);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text3);
}

/* ----- Admin-in-charge banner ----- */
.admin-lock-banner {
    display: none;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, rgba(196,138,75,0.15), rgba(196,138,75,0.05));
    border: 1px solid rgba(196,138,75,0.4);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text2);
    animation: pulse-border 2s ease-in-out infinite;
}
.admin-lock-banner.visible { display: flex; }
.admin-lock-banner .lock-icon { font-size: 1.2rem; flex-shrink: 0; }
@keyframes pulse-border {
    0%,100% { border-color: rgba(196,138,75,0.4); }
    50%      { border-color: rgba(196,138,75,0.8); }
}

/* ----- TEAMS GRID (Dashboard) ----- */
.admin-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.admin-bar-label { font-size: 12px; color: var(--text); font-weight: 700; letter-spacing: 0.5px; margin-right: 4px; }

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 4px;
}

.team-card {
    background: var(--surface);
    border: 2px solid var(--team-color, var(--primary));
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: teamReveal 0.5s ease forwards;
    opacity: 0;
    transform: translateY(-16px);
}
.team-card:nth-child(1) { animation-delay: 0.0s; }
.team-card:nth-child(2) { animation-delay: 0.08s; }
.team-card:nth-child(3) { animation-delay: 0.16s; }
.team-card:nth-child(4) { animation-delay: 0.24s; }
.team-card:nth-child(5) { animation-delay: 0.32s; }
.team-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes teamReveal {
    to { opacity: 1; transform: translateY(0); }
}
.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(var(--team-rgb, 230,57,70), 0.15);
}
.team-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--team-color);
    box-shadow: 0 0 12px var(--team-color);
}
.team-card-mine {
    box-shadow: 0 0 0 3px var(--team-color), 0 0 30px rgba(0,0,0,0.5);
}
.team-card-mine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.team-mine-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--team-color);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    animation: mineFlash 2s ease-in-out infinite;
}
@keyframes mineFlash {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.7; }
}
.team-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.team-number {
    display: block;
    font-family: var(--font-title);
    font-size: 11px;
    color: var(--team-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.team-name {
    display: block;
    font-family: var(--font-title);
    font-size: 17px;
    color: var(--text);
    line-height: 1.2;
}
.team-members {
    list-style: none;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.team-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    transition: background var(--transition);
}
.team-member:hover { background: rgba(255,255,255,0.06); }
.team-member-me {
    background: rgba(var(--team-color), 0.1) !important;
    border-left: 3px solid var(--team-color);
}
.member-num { font-family: var(--font-mono); font-size: 11px; color: var(--text3); min-width: 36px; }
.member-pseudo { font-weight: 600; font-size: 14px; flex: 1; }
.member-you-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--team-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-card-large .team-header { padding: 20px; }
.team-card-large .team-name { font-size: 22px; }
.teams-hidden-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(200,168,75,0.1);
    border: 1px solid rgba(200,168,75,0.2);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 16px;
}
.teams-single { max-width: 400px; }
.no-team-notice {
    text-align: center;
    padding: 48px 24px;
    color: var(--text2);
}
.notice-icon { font-size: 48px; display: block; margin-bottom: 16px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    max-width: 500px;
    margin: 0 auto;
}
.empty-skull {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: floatSkulll 4s ease-in-out infinite;
}
.empty-state h2 { font-family: var(--font-title); font-size: 22px; margin-bottom: 12px; color: var(--text2); }
.empty-state p  { color: var(--text3); font-size: 14px; margin-bottom: 8px; }
.empty-tagline  { font-style: italic; color: var(--text3) !important; }

/* ----- ADMIN USERS TABLE ----- */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.filter-group { flex: 1; min-width: 180px; }
.filter-group-narrow { flex: 0 0 auto; min-width: 0; }
.admissions-alert { border-color: rgba(244,162,97,0.5); }

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}
/* Users table: sticky thead + vertical scroll */
.users-table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 300px);
    min-height: 300px;
}
.users-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--border2);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text3);
    background: var(--bg3);
    border-bottom: 1px solid var(--border2);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr.status-pending td { background: rgba(200,168,75,0.04); }
.data-table tr.status-inactive td { opacity: 0.6; }
.data-table tr.status-visitor td { background: rgba(138,68,220,0.04); }
.sort-link {
    color: var(--text2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition);
}
.sort-link:hover { color: var(--text); }
.numero-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: rgba(200,168,75,0.1);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid rgba(200,168,75,0.2);
}
.no-numero { color: var(--text3); }
.cell-pseudo { white-space: nowrap; }
.pseudo-name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.cell-email { font-size: 13px; color: var(--text2); white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cell-actions { vertical-align: middle; }
.actions-wrap { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; white-space: nowrap; }
.action-btn { flex-shrink: 0; }
.th-actions { text-align: right; }
.table-empty { text-align: center; padding: 40px; color: var(--text3); }

/* ----- ADMIN TEAMS PAGE ----- */
.session-info-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.session-date-label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.session-date-val { font-family: var(--font-mono); font-size: 15px; color: var(--accent); font-weight: 700; }
.session-round { font-size: 12px; color: var(--text2); font-family: var(--font-mono); }

.admin-teams-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

/* Panel */
.panel {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border2);
    background: var(--bg3);
    gap: 10px;
    flex-wrap: wrap;
}
.panel-title {
    font-family: var(--font-title);
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}
.panel-actions { display: flex; gap: 6px; }
.panel-body { padding: 16px; }
.count-badge {
    background: var(--primary);
    color: #000;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Participants list */
.participants-search { margin-bottom: 10px; }
.participants-list {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Desktop : panel participants sticky + liste scrollable */
@media (min-width: 769px) {
    .panel-participants {
        position: sticky;
        top: 72px;
        align-self: flex-start;
    }
    /*
     * Calcul :
     *   72px  sticky top (nav)
     *  ~54px  panel-header
     *  ~16px  panel-body padding-top
     *  ~48px  barre de recherche + margin
     *  [list] ← max-height ici
     *  ~50px  participant-summary (2 lignes)
     *  ~82px  generate-section (bouton + hint + spacing)
     *  ~16px  panel-body padding-bottom
     *   12px  marge de sécurité
     * Total overhead ≈ 350px
     */
    .panel-participants .participants-list {
        max-height: calc(100vh - 350px);
        min-height: 100px;
    }
}
.participants-list::-webkit-scrollbar { width: 4px; }
.participants-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.participant-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}
.participant-item:hover { background: var(--surface2); }
.participant-item.checked {
    background: rgba(45,106,79,0.15);
    border-color: rgba(45,106,79,0.3);
}
.participant-check { accent-color: var(--green-light); cursor: pointer; width: 15px; height: 15px; flex-shrink: 0; }

/* Joueur en pause — non sélectionnable */
.participant-item.participant-paused {
    opacity: 0.45;
    cursor: not-allowed;
}
.participant-item.participant-paused:hover { background: transparent; }
.participant-item.participant-paused .participant-check { cursor: not-allowed; }
.participant-num { font-family: var(--font-mono); font-size: 11px; color: var(--text3); min-width: 38px; }
.participant-pseudo { font-size: 14px; font-weight: 600; }
.participant-visitor-tag {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: #c084fc; background: rgba(138,68,220,0.18); border: 1px solid rgba(138,68,220,0.3);
    border-radius: 4px; padding: 0 4px; line-height: 16px; display: inline-block;
}
/* Status group: [V] [presence-dot] [online-dot] — pushed to the right of the row */
.participant-status-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
/* Online indicator dot in participant list */
.participant-online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: help;
}
.participant-online-open   { background: #4caf50; box-shadow: 0 0 4px rgba(76,175,80,0.7); }
.participant-online-ghost  { background: #7c6f3a; border: 1px solid rgba(220,195,80,0.4); }
.participant-online-manual { background: #a855f7; box-shadow: 0 0 4px rgba(168,85,247,0.6); }
.participant-online-off    { background: #2e2e3a; border: 1px solid #444; }

/* Kick-visitor button — visible only on visitor rows in teams management */
.btn-kick-visitor {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; padding: 0; border: none; border-radius: 3px;
    background: transparent; color: var(--text3);
    font-size: 10px; line-height: 1; cursor: pointer;
    opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.participant-item:hover .btn-kick-visitor { opacity: 1; }
.btn-kick-visitor:hover { color: var(--primary); background: rgba(230,57,70,0.15); }
.btn-kick-visitor:disabled { cursor: not-allowed; opacity: 0.5; }

/* ↩ tag — manually unchecked indicator (shows who unchecked the player) */
.participant-excluded-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    line-height: 16px;
    border-radius: 4px;
    display: inline-block;
    background: rgba(244,162,97,.13);
    color: var(--warning);
    border: 1px solid rgba(244,162,97,.3);
    cursor: default;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* M tag — manually connected indicator in participant list */
.participant-manual-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    font-size: 9px;
    font-weight: 800;
    border-radius: 3px;
    background: rgba(168,85,247,0.2);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.45);
    flex-shrink: 0;
    line-height: 1;
}

.participant-summary {
    margin-top: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text2);
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 4px;
}
.distribution-preview { font-size: 11px; color: var(--accent); font-family: var(--font-mono); }
.generate-section { margin-top: 14px; }
.generate-hint { font-size: 11px; color: var(--text2); margin-top: 8px; text-align: center; line-height: 1.4; }
.no-participants { color: var(--text3); font-size: 13px; text-align: center; padding: 20px; }

/* Teams preview */
.teams-empty-state { text-align: center; padding: 48px 20px; }
.teams-empty-state .empty-skull { font-size: 56px; opacity: 0.2; margin-bottom: 16px; }
.teams-empty-state p { color: var(--text3); font-size: 14px; }

.teams-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.team-preview-card {
    background: var(--bg2);
    border: 2px solid var(--team-color, var(--primary));
    border-radius: var(--radius);
    overflow: hidden;
    animation: teamReveal 0.4s ease forwards;
    opacity: 0;
    transform: translateY(-10px);
}
.team-preview-card:nth-child(1) { animation-delay: 0s; }
.team-preview-card:nth-child(2) { animation-delay: 0.06s; }
.team-preview-card:nth-child(3) { animation-delay: 0.12s; }
.team-preview-card:nth-child(4) { animation-delay: 0.18s; }
.team-preview-card:nth-child(5) { animation-delay: 0.24s; }
.team-preview-card:nth-child(6) { animation-delay: 0.30s; }
.team-preview-header {
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.team-preview-num {
    font-family: var(--font-title);
    font-size: 9px;
    color: var(--team-color);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 2px;
}
.team-preview-name {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--text);
    display: block;
    line-height: 1.2;
}
.team-preview-members {
    list-style: none;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.team-preview-members li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pm-num { font-family: var(--font-mono); font-size: 10px; color: var(--text2); min-width: 32px; }
.pm-pseudo { font-weight: 600; }
.captain-star { font-size: 13px; line-height: 1; flex-shrink: 0; }

/* Conflict dots — previous round indicators */
/* .conflict-dots wraps both dots and is pushed to the far right of the flex row */
.conflict-dots {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
/* Individual dot — no auto margin; parent wrapper handles positioning */
.conflict-dot {
    font-size: 9px;
    line-height: 1;
    filter: drop-shadow(0 0 3px currentColor);
    cursor: help;
}
.conflict-red    { color: #e63946; }
.conflict-orange { color: #f4a261; }

/* Presence indicator dot (participants list) */
.presence-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: help;
}
.presence-ready {
    background: #4caf50;
    box-shadow: 0 0 5px rgba(76,175,80,0.6);
}
.presence-pause {
    background: #ff9800;
}

/* Online indicator (admin users table) */
.cell-online { font-size: 12px; white-space: nowrap; }
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 6px rgba(76,175,80,0.7);
    margin-right: 4px;
    animation: pulse-online 2s ease-in-out infinite;
}
@keyframes pulse-online {
    0%,100% { box-shadow: 0 0 4px rgba(76,175,80,0.5); }
    50%      { box-shadow: 0 0 10px rgba(76,175,80,0.9); }
}
.online-label  { color: #4caf50; font-weight: 600; font-size: 12px; }
.offline-label { color: var(--text3); }
.online-dot-warn { background: var(--warning); box-shadow: 0 0 6px rgba(244,162,97,0.7); animation-name: pulse-warn; }
@keyframes pulse-warn {
    0%,100% { box-shadow: 0 0 4px rgba(244,162,97,0.5); }
    50%      { box-shadow: 0 0 10px rgba(244,162,97,0.9); }
}
.idle-warn-text { color: var(--warning); font-weight: 600; }
/* Ghost state: session exists but no browser tab open */
.online-dot-ghost {
    background: #7c6f3a;
    box-shadow: 0 0 5px rgba(180,160,60,0.5);
    animation-name: pulse-ghost;
    border: 1px solid rgba(220,195,80,0.35);
}
@keyframes pulse-ghost {
    0%,100% { box-shadow: 0 0 3px rgba(180,160,60,0.4); opacity: 0.75; }
    50%      { box-shadow: 0 0 8px rgba(220,195,80,0.7); opacity: 1; }
}
.online-label-ghost { color: #b0a050; font-size: 12px; font-weight: 500; }
/* Manual state: manually connected by admin */
.online-dot-manual {
    background: #a855f7;
    box-shadow: 0 0 5px rgba(168,85,247,0.55);
    animation-name: pulse-manual;
    border: 1px solid rgba(168,85,247,0.4);
}
@keyframes pulse-manual {
    0%,100% { box-shadow: 0 0 3px rgba(168,85,247,0.4); opacity: 0.8; }
    50%      { box-shadow: 0 0 9px rgba(168,85,247,0.75); opacity: 1; }
}
.online-label-manual { color: #c084fc; font-size: 12px; font-weight: 500; }
.presence-pause-tag  { color: var(--warning); font-size: 12px; font-weight: 600; }

/* Loading state */
.teams-loading { text-align: center; padding: 60px 20px; }
.loading-skull {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    animation: spin 2s linear infinite;
}
.teams-loading p { color: var(--text2); margin-bottom: 16px; }
.loading-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent2));
    border-radius: 2px;
    transition: width 0.1s linear;
}

.validated-label { color: #4ade80; font-weight: 700; font-size: 14px; }
.round-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text3);
    background: var(--surface2);
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
}

/* History */
.section-history { margin-top: 40px; }
.section-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-history-header .section-title { margin-bottom: 0; }
.section-title {
    font-family: var(--font-title);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.history-date { font-family: var(--font-mono); font-size: 13px; color: var(--accent); min-width: 80px; }
.history-label { font-weight: 600; font-size: 14px; flex: 1; }
.history-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text3); }

/* ----- MODALS ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeInOverlay 0.2s ease; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease;
    position: relative;
    /* Redéfinir les variables de couleur pour plus de lisibilité dans les modales */
    --text2: #b0bcd0;
    --text3: #8a94b0;
}
.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent2));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-sm { max-width: 380px; }
@keyframes modalSlideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-family: var(--font-title);
    font-size: 16px;
    letter-spacing: 0.5px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal-body { padding: 14px 20px; }

/* Lisibilité des textes dans les modales — fond plus clair que la page */
.modal .form-group                  { margin-bottom: 12px; }
.modal .form-section-divider        { margin: 8px 0 10px; }
.modal .form-label                  { color: var(--text); }
.modal .form-label-hint             { color: var(--text2); font-weight: 400; text-transform: none; }
.modal .form-hint                   { color: var(--text2); }
.modal .form-hint-small             { color: var(--text2); }
.modal .form-label-toggle           { color: var(--text); }
.modal .form-section-divider        { color: var(--text2); }
.modal .form-section-divider::before { border-color: var(--border2); }
.modal .form-input                  { color: var(--text); background: var(--bg3); border-color: var(--border2); }
.modal .form-input::placeholder     { color: var(--text2); }
.modal .form-input:focus            { background: var(--surface2); }
.modal select.form-input            { color: var(--text); }
.modal select.form-input option     { background: var(--bg3); color: var(--text); }
.modal p.form-hint                  { color: var(--text2); }
.modal .modal-body                  { color: var(--text2); }
.modal .modal-body p                { color: var(--text2); }
.modal .toggle-slider               { background: var(--surface2); border-color: var(--border2); }
.modal .toggle-slider::after        { background: var(--text2); }
.modal .required                    { color: var(--primary); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.modal-warning { color: var(--warning); font-size: 13px; margin-top: 8px; }

/* ----- VALIDATION OVERLAY ----- */
.validation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}
.validation-overlay.show { display: flex; animation: overlayPop 0.4s ease; }
@keyframes overlayPop { from { opacity: 0; } to { opacity: 1; } }
.validation-content { animation: validationBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes validationBounce {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.validation-skull {
    font-size: 100px;
    display: block;
    margin-bottom: 20px;
    animation: skullSpin 0.8s ease;
    filter: drop-shadow(0 0 40px var(--primary));
}
@keyframes skullSpin {
    0%   { transform: rotate(-20deg) scale(0.5); }
    60%  { transform: rotate(10deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}
.validation-title {
    font-family: var(--font-title);
    font-size: 36px;
    color: var(--primary);
    letter-spacing: 4px;
    text-shadow: 0 0 30px var(--primary);
    margin-bottom: 12px;
}
.validation-sub { font-size: 18px; color: var(--accent); letter-spacing: 1px; }

/* ----- FOOTER ----- */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text3);
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-skull { font-size: 18px; opacity: 0.5; }
.footer-brand { font-family: var(--font-title); letter-spacing: 2px; color: var(--text2); font-size: 13px; }
.footer-tagline { font-style: italic; color: var(--text3); font-size: 11px; max-width: 400px; }
.footer-info { color: var(--text3); font-size: 11px; }

/* ----- ADMIN LOCK PAGE ----- */
.locked-panel {
    max-width: 560px;
    margin: 40px auto;
    background: var(--bg2);
    border: 2px solid var(--danger);
    border-radius: 12px;
    padding: 48px 36px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.locked-icon { font-size: 52px; line-height: 1; }
.locked-title { font-family: var(--font-title); font-size: 22px; color: var(--danger); margin: 0; }
.locked-desc { font-size: 15px; color: var(--text1); margin: 0; }
.locked-sub { font-size: 13px; color: var(--text3); margin: 0; line-height: 1.6; }

.locked-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text3);
    margin-top: 4px;
}
.locked-status-free {
    border-color: var(--success, #2d6a4f);
    color: #52b788;
}
.locked-spinner {
    width: 14px; height: 14px;
    border: 2px solid var(--border2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
.locked-status-free .locked-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.locked-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ----- TERMINATED OVERLAY — shown when admin force-disconnects a user ----- */
.terminated-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: terminatedFadeIn 0.3s ease;
}
@keyframes terminatedFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.terminated-skull {
    font-size: 120px;
    display: block;
    margin-bottom: 24px;
    animation: terminatedSkull 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               terminatedSkullShake 0.15s ease-in-out 0.7s 3 alternate;
    filter: drop-shadow(0 0 40px rgba(230,57,70,0.9));
    transform-origin: center;
}
@keyframes terminatedSkull {
    0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
    70%  { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes terminatedSkullShake {
    from { transform: rotate(-6deg) scale(1.05); }
    to   { transform: rotate(6deg)  scale(1.05); }
}
.terminated-text {
    font-family: var(--font-title);
    font-size: clamp(40px, 8vw, 80px);
    color: var(--primary);
    letter-spacing: 4px;
    text-shadow: 0 0 40px var(--primary), 0 0 80px rgba(230,57,70,0.5);
    animation: terminatedText 0.5s ease 0.4s both,
               terminatedGlitch 0.2s steps(1) 1.5s 4;
    margin-bottom: 16px;
}
@keyframes terminatedText {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes terminatedGlitch {
    0%   { text-shadow: 0 0 40px var(--primary); transform: translateX(0); }
    25%  { text-shadow: -4px 0 var(--accent2), 4px 0 var(--primary); transform: translateX(-4px); }
    50%  { text-shadow: 4px 0 var(--accent2), -4px 0 var(--primary); transform: translateX(4px); }
    75%  { text-shadow: -2px 0 var(--accent2), 2px 0 var(--primary); transform: translateX(-2px); }
    100% { text-shadow: 0 0 40px var(--primary); transform: translateX(0); }
}
.terminated-sub {
    font-size: 16px;
    color: var(--text2);
    letter-spacing: 1px;
    animation: terminatedText 0.5s ease 0.7s both;
    max-width: 500px;
    padding: 0 20px;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
    .admin-teams-layout { grid-template-columns: 260px 1fr; }
}
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .hamburger { display: flex; }
    .main-nav { display: none; }
    .header-user .user-info { display: none; }
    .header-user .btn-logout { display: none; }
    /* Header : moins de padding/gap pour libérer de la place */
    .header-inner { gap: 10px; padding: 0 12px; }
    .logo-main { font-size: 15px; }
    /* Bouton présence mobile : icône seule dans un cercle parfait */
    .presence-label { display: none; }
    .btn-presence {
        width: 32px; height: 32px; padding: 0;
        font-size: 16px; line-height: 1;
        border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .admin-teams-layout { grid-template-columns: 1fr; }
    .panel-participants { order: 1; }
    .panel-teams { order: 2; }
    .teams-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
    .auth-card { padding: 28px 20px; }
    .actions-wrap { flex-wrap: wrap; }
}
@media (max-width: 400px) {
    /* Très petits écrans : masquer le sous-titre logo et réduire encore */
    .logo-sub { display: none; }
    .logo-main { font-size: 13px; }
    .header-inner { gap: 6px; padding: 0 10px; }
}
@media (max-width: 480px) {
    .teams-grid { grid-template-columns: 1fr; }
    .container { padding: 20px 12px; }
    .teams-preview { grid-template-columns: 1fr 1fr; }
}

/* ----- USERS TABLE — last-login compact on mobile ----- */
.cell-lastlogin { white-space: nowrap; font-size: 13px; }
.cell-lastlogin.lastlogin-fresh  { color: #4caf82;        font-weight: 600; }
.cell-lastlogin.lastlogin-warn   { color: var(--warning); font-weight: 600; }
.cell-lastlogin.lastlogin-danger { color: var(--primary); font-weight: 600; }
@media (max-width: 768px) {
    .cell-lastlogin { font-size: 11px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
}

/* ----- INACTIVITY FILTER PILLS ----- */
.filter-pills-group {
    display: flex;
    gap: 4px;
    align-items: center;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text2);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.filter-pill:hover { background: var(--bg2); color: var(--text); }
.filter-pill.filter-pill-active {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
}
.filter-pill-fresh        { color: #4caf82; border-color: rgba(76,175,130,0.3); }
.filter-pill-fresh:hover  { background: rgba(76,175,130,0.1); }
.filter-pill-fresh.filter-pill-active {
    background: rgba(76,175,130,0.15);
    border-color: #4caf82;
    color: #4caf82;
}
.filter-pill-warn        { color: var(--warning); border-color: rgba(244,162,97,0.3); }
.filter-pill-warn:hover  { background: rgba(244,162,97,0.1); }
.filter-pill-warn.filter-pill-active  {
    background: rgba(244,162,97,0.15);
    border-color: var(--warning);
    color: var(--warning);
}
.filter-pill-danger       { color: var(--primary); border-color: rgba(230,57,70,0.3); }
.filter-pill-danger:hover { background: rgba(230,57,70,0.1); }
.filter-pill-danger.filter-pill-active {
    background: rgba(230,57,70,0.15);
    border-color: var(--primary);
    color: var(--primary);
}
.filter-pill-online        { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.filter-pill-online:hover  { background: rgba(74,222,128,0.08); }
.filter-pill-online.filter-pill-active {
    background: rgba(74,222,128,0.15);
    border-color: #4ade80;
    color: #4ade80;
}

/* ----- REMEMBER-ME CHECKBOX ----- */
.form-group-inline { margin-top: -4px; margin-bottom: 8px; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.checkbox-mark {
    width: 18px; height: 18px;
    border: 2px solid var(--border2);
    border-radius: 3px;
    background: var(--surface);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
}
.checkbox-mark::after {
    content: '✓';
    font-size: 12px;
    color: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
    line-height: 1;
}
.checkbox-input:checked + .checkbox-mark {
    border-color: var(--primary);
    background: rgba(230,57,70,0.12);
}
.checkbox-input:checked + .checkbox-mark::after { opacity: 1; }
.checkbox-text { font-size: 13px; color: var(--text2); }

/* ----- MOBILE TABLE HEADERS — abbrev / col visibility ----- */
/* Desktop: show full labels, hide short ones */
.col-full   { display: inline; }
.col-mobile { display: none;   }

/* Status cell on mobile: squeeze the badge to a colored square */
.cell-online { white-space: nowrap; }
.col-online-th { text-align: center; }

/* ----- AUDIT LOG SECTION ----- */
.section-audit {
    margin-top: 40px;
}
.section-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.section-audit-header .section-title { margin-bottom: 0; }
.audit-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.audit-filter-input {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 5px 10px;
    width: 200px;
    outline: none;
    transition: border-color var(--transition);
}
.audit-filter-input:focus { border-color: var(--accent2); }
.audit-filter-input::placeholder { color: var(--text3); }
.audit-table { font-size: 13px; }
.audit-table td { padding: 9px 12px; vertical-align: top; }
.audit-date { color: var(--text2); white-space: nowrap; font-size: 12px; }
.audit-admin { white-space: nowrap; color: var(--text); }
.audit-action-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(67,97,238,0.18);
    color: #8fa8ff;
    border: 1px solid rgba(67,97,238,0.35);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.audit-target { color: var(--text); white-space: nowrap; }
.audit-changes { display: flex; flex-wrap: wrap; gap: 6px; }
.audit-change {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 3px 9px;
    font-size: 12px;
}
.audit-field { color: var(--text2); font-style: italic; }
.audit-from { color: #f07070; text-decoration: line-through; opacity: 0.85; }
.audit-arrow { color: var(--text2); }
.audit-to   { color: #5dcc90; font-weight: 700; }
.audit-nochange { color: var(--text2); font-style: italic; font-size: 12px; }

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    /* Switch to abbreviated column headers */
    .col-full   { display: none;   }
    .col-mobile { display: inline; }

    /* Status column: hidden on mobile — conveyed by pseudo colour */
    .col-status-th,
    .cell-status { display: none; }

    /* Pseudo badgé par statut sur mobile (même rendu que les badges de statut) */
    .user-row.status-active .cell-pseudo .pseudo-name {
        background: rgba(45,106,79,0.25); color: #4ade80;
        border: 1px solid rgba(45,106,79,0.5);
        border-radius: 6px; padding: 2px 7px; font-size: 12px;
    }
    .user-row.status-visitor .cell-pseudo .pseudo-name {
        background: rgba(138,68,220,0.2); color: #c084fc;
        border: 1px solid rgba(138,68,220,0.4);
        border-radius: 6px; padding: 2px 7px; font-size: 12px;
    }
    .user-row.status-pending .cell-pseudo .pseudo-name {
        background: rgba(200,168,75,0.2); color: var(--accent);
        border: 1px solid rgba(200,168,75,0.4);
        border-radius: 6px; padding: 2px 7px; font-size: 12px;
    }

    /* Badges Admin / SuperAdmin : initiale seulement sur mobile */
    .badge-admin { font-size: 0; padding: 2px 5px; }
    .badge-admin::before { content: 'A'; font-size: 11px; }
    .badge-superadmin { font-size: 0; padding: 2px 5px; }
    .badge-superadmin::before { content: 'SA'; font-size: 11px; }

    /* Action buttons: uniform size on mobile (based on "Désactiver") */
    .actions-wrap .btn {
        flex: 1 1 auto;
        min-width: 82px;
        justify-content: center;
    }

    /* Online column: hide text on mobile, keep dot */
    .cell-online .online-label,
    .cell-online .offline-label { display: none; }

    /* Audit table: hide some columns on very small screens */
    .audit-table .hide-mobile { display: none; }
}

/* ----- MA CHAMBRE ----- */
.chambre-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}
.chambre-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}
.chambre-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chambre-form .form-group { margin-bottom: 16px; }

/* Readonly info grid */
.chambre-readonly-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 4px 0 20px;
}
.chambre-info-item {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}
.chambre-info-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    margin-bottom: 4px;
}
.chambre-info-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}
.parrain-badge { display: inline-flex; align-items: center; gap: 6px; }
.no-parrain { color: var(--text3); font-style: italic; font-weight: 400; }
.chambre-form-footer { text-align: right; margin-top: 4px; }

/* Champ pseudo verrouillé */
.field-locked-icon { margin-left: 5px; font-style: normal; opacity: .7; cursor: help; }
.field-locked-wrap { position: relative; cursor: not-allowed; }
.field-locked-wrap::after {
    content: attr(title);
    position: absolute; bottom: calc(100% + 6px); left: 0;
    background: var(--bg3); color: var(--text2);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 6px 10px; font-size: 12px; white-space: nowrap;
    pointer-events: none; opacity: 0; transition: opacity .15s;
    z-index: 10;
}
.field-locked-wrap:hover::after { opacity: 1; }
.field-locked {
    pointer-events: none;
    opacity: .55;
    background: var(--bg) !important;
    cursor: not-allowed;
}

/* Voisins list */
.voisins-count {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px;
    padding: 1px 7px;
    color: var(--text2);
    font-weight: 700;
    margin-left: 4px;
}
.voisins-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}
.voisin-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}
.voisin-self { border-color: rgba(230,57,70,0.3); background: rgba(230,57,70,0.04); }
.self-tag { font-size: 11px; color: var(--text3); font-weight: 400; }

/* Dots connexion */
.voisin-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.vdot-online { background: #4ade80; box-shadow: 0 0 5px rgba(74,222,128,0.6); }
.vdot-ghost  { background: #facc15; box-shadow: 0 0 5px rgba(250,204,21,0.4); }
.vdot-manual { background: #c084fc; box-shadow: 0 0 5px rgba(192,132,252,0.4); }

/* Numéro & pseudo */
.voisin-numero {
    font-size: 11px;
    color: var(--text3);
    font-family: 'Share Tech Mono', monospace;
    flex-shrink: 0;
}
.voisin-pseudo {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.voisin-pseudo-active  { color: #4ade80; }
.voisin-pseudo-visitor { color: #c084fc; }
.voisin-pseudo-pending { color: var(--warning); }
.voisin-pseudo-inactive{ color: var(--text3); }

/* Présence */
.voisin-presence { font-size: 13px; margin-left: auto; flex-shrink: 0; }

/* Empty state */
.chambre-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text3);
}
.chambre-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* Colonne droite : empile Gaming+Voisins verticalement */
.chambre-right { display: flex; flex-direction: column; gap: 24px; }

/* Bloc Gaming */
.chambre-gaming-block { margin-bottom: 4px; }
.chambre-gaming-block:last-child { margin-bottom: 0; }

.chambre-twitch-row { display: flex; gap: 10px; align-items: flex-end; }
.chambre-twitch-row .form-input { flex: 1; }
.chambre-twitch-row .btn { white-space: nowrap; flex-shrink: 0; }
.btn-block { width: 100%; justify-content: center; }

/* Responsive */
@media (max-width: 900px) {
    .chambre-layout { grid-template-columns: 1fr; }
    .chambre-right { gap: 16px; }
}
@media (max-width: 768px) {
    .chambre-readonly-grid { grid-template-columns: 1fr 1fr; }
    .chambre-card { padding: 20px 16px; }
}

/* ----- SCROLLBAR ----- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ----- HISTORY PAGE ----- */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.history-day-block {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.history-day-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
.history-day-title:hover { background: rgba(255,255,255,0.06); }

.history-day-chevron {
    font-size: 11px;
    color: var(--text3);
    flex-shrink: 0;
    transition: transform 0.25s ease;
    margin-left: 4px;
}
.history-day-block.collapsed .history-day-chevron { transform: rotate(-90deg); }
.history-day-block.collapsed .history-day-title { border-bottom-color: transparent; }

.history-day-icon {
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.history-day-label {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--accent);
    text-transform: capitalize;
    flex: 1;
}

.history-day-badge {
    font-size: 11px;
    color: var(--accent2);
    background: rgba(67, 97, 238, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.25);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
}
.history-day-rounds {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(var(--accent-rgb, 255,80,80), 0.1);
    border: 1px solid rgba(var(--accent-rgb, 255,80,80), 0.2);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
}

.history-partners-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.history-day-block.collapsed .history-partners-list {
    max-height: 0;
    padding: 0;
}

.history-partner-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.history-partner-item:last-child { border-bottom: none; }
.history-partner-item:hover { background: rgba(255,255,255,0.03); }

.hpi-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text3);
    min-width: 32px;
}

.hpi-pseudo {
    font-size: 14px;
    color: var(--text1);
    flex: 1;
}

.hpi-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(var(--accent-rgb, 255,80,80), 0.12);
    border: 1px solid rgba(var(--accent-rgb, 255,80,80), 0.25);
    border-radius: 10px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* ----- UTILITY ----- */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ----- PENDING NOTIFICATION (Twitch-style) ----- */
.pending-notif {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    gap: 14px;
    width: 320px;
    background: var(--bg3);
    border: 1px solid var(--primary);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.55), 0 0 18px rgba(230,57,70,0.25);
    animation: notifSlideIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.pending-notif.visible { display: flex; }
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateX(110%) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes notifSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(110%) scale(0.9); }
}
.pending-notif.hiding {
    animation: notifSlideOut 0.3s cubic-bezier(0.4,0,1,1) forwards;
}
.pending-notif-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.pending-notif-body {
    flex: 1;
    min-width: 0;
}
.pending-notif-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 4px;
}
.pending-notif-pseudo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}
.pending-notif-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.pending-notif-link:hover { color: #fff; }
.pending-notif-close {
    background: transparent;
    border: none;
    color: var(--text3);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
    margin-top: 2px;
}
.pending-notif-close:hover { color: var(--text); }

/* ----- TWITCH LIVE NOTIFICATION ----- */
.twitch-live-notif {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    gap: 14px;
    width: 320px;
    background: var(--bg3);
    border: 1px solid #9146ff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.6), 0 0 24px rgba(145,70,255,0.35);
    animation: notifSlideIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.twitch-live-notif.visible { display: flex; }
.twitch-live-notif.hiding {
    animation: notifSlideOut 0.3s cubic-bezier(0.4,0,1,1) forwards;
}
/* Décaler vers le haut si le pending-notif admin est aussi visible */
.pending-notif.visible ~ .twitch-live-notif.visible,
.twitch-live-notif.visible + .pending-notif.visible { bottom: 160px; }
.twitch-live-notif-icon { flex-shrink: 0; margin-top: 2px; }
.twitch-live-notif-body { flex: 1; min-width: 0; }
.twitch-live-notif-label {
    font-size: 11px;
    font-weight: 700;
    color: #9146ff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.twitch-live-notif-pseudo {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.twitch-live-notif-msg {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 8px;
}
.twitch-live-notif-link {
    font-size: 12px;
    color: #9146ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.twitch-live-notif-link:hover { color: #b880ff; }
.twitch-live-notif-close {
    background: transparent;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 0.15s;
}
.twitch-live-notif-close:hover { color: var(--text); }

/* ----- THEME TOGGLE BUTTON ----- */
.btn-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all var(--transition);
    flex-shrink: 0;
    padding: 0;
}
.btn-theme-toggle:hover {
    background: var(--surface2);
    border-color: var(--border2);
    box-shadow: 0 0 8px rgba(200,168,75,0.25);
}

/* ----- LIGHT MODE ----- */
html.light-mode {
    --bg:           #d8dce8;
    --bg2:          #cdd2e0;
    --bg3:          #c2c8d8;
    --surface:      #e2e6f0;
    --surface2:     #d8dce8;
    --border:       rgba(0,0,0,0.14);
    --border2:      rgba(0,0,0,0.24);
    --text:         #0e1120;
    --text2:        #2a3248;
    --text3:        #48566e;
    --primary-dim:  #f5c0c4;
    --shadow:       0 4px 24px rgba(0,0,0,0.13);
    --shadow-lg:    0 8px 48px rgba(0,0,0,0.18);
    --glow-red:     0 0 12px rgba(230,57,70,0.2);
    --glow-blue:    0 0 12px rgba(67,97,238,0.2);
    --glow-green:   0 0 12px rgba(45,106,79,0.2);
}

/* Override hardcoded backgrounds for light mode */
html.light-mode .site-header {
    background: rgba(210, 216, 232, 0.97);
    box-shadow: 0 2px 16px rgba(0,0,0,0.13);
}
html.light-mode .mobile-nav {
    background: var(--bg2);
}
html.light-mode body {
    background-color: var(--bg);
    color: var(--text);
}
/* Scanlines are invisible on light bg — hide them */
html.light-mode .scanlines {
    display: none;
}
/* Background particles: reduce blue/red tints for light mode */
html.light-mode .bg-particles::before {
    background:
        radial-gradient(ellipse 60% 40% at 20% 20%, rgba(67,97,238,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 80% 80%, rgba(230,57,70,0.03) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 50% 50%, rgba(200,168,75,0.02) 0%, transparent 70%);
}
/* History day hover uses hardcoded rgba(255,255,255,...) */
html.light-mode .history-day-title {
    background: rgba(0,0,0,0.02);
}
html.light-mode .history-day-title:hover {
    background: rgba(0,0,0,0.05);
}
html.light-mode .history-day-block.collapsed .history-day-title {
    border-bottom-color: transparent;
}

/* Badges: override bright-on-dark colors for light mode readability */
html.light-mode .badge-active   { background: rgba(28,110,55,0.1); color: #1a6b34; border-color: rgba(28,110,55,0.3); }
html.light-mode .badge-pending  { background: rgba(160,120,0,0.12); color: #7a5800; border-color: rgba(160,120,0,0.3); }
html.light-mode .badge-inactive { background: rgba(100,100,100,0.1); color: #444; border-color: rgba(100,100,100,0.3); }
html.light-mode .badge-admin      { background: rgba(160,120,0,0.12); color: #7a5800; border-color: rgba(160,120,0,0.3); }
html.light-mode .badge-superadmin { background: rgba(185,28,28,0.1); color: #b91c1c; border-color: rgba(185,28,28,0.3); }
html.light-mode .badge-visitor    { background: rgba(110,40,190,0.1); color: #6520b0; border-color: rgba(110,40,190,0.25); }

/* Table: row hover + status tints visible on light background */
html.light-mode .data-table tr:hover td        { background: rgba(0,0,0,0.03); }
html.light-mode .data-table tr.status-pending td { background: rgba(160,120,0,0.06); }
html.light-mode .data-table tr.status-visitor td { background: rgba(110,40,190,0.05); }
html.light-mode .data-table th                { background: var(--bg3); }
html.light-mode .audit-action-badge { background: rgba(50,80,200,0.08); color: #2840bb; border-color: rgba(50,80,200,0.2); }
html.light-mode .online-dot-manual  { background: #7c3aed; box-shadow: 0 0 4px rgba(124,58,237,0.3); }
html.light-mode .online-label-manual { color: #6d28d9; }
html.light-mode .participant-manual-tag { background: rgba(109,40,217,0.1); color: #5b21b6; border-color: rgba(109,40,217,0.3); }
html.light-mode .participant-online-manual { background: #7c3aed; box-shadow: 0 0 4px rgba(124,58,237,0.4); }
html.light-mode .btn-purple { background: rgba(109,40,217,0.1); color: #5b21b6; border-color: rgba(109,40,217,0.3); }
html.light-mode .btn-purple:hover { background: rgba(109,40,217,0.2); }
html.light-mode .audit-change       { background: var(--bg3); border-color: var(--border2); }
html.light-mode .audit-from         { color: #c0392b; }
html.light-mode .audit-to           { color: #1a7a42; }
html.light-mode .audit-date         { color: var(--text2); }
html.light-mode .audit-target       { color: var(--text); }

/* ============================================================
   TEAMS KICK OVERLAY — résident évincé par un admin
   ============================================================ */
#teamsKickOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kick-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(4px);
}
.kick-overlay-box {
    position: relative;
    background: var(--bg2);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 48px 56px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 60px rgba(230, 57, 70, 0.45), 0 8px 32px rgba(0,0,0,0.6);
    animation: kickBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes kickBoxIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.kick-overlay-icon {
    font-size: 3.2rem;
    margin-bottom: 16px;
    display: block;
    animation: kickIconPulse 1s ease-in-out infinite alternate;
}
@keyframes kickIconPulse {
    from { transform: scale(1);    filter: drop-shadow(0 0 4px var(--primary)); }
    to   { transform: scale(1.12); filter: drop-shadow(0 0 16px var(--primary)); }
}
.kick-overlay-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#kickOverlayMsg {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
.kick-overlay-countdown {
    color: var(--text2);
    font-size: 0.9rem;
}
.kick-overlay-countdown span {
    color: var(--accent);
    font-weight: 700;
}

/* ── Readonly notice (resident on teams page) ─────────────── */
.readonly-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(67, 97, 238, 0.12);
    border: 1px solid rgba(67, 97, 238, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: var(--text2);
    font-size: 0.9rem;
}
.readonly-notice-icon { font-size: 1.1rem; }

/* ── Twitch live/offline border on input ─────────────────────── */
#twitchPseudoInput.twitch-live {
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}
#twitchPseudoInput.twitch-offline {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(244, 162, 97, 0.2);
}
.twitch-live-badge {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.twitch-live-badge.live    { color: #2ecc71; }
.twitch-live-badge.offline { color: var(--warning); }

/* ── Live streamers block (dashboard) ───────────────────────── */
.live-streamers-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(145, 71, 255, 0.08);
    border: 1px solid rgba(145, 71, 255, 0.28);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}
.live-streamers-label {
    font-size: 0.78rem;
    color: var(--text2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    margin-right: 4px;
}
.twitch-live-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #9147ff;
    color: #fff;
    border-radius: 6px;
    padding: 5px 13px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.twitch-live-btn:hover {
    background: #7d3de0;
    transform: translateY(-1px);
    color: #fff;
}
.tlb-dot {
    width: 7px;
    height: 7px;
    background: #f00;
    border-radius: 50%;
    flex-shrink: 0;
    animation: tlb-pulse 1.5s ease-in-out infinite;
}
@keyframes tlb-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
.tlb-pseudo { color: #fff; }
.tlb-channel { color: rgba(255,255,255,0.6); font-size: 0.75rem; }

/* ============================================================
   COD STATS — Pages /cod et /cod/:id
   ============================================================ */

/* ── Alerte ───────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .9rem; }
.alert-error { background: rgba(230,57,70,.12); border: 1px solid rgba(230,57,70,.3); color: #f87171; }

/* ── Grille joueurs (page équipe) ────────────────────────── */
.cod-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.cod-player-card {
    position: relative;
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: .9rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
}
.cod-player-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--player-color, var(--primary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.cod-player-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    border-color: var(--player-color, var(--primary));
}

.cod-player-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.cod-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cod-avatar-initials {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: #fff;
    opacity: .8;
}

.cod-player-info { flex: 1; }
.cod-player-name { font-family: var(--font-title); font-size: 1.05rem; color: var(--text); letter-spacing: .03em; }
.cod-player-role { font-size: .78rem; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-top: .15rem; }

.cod-player-stats { display: flex; align-items: center; gap: 1rem; }

/* K/D colors */
.kd-green { color: #3a9a6e !important; }
.kd-gold  { color: var(--accent) !important; }
.kd-red   { color: var(--primary) !important; }

.cod-stat-kd {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,255,255,.04);
    border-radius: var(--radius);
    padding: .5rem .85rem;
    min-width: 60px;
}
.cod-stat-kd .cod-stat-value { font-family: var(--font-title); font-size: 1.5rem; line-height: 1; }
.cod-stat-kd .cod-stat-label { font-size: .65rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-top: .1rem; }

.cod-stat-mini { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.cod-mini-row  { display: flex; justify-content: space-between; font-size: .8rem; }
.cod-mini-label { color: var(--text3); }
.cod-mini-value { color: var(--text2); font-weight: 600; }

.cod-player-error { display: flex; align-items: center; gap: .5rem; color: var(--text3); font-size: .85rem; }
.cod-error-icon { color: var(--warning); }

.cod-card-arrow {
    position: absolute; right: 1rem; bottom: 1rem;
    color: var(--text3); font-size: .9rem;
    transition: transform .18s ease, color .18s ease;
}
.cod-player-card:hover .cod-card-arrow { transform: translateX(3px); color: var(--text2); }

/* ── Leaderboard ─────────────────────────────────────────── */
.cod-leaderboard { margin-bottom: 2.5rem; }
.section-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--text2);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.section-title .title-icon { margin-right: .4rem; }

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

.cod-lb-block {
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}
.cod-lb-title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text3);
    margin-bottom: .75rem;
}
.cod-lb-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: .88rem;
}
.cod-lb-row:last-child { border-bottom: none; }
.cod-lb-gold { background: rgba(200,168,75,.06); border-radius: var(--radius); padding: .35rem .5rem; }
.cod-lb-rank { color: var(--text3); min-width: 18px; font-size: .78rem; }
.cod-lb-gold .cod-lb-rank { color: var(--accent); font-weight: 700; }
.cod-lb-name { flex: 1; color: var(--text2); text-decoration: none; }
.cod-lb-name:hover { color: var(--text); }
.cod-lb-val { font-weight: 700; color: var(--text); font-size: .9rem; }

/* ── Page profil — K/D hero ──────────────────────────────── */
.cod-back-link {
    display: inline-block;
    color: var(--text3);
    text-decoration: none;
    font-size: .85rem;
    margin-bottom: .75rem;
    transition: color .15s;
}
.cod-back-link:hover { color: var(--text2); }

.cod-player-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: .4rem;
}

.cod-kd-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}
.cod-kd-badge {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,255,255,.04);
    border-radius: var(--radius-lg);
    padding: 1rem 1.75rem;
    border: 2px solid rgba(255,255,255,.06);
}
.cod-kd-badge.kd-green { border-color: rgba(58,154,110,.3); background: rgba(58,154,110,.06); }
.cod-kd-badge.kd-gold  { border-color: rgba(200,168,75,.3); background: rgba(200,168,75,.06); }
.cod-kd-badge.kd-red   { border-color: rgba(230,57,70,.3);  background: rgba(230,57,70,.06);  }
.cod-kd-number { font-family: var(--font-title); font-size: 3rem; line-height: 1; }
.cod-kd-label  { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-top: .25rem; }

.cod-kd-meta { flex: 1; }
.cod-kd-meta-row { margin-bottom: .6rem; color: var(--text2); font-size: .95rem; }
.cod-kd-meta-row:last-child { margin-bottom: 0; }
.cod-sep { color: var(--text3); margin: 0 .4rem; }
.cod-wins-big { font-family: var(--font-title); font-size: 1.4rem; color: var(--accent); margin-right: .3rem; }
.cod-wr { font-weight: 700; color: var(--text); }
.cod-meta-label { color: var(--text3); margin-left: .25rem; font-size: .85rem; }

/* ── Stats grid (profil) ─────────────────────────────────── */
.cod-stats-section { margin-bottom: 2.5rem; }

.cod-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}
.cod-stat-block {
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 1rem .85rem;
    text-align: center;
    transition: border-color .15s;
}
.cod-stat-block:hover { border-color: rgba(255,255,255,.13); }
.cod-sb-icon  { font-size: 1.3rem; margin-bottom: .3rem; }
.cod-sb-value { font-family: var(--font-title); font-size: 1.2rem; color: var(--text); }
.cod-sb-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-top: .2rem; }

/* Top placements */
.cod-tops-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.cod-top-block {
    display: flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.04);
    border-radius: var(--radius);
    padding: .45rem .85rem;
    font-size: .85rem;
}
.cod-top-label { color: var(--text3); }
.cod-top-val   { font-weight: 700; color: var(--text2); }

/* ── Onglets par mode ────────────────────────────────────── */
.cod-mode-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.cod-tab {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    padding: .45rem 1rem;
    color: var(--text3);
    font-family: var(--font-body);
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cod-tab:hover  { background: rgba(255,255,255,.07); color: var(--text2); }
.cod-tab.active { background: rgba(230,57,70,.12); border-color: rgba(230,57,70,.3); color: var(--primary); }

.cod-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
}
.cod-mode-stat {
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius);
    padding: .85rem .75rem;
    text-align: center;
}
.cod-ms-val   { font-family: var(--font-title); font-size: 1.1rem; color: var(--text); }
.cod-ms-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-top: .15rem; }
.cod-no-data  { color: var(--text3); font-size: .9rem; padding: 1rem 0; }

/* ── Chart ────────────────────────────────────────────────── */
.cod-chart-wrap {
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    max-width: 520px;
}

/* ── Tableau matchs ──────────────────────────────────────── */
.cod-matches-table-wrap {
    overflow-x: auto;
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius-lg);
}
.cod-matches-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.cod-matches-table th {
    padding: .65rem 1rem;
    text-align: left;
    color: var(--text3);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid rgba(255,255,255,.07);
    white-space: nowrap;
}
.cod-matches-table td {
    padding: .6rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    color: var(--text2);
}
.cod-matches-table tr:last-child td { border-bottom: none; }
.cod-matches-table tr:hover td { background: rgba(255,255,255,.025); }
.cod-match-win td { background: rgba(58,154,110,.06) !important; }
.cod-match-date { color: var(--text3) !important; white-space: nowrap; }
.cod-match-mode { color: var(--text2); white-space: nowrap; }
.cod-match-placement { font-weight: 700; }
.cod-win-badge { color: var(--accent); }

/* ── Badge warn (mode demo) ──────────────────────────────── */
.badge-warn { background: rgba(244,162,97,.15); color: var(--warning); border: 1px solid rgba(244,162,97,.25); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .cod-kd-hero { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .cod-players-grid { grid-template-columns: 1fr; }
    .cod-lb-grid { grid-template-columns: 1fr; }
    .cod-charts-section { display: none; }
}
