/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #202124;
    background: #f3f4f6;
    min-height: 100vh;
    line-height: 1.5;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ===== App chrome ===== */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.app-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    text-decoration: none;
}
.app-brand__icon { font-size: 1.4rem; }
.app-header__tagline {
    color: #6b7280;
    font-size: 0.85rem;
}

.app-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.app-footer {
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
    padding: 24px 16px 40px;
}

/* ===== Quiz intro ===== */
.quiz-intro h1 {
    font-size: 1.7rem;
    margin: 0 0 8px;
    color: #111827;
}
.quiz-intro p {
    margin: 0 0 24px;
    color: #4b5563;
}

/* ===== Email frame (Outlook-like preview) ===== */
.email-frame {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    overflow: hidden;
    max-width: 720px;
    margin: 0 auto;
}
.email-frame--reveal {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.08);
}

/* ===== Email meta block ===== */
.email__meta {
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
    font-size: 0.9rem;
}
.email__meta-row {
    display: flex;
    gap: 10px;
    padding: 2px 0;
}
.email__meta-label {
    flex: 0 0 54px;
    color: #6b7280;
    font-weight: 500;
}
.email__meta-value {
    color: #1f2937;
    word-break: break-word;
}
.email__meta-row--subject {
    padding-top: 6px;
    border-top: 1px dashed #e5e7eb;
    margin-top: 6px;
}

/* ===== Email body shared ===== */
.email__body {
    padding: 28px 32px 24px;
    font-size: 0.98rem;
    color: #1f2937;
    background: #ffffff;
}
.email__greeting { margin: 0 0 12px; }
.email__paragraph { margin: 0 0 16px; line-height: 1.6; }
.email__paragraph--muted { color: #6b7280; font-size: 0.88rem; }
.email__cta { text-align: center; margin: 24px 0 20px; }
.email__signoff { margin: 20px 0 0; }
.email__footer {
    padding: 16px 32px 20px;
    font-size: 0.78rem;
    color: #6b7280;
    border-top: 1px solid #eef2f7;
    background: #fafafa;
}
.email__legal { margin-top: 6px; }

/* ===== Microsoft theme ===== */
.email__body--microsoft { font-family: 'Segoe UI', 'Inter', sans-serif; }
.ms-logo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}
.ms-logo__square {
    width: 12px; height: 12px; display: inline-block;
}
.ms-logo__square--red    { background: #f25022; }
.ms-logo__square--green  { background: #7fba00; }
.ms-logo__square--blue   { background: #00a4ef; margin-right: 0; }
.ms-logo__square--yellow { background: #ffb900; }
.ms-logo__text {
    font-weight: 600;
    color: #737373;
    margin-left: 6px;
    font-size: 1.05rem;
}
.ms-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
}
.ms-btn {
    display: inline-block;
    background: #0067b8;
    color: #ffffff !important;
    padding: 12px 28px;
    border-radius: 2px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.98rem;
    letter-spacing: 0.2px;
}
.ms-btn:hover { background: #005a9e; }

/* ===== Amazon theme ===== */
.email__body--amazon { font-family: 'Amazon Ember', 'Inter', sans-serif; }
.amz-header {
    background: #232f3e;
    margin: -28px -32px 20px;
    padding: 14px 32px;
}
.amz-logo {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}
.amz-logo__smile { color: #ff9900; }
.amz-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
}
.amz-btn {
    display: inline-block;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    color: #111 !important;
    padding: 10px 28px;
    border: 1px solid #a88734;
    border-radius: 3px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}
.amz-btn:hover { background: linear-gradient(to bottom, #f5d78e, #eeb933); }

/* ===== PayPal theme ===== */
.email__body--paypal { font-family: 'Inter', sans-serif; }
.pp-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #003087;
}
.pp-logo {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    font-size: 1.4rem;
}
.pp-logo__p1 { color: #003087; }
.pp-logo__p2 { color: #009cde; margin-left: -6px; }
.pp-logo__text {
    margin-left: 8px;
    color: #003087;
    font-size: 1.25rem;
}
.pp-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #003087;
    margin: 0 0 16px;
}
.pp-btn {
    display: inline-block;
    background: #0070ba;
    color: #ffffff !important;
    padding: 12px 34px;
    border-radius: 24px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.98rem;
}
.pp-btn:hover { background: #005ea6; }

/* ===== Fake links ===== */
.fake-link {
    cursor: pointer;
    position: relative;
}
.fake-link--inline {
    color: #0067b8;
    text-decoration: underline;
    word-break: break-all;
}

/* ===== Highlights (revealed on result page) ===== */
.highlight-danger {
    background: #fde2e1 !important;
    color: #991b1b !important;
    box-shadow: 0 0 0 1px #fca5a5 inset;
    border-radius: 3px;
    padding: 1px 4px;
}
.highlight-warning {
    background: #fff4d6 !important;
    color: #92400e !important;
    box-shadow: 0 0 0 1px #fcd34d inset;
    border-radius: 3px;
    padding: 1px 4px;
}
.highlight-safe {
    background: #dcfce7 !important;
    color: #14532d !important;
    box-shadow: 0 0 0 1px #86efac inset;
    border-radius: 3px;
    padding: 1px 4px;
}
/* Buttons keep readable text when highlighted */
a.ms-btn.highlight-danger,
a.ms-btn.highlight-safe,
a.amz-btn.highlight-danger,
a.amz-btn.highlight-safe,
a.pp-btn.highlight-danger,
a.pp-btn.highlight-safe {
    color: #ffffff !important;
    box-shadow: 0 0 0 3px currentColor;
}
a.ms-btn.highlight-danger,
a.amz-btn.highlight-danger,
a.pp-btn.highlight-danger { outline: 3px solid #ef4444; outline-offset: 2px; }
a.ms-btn.highlight-safe,
a.amz-btn.highlight-safe,
a.pp-btn.highlight-safe { outline: 3px solid #22c55e; outline-offset: 2px; }

/* ===== Answer bar ===== */
.answer-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 28px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.answer-btn {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.answer-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.08); }
.answer-btn:active { transform: translateY(0); }
.answer-btn--legit { border-color: #16a34a; color: #166534; }
.answer-btn--legit:hover { background: #dcfce7; }
.answer-btn--phish { border-color: #dc2626; color: #991b1b; }
.answer-btn--phish:hover { background: #fee2e2; }

/* ===== Result page ===== */
.result-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.result-banner--ok { background: #dcfce7; border: 1px solid #86efac; }
.result-banner--ko { background: #fee2e2; border: 1px solid #fca5a5; }
.result-banner__icon { font-size: 2rem; }
.result-banner h1 { margin: 0; font-size: 1.4rem; }
.result-banner p  { margin: 4px 0 0; color: #1f2937; }

.result-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    max-width: 1080px;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .result-columns { grid-template-columns: 1fr; }
}

.explanation-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
    position: sticky;
    top: 80px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.explanation-panel h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #111827;
}
.explanation-list {
    margin: 0;
    padding-left: 20px;
    color: #374151;
}
.explanation-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.legend {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
    font-size: 0.85rem;
    color: #4b5563;
}
.legend h3 { margin: 0 0 8px; font-size: 0.9rem; color: #111827; }
.legend p { margin: 4px 0; }
.legend-chip {
    display: inline-block;
    min-width: 48px;
    text-align: center;
    font-size: 0.75rem;
    margin-right: 6px;
}

.next-form { margin-top: 20px; }
.next-btn {
    width: 100%;
    padding: 12px 16px;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.98rem;
}
.next-btn:hover { background: #1f2937; }

/* ===== Landing page ===== */
.landing {
    max-width: 640px;
    margin: 20px auto 0;
    background: #ffffff;
    padding: 40px 40px 34px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.08);
}
.landing__hero { text-align: center; margin-bottom: 28px; }
.landing__badge {
    display: inline-block;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.landing h1 {
    font-size: 1.9rem;
    margin: 0 0 10px;
    color: #0f172a;
    line-height: 1.2;
}
.landing__lead {
    color: #475569;
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
}
.landing__form { margin: 0 0 20px; }
.landing__label {
    display: block;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.landing__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.landing__input {
    flex: 1 1 220px;
    padding: 13px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: #111827;
    transition: border-color .12s ease, box-shadow .12s ease;
    background: #fafafa;
}
.landing__input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px #c7d2fe;
}
.landing__btn {
    padding: 13px 22px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: background .12s ease, transform .08s ease;
}
.landing__btn:hover { background: #4338ca; transform: translateY(-1px); }
.landing__hint {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 0.82rem;
}
.landing__meta {
    text-align: center;
    margin: 4px 0 24px;
    color: #6b7280;
    font-size: 0.9rem;
}
.landing__link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}
.landing__link:hover { text-decoration: underline; }
.landing__sep { margin: 0 8px; color: #cbd5e1; }
.landing__tips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}
.landing__tips li {
    background: #f8fafc;
    border-left: 3px solid #4f46e5;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #334155;
}

/* ===== HUD (progress + score) ===== */
.hud {
    max-width: 720px;
    margin: 0 auto 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.hud__side { font-size: 0.92rem; color: #475569; }
.hud__side--right { text-align: right; }
.hud__pseudo strong, .hud__score strong { color: #111827; }
.hud__progress { min-width: 0; }
.hud__progress-label {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
}
.hud__progress-label strong { color: #111827; font-size: 0.95rem; }
.hud__bar {
    background: #e5e7eb;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.hud__bar-fill {
    background: linear-gradient(90deg, #4f46e5, #0ea5e9);
    height: 100%;
    transition: width .3s ease;
}
@media (max-width: 640px) {
    .hud { grid-template-columns: 1fr; text-align: center; }
    .hud__side--right { text-align: center; }
}

/* ===== End screen ===== */
.end-hero {
    max-width: 640px;
    margin: 0 auto 32px;
    padding: 36px 28px 28px;
    background: #ffffff;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}
.end-hero--perfect {
    background: linear-gradient(160deg, #fefce8 0%, #ffffff 60%);
    border-color: #fde68a;
}
.end-hero__badge { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.end-hero h1 { font-size: 1.6rem; margin: 0 0 12px; color: #0f172a; }
.end-hero__score {
    font-weight: 800;
    color: #111827;
    line-height: 1;
    margin: 10px 0 14px;
}
.end-hero__score-num { font-size: 3.4rem; }
.end-hero__score-den { font-size: 1.6rem; color: #64748b; margin-left: 6px; }
.end-hero__meta { color: #475569; margin: 0 0 22px; font-size: 0.95rem; }
.end-hero__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.end-hero__form { margin: 0; }
.end-hero__link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.end-hero__link:hover { text-decoration: underline; }

/* ===== Leaderboard ===== */
.leaderboard-section {
    max-width: 680px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 24px;
}
.leaderboard-section--standalone { margin-top: 8px; }
.leaderboard-section h1,
.leaderboard-section h2 {
    margin: 0 0 14px;
    font-size: 1.25rem;
    color: #0f172a;
}
.leaderboard-section h1 { font-size: 1.6rem; }
.leaderboard__lead { color: #64748b; margin: 0 0 18px; font-size: 0.92rem; }
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.leaderboard th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 8px 10px;
    border-bottom: 2px solid #e5e7eb;
}
.leaderboard td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1f2937;
}
.leaderboard__rank {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #475569;
}
.leaderboard__score { text-align: right; white-space: nowrap; }
.leaderboard__time  { text-align: right; color: #64748b; font-variant-numeric: tabular-nums; }
.leaderboard__row--me {
    background: #eef2ff;
}
.leaderboard__row--me td { color: #3730a3; font-weight: 600; }
.leaderboard__me-tag {
    display: inline-block;
    background: #4f46e5;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.leaderboard__empty { color: #64748b; font-style: italic; }
.leaderboard__cta { margin-top: 20px; text-align: center; }

/* Finish-variant of next-btn used as an anchor */
.next-btn--finish { background: #16a34a; }
.next-btn--finish:hover { background: #15803d; }
a.next-btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

/* ===== Leaderboard hero + podium ===== */
.lb-hero {
    max-width: 820px;
    margin: 0 auto 20px;
    padding: 28px 24px 20px;
    text-align: center;
}
.lb-hero__badge {
    display: inline-block;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #78350f;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.25);
}
.lb-hero h1 {
    font-size: 2.2rem;
    margin: 0 0 8px;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.lb-hero__lead {
    color: #64748b;
    margin: 0;
    font-size: 0.98rem;
}

/* ---- Podium ---- */
.podium {
    max-width: 820px;
    margin: 40px auto 36px;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: nowrap;
}
.podium__slot {
    flex: 1 1 0;
    min-width: 0;
    max-width: 240px;
    display: flex;
    flex-direction: column;
}
/* Visual order: 2nd on the left, 1st in the middle, 3rd on the right.
   Logical DOM order stays 1,2,3 for accessibility. */
.podium__slot--1 { order: 2; }
.podium__slot--2 { order: 1; }
.podium__slot--3 { order: 3; }

.podium__card {
    position: relative;
    background: #ffffff;
    border-radius: 14px 14px 0 0;
    padding: 22px 14px 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    border-bottom: none;
}
.podium__card--1 {
    border-color: #fbbf24;
    background: linear-gradient(165deg, #fffbeb 0%, #ffffff 55%);
    padding-top: 30px;
}
.podium__card--2 {
    border-color: #cbd5e1;
    background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
}
.podium__card--3 {
    border-color: #fed7aa;
    background: linear-gradient(165deg, #fff7ed 0%, #ffffff 55%);
}
.podium__crown {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.4));
    animation: float 2.4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-4px); }
}
.podium__medal {
    font-size: 2.6rem;
    line-height: 1;
    margin: 0 0 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.podium__card--1 .podium__medal { font-size: 3rem; }
.podium__pseudo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
    margin-bottom: 10px;
    line-height: 1.2;
}
.podium__card--1 .podium__pseudo { font-size: 1.2rem; }
.podium__score { margin-bottom: 4px; line-height: 1; }
.podium__score-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
}
.podium__card--1 .podium__score-num { font-size: 1.9rem; }
.podium__score-den {
    color: #64748b;
    font-size: 0.85rem;
    margin-left: 2px;
}
.podium__time {
    color: #64748b;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.podium__base {
    color: #ffffff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 10px 10px;
    position: relative;
    overflow: hidden;
}
.podium__base::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent 40%);
    pointer-events: none;
}
.podium__rank {
    font-size: 2.6rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}
.podium__base--1 {
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
    height: 110px;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.3);
}
.podium__base--2 {
    background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
    height: 78px;
    box-shadow: 0 8px 18px rgba(148, 163, 184, 0.3);
}
.podium__base--3 {
    background: linear-gradient(180deg, #fdba74 0%, #ea580c 100%);
    height: 56px;
    box-shadow: 0 6px 14px rgba(234, 88, 12, 0.3);
}

@media (max-width: 600px) {
    .podium {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    .podium__slot { max-width: 100%; order: unset !important; }
    .podium__slot--1 { order: 1 !important; }
    .podium__slot--2 { order: 2 !important; }
    .podium__slot--3 { order: 3 !important; }
    .podium__base { height: 52px; }
    .podium__rank { font-size: 1.8rem; }
}

/* ---- Full ranking table ---- */
.lb-full {
    max-width: 820px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.lb-full__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}
.lb-full__header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}
.lb-full__count {
    color: #64748b;
    font-size: 0.88rem;
}
.lb-full__table-wrap { overflow-x: auto; }
.leaderboard--full { min-width: 560px; }
.lb-full__date {
    color: #64748b;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.lb-row__pseudo { font-weight: 600; }
.lb-row--top3-1 {
    background: linear-gradient(90deg, #fefce8 0%, #ffffff 80%);
}
.lb-row--top3-2 {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 80%);
}
.lb-row--top3-3 {
    background: linear-gradient(90deg, #fff7ed 0%, #ffffff 80%);
}
.lb-row--top3 .leaderboard__rank { font-size: 1.15rem; }

/* ---- Empty state ---- */
.lb-empty {
    max-width: 460px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
}
.lb-empty__icon { font-size: 3rem; margin-bottom: 10px; }
.lb-empty h2 { margin: 0 0 6px; color: #0f172a; font-size: 1.25rem; }
.lb-empty p { margin: 0; color: #64748b; }

/* ===== Admin login ===== */
.login {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}
.login__card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 32px 32px 28px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}
.login__badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.login__card h1 {
    margin: 0 0 18px;
    font-size: 1.45rem;
    color: #0f172a;
}
.login__form { display: flex; flex-direction: column; }
.login__label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 600;
    margin: 10px 0 5px;
}
.login__input {
    padding: 11px 13px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #111827;
    background: #fafafa;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.login__input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px #c7d2fe;
}
.login__btn {
    margin-top: 18px;
    padding: 12px 16px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}
.login__btn:hover { background: #4338ca; }
.login__alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin: 0 0 14px;
    font-size: 0.9rem;
}
.login__alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== Admin nav (tabs + logout) ===== */
.admin-nav {
    max-width: 1100px;
    margin: 0 auto 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-nav__tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav__tab {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background .12s ease, color .12s ease;
}
.admin-nav__tab:hover { background: #f1f5f9; color: #0f172a; }
.admin-nav__tab.is-active {
    background: #eef2ff;
    color: #3730a3;
}
.admin-nav__user {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.admin-nav__whoami { font-size: 0.88rem; color: #64748b; }
.admin-nav__whoami strong { color: #0f172a; }
.admin-nav__logout { margin: 0; }
.admin-nav__logout-btn {
    padding: 7px 14px;
    background: #ffffff;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
}
.admin-nav__logout-btn:hover { background: #fee2e2; }

/* ===== Admin alerts & panels ===== */
.admin__alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 0 0 16px;
    font-size: 0.92rem;
}
.admin__alert--ok {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}
.admin__alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.admin__panel {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}
.admin__panel h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #0f172a;
}
.admin__muted {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}
.admin__inline-form { display: inline; margin: 0; }
.admin__delete-btn {
    background: #ffffff;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 600;
}
.admin__delete-btn:hover { background: #fee2e2; }
.admin__actions-col { width: 200px; }

/* ===== Create-user form ===== */
.admin-user-form { }
.admin-user-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}
@media (max-width: 640px) {
    .admin-user-form__row { grid-template-columns: 1fr; }
}
.admin-user-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}
.admin-user-form input {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fafafa;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.admin-user-form input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px #c7d2fe;
}
.admin-user-form__btn {
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    height: 42px;
}
.admin-user-form__btn:hover { background: #15803d; }
.admin-user-form__hint {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* ===== Admin panel ===== */
.admin {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 26px;
}
.admin__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}
.admin__badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.admin h1 { margin: 0 0 4px; font-size: 1.4rem; color: #0f172a; }
.admin__lead { margin: 0; color: #64748b; font-size: 0.9rem; }
.admin__export-btn {
    display: inline-block;
    background: #16a34a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background .12s ease, transform .08s ease;
}
.admin__export-btn:hover { background: #15803d; transform: translateY(-1px); }
.admin__reset-btn {
    background: #ffffff;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background .12s ease, transform .08s ease;
}
.admin__reset-btn:hover:not(:disabled) {
    background: #fee2e2;
    transform: translateY(-1px);
}
.admin__reset-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.admin__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.admin__table-wrap { overflow-x: auto; }
.admin__table { min-width: 820px; }
.admin__table th,
.admin__table td { white-space: nowrap; }
.admin__timestamp {
    font-size: 0.82rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.admin__id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: #94a3b8;
}
.admin__id-col { width: 200px; }

/* ===== Tooltip for blocked link clicks ===== */
.fake-link-tooltip {
    position: fixed;
    z-index: 999;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
}
.fake-link-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.fake-link-tooltip__label {
    display: block;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================================================
   Mode tactile — activé via JS (classe .touch-mode sur <body>)
   =========================================================== */

/* Zéro 300ms de délai, pas de zoom double-tap */
body.touch-mode button,
body.touch-mode a,
body.touch-mode input,
body.touch-mode .answer-btn,
body.touch-mode .next-btn {
    touch-action: manipulation;
}

/* Supprime la sélection de texte sur les éléments cliquables */
body.touch-mode button,
body.touch-mode .answer-btn,
body.touch-mode .next-btn,
body.touch-mode .landing__btn,
body.touch-mode .admin-nav__tab {
    -webkit-user-select: none;
            user-select: none;
}

/* Inputs : min 16px pour éviter tout zoom automatique */
body.touch-mode input[type="text"],
body.touch-mode input[type="password"] {
    font-size: 16px;
}

/* ---- Tap-targets agrandis ---- */

/* Landing / pseudo */
body.touch-mode .landing__input {
    padding: 18px 18px;
    font-size: 1.1rem;
    min-height: 56px;
}
body.touch-mode .landing__btn {
    padding: 18px 28px;
    font-size: 1.1rem;
    min-height: 56px;
}
body.touch-mode .landing__link {
    padding: 8px 6px;
    display: inline-block;
}

/* Boutons de réponse du quiz */
body.touch-mode .answer-btn {
    padding: 22px 24px;
    font-size: 1.15rem;
    min-height: 68px;
}

/* Boutons "Email suivant" / "Voir mon score final" / "Rejouer" */
body.touch-mode .next-btn {
    padding: 16px 22px;
    font-size: 1.05rem;
    min-height: 54px;
}

/* Barre admin */
body.touch-mode .admin-nav__tab {
    padding: 14px 18px;
    font-size: 1rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}
body.touch-mode .admin-nav__logout-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
    min-height: 48px;
}

/* Boutons admin dans la table */
body.touch-mode .admin__delete-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
    min-height: 44px;
}
body.touch-mode .admin__reset-btn,
body.touch-mode .admin__export-btn {
    padding: 14px 22px;
    font-size: 1rem;
    min-height: 52px;
}

/* Formulaire création d'utilisateur */
body.touch-mode .admin-user-form input {
    padding: 14px 14px;
    font-size: 1rem;
    min-height: 50px;
}
body.touch-mode .admin-user-form__btn {
    padding: 14px 22px;
    font-size: 1rem;
    min-height: 50px;
    height: auto;
}

/* Login admin */
body.touch-mode .login__input {
    padding: 15px 15px;
    font-size: 1.05rem;
    min-height: 52px;
}
body.touch-mode .login__btn {
    padding: 16px 22px;
    font-size: 1.05rem;
    min-height: 54px;
}

/* Désactive les :hover animés qui clignotent au tap */
@media (hover: none) and (pointer: coarse) {
    .answer-btn:hover,
    .next-btn:hover,
    .landing__btn:hover,
    .admin__export-btn:hover,
    .login__btn:hover {
        transform: none;
    }
}

/* Quand le clavier virtuel est ouvert, on libère la moitié basse de l'écran */
body.vkbd-open {
    padding-bottom: 340px;
}

/* ===========================================================
   Clavier virtuel AZERTY — rendu par keyboard.js
   =========================================================== */
.vkbd {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #1f2937 0%, #0f172a 100%);
    color: #f8fafc;
    padding: 14px 16px 18px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 0.22s ease-out;
    -webkit-user-select: none;
            user-select: none;
    touch-action: manipulation;
}
.vkbd.is-visible { transform: translateY(0); }

.vkbd__inner {
    max-width: 820px;
    margin: 0 auto;
}

.vkbd__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 700;
}
.vkbd__close {
    background: transparent;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
}
.vkbd__close:active {
    background: #334155;
}

.vkbd__rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vkbd__row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.vkbd__key {
    background: #374151;
    color: #f8fafc;
    border: 1px solid #4b5563;
    border-radius: 10px;
    min-width: 48px;
    min-height: 54px;
    padding: 0 4px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex: 1 1 0;
    touch-action: manipulation;
    transition: transform 0.05s ease, background 0.1s ease;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.vkbd__key:active {
    transform: translateY(1px);
    background: #4b5563;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

/* Touches utilitaires (Maj, Espace, ⌫, OK) */
.vkbd__utility {
    display: flex;
    gap: 5px;
    margin-top: 6px;
}
.vkbd__key--util {
    background: #4f46e5;
    border-color: #6366f1;
    flex: 0 0 auto;
    min-width: 90px;
    padding: 0 14px;
    font-size: 1rem;
}
.vkbd__key--util:active { background: #4338ca; }

.vkbd__key--space {
    flex: 1 1 auto;
    min-width: 200px;
}
.vkbd__key--back {
    font-size: 1.3rem;
}
.vkbd__key--ok {
    background: #16a34a;
    border-color: #15803d;
    min-width: 110px;
}
.vkbd__key--ok:active { background: #15803d; }

.vkbd__key--shift.is-active {
    background: #6366f1;
    border-color: #818cf8;
}
.vkbd__key--shift.is-locked {
    background: #eab308;
    border-color: #ca8a04;
    color: #1f2937;
}

@media (max-width: 640px) {
    .vkbd__key { min-width: 0; min-height: 48px; font-size: 1.05rem; padding: 0 2px; }
    .vkbd__key--util { min-width: 64px; font-size: 0.88rem; padding: 0 8px; }
    .vkbd__key--space { min-width: 120px; }
    .vkbd__key--ok { min-width: 70px; }
    body.vkbd-open { padding-bottom: 300px; }
}
