/* ==========================================================================
   Sénateur — feuille de style principale
   ========================================================================== */

:root {
    --bg: #070B14;
    --bg-2: #0A1120;
    --surface: #111A2B;
    --surface-2: #16223A;
    --surface-3: #1D2B47;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #E9EEF9;
    --muted: #93A1B8;
    --brand: #2F7BFF;
    --brand-dark: #1C5BD6;
    --brand-soft: rgba(47, 123, 255, 0.14);
    --accent: #F2C14E;
    --accent-soft: rgba(242, 193, 78, 0.14);
    --win: #16C784;
    --draw: #F2C14E;
    --loss: #FF5A5F;
    --radius-lg: 20px;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.25);
    --nav-height: 68px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100%;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 8px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 19px;
}

h3 {
    font-size: 16px;
}

p {
    margin: 0 0 10px;
}

a {
    color: var(--brand);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.tiny {
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.ico {
    flex: none;
}

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.page {
    padding: 16px 16px calc(var(--nav-height) + 28px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.page-narrow {
    max-width: 620px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.section {
    margin: 22px 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
}

/* ---------- Barre du haut ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.96), rgba(7, 11, 20, 0.82));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 6px 16px;
    max-width: 1080px;
    margin: 0 auto;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
    flex: 1;
    text-align: center;
}

.topbar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    transform: rotate(180deg);
    transition: transform 0.12s ease;
}

.topbar-back:active {
    transform: rotate(180deg) scale(0.95);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 38px;
    justify-content: flex-end;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(140deg, var(--brand), #7C4DFF);
    color: #fff;
}

.brand-footer {
    margin-bottom: 10px;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.12s ease;
}

.avatar:active {
    transform: scale(0.94);
}

/* ---------- Barre de navigation du bas ---------- */

.bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(10, 16, 30, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottomnav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    max-width: 620px;
    margin: 0 auto;
    padding: 6px 6px 4px;
}

.navitem {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    transition: transform 0.12s ease, color 0.15s ease;
}

.navitem-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 28px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.navitem:active {
    transform: scale(0.94);
}

.navitem.active {
    color: var(--text);
}

.navitem.active .navitem-ico {
    background: var(--brand);
    color: #fff;
}

.navitem.active .navitem-label {
    color: var(--text);
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 650;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 6px 18px rgba(47, 123, 255, 0.32);
}

.btn-accent {
    background: var(--accent);
    color: #201804;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-danger {
    background: rgba(255, 90, 95, 0.14);
    color: #FF8A8E;
    border-color: rgba(255, 90, 95, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 11px;
}

.btn-icon {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- Cartes ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.card-lg {
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-tap {
    transition: transform 0.12s ease, border-color 0.15s ease;
}

.card-tap:active {
    transform: scale(0.985);
    border-color: var(--line-strong);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- Héros ---------- */

.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.hero-media {
    position: relative;
    height: 240px;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.15) 10%, rgba(7, 11, 20, 0.92) 78%, var(--bg) 100%);
}

.hero-body {
    position: relative;
    margin-top: -74px;
    padding: 0 18px 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: #9CC2FF;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 27px;
    margin-bottom: 8px;
}

.hero p {
    color: var(--muted);
    max-width: 620px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

/* ---------- Affiche de match ---------- */

.match-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}

.match-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--muted);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.team-line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}

.team-line.away {
    justify-content: flex-end;
    text-align: right;
}

.team-name {
    font-weight: 650;
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-score {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.02em;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--surface-2);
    min-width: 62px;
    text-align: center;
}

.match-kick {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
}

.badge-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 800;
    color: #08101F;
    background: var(--badge-color, var(--accent));
    flex: none;
    letter-spacing: 0.02em;
}

.badge-sm {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.badge-md {
    width: 36px;
    height: 36px;
    font-size: 11.5px;
}

.badge-lg {
    width: 52px;
    height: 52px;
    font-size: 15px;
    border-radius: 16px;
}

/* ---------- Probabilités ---------- */

.probbar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
}

.probbar span {
    display: block;
    height: 100%;
}

.pb-home {
    background: var(--brand);
}

.pb-draw {
    background: var(--draw);
}

.pb-away {
    background: #7C4DFF;
}

.problegend {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
    text-align: center;
}

.problegend div {
    font-size: 12px;
    color: var(--muted);
}

.problegend strong {
    display: block;
    font-size: 15px;
    color: var(--text);
}

/* ---------- Pills de forme ---------- */

.pills {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 800;
    color: #06121F;
}

.pill-win {
    background: var(--win);
}

.pill-draw {
    background: var(--draw);
}

.pill-loss {
    background: var(--loss);
}

/* ---------- Jauges ---------- */

.gauge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gauge-track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #7C4DFF);
}

.gauge-fill.is-accent {
    background: linear-gradient(90deg, var(--accent), #FF9F45);
}

.gauge-value {
    font-weight: 700;
    font-size: 13.5px;
    min-width: 46px;
    text-align: right;
}

/* ---------- Chiffres clés ---------- */

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.kpi-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 11.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ---------- Étapes ---------- */

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: #9CC2FF;
    font-weight: 800;
    flex: none;
}

/* ---------- Tableaux ---------- */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 520px;
}

table.data th,
table.data td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-2);
    position: sticky;
    top: 0;
}

table.data tr:last-child td {
    border-bottom: none;
}

table.data tbody tr {
    transition: background 0.12s ease;
}

table.data tbody tr:active {
    background: var(--surface-2);
}

.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--surface-2);
    font-weight: 700;
    font-size: 12px;
}

.pos-1,
.pos-2,
.pos-3 {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ---------- Formulaires ---------- */

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface-2);
}

.textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.input-with-icon .input {
    padding-left: 40px;
}

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.chip:active {
    transform: scale(0.95);
}

.chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---------- Messages ---------- */

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(255, 90, 95, 0.12);
    border-color: rgba(255, 90, 95, 0.3);
    color: #FFB0B2;
}

.alert-ok {
    background: rgba(22, 199, 132, 0.12);
    border-color: rgba(22, 199, 132, 0.3);
    color: #86EFC4;
}

.alert-info {
    background: var(--brand-soft);
    border-color: rgba(47, 123, 255, 0.3);
    color: #A9C8FF;
}

.empty {
    text-align: center;
    padding: 30px 18px;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.4s infinite linear;
    height: 92px;
}

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

/* ---------- Badges et tags ---------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--muted);
    letter-spacing: 0.02em;
}

.tag-win {
    background: rgba(22, 199, 132, 0.14);
    color: #86EFC4;
}

.tag-accent {
    background: var(--accent-soft);
    color: var(--accent);
}

.tag-brand {
    background: var(--brand-soft);
    color: #A9C8FF;
}

.tag-loss {
    background: rgba(255, 90, 95, 0.14);
    color: #FFB0B2;
}

/* ---------- Analyse ---------- */

.scoreline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.scoreline small {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.score-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.score-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14px;
    font-weight: 650;
}

.score-item.first {
    background: var(--brand-soft);
    color: #C6DAFF;
}

.pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.pick-main {
    background: linear-gradient(120deg, rgba(47, 123, 255, 0.2), rgba(124, 77, 255, 0.16));
    border-color: rgba(47, 123, 255, 0.35);
}

.insight {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
    color: #C9D4E8;
}

.insight .ico {
    color: var(--accent);
    margin-top: 2px;
}

/* ---------- Modale ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(4, 7, 14, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    animation: slideUp 0.22s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-title {
    font-size: 19px;
    margin-bottom: 8px;
}

.modal-text {
    color: var(--muted);
    font-size: 14px;
}

.install-steps {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.install-step {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    color: #C9D4E8;
}

.install-step span:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: var(--surface-2);
    flex: none;
}

.platform-row {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    color: var(--muted);
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 20px);
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 95;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.ok {
    border-color: rgba(22, 199, 132, 0.4);
}

.toast.err {
    border-color: rgba(255, 90, 95, 0.4);
}

/* ---------- Écran d'ouverture ---------- */

#app-splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #070B14;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
}

#app-splash img {
    border-radius: 22px;
}

#app-splash.show {
    display: flex;
    animation: splashOut 0.4s ease 1.2s forwards;
}

@keyframes splashOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ---------- Pages d'authentification ---------- */

.auth-shell {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-media {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    height: 150px;
    margin-bottom: -50px;
}

.auth-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.1), var(--bg));
}

.auth-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.authorized-note {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
}

/* ---------- Pied de page public ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding: 26px 16px calc(var(--nav-height) + 30px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-2);
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 1080px;
    margin: 0 auto;
}

.site-footer h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.site-footer a {
    color: var(--text);
    font-size: 14px;
}

.site-footer-bottom {
    max-width: 1080px;
    margin: 22px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12.5px;
}

/* ---------- Administration ---------- */

body.admin {
    background: var(--bg-2);
}

.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.admin-tab {
    flex: none;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.admin-tab:active {
    transform: scale(0.96);
}

.admin-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.chart-box {
    position: relative;
    height: 260px;
    width: 100%;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.list-row-main {
    min-width: 0;
    flex: 1;
}

.list-row-title {
    font-weight: 650;
    font-size: 14.5px;
}

.list-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gate {
    max-width: 460px;
    margin: 40px auto;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ---------- Grands écrans ---------- */

@media (min-width: 768px) {
    body {
        font-size: 15.5px;
    }

    .page {
        padding: 22px 24px 40px;
    }

    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .grid-cards-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .hero-media {
        height: 340px;
    }

    .hero h1 {
        font-size: 38px;
    }

    .score-list {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        align-items: center;
    }

    .bottomnav-inner {
        padding: 6px 12px 6px;
    }
}

@media (min-width: 1024px) {
    .grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cards-3 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- Apparition au défilement ---------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Graphique en barres de l'administration ---------- */

.bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 150px;
}

.bar-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    height: 100%;
    min-width: 0;
}

.bar {
    width: 100%;
    max-width: 28px;
    max-height: 88%;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--brand), #7C4DFF);
    transition: height 0.3s ease;
}

.bar-label {
    font-size: 9.5px;
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- Administration : ajustements ---------- */

body.admin .card h2,
body.admin .card h3 {
    letter-spacing: -0.01em;
}

body.admin .field:last-child {
    margin-bottom: 0;
}

body.admin .stat-grid {
    grid-template-columns: 1fr 1fr;
}

/* ---------- Bandeau de page ---------- */

.phero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.phero img {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.phero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.1) 20%, rgba(7, 11, 20, 0.9) 100%);
}

.phero-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px;
    z-index: 1;
}

.phero-body h1 {
    font-size: 21px;
    margin: 0;
}

@media (min-width: 768px) {
    .phero img {
        height: 220px;
    }

    .phero-body {
        padding: 22px 24px;
    }

    .phero-body h1 {
        font-size: 30px;
    }
}
