/*
Theme Name: ECHOTHEME
Description: Thème façade du jeu ÉCHO — la carte est la home, le plugin ÉCHO pilote tout. Clair/sombre, mobile-first (nav bas app-like, safe-areas, PWA).
Version: 0.4.1
Author: Mica
License: GPL-2.0+
Text Domain: echotheme
*/

/* ---- Variables de thème (sombre = défaut, clair via html[data-theme="light"]) ---- */
:root {
    --bg: #0b0e1a;
    --panel: #141a2e;
    --panel2: #1c2540;
    --ink: #e8ecf8;
    --muted: #8b95b5;
    --line: #26304f;
    --accent: #d946ef;
    --card: #0f1424;
}
html[data-theme="light"] {
    --bg: #eef2fb;
    --panel: #ffffff;
    --panel2: #f4f7ff;
    --ink: #1b2440;
    --muted: #6b7596;
    --line: #dbe2f2;
    --accent: #7c3aed;
    --card: #ffffff;
}

* { box-sizing: border-box; }
/* Plein écran : on neutralise la marge que la barre d'admin WP injecte parfois */
html { margin-top: 0 !important; }
* html body { margin-top: 0 !important; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    transition: background .2s, color .2s;
}
a { color: var(--accent); text-decoration: none; }

/* ---- Header app (style protos : néon, zone joueur à droite) ---- */
.echo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 35%, transparent);
}
.echo-header .logo {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .22em;
    background: linear-gradient(90deg, var(--accent), #7af0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.echo-header .logo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
.echo-header .grow { flex: 1; }
.echo-header .hchip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
}
.echo-header .hchip:hover { border-color: var(--accent); }
.echo-header .hbadges { color: #f5b73d; border-color: color-mix(in srgb, #f5b73d 45%, var(--line)); font-weight: 700; }
.echo-header .hbadges b { color: var(--ink); }
.echo-header .huser {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px 2px 2px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    color: var(--ink);
}
.echo-header .huser:hover { border-color: var(--accent); }
.echo-header .hpseudo { font-size: 13px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.echo-avatar {
    border-radius: 50%;
    display: inline-block;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--accent), 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.echo-avatar-ini {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
}
@media (max-width: 560px) {
    .echo-header .hpseudo { display: none; } /* avatar seul sur petit écran */
    .echo-header .hgear { display: none; }   /* l'avatar mène déjà aux paramètres */
}

/* ---- Contenu page standard ---- */
.echo-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 16px 60px;
}
.echo-content h1 { font-size: 22px; letter-spacing: .04em; }

/* ============================================================
   MOBILE-FIRST — confort tactile (règle projet : toujours penser
   smartphone + future app). Cibles ≥ 44px, nav bas app-like,
   safe-areas (encoches iOS/Android), pas d'interaction hover-only.
   ============================================================ */

/* Nav basse MAP · DÉFIS · MON MUR — app-like, TOUJOURS visible (cf. maquettes) */
.echo-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: center;
    gap: 4px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -1px 0 color-mix(in srgb, var(--accent) 25%, transparent);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.echo-bottomnav a {
    flex: 1;
    max-width: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 48px;
    justify-content: center;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    border-radius: 12px;
}
.echo-bottomnav a.on,
.echo-bottomnav a:active {
    color: var(--accent);
    background: var(--panel2);
    text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.echo-content { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
