/* ═══════════════════════════════════════════════════════════════════════
   ADVENTURE THEME — La Chasse au Trésor
   Palette extraite du design original
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --adv-bg:       #F5ECD7;   /* Parchemin clair */
    --adv-bg-card:  #EDD9B0;   /* Parchemin sombre (cartes) */
    --adv-bg-input: #FBF4E4;   /* Champs de saisie */
    --adv-dark:     #2C1810;   /* Brun très foncé (textes, boutons) */
    --adv-dark2:    #3D2314;   /* Brun foncé secondaire */
    --adv-gold:     #D4A017;   /* Or */
    --adv-amber:    #C67C3C;   /* Ambre (accents, boutons secondaires) */
    --adv-muted:    #8B6E5A;   /* Texte secondaire */
    --adv-green:    #5A9E50;   /* Complété */
    --adv-red:      #C0392B;   /* Erreur */
    --adv-shadow:   rgba(44,24,16,0.15);
    --adv-radius:   14px;
    --adv-radius-sm:8px;
    --nav-height:   72px;      /* Hauteur de la nav bottom */
    --header-height: 0px;      /* Fallback 0 (= chevauchement masqué) — overridé par JS */
    --font-title:   'Georgia', 'Times New Roman', serif;
    --font-body:    'Segoe UI', system-ui, sans-serif;
}

/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background-color: var(--adv-bg);
    color: var(--adv-dark);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

/* Espace pour la nav bottom fixe */
.page-content {
    padding-bottom: 16px;
    min-height: 100vh;
}

/* ── Typographie ───────────────────────────────────────────────────────── */
h1, h2, h3, .title-font {
    font-family: var(--font-title);
    font-weight: 900;
    color: var(--adv-dark);
    letter-spacing: 0.5px;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.text-muted-adv { color: var(--adv-muted); font-size: 0.85rem; }
.text-gold      { color: var(--adv-gold); }
.text-amber     { color: var(--adv-amber); }
.text-green     { color: var(--adv-green); }

/* ── Header ────────────────────────────────────────────────────────────── */
.adv-header {
    background: var(--adv-bg-card);
    border-bottom: 2px solid var(--adv-gold);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.adv-header__logo {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--adv-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adv-header__actions { display: flex; gap: 12px; align-items: center; }

/* ── Cartes ────────────────────────────────────────────────────────────── */
.adv-card {
    background: var(--adv-bg-card);
    border-radius: var(--adv-radius);
    padding: 18px;
    box-shadow: 0 2px 8px var(--adv-shadow);
    margin-bottom: 14px;
}

.adv-card--gold {
    border: 2px solid var(--adv-gold);
}

.adv-card--dark {
    background: var(--adv-dark);
    color: var(--adv-bg);
}

.adv-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--adv-muted);
    margin-bottom: 8px;
}

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn-adv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-adv:hover  { opacity: 0.9; transform: translateY(-1px); }
.btn-adv:active { transform: translateY(0); }

.btn-adv--primary {
    background: var(--adv-dark);
    color: var(--adv-bg);
}

.btn-adv--gold {
    background: var(--adv-gold);
    color: var(--adv-dark);
}

.btn-adv--amber {
    background: var(--adv-amber);
    color: white;
}

.btn-adv--outline {
    background: transparent;
    color: var(--adv-dark);
    border: 2px solid var(--adv-dark);
}

.btn-adv--sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-adv--full { width: 100%; }

/* ── Barre de progression ─────────────────────────────────────────────── */
.adv-progress {
    background: rgba(44,24,16,0.1);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.adv-progress__bar {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--adv-amber), var(--adv-gold));
    transition: width 0.6s ease;
}

/* ── Badge de progression ─────────────────────────────────────────────── */
.adv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--adv-bg-card);
    border: 2px solid var(--adv-gold);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--adv-dark);
}

/* ── Liste d'énigmes (parcours) ───────────────────────────────────────── */
.adv-quest-list { list-style: none; }

.adv-quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--adv-bg-card);
    border-radius: var(--adv-radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--adv-dark);
    transition: background 0.2s;
}

.adv-quest-item:hover { background: #E5CEAA; color: var(--adv-dark); }

.adv-quest-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.adv-quest-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--adv-dark);
    color: var(--adv-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    flex-shrink: 0;
}

.adv-quest-num.solved {
    background: var(--adv-green);
}

.adv-quest-name { flex: 1; font-weight: 600; }

.adv-quest-icon { font-size: 1.2rem; }

/* ── Stats bar (profil) ───────────────────────────────────────────────── */
.adv-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(44,24,16,0.15);
    border-radius: var(--adv-radius-sm);
    overflow: hidden;
}

.adv-stat {
    background: var(--adv-bg-card);
    padding: 14px 10px;
    text-align: center;
}

.adv-stat__value {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--adv-dark);
}

.adv-stat__label {
    font-size: 0.72rem;
    color: var(--adv-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* ── Avatar ───────────────────────────────────────────────────────────── */
.adv-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--adv-bg-card);
    border: 3px solid var(--adv-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    overflow: hidden;
}

.adv-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Badges jeu (récompenses) ─────────────────────────────────────────── */
.adv-reward-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.adv-reward {
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--adv-bg-card);
    border: 2px solid var(--adv-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}

.adv-reward.locked {
    border-color: var(--adv-muted);
    opacity: 0.4;
    filter: grayscale(1);
}

/* ── Classement ───────────────────────────────────────────────────────── */
.adv-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 20px;
}

.adv-podium__player {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.adv-podium__rank {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    margin-bottom: 6px;
}

.rank-1 { background: var(--adv-gold);  width: 70px; height: 70px; font-size: 2.2rem; }
.rank-2 { background: #9EA7B3; }
.rank-3 { background: #C67C3C; }

.adv-podium__name { font-size: 0.75rem; font-weight: 700; color: var(--adv-dark); }
.adv-podium__pts  { font-size: 0.7rem;  color: var(--adv-muted); }

.adv-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--adv-bg-card);
    border-radius: var(--adv-radius-sm);
    margin-bottom: 6px;
}

.adv-leaderboard-row.me {
    background: rgba(212,160,23,0.2);
    border: 1px solid var(--adv-gold);
}

.adv-rank-num {
    width: 28px;
    font-weight: 700;
    color: var(--adv-muted);
    text-align: center;
    flex-shrink: 0;
}

.adv-player-name { flex: 1; font-weight: 600; }
.adv-player-pts  { font-weight: 700; color: var(--adv-amber); }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.adv-tabs {
    display: flex;
    background: var(--adv-bg-card);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 20px;
}

.adv-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 26px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    color: var(--adv-muted);
}

.adv-tab.active {
    background: var(--adv-dark);
    color: var(--adv-bg);
}

/* ── Carte parcours (SVG map) ─────────────────────────────────────────── */
.adv-map-container {
    position: relative;
    background: var(--adv-bg-card);
    border-radius: var(--adv-radius);
    overflow: hidden;
    min-height: 400px;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212,160,23,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(198,124,60,0.05) 0%, transparent 50%);
}

.adv-map-path {
    position: relative;
    padding: 24px;
}

.adv-map-stop {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    position: relative;
}

.adv-map-stop::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 40px;
    width: 2px;
    height: calc(100% + 8px);
    background: var(--adv-muted);
    opacity: 0.3;
    z-index: 0;
}

.adv-map-stop:last-child::before { display: none; }

.adv-map-dot {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--adv-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.adv-map-dot.solved { background: var(--adv-green); }
.adv-map-dot.current { background: var(--adv-amber); }
.adv-map-dot.locked  { background: var(--adv-bg-card); border: 2px solid var(--adv-muted); }

.adv-map-info { flex: 1; }
.adv-map-title { font-weight: 700; font-size: 0.95rem; }
.adv-map-subtitle { font-size: 0.78rem; color: var(--adv-muted); }

/* ── Formulaires ──────────────────────────────────────────────────────── */
.adv-form-group { margin-bottom: 16px; }

.adv-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--adv-muted);
    margin-bottom: 6px;
}

.adv-input, .adv-textarea, .adv-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(44,24,16,0.15);
    border-radius: var(--adv-radius-sm);
    background: var(--adv-bg-input);
    color: var(--adv-dark);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}

.adv-input:focus, .adv-textarea:focus, .adv-select:focus {
    border-color: var(--adv-amber);
    background: white;
}

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

.adv-textarea {
    resize: vertical;
    min-height: 90px;
}

.adv-error {
    font-size: 0.8rem;
    color: var(--adv-red);
    margin-top: 4px;
}

/* ── Vidéo player ─────────────────────────────────────────────────────── */
.adv-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--adv-radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.adv-video-container iframe,
.adv-video-container video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Alerte / Info box ────────────────────────────────────────────────── */
.adv-alert {
    padding: 14px 16px;
    border-radius: var(--adv-radius-sm);
    font-size: 0.9rem;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.adv-alert--info    { background: rgba(212,160,23,0.15); border-left: 4px solid var(--adv-gold); }
.adv-alert--success { background: rgba(90,158,80,0.15);  border-left: 4px solid var(--adv-green); }
.adv-alert--error   { background: rgba(192,57,43,0.15);  border-left: 4px solid var(--adv-red); }
.adv-alert--pending { background: rgba(139,110,90,0.1);  border-left: 4px solid var(--adv-muted); }

/* ── Navigation bottom (mobile) ───────────────────────────────────────── */
.adv-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--adv-bg-card);
    border-top: 2px solid rgba(44,24,16,0.12);
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 0 -4px 16px var(--adv-shadow);
}

.adv-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--adv-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 4px;
    transition: color 0.2s;
    border: none;
    background: none;
    cursor: pointer;
}

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

.adv-nav-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.adv-nav-item.active .adv-nav-icon {
    filter: drop-shadow(0 0 3px rgba(212,160,23,0.6));
}

/* ── Section header ───────────────────────────────────────────────────── */
.adv-section {
    padding: 20px 20px 0;
}

.adv-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--adv-muted);
    margin-bottom: 10px;
}

/* ── Greeting banner ──────────────────────────────────────────────────── */
.adv-greeting {
    padding: 20px 20px 14px;
}

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

.adv-greeting__name {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--adv-dark);
}

/* ── Hint / indice ────────────────────────────────────────────────────── */
.adv-hint-box {
    background: rgba(198,124,60,0.1);
    border: 2px dashed var(--adv-amber);
    border-radius: var(--adv-radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.adv-hint-box:hover { background: rgba(198,124,60,0.18); }

.adv-hint-icon { font-size: 1.5rem; }

.adv-hint-text strong { display: block; font-weight: 700; font-size: 0.9rem; }
.adv-hint-text small  { color: var(--adv-muted); font-size: 0.78rem; }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.adv-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    padding-bottom: 40px;
    background: var(--adv-bg);
}

.adv-auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.adv-auth-logo__title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--adv-dark);
    letter-spacing: 2px;
    line-height: 1.1;
}

.adv-auth-logo__subtitle {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--adv-amber);
    margin-top: 4px;
}

.adv-auth-box {
    background: var(--adv-bg-card);
    border-radius: var(--adv-radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 20px var(--adv-shadow);
    border: 1px solid rgba(212,160,23,0.2);
}

.adv-auth-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--adv-dark);
    margin-bottom: 20px;
    text-align: center;
}

.adv-auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--adv-muted);
}

.adv-auth-footer a { color: var(--adv-amber); font-weight: 700; text-decoration: none; }
.adv-auth-footer a:hover { text-decoration: underline; }

/* ── Divider ──────────────────────────────────────────────────────────── */
.adv-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--adv-gold), transparent);
    border: none;
    margin: 20px 0;
}

/* ── Responsive (desktop) ─────────────────────────────────────────────── */

/* Bandeau de page — défile avec le contenu (non sticky pour éviter
   les artefacts d'empilement avec le header principal et la carte) */
.adv-page-header {
    background: var(--adv-bg-card);
    border-bottom: 2px solid var(--adv-gold);
    padding: 16px 20px;
}

/* Conteneur centré pour le contenu des page-headers pleine largeur */
.adv-page-header-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

@media (min-width: 768px) {
    .page-content { max-width: 100%; }
    .adv-section  { max-width: 720px; margin-left: auto; margin-right: auto; }
    .adv-greeting { max-width: 720px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 1024px) {
    .adv-section  { max-width: 860px; }
    .adv-greeting { max-width: 860px; }
}
