/* =========================================================
   HappyFace OW Tracker — design system
   Dark gaming premium, mobile first (iPhone), responsive PC.
   ========================================================= */

:root {
    --bg: #0b0c10;
    --bg-elev: #101218;
    --surface: #15171e;
    --surface-2: #1b1e27;
    --surface-3: #232733;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f5f6f8;
    --text-2: #c9ccd4;
    --muted: #8d93a1;
    --accent: #ff9b1f;
    --accent-2: #ff6a00;
    --accent-soft: rgba(255, 155, 31, 0.14);
    --accent-glow: 0 0 0 1px rgba(255, 155, 31, 0.35), 0 8px 30px rgba(255, 106, 0, 0.18);
    --gradient: linear-gradient(135deg, #ffb347 0%, #ff8a1f 45%, #ff6a00 100%);

    --tank: #4aa3ff;
    --damage: #ff5a6a;
    --support: #3fd99a;

    --buff: #3fd99a;
    --nerf: #ff5a6a;
    --adjust: #5aa9ff;
    --fix: #b48cff;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.03) inset;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Rajdhani", "Inter", system-ui, sans-serif;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --nav-height: 64px;
    --side-width: 248px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100dvh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 0, 0.10), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(74, 163, 255, 0.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

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

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

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin: 0;
}

h1 {
    font-size: 1.9rem;
    font-weight: 700;
}

h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Boot screen ---------- */
.boot {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.boot-logo {
    filter: drop-shadow(0 8px 30px rgba(255, 106, 0, 0.45));
    animation: pulse 1.6s ease-in-out infinite;
}

.boot-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.boot-title span {
    color: var(--accent);
}

.boot-bar {
    width: 160px;
    height: 4px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
}

.boot-bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--gradient);
    animation: slide 1.1s var(--ease) infinite;
}

@keyframes slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(260%); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ---------- Shell ---------- */
.shell {
    min-height: 100dvh;
}

.main {
    padding: calc(var(--safe-top) + 12px) calc(16px + var(--safe-right)) calc(var(--nav-height) + var(--safe-bottom) + 28px) calc(16px + var(--safe-left));
    max-width: 1180px;
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(var(--safe-top) + 10px) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
    background: rgba(11, 12, 16, 0.78);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.brand em {
    color: var(--accent);
    font-style: normal;
}

.topbar + .main {
    padding-top: 16px;
}

/* Bottom navigation (mobile) */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding: 6px calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
    background: rgba(13, 14, 19, 0.88);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-top: 1px solid var(--border);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-item:hover {
    text-decoration: none;
    color: var(--text-2);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    top: -6px;
    width: 26px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--gradient);
    box-shadow: 0 0 12px rgba(255, 122, 0, 0.7);
}

.nav-item .dot {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--accent-2);
}

/* Sidebar (desktop) */
.side-nav {
    display: none;
}

@media (min-width: 960px) {
    .bottom-nav {
        display: none;
    }

    .side-nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--side-width);
        padding: 22px 16px;
        background: rgba(13, 14, 19, 0.75);
        border-right: 1px solid var(--border);
        backdrop-filter: blur(18px);
        z-index: 30;
    }

    .side-nav .brand {
        padding: 4px 10px 22px;
    }

    .side-nav .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 0 14px;
        font-size: 0.95rem;
        min-height: 46px;
    }

    .side-nav .nav-item.active {
        background: var(--accent-soft);
    }

    .side-nav .nav-item.active::before {
        top: 12px;
        left: 0;
        width: 3px;
        height: 22px;
        border-radius: 0 3px 3px 0;
    }

    .side-nav .nav-item .dot {
        position: static;
        margin-left: auto;
    }

    .side-footer {
        margin-top: auto;
        color: var(--muted);
        font-size: 0.75rem;
        padding: 0 10px;
    }

    .shell {
        padding-left: var(--side-width);
    }

    .topbar {
        display: none;
    }

    .main {
        padding: 32px 36px 48px;
    }
}

/* ---------- Page headers ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 18px;
}

.page-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
}

.section {
    margin-top: 26px;
}

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

.section-title h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--gradient);
}

/* ---------- Cards ---------- */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)) , var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.card.flush {
    padding: 0;
    overflow: hidden;
}

.card.interactive {
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    cursor: pointer;
}

.card.interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 155, 31, 0.35);
}

.card.interactive:active {
    transform: scale(0.985);
}

.grid {
    display: grid;
    gap: 12px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

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

@media (min-width: 720px) {
    .grid.cols-md-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .grid.cols-md-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid.cols-md-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Buttons & inputs ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.25);
}

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

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

.btn.primary {
    background: var(--gradient);
    border-color: transparent;
    color: #1a0e00;
    box-shadow: 0 6px 22px rgba(255, 106, 0, 0.35);
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    border-color: rgba(255, 90, 106, 0.45);
    color: #ffb3bc;
    background: rgba(255, 90, 106, 0.08);
}

.btn.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn.icon {
    width: 44px;
    padding: 0;
}

.btn.icon.small {
    width: 36px;
}

.btn .spin,
.spin {
    animation: spin 0.9s linear infinite;
}

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

.input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elev);
    color: var(--text);
    font-size: 16px; /* évite le zoom automatique d'iOS */
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.invalid {
    border-color: var(--nerf);
}

select.input {
    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% - 15px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

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

.field label {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.field-error {
    color: #ff99a6;
    font-size: 0.82rem;
}

.search-row {
    display: flex;
    gap: 8px;
}

.search-row .input {
    flex: 1;
    min-width: 0;
}

/* Segmented control / chips */
.segmented {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.segmented button {
    border: 0;
    background: transparent;
    color: var(--muted);
    min-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.segmented button.active {
    background: var(--surface-3);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

.chips.wrap {
    flex-wrap: wrap;
    overflow: visible;
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s var(--ease);
}

.chip.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.chip.buff.active { border-color: var(--buff); background: rgba(63, 217, 154, 0.12); }
.chip.nerf.active { border-color: var(--nerf); background: rgba(255, 90, 106, 0.12); }
.chip.adjust.active { border-color: var(--adjust); background: rgba(90, 169, 255, 0.12); }
.chip.fix.active { border-color: var(--fix); background: rgba(180, 140, 255, 0.12); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--surface-3);
    color: var(--text-2);
    white-space: nowrap;
}

.badge.buff { background: rgba(63, 217, 154, 0.15); color: var(--buff); }
.badge.nerf { background: rgba(255, 90, 106, 0.15); color: var(--nerf); }
.badge.adjust { background: rgba(90, 169, 255, 0.15); color: var(--adjust); }
.badge.fix { background: rgba(180, 140, 255, 0.15); color: var(--fix); }
.badge.info { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.badge.mode { background: rgba(90, 169, 255, 0.12); color: var(--adjust); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.new { background: var(--gradient); color: #1a0e00; }
.badge.tank { background: rgba(74, 163, 255, 0.14); color: var(--tank); }
.badge.damage { background: rgba(255, 90, 106, 0.14); color: var(--damage); }
.badge.support { background: rgba(63, 217, 154, 0.14); color: var(--support); }

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

.small {
    font-size: 0.82rem;
}

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

.row.wrap {
    flex-wrap: wrap;
}

.row.between {
    justify-content: space-between;
}

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

.spacer {
    flex: 1;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

/* ---------- Profile hero ---------- */
.profile-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-hero .namecard {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    filter: saturate(1.1);
}

.profile-hero .namecard::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(11, 12, 16, 0.95) 0%, rgba(11, 12, 16, 0.65) 55%, rgba(11, 12, 16, 0.4) 100%),
        linear-gradient(0deg, rgba(11, 12, 16, 0.9), transparent 70%);
}

.profile-hero .content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.avatar {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    border: 2px solid rgba(255, 155, 31, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 155, 31, 0.12), 0 10px 26px rgba(0, 0, 0, 0.5);
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
}

.profile-hero h1 {
    font-size: 1.7rem;
    word-break: break-word;
}

.profile-hero .tag {
    color: var(--muted);
    font-size: 0.86rem;
}

.profile-actions {
    position: relative;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px 18px;
}

/* ---------- Ranks ---------- */
.rank-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 14px 8px;
}

.rank-card .role {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rank-card .role.tank { color: var(--tank); }
.rank-card .role.damage { color: var(--damage); }
.rank-card .role.support { color: var(--support); }

.rank-emblem {
    position: relative;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
}

.rank-emblem img.rank {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55));
}

.rank-emblem img.tier {
    position: absolute;
    bottom: -6px;
    right: -8px;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.rank-emblem.unranked {
    border-radius: 50%;
    border: 2px dashed var(--border-strong);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.rank-label {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}

/* ---------- Stat tiles ---------- */
.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat .label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat .value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat .value.accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat .sub {
    color: var(--muted);
    font-size: 0.78rem;
}

.meter {
    height: 6px;
    border-radius: 6px;
    background: var(--surface-3);
    overflow: hidden;
}

.meter > span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--gradient);
    transition: width 0.6s var(--ease);
}

.meter.win > span {
    background: linear-gradient(90deg, #2bc48a, #3fd99a);
}

/* ---------- Heroes ---------- */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}

@media (min-width: 720px) {
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }
}

.hero-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.hero-tile:hover {
    text-decoration: none;
    transform: translateY(-3px);
    border-color: rgba(255, 155, 31, 0.4);
}

.hero-tile .portrait {
    position: relative;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at 50% 30%, rgba(255, 155, 31, 0.2), transparent 70%), var(--surface-2);
}

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

.hero-tile .meta {
    padding: 8px 10px 10px;
}

.hero-tile .name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-tile .role-line {
    font-size: 0.72rem;
    color: var(--muted);
}

.hero-tile .fav {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    display: grid;
    place-items: center;
    background: rgba(11, 12, 16, 0.65);
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.hero-tile .fav.on {
    color: var(--accent);
}

.hero-tile .role-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
}

.role-strip.tank { background: var(--tank); }
.role-strip.damage { background: var(--damage); }
.role-strip.support { background: var(--support); }

.hero-avatar {
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
}

.hero-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.hero-row:last-child {
    border-bottom: 0;
}

.hero-row:hover {
    text-decoration: none;
}

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

.hero-row .info .name {
    font-weight: 700;
}

.hero-row .figures {
    text-align: right;
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

.hero-row .figures strong {
    color: var(--text);
    font-size: 0.95rem;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: radial-gradient(600px 300px at 80% 0%, rgba(255, 155, 31, 0.2), transparent 70%), var(--surface);
    padding: 18px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.hero-banner img.portrait {
    width: 104px;
    height: 104px;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid rgba(255, 155, 31, 0.55);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.ability {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ability img {
    width: 40px;
    height: 40px;
    padding: 6px;
    border-radius: 10px;
    background: var(--surface-3);
    flex-shrink: 0;
}

/* ---------- Patch notes ---------- */
.patch {
    padding: 0;
    overflow: hidden;
}

.patch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(255, 155, 31, 0.08), transparent 60%);
}

.patch-header .date {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.patch-body {
    padding: 6px 16px 16px;
}

.patch-section-title {
    margin: 14px 0 8px;
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev);
    margin-bottom: 10px;
    overflow: hidden;
}

.hero-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.hero-block-header .name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
}

.dev-comment {
    margin: 10px 12px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: rgba(255, 155, 31, 0.06);
    color: var(--text-2);
    font-size: 0.86rem;
}

.dev-comment .who {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.change {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.change:last-child {
    border-bottom: 0;
}

.change-line {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    background: none;
    border: 0;
    width: 100%;
    text-align: left;
    padding: 0;
    color: inherit;
}

.change-line .text {
    flex: 1;
    min-width: 0;
}

.change-line .subject {
    display: block;
    font-size: 0.74rem;
    color: var(--muted);
    font-weight: 600;
}

.change-line .official {
    color: var(--text);
}

.change-line .chev {
    color: var(--muted);
    transition: transform 0.25s var(--ease);
    margin-top: 2px;
}

.change.open .change-line .chev {
    transform: rotate(180deg);
}

.change.significant .official {
    font-weight: 600;
}

.values {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
}

.values .old {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.25);
}

.values .pct {
    font-family: var(--font);
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface-3);
}

.values .pct.buff { color: var(--buff); background: rgba(63, 217, 154, 0.12); }
.values .pct.nerf { color: var(--nerf); background: rgba(255, 90, 106, 0.12); }

.analysis {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    animation: fadeIn 0.3s var(--ease);
}

.analysis-block {
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.analysis-block h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.analysis-block.fact h4 { color: var(--text-2); }
.analysis-block.calc h4 { color: var(--adjust); }
.analysis-block.interp h4 { color: var(--accent); }
.analysis-block.tips h4 { color: var(--buff); }

.analysis-block ul {
    margin: 0;
    padding-left: 18px;
}

.analysis-block li + li {
    margin-top: 4px;
}

.analysis-block p {
    margin: 0;
}

.hypothesis {
    font-size: 0.74rem;
    color: var(--muted);
    font-style: italic;
    margin-top: 6px !important;
}

.timeline {
    position: relative;
    padding-left: 22px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(var(--accent), rgba(255, 155, 31, 0.05));
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}

/* ---------- Charts ---------- */
.chart {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.chart .grid-line {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

.chart .axis-label {
    fill: var(--muted);
    font-size: 10px;
    font-family: var(--font);
}

.chart .line {
    fill: none;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart .point {
    stroke: var(--bg);
    stroke-width: 2;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-2);
}

.chart-legend .swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

.compare-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
}

.compare-bar .label {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 92px;
}

.compare-bar .side {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compare-bar .side.left {
    align-items: flex-end;
    text-align: right;
}

.compare-bar .side .val {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.compare-bar .side .val.win {
    color: var(--accent);
}

.compare-bar .bar {
    height: 6px;
    width: 100%;
    border-radius: 6px;
    background: var(--surface-3);
    overflow: hidden;
    display: flex;
}

.compare-bar .side.left .bar {
    justify-content: flex-end;
}

.compare-bar .bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--gradient);
}

.compare-bar .side.right .bar span {
    background: linear-gradient(90deg, #4aa3ff, #8fc6ff);
}

/* ---------- States ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: 12px;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to { transform: translateX(100%); }
}

.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 30px 18px;
}

.state .icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
}

.state.error .icon-wrap {
    background: rgba(255, 90, 106, 0.12);
    color: var(--nerf);
}

.state p {
    margin: 0;
    color: var(--muted);
    max-width: 440px;
}

.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(90, 169, 255, 0.08);
    border: 1px solid rgba(90, 169, 255, 0.25);
    color: var(--text-2);
    font-size: 0.86rem;
}

.notice.warn {
    background: rgba(255, 155, 31, 0.08);
    border-color: rgba(255, 155, 31, 0.3);
}

.notice.error {
    background: rgba(255, 90, 106, 0.08);
    border-color: rgba(255, 90, 106, 0.3);
}

.notice svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.offline-banner {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: calc(var(--safe-top) + 6px) 12px 6px;
    background: #3a2205;
    color: #ffd29a;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Toasts */
.toasts {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 14px);
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 420px);
    pointer-events: none;
}

@media (min-width: 960px) {
    .toasts {
        bottom: 24px;
        left: calc(50% + var(--side-width) / 2);
    }
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(27, 30, 39, 0.96);
    border: 1px solid var(--border-strong);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    animation: toastIn 0.35s var(--ease);
}

.toast.success { border-color: rgba(63, 217, 154, 0.45); }
.toast.warning { border-color: rgba(255, 155, 31, 0.5); }
.toast.error { border-color: rgba(255, 90, 106, 0.5); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* Dialog */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
    animation: fadeIn 0.2s;
}

@media (min-width: 720px) {
    .dialog-backdrop {
        align-items: center;
    }
}

.dialog {
    width: min(100%, 440px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: toastIn 0.3s var(--ease);
}

.dialog p {
    color: var(--text-2);
}

.dialog .actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Update banner */
.update-banner {
    position: fixed;
    top: calc(var(--safe-top) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid rgba(255, 155, 31, 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    font-size: 0.88rem;
}

.update-banner[hidden] {
    display: none;
}

.update-banner button {
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--gradient);
    color: #1a0e00;
    font-weight: 700;
    cursor: pointer;
}

/* Lists & tables */
.list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

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

table.data th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

table.data td.num,
table.data th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.kv {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    font-size: 0.86rem;
}

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

.kv dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: 0;
}

.settings-item .desc {
    color: var(--muted);
    font-size: 0.8rem;
}

.switch {
    position: relative;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.switch .track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    transition: background 0.2s;
}

.switch .track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.25s var(--ease);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .track {
    background: var(--accent-2);
    border-color: transparent;
}

.switch input:checked + .track::after {
    transform: translateX(20px);
}

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.steps li {
    counter-increment: step;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.steps li::before {
    content: counter(step);
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--gradient);
    color: #1a0e00;
    font-weight: 800;
}

/* Animations d'entrée */
.fade-in {
    animation: fadeIn 0.45s var(--ease) both;
}

.rise {
    animation: rise 0.5s var(--ease) both;
}

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

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.no-anim *,
.no-anim *::before,
.no-anim *::after {
    animation: none !important;
    transition: none !important;
}

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

/* Blazor */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    padding: 14px 16px calc(14px + var(--safe-bottom));
    background: #3b0d14;
    color: #ffd6dc;
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: 700;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 16px;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 90, 106, 0.1);
    border: 1px solid rgba(255, 90, 106, 0.3);
}

.blazor-error-boundary::after {
    content: "Une erreur est survenue dans ce composant.";
}

.fav-star {
    color: var(--accent);
}

@media (max-width: 420px) {
    .hide-xs {
        display: none;
    }
}

/* ---------- Rang actuel / meilleur rang ---------- */
.rank-caption {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.peak {
    width: 100%;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.peak-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
}

.peak.higher .peak-value {
    text-shadow: 0 0 14px currentColor;
}

.division-bronze { color: #c98a55; }
.division-silver { color: #c7ccd6; }
.division-gold { color: #f3c64e; }
.division-platinum { color: #6fd3d6; }
.division-emerald { color: #3fd98a; }
.division-diamond { color: #79b8ff; }
.division-master { color: #ff9b5a; }
.division-grandmaster { color: #c49bff; }
.division-champion { color: #ff6ad5; }
