@charset "UTF-8";
/* ==========================================================================
   GameBase — Socle commun (site public + administration)
   Jetons de design, reset, typographie, boutons, formulaires, messages.
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Surfaces */
    --bg: #07070f;
    --bg-2: #0b0b17;
    --surface: #10101e;
    --surface-2: #161628;
    --surface-3: #1d1d34;
    --border: rgba(160, 150, 255, 0.11);
    --border-strong: rgba(160, 150, 255, 0.24);

    /* Texte */
    --text: #edecff;
    --text-2: #b9b8d9;
    --muted: #8a89ad;

    /* Couleurs néon */
    --violet: #8b5cf6;
    --violet-2: #a78bfa;
    --indigo: #6366f1;
    --cyan: #22d3ee;
    --pink: #f472b6;
    --lime: #a3e635;
    --amber: #fbbf24;
    --green: #34d399;
    --red: #f87171;

    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
    --grad-text: linear-gradient(92deg, #c4b5fd 0%, #22d3ee 55%, #f0abfc 100%);

    /* Formes & effets */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
    --glow: 0 0 0 1px rgba(139, 92, 246, 0.45), 0 12px 40px -10px rgba(139, 92, 246, 0.6);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* Typographie */
    --font-display: "Chakra Petch", system-ui, sans-serif;
    --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

    /* Mise en page */
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 32px);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

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

p {
    margin: 0;
}

code,
kbd {
    font-family: var(--font-mono);
    font-size: 0.88em;
}

code {
    padding: 0.1em 0.4em;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--violet-2);
}

::selection {
    background: rgba(139, 92, 246, 0.45);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

[hidden] {
    display: none !important;
}

/* ---------- Utilitaires ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--violet);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 16px;
}

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

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

.icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
}

.link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--violet-2);
    font-weight: 500;
    transition: color 0.2s;
}

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

/* ---------- Fond animé (grille + halos) ---------- */
.bg-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-fx__grid {
    position: absolute;
    inset: -1px;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg-fx__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: orb-float 18s ease-in-out infinite alternate;
}

.bg-fx__orb--1 {
    top: -180px;
    left: -120px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 70%);
}

.bg-fx__orb--2 {
    top: 120px;
    right: -160px;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 70%);
    animation-delay: -6s;
}

.bg-fx__orb--3 {
    top: 900px;
    left: 30%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.18), transparent 70%);
    animation-delay: -12s;
}

@keyframes orb-float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(40px, 60px, 0) scale(1.08); }
}

/* ---------- Boutons ---------- */
.btn {
    --btn-bg: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(167, 139, 250, 0.5);
}

.btn:active {
    transform: translateY(0);
}

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

.btn--primary {
    border-color: transparent;
    background: var(--grad);
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: #fff;
    box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
    background-position: 100% 50%;
    box-shadow: 0 12px 32px -10px rgba(34, 211, 238, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.03);
}

.btn--ghost:hover {
    background: rgba(139, 92, 246, 0.12);
}

.btn--danger {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

.btn--danger:hover {
    border-color: var(--red);
    background: rgba(248, 113, 113, 0.22);
}

.btn--sm {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn--block {
    width: 100%;
}

/* ---------- Formulaires ---------- */
.form {
    display: grid;
    gap: 20px;
}

.form-grid {
    display: grid;
    gap: 16px 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field__label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.field__label small,
.switch__label small {
    color: var(--muted);
    font-weight: 400;
}

.field__help {
    color: var(--muted);
    font-size: 0.85rem;
}

.field__help--warning {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--amber);
}

.field__error {
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 500;
}

.req {
    color: var(--pink);
}

.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(7, 7, 15, 0.6);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder {
    color: #5f5e80;
}

.input:hover {
    border-color: rgba(167, 139, 250, 0.4);
}

.input:focus {
    outline: none;
    border-color: var(--violet);
    background: rgba(7, 7, 15, 0.9);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.input.is-invalid,
.is-invalid .input {
    border-color: var(--red);
}

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

select.input {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select.input option {
    background: var(--surface);
}

.input--code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    min-height: 80px;
}

/* Interrupteur */
.switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.switch__track {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    transition: background 0.25s, border-color 0.25s;
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-2);
    transition: transform 0.25s var(--ease), background 0.25s;
}

.switch input:checked + .switch__track {
    background: var(--grad);
    border-color: transparent;
}

.switch input:checked + .switch__track::after {
    transform: translateX(20px);
    background: #fff;
}

.switch input:focus-visible + .switch__track {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.switch__label {
    display: grid;
    line-height: 1.3;
    font-weight: 500;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-2);
    font-size: 0.92rem;
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--violet);
}

/* ---------- Messages ---------- */
.flashes {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    animation: flash-in 0.4s var(--ease);
}

.flash__icon {
    margin-top: 3px;
}

.flash__text {
    flex: 1;
    font-size: 0.94rem;
}

.flash__close {
    display: grid;
    place-items: center;
    padding: 2px;
    border: 0;
    background: none;
    color: var(--muted);
}

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

.flash--success {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
}

.flash--success .flash__icon {
    color: var(--green);
}

.flash--error {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
}

.flash--error .flash__icon {
    color: var(--red);
}

.flash--warning {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.flash--warning .flash__icon {
    color: var(--amber);
}

.flash--info .flash__icon {
    color: var(--cyan);
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Logo ---------- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo__mark {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 4px 14px rgba(139, 92, 246, 0.55));
    transition: transform 0.4s var(--ease);
}

.logo:hover .logo__mark {
    transform: rotate(-8deg) scale(1.05);
}

.logo__text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge--featured {
    background: rgba(251, 191, 36, 0.92);
    color: #1a1305;
}

/* ---------- Publicité ---------- */
.ad-slot {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 4px;
    margin-block: 24px;
    overflow: hidden;
}

.ad-slot__label {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.ad-slot__content {
    width: 100%;
    display: flex;
    justify-content: center;
}

.ad-slot--preview {
    min-height: 90px;
    place-items: center;
    padding: 16px;
    border: 2px dashed rgba(251, 191, 36, 0.5);
    border-radius: var(--radius);
    background: repeating-linear-gradient(-45deg, rgba(251, 191, 36, 0.05) 0 12px, transparent 12px 24px);
}

.ad-slot__preview {
    color: var(--amber);
    font-size: 0.85rem;
    text-align: center;
}

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

/* ---------- Avatar de joueur (site et administration) ---------- */
.player-avatar {
    --avatar-size: 36px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, hsl(var(--avatar-hue, 260) 90% 75% / 0.55), transparent 60%),
        hsl(var(--avatar-hue, 260) 55% 28%);
    box-shadow: inset 0 0 0 2px hsl(var(--avatar-hue, 260) 80% 65% / 0.55);
    font-size: calc(var(--avatar-size) * 0.55);
    line-height: 1;
    user-select: none;
}

.player-avatar--sm { --avatar-size: 28px; }
.player-avatar--lg { --avatar-size: 56px; }
.player-avatar--xl { --avatar-size: 88px; box-shadow: inset 0 0 0 3px hsl(var(--avatar-hue, 260) 80% 65% / 0.6), 0 12px 40px -12px hsl(var(--avatar-hue, 260) 80% 55% / 0.8); }
