/* =========================================================
   Thème « Esport / Gaming » — néon, biseaux, typo compétition
   ========================================================= */
:root {
    --bg: #07080f;
    --bg-2: #0d1020;
    --surface: #111528;
    --surface-2: #171c35;
    --text: #e8ecff;
    --muted: #8a91b4;
    --border: #232a4d;
    --primary: #00e5ff;      /* cyan néon */
    --accent: #ff2e88;       /* magenta néon */
    --lime: #b6ff3b;
    --danger: #ff3b5c;
    --success-text: #7dffb0;
    --error-text: #ff8aa0;
    --cut: 14px;             /* taille des coins biseautés */
    --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
    --font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(255, 46, 136, .16), transparent 60%),
        radial-gradient(900px 600px at 0% 0%, rgba(0, 229, 255, .12), transparent 55%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Grille façon HUD en arrière-plan */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 229, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: #fff; }

h1, h2 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-transform: uppercase; letter-spacing: .04em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.main { flex: 1; padding-top: 36px; padding-bottom: 72px; }
.muted { color: var(--muted); }
.inline { display: inline; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: rgba(7, 8, 15, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    opacity: .7;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand {
    display: flex; align-items: center; gap: 12px;
    color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
    text-transform: uppercase; letter-spacing: .12em;
}
.brand:hover { color: #fff; }
.brand-mark {
    display: grid; place-items: center; width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #07080f; font-size: 1rem;
    clip-path: polygon(25% 0, 100% 0, 100% 75%, 75% 100%, 0 100%, 0 25%);
    box-shadow: 0 0 20px rgba(0, 229, 255, .5);
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a, .link-button {
    position: relative; color: var(--muted);
    font-family: var(--font-display); font-size: .74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em;
}
.nav-links a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
    background: var(--primary); box-shadow: 0 0 8px var(--primary); transition: right .2s;
}
.nav-links a:hover, .link-button:hover { color: #fff; }
.nav-links a:hover::after { right: 0; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; }

.site-footer {
    padding: 26px 0; color: var(--muted); border-top: 1px solid var(--border);
    font-family: var(--font-display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Hero ---------- */
.hero { padding: 36px 0 44px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
    color: var(--primary); font-family: var(--font-display); font-size: .72rem; font-weight: 700;
    letter-spacing: .3em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 900; letter-spacing: .02em;
    background: linear-gradient(95deg, #fff 30%, var(--primary) 65%, var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 40px rgba(0, 229, 255, .15);
}
.hero p { color: var(--muted); font-size: 1.2rem; margin: 12px 0 28px; max-width: 620px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.stat {
    min-width: 150px; padding: 14px 20px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-left: 3px solid var(--primary);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.stat:nth-child(2) { border-left-color: var(--accent); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; }

.search { display: flex; align-items: center; gap: 14px; max-width: 560px; }
.search input { flex: 1; }
.count { color: var(--muted); font-family: var(--font-display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Cartes projets ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }

.card {
    position: relative; display: flex; flex-direction: column;
    background: linear-gradient(160deg, var(--surface-2), var(--surface) 55%);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
    transition: transform .2s, filter .2s;
}
/* bordure néon qui suit les biseaux */
.card::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(135deg, var(--border), var(--border));
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    padding: 1px; transition: background .2s;
}
.card:hover { transform: translateY(-4px); filter: drop-shadow(0 10px 30px rgba(0, 229, 255, .18)); }
.card:hover::before { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.card-link { flex: 1; padding: 24px 24px 10px; color: inherit; }
.card-link:hover { color: inherit; }
.card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.card-head h2 { font-size: 1rem; color: #fff; }
.card-desc { color: var(--muted); font-size: 1rem; margin: 0; }
.card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 16px 24px 20px; border-top: 1px dashed var(--border); margin: 0 0 0;
}
.meta { color: var(--muted); font-size: .9rem; letter-spacing: .04em; }
.card-actions { display: flex; gap: 8px; flex-shrink: 0; }

.app-icon {
    --hue: 190;
    flex-shrink: 0; display: grid; place-items: center;
    width: 54px; height: 54px;
    background: linear-gradient(135deg, hsl(var(--hue) 100% 55%), hsl(calc(var(--hue) + 70) 100% 50%));
    color: #07080f; font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; text-transform: uppercase;
    clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
    box-shadow: 0 0 24px hsl(var(--hue) 100% 55% / .45);
}
.app-icon-lg { width: 88px; height: 88px; font-size: 2.3rem; }
.app-icon-sm { width: 34px; height: 34px; font-size: .85rem; }

.tag {
    display: inline-block; margin-top: 6px; padding: 2px 10px;
    background: rgba(182, 255, 59, .1); color: var(--lime);
    border: 1px solid rgba(182, 255, 59, .35);
    font-family: var(--font-display); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.tag-cat { background: rgba(0, 229, 255, .12); color: var(--primary); border-color: rgba(0, 229, 255, .4); }

/* ---------- Filtres par catégorie ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; cursor: pointer;
    background: var(--surface); color: var(--muted); border: 1px solid var(--border);
    font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
    transition: color .2s, border-color .2s, background .2s;
}
.chip span { color: var(--muted); font-size: .9em; opacity: .75; }
.chip:hover { color: #fff; border-color: var(--primary); }
.chip.is-active {
    background: linear-gradient(100deg, var(--primary), #4d7cff 60%, var(--accent));
    border-color: transparent; color: #07080f;
}
.chip.is-active span { color: #07080f; opacity: .8; }

/* ---------- Page détail ---------- */
.back {
    display: inline-block; margin-bottom: 22px; color: var(--muted);
    font-family: var(--font-display); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
}
.back:hover { color: var(--primary); }
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.detail-main, .detail-side, .panel {
    position: relative;
    background: linear-gradient(170deg, var(--surface-2), var(--surface) 60%);
    border: 1px solid var(--border);
    padding: 32px;
    clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}
.detail-main::after, .panel::after {
    content: ""; position: absolute; top: 0; left: 0; width: 90px; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 14px var(--primary);
}
.detail-head { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; }
.detail-head h1 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); color: #fff; }
.description { overflow-wrap: anywhere; font-size: 1.08rem; color: #c9cff0; }
.detail-side { position: sticky; top: 94px; }
.specs { margin: 22px 0 0; }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; }
.specs dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; color: #fff; }
.note {
    margin: 18px 0 0; padding: 12px 14px; font-size: .9rem;
    background: rgba(255, 196, 0, .07); border-left: 3px solid #ffc400; color: #ffd966;
}

/* ---------- Boutons ---------- */
.btn {
    --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--border);
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border: 1px solid var(--btn-bd);
    background: var(--btn-bg); color: var(--btn-fg);
    font-family: var(--font-display); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    cursor: pointer; white-space: nowrap;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: background .2s, color .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { --btn-bd: var(--primary); --btn-fg: var(--primary); background: rgba(0, 229, 255, .06); }
.btn-primary {
    --btn-bg: linear-gradient(100deg, var(--primary), #4d7cff 55%, var(--accent));
    --btn-fg: #07080f; --btn-bd: transparent;
    background-size: 160% 100%; background-position: 0 0;
}
.btn-primary:hover {
    --btn-fg: #07080f; background: var(--btn-bg); background-size: 160% 100%; background-position: 100% 0;
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, .6));
}
/* « Jouer » : version navigateur, en vert pour la distinguer du téléchargement */
.btn-play { --btn-fg: var(--lime); --btn-bd: rgba(182, 255, 59, .55); background: rgba(182, 255, 59, .08); }
.btn-play:hover { --btn-fg: #07080f; --btn-bd: var(--lime); background: var(--lime); filter: drop-shadow(0 0 12px rgba(182, 255, 59, .5)); }
.detail-side .btn + .btn { margin-top: 12px; }
.side-hint { margin: 8px 0 14px; color: var(--muted); font-size: .9rem; text-align: center; }
.btn-danger { --btn-fg: var(--danger); }
.btn-danger:hover { --btn-bd: var(--danger); --btn-fg: #fff; background: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: .64rem; }
.btn-lg { padding: 17px 24px; font-size: .88rem; }
.btn-block { width: 100%; white-space: normal; text-align: center; }

/* ---------- Formulaires ---------- */
input[type="text"], input[type="password"], input[type="search"], input[type="file"], textarea {
    width: 100%; padding: 12px 14px;
    background: rgba(7, 8, 15, .6); color: var(--text);
    border: 1px solid var(--border); border-radius: 0;
    font: inherit; font-size: 1.02rem;
    transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: #5b6189; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 229, 255, .15), 0 0 18px rgba(0, 229, 255, .2); }
input[type="file"]::file-selector-button {
    margin-right: 14px; padding: 8px 14px; border: 0; cursor: pointer;
    background: var(--surface-2); color: var(--primary);
    font-family: var(--font-display); font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
textarea { resize: vertical; }
.form { display: flex; flex-direction: column; gap: 20px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: var(--muted); font-family: var(--font-display); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.field small { color: var(--muted); font-size: .92rem; }
.field small strong { color: var(--text); }
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row .field { min-width: 160px; }
.row .grow { flex: 1; min-width: 240px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }

.panel { max-width: 780px; }
.panel h1 { font-size: 1.4rem; color: #fff; }
.auth { display: grid; place-items: center; padding-top: 30px; }
.auth .panel { width: 100%; max-width: 440px; }
.auth .muted { margin: 10px 0 0; }

/* ---------- Messages ---------- */
.alert { padding: 13px 18px; margin-bottom: 22px; border-left: 3px solid; background: var(--surface); }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { color: var(--success-text); border-color: var(--success-text); background: rgba(125, 255, 176, .06); }
.alert-error { color: var(--error-text); border-color: var(--danger); background: rgba(255, 59, 92, .07); }
.panel .alert { margin: 18px 0 0; }

/* ---------- Admin ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--primary); font-family: var(--font-display); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; background: var(--bg-2); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(0, 229, 255, .04); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--font-display); font-weight: 700; }
.table .actions { text-align: right; }
.cell-project { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.cell-project a { color: #fff; }
.cell-project a:hover { color: var(--primary); }

/* ---------- États vides / erreurs ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin: 0 0 8px; }
.big-code {
    font-family: var(--font-display); font-size: clamp(5rem, 16vw, 9rem); font-weight: 900; margin: 0; line-height: 1;
    color: transparent; -webkit-text-stroke: 2px var(--accent);
    text-shadow: 0 0 30px rgba(255, 46, 136, .45);
}

@media (max-width: 820px) {
    .detail { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .nav-links { gap: 16px; }
    .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Onglets connexion / création de compte */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { flex: 1; text-align: center; padding: 10px 12px; border: 1px solid var(--border, #2a3550); border-radius: 8px; color: var(--muted); font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.tab.active { color: #fff; border-color: currentColor; }
.tab-pane[hidden] { display: none; }
.nav-user { color: var(--muted); font-size: .95rem; }
.page-head .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* RGPD : pages légales, bandeau cookies, mon compte */
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.footer-links a, .footer-links .link-button { color: var(--muted); font-size: .95rem; text-decoration: none; }
.footer-links a:hover, .footer-links .link-button:hover { color: var(--primary); }
.legal { max-width: 860px; }
.legal h1 { font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; margin-bottom: 8px; }
.legal h2 { font-size: 1.05rem; color: var(--primary); margin: 30px 0 8px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 820px; margin: 0 auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; background: var(--surface-2); border: 1px solid var(--primary); box-shadow: 0 0 30px rgba(0, 229, 255, .18); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 380px; font-size: .98rem; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--muted); }
.consent input { margin-top: 5px; }
.profile { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; color: #fff; }
.panel h2 { font-size: 1rem; color: var(--primary); margin: 26px 0 6px; }
.rights { margin: 0; padding-left: 18px; }

/* Logo du site */
.brand-logo { display: block; width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(0, 229, 255, .45)); }

/* Encart : installer l application de gestion */
.app-card { display: flex; gap: 22px; align-items: flex-start; margin: 0 0 28px; padding: 22px 24px; background: linear-gradient(170deg, var(--surface-2), var(--surface) 70%); border: 1px solid var(--border); }
.app-card img { flex: none; filter: drop-shadow(0 0 12px rgba(0, 229, 255, .4)); }
.app-card h2 { margin: 0 0 6px; font-size: 1.1rem; color: #fff; }
.app-card .muted { margin: 0 0 10px; }
.app-steps { margin: 0 0 16px; padding-left: 20px; color: var(--text); }
.app-steps li { margin: 4px 0; }
.app-steps code, .app-card code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; }
@media (max-width: 640px) { .app-card { flex-direction: column; } }

/* Jeu en maintenance : boutons grisés */
.btn.is-disabled { opacity: .35; filter: grayscale(1); cursor: not-allowed; pointer-events: none; box-shadow: none; }
.tag-maint { color: #ffb020; border-color: rgba(255, 176, 32, .55); background: rgba(255, 176, 32, .08); }
.card:has(.is-disabled) .app-icon { filter: grayscale(.6); }
