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

/* ============================================
   DESIGN SYSTEM — PépiPlaques Silicon Valley
   ============================================ */
:root {
    /* Palette principale */
    --bg:          #080a12;
    --bg-elevated: #0d1017;
    --bg-card:     #111520;
    --bg-glass:    rgba(17, 21, 32, 0.85);
    --bg-input:    rgba(255,255,255,0.05);

    /* Accent */
    --accent:       #e8445a;
    --accent-glow:  rgba(232, 68, 90, 0.25);
    --accent-hover: #d63a50;
    --accent-soft:  rgba(232, 68, 90, 0.12);

    /* Métaux */
    --gold:         #f5c842;
    --gold-glow:    rgba(245, 200, 66, 0.22);
    --gold-soft:    rgba(245, 200, 66, 0.10);
    --gold-border:  rgba(245, 200, 66, 0.45);
    --silver:       #b0bec5;
    --silver-soft:  rgba(176, 190, 197, 0.08);
    --silver-border:rgba(176, 190, 197, 0.35);
    --bronze:       #cd8b4a;
    --bronze-soft:  rgba(205, 139, 74, 0.08);
    --bronze-border:rgba(205, 139, 74, 0.35);

    /* Texte */
    --text:         #e8eaf0;
    --text-secondary: #7b8499;
    --text-dim:     rgba(232, 234, 240, 0.45);

    /* Bordures */
    --border:       rgba(255,255,255,0.07);
    --border-light: rgba(255,255,255,0.12);

    /* États */
    --success: #34d399;
    --warning: #fbbf24;
    --danger:  #f87171;

    /* Rayons */
    --r-sm:  8px;
    --r-md:  14px;
    --r-lg:  20px;
    --r-xl:  28px;
    --r-pill: 999px;

    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    /* Subtle noise texture */
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232,68,90,0.07) 0%, transparent 70%);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 110px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 10, 18, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin: 0 -16px 20px;
    gap: 12px;
}

.header-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    white-space: nowrap;
    user-select: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Pill pseudo */
.username-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-soft);
    border: 1px solid rgba(232, 68, 90, 0.3);
    border-radius: var(--r-pill);
    padding: 6px 14px 6px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.username-pill:hover {
    background: rgba(232, 68, 90, 0.2);
    border-color: var(--accent);
    transform: scale(1.03);
}

.username-pill:active { transform: scale(0.96); }

.username-pill-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(232,68,90,0.4);
}

.username-pill-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Boutons icône */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-color: rgba(255,255,255,0.18);
}

.btn-icon:active { transform: scale(0.9); }

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon.btn-admin {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn-icon.btn-admin:hover {
    background: rgba(248, 113, 113, 0.1);
}

/* ============================================
   CARTE JOUEUR CONNECTÉ (Mon Profil Card)
   ============================================ */
.my-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.my-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232,68,90,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.my-card:hover {
    border-color: rgba(232,68,90,0.35);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(232,68,90,0.1);
}

.my-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.my-card-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.my-card-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    border: 2px solid rgba(232,68,90,0.4);
    font-family: 'Outfit', sans-serif;
}

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

.my-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.my-card-plate {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    font-family: 'Outfit', sans-serif;
}

.my-card-plate.no-plate {
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0;
    font-style: italic;
}

.my-card-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.my-card-rank-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-secondary);
    line-height: 1;
}

.my-card-rank-number.rank-1 { color: var(--gold); }
.my-card-rank-number.rank-2 { color: var(--silver); }
.my-card-rank-number.rank-3 { color: var(--bronze); }

.my-card-rank-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

/* ============================================
   LEADER SECTION
   ============================================ */
.leader-section {
    margin-bottom: 20px;
}

.leader-card {
    background: linear-gradient(160deg, #110d20 0%, #1a1030 50%, #0a1828 100%);
    border-radius: var(--r-xl);
    padding: 28px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--gold-border);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 40px var(--gold-glow), var(--shadow-md);
    animation: leaderFadeIn 0.5s ease;
}

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

.leader-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 60px rgba(245,200,66,0.3), var(--shadow-lg);
}

/* Shimmer ring */
.leader-card::before {
    content: '';
    position: absolute;
    top: -60%; left: -60%;
    width: 220%; height: 220%;
    background: conic-gradient(from 0deg,
        transparent 0%,
        rgba(245,200,66,0.05) 25%,
        transparent 50%,
        rgba(245,200,66,0.04) 75%,
        transparent 100%);
    animation: leaderGlow 10s linear infinite;
    z-index: 0;
}

@keyframes leaderGlow { to { transform: rotate(360deg); } }

.leader-card > * { position: relative; z-index: 1; }

.leader-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--gold);
    opacity: 0.7;
    /* Décalage droite pour éviter le chevauchement avec le timer */
    padding-right: 90px;
    text-align: center;
    width: 100%;
}

/* ── Timer « en tête depuis » ─────────────────────────────── */
.leader-timer {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 200, 66, 0.10);
    border: 1px solid rgba(245, 200, 66, 0.30);
    border-radius: var(--r-pill);
    padding: 4px 10px 4px 7px;
    z-index: 2;
    pointer-events: none;       /* ne bloque pas le clic sur la carte */
}

.leader-timer-icon {
    font-size: 0.7rem;
    line-height: 1;
    opacity: 0.75;
}

.leader-timer-value {
    font-family: 'Outfit', ui-monospace, 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
    min-width: 80px;            /* évite les sauts de layout à chaque seconde */
    text-align: left;
}

.leader-avatar-wrap {
    position: relative;
    display: inline-block;
    margin: 4px 0;
}

.leader-avatar-wrap img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--gold-border);
    display: block;
    box-shadow: 0 0 24px var(--gold-glow);
}

.avatar-placeholder-leader {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1035, #2a1545);
    border: 2.5px solid var(--gold-border);
    box-shadow: 0 0 24px var(--gold-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--gold);
}

.leader-crown-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    animation: crownBounce 2.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(245,200,66,0.6));
}

@keyframes crownBounce {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-4deg); }
    50%       { transform: translateX(-50%) translateY(-5px) rotate(4deg); }
}

.leader-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    color: #fff;
    letter-spacing: -0.3px;
}

.leader-plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,200,66,0.1);
    border: 1px solid var(--gold-border);
    color: var(--gold);
    padding: 5px 18px;
    border-radius: var(--r-pill);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 3px;
    text-shadow: 0 0 12px rgba(245,200,66,0.4);
}

/* ============================================
   PODIUM
   ============================================ */
.podium-section {
    margin-bottom: 20px;
}

.podium-section h2 { display: none; }

.podium {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    padding: 0 2px;
}

.podium-item {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 8px 12px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
}

.podium-item:hover { transform: translateY(-4px); }

/* Rank badge */
.podium-item .podium-rank-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: var(--r-pill);
    background: rgba(255,255,255,0.07);
    color: var(--text-secondary);
}

/* 1er */
.podium-1 {
    border-color: var(--gold-border);
    background: linear-gradient(180deg, rgba(245,200,66,0.08) 0%, var(--bg-card) 65%);
    padding: 20px 8px 14px;
    min-height: 185px;
    box-shadow: 0 0 28px var(--gold-glow), var(--shadow-sm);
    order: 2;
}
.podium-1:hover { box-shadow: 0 0 44px rgba(245,200,66,0.25), var(--shadow-md); }
.podium-1 .podium-rank-badge { background: rgba(245,200,66,0.15); color: var(--gold); }
.podium-1 .medal { font-size: 1.7rem; }
.podium-1 .podium-avatar img,
.podium-1 .avatar-placeholder-small { width: 54px; height: 54px; border: 2px solid var(--gold-border); }
.podium-1 .podium-name { color: var(--gold); font-size: 0.82rem; }
.podium-1 .podium-plate { font-size: 0.78rem; }

/* 2ème */
.podium-2 {
    border-color: var(--silver-border);
    background: linear-gradient(180deg, var(--silver-soft) 0%, var(--bg-card) 65%);
    min-height: 155px;
    order: 1;
}
.podium-2:hover { box-shadow: 0 0 24px rgba(176,190,197,0.15); }
.podium-2 .podium-rank-badge { background: rgba(176,190,197,0.12); color: var(--silver); }
.podium-2 .podium-name { color: var(--silver); }

/* 3ème */
.podium-3 {
    border-color: var(--bronze-border);
    background: linear-gradient(180deg, var(--bronze-soft) 0%, var(--bg-card) 65%);
    min-height: 142px;
    order: 3;
}
.podium-3:hover { box-shadow: 0 0 24px rgba(205,139,74,0.15); }
.podium-3 .podium-rank-badge { background: rgba(205,139,74,0.12); color: var(--bronze); }
.podium-3 .podium-name { color: var(--bronze); }

.medal { font-size: 1.3rem; }

.podium-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
}

.podium-name {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.podium-plate {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    font-family: 'Outfit', sans-serif;
}

.podium-label {
    font-size: 0.58rem;
    color: var(--text-dim);
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: none; /* masqué — le badge suffit */
}

/* ============================================
   RANKING LIST
   ============================================ */
.ranking-section {
    margin-bottom: 24px;
}

.ranking-section h2 { display: none; }

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.ranking-item:hover {
    border-color: var(--border-light);
    background: rgba(255,255,255,0.03);
    transform: translateX(3px);
}

.ranking-item.is-me {
    border-color: rgba(232,68,90,0.35);
    background: linear-gradient(90deg, rgba(232,68,90,0.06) 0%, var(--bg-card) 100%);
    box-shadow: inset 3px 0 0 var(--accent);
}

.rank {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 28px;
    font-size: 0.95rem;
    text-align: center;
}

.ranking-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.ranking-avatar .avatar-placeholder-small {
    width: 38px;
    height: 38px;
}

.ranking-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-plate {
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
}

/* ============================================
   BOUTONS GLOBAUX
   ============================================ */
.btn {
    display: inline-block;
    padding: 13px 24px;
    border: none;
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px rgba(232,68,90,0.4);
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--r-sm);
}

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

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.btn-warning {
    background: var(--warning);
    color: #111;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* CTA Capture — flottant */
.btn-capture {
    display: block;
    width: calc(100% - 32px);
    max-width: 448px;
    padding: 17px 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    border-radius: var(--r-lg);
    background: #1c1f2e;
    color: rgba(232, 234, 240, 0.85);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.btn-capture:hover {
    background: #23273a;
    border-color: rgba(255,255,255,0.15);
    color: var(--text);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============================================
   LOGIN
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(232,68,90,0.09) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 90%, rgba(245,200,66,0.04) 0%, transparent 70%);
}

.login-box {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    margin-bottom: 6px;
    display: block;
}

.login-box h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.login-tagline {
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-size: 0.88rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 28px 24px;
    text-align: left;
    animation: slideUp 0.3s ease;
}

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

.login-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.login-step-title strong {
    color: var(--text);
}

/* ============================================
   FORMS
   ============================================ */
form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

label {
    font-weight: 600;
    font-size: 0.82rem;
    text-align: left;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="file"] {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.plate-input {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.4rem !important;
    text-align: center;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

small {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.link-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    text-align: center;
    margin-top: 8px;
    transition: color 0.2s;
}

.link-back:hover { color: var(--text); }

/* Remember me */
.remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remember-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.remember-row label {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-md);
    margin-bottom: 14px;
    font-size: 0.87rem;
    font-weight: 500;
}

.alert.success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52,211,153,0.35);
    color: var(--success);
}

.alert.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248,113,113,0.35);
    color: var(--danger);
}

.alert.warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251,191,36,0.35);
    color: var(--warning);
}

/* ============================================
   VIEWER FULLSCREEN JOUEUR
   ============================================ */
.player-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
}

.player-viewer.active {
    display: block;
    animation: fadeIn 0.22s ease;
}

/* Photo plaque — remplit tout l'écran */
.viewer-photo {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #000;
}

/* Gradient haut pour lisibilité du profil */
.viewer-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.65) 0%,
        transparent 35%
    );
    pointer-events: none;
}

/* Bouton fermer */
.viewer-close {
    position: absolute;
    top: env(safe-area-inset-top, 18px);
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.viewer-close:hover { background: rgba(0,0,0,0.75); }

/* Profil haut-gauche */
.viewer-profile {
    position: absolute;
    top: 18px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-pill);
    padding: 6px 14px 6px 6px;
    max-width: calc(100% - 72px);
}

.viewer-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.25);
    display: block;
}

.viewer-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
}

.viewer-profile-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.viewer-username {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-plate-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1.5px;
}

/* Fallback : pas de photo */
.viewer-no-photo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.viewer-no-photo-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 32px;
}

.viewer-avatar-lg-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--border-light);
}

.viewer-avatar-placeholder-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: #fff;
}

.viewer-plate-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 3px;
}

.viewer-date-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============================================
   MODAL PROFIL (conservé pour compatibilité)
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    z-index: 100;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 12px 24px 36px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    animation: slideUpModal 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.7);
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Handle */
.modal-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--border-light);
    margin: 4px auto 20px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255,255,255,0.1);
}

.modal-avatar {
    margin-bottom: 12px;
}

.modal-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.avatar-placeholder-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin: 0 auto;
    color: white;
}

.modal-username {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,200,66,0.1);
    border: 1px solid var(--gold-border);
    color: var(--gold);
    padding: 6px 20px;
    border-radius: var(--r-pill);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 18px;
}

.modal-plate-photo {
    margin-bottom: 14px;
}

.modal-plate-photo img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-light);
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.modal-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.lightbox-overlay.active { display: flex; }

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: var(--r-md);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.16); }

/* ============================================
   RULES (accordion)
   ============================================ */
.rules-section {
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.rules-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.rules-toggle:hover { background: rgba(255,255,255,0.02); }

.rules-toggle h2 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.rules-arrow {
    color: var(--text-secondary);
    font-size: 0.72rem;
    transition: transform 0.3s;
}

.rules-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.rules-content.open { max-height: 900px; }

.rule-block {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
}

.rule-block h3 {
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
}

.rule-block p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 6px;
    line-height: 1.65;
}

.rule-block ul {
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding-left: 18px;
    margin-bottom: 6px;
}

.rule-block li { margin-bottom: 3px; }

.plate-example {
    background: rgba(255,255,255,0.04);
    display: inline-block;
    padding: 6px 20px;
    border-radius: var(--r-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: var(--text);
    margin: 8px 0;
    border: 1px solid var(--border-light);
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar-large img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid var(--border-light);
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
}

.plate-photo {
    width: 75px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--gold-border);
    flex-shrink: 0;
}

.notifications-card {
    border-color: rgba(232, 68, 90, 0.35);
}

.notifications-card h3 {
    color: var(--accent);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notifications-card h3::before { content: '🔔'; }

.toggle-container { max-width: 300px; margin: 0 auto; }

.profile-card h2 { margin-bottom: 8px; font-family: 'Outfit', sans-serif; }

.profile-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 20px;
}

/* ============================================
   CAPTURE PAGE
   ============================================ */
.current-plate {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.capture-form {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 20px;
}

.photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--r-sm);
    margin-top: 8px;
}

/* ============================================
   ADMIN
   ============================================ */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.admin-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
}

.danger-zone {
    border: 1px solid var(--danger);
    border-radius: var(--r-md);
    padding: 20px;
}

.danger-zone h2 {
    color: var(--danger);
    margin-bottom: 12px;
}

/* ============================================
   MISC
   ============================================ */
.text-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 16px;
    font-size: 0.9rem;
}

/* Spin */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning svg { animation: spin 0.6s linear; }

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 380px) {
    .header { padding: 10px 12px; }
    .username-pill { padding: 5px 10px; font-size: 0.78rem; }
    .btn-icon { width: 32px; height: 32px; }
    .btn-icon svg { width: 14px; height: 14px; }
    .my-card { padding: 14px 16px; gap: 12px; }
    .my-card-avatar, .my-card-avatar img, .my-card-avatar-placeholder { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.1ms !important;
    }
}
