/* =============================================================
   MEJOR HOMBRE — Design System (Dark + Gold)
   Mockups de validación. Sin emojis, todo SVG.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
    /* Fondos y superficies */
    --bg:            #08090B;
    --bg-radial:     #0E1013;
    --surface:       #121317;
    --surface-2:     #17191E;
    --surface-3:     #1E2127;
    --hairline:      rgba(255,255,255,0.07);
    --hairline-2:    rgba(255,255,255,0.12);

    /* Dorado (marca) */
    --gold:          #D4A853;
    --gold-bright:   #E8CA8A;
    --gold-deep:     #A87E32;
    --gold-soft:     rgba(212,168,83,0.14);
    --gold-glow:     rgba(212,168,83,0.28);

    /* Texto */
    --text:          #F4F3EF;
    --text-2:        #9DA0A8;
    --text-3:        #63666E;
    --text-on-gold:  #17130A;

    /* Semánticos */
    --success:       #6FB58A;
    --danger:        #D9695F;

    /* Radios y sombras — punto medio: con carácter pero sin caer en "app de spa".
       El pill queda solo para badges/nav/CTA. */
    --r-sm: 9px; --r: 13px; --r-lg: 18px; --r-xl: 24px; --r-full: 999px;
    --shadow: 0 18px 50px rgba(0,0,0,0.55);
    --shadow-gold: 0 12px 34px rgba(212,168,83,0.18);

    --font: 'Inter', -apple-system, system-ui, sans-serif;
    --font-display: 'Space Grotesk', var(--font);
    --font-read: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(120% 80% at 50% -10%, var(--bg-radial) 0%, var(--bg) 55%) fixed;
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}

/* Contenedor tipo pantalla de app (para páginas individuales) */
.screen {
    max-width: 440px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 92px;
}

/* ---------- Tipografía ---------- */
.eyebrow {
    font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--gold); font-weight: 600;
}
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.muted { color: var(--text-2); }
.tiny { font-size: 12.5px; color: var(--text-3); }

/* ---------- Iconos ---------- */
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 30px; height: 30px; }

/* ---------- Header de app ---------- */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 20px 14px;
}
.app-header .brand { display: flex; flex-direction: column; gap: 3px; }
.app-header .brand .rank { font-size: 12px; color: var(--text-2); }
.app-header h1 { font-size: 22px; }

.pill-flame {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--gold-soft); color: var(--gold-bright);
    border: 1px solid rgba(212,168,83,0.25);
    padding: 8px 13px; border-radius: var(--r-full);
    font-weight: 700; font-family: var(--font-display); font-size: 15px;
}

/* ---------- Barra de XP / Rango ---------- */
.xp-block { padding: 0 20px 6px; }
.xp-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.xp-row .rank-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.xp-row .rank-name b { color: var(--gold); }
.xp-row .xp-count { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.xp-track { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.xp-fill {
    height: 100%; border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright));
    box-shadow: 0 0 16px var(--gold-glow);
}

/* ---------- Sección ---------- */
.section-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 20px 10px;
}
.section-label span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.section-label .count { color: var(--gold); }

/* ---------- Cards de pilares (checklist) ---------- */
.pillars { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.pillar {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 16px 16px;
    position: relative; overflow: hidden;
    transition: transform .12s ease, border-color .2s ease;
}
.pillar:active { transform: scale(.99); }
.pillar .p-ico {
    width: 46px; height: 46px; flex: none; border-radius: 13px;
    display: grid; place-items: center;
    background: var(--surface-3); color: var(--text);
    border: 1px solid var(--hairline);
}
.pillar .p-body { flex: 1; min-width: 0; }
.pillar .p-title { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.pillar .p-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.pillar .p-xp { font-size: 12px; color: var(--gold); font-weight: 600; font-family: var(--font-display); }

/* estado completado — el ícono dorado ya comunica "hecho";
   sin borde lateral (evitamos el look gamer/f2p). */
.pillar.done { border-color: var(--hairline); background: var(--surface); }
.pillar.done .p-ico { background: var(--gold-soft); color: var(--gold-bright); border-color: rgba(212,168,83,0.3); }
.pillar.done .p-title { color: var(--text-2); }
.pillar.done .p-title { color: var(--text); }

/* control derecho */
.p-action { flex: none; }
.check {
    width: 30px; height: 30px; border-radius: var(--r-full);
    display: grid; place-items: center;
    border: 2px solid var(--hairline-2); color: transparent;
}
.check.on { background: var(--gold); border-color: var(--gold); color: var(--text-on-gold); box-shadow: 0 0 14px var(--gold-glow); }
.btn-ghost {
    border: 1px solid var(--hairline-2); background: transparent; color: var(--text);
    padding: 9px 15px; border-radius: var(--r-full); font-size: 13.5px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
}
.btn-ghost .icon-sm { color: var(--gold); }

/* ---------- Chips (pilares secundarios) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 20px 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--hairline);
    padding: 10px 14px; border-radius: var(--r-full);
    font-size: 13.5px; color: var(--text-2); font-weight: 500; cursor: pointer;
    transition: all .15s ease;
}
.chip .icon-sm { color: var(--text-3); }
.chip.on { color: var(--gold-bright); border-color: rgba(212,168,83,0.4); background: var(--gold-soft); }
.chip.on .icon-sm { color: var(--gold); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: var(--font); font-weight: 700; font-size: 16px;
    padding: 16px 22px; border-radius: var(--r-full); border: none; cursor: pointer;
    width: 100%;
}
.btn-gold {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--text-on-gold); box-shadow: var(--shadow-gold);
}
.btn-gold:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--hairline-2); }
.btn-block { width: 100%; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px;
    width: min(408px, calc(100% - 32px));
    display: flex; justify-content: space-around; align-items: center;
    background: rgba(20,21,25,0.85); backdrop-filter: blur(18px);
    border: 1px solid var(--hairline); border-radius: var(--r-full);
    padding: 10px 8px; box-shadow: var(--shadow);
    z-index: 40;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 600; padding: 4px 14px; text-decoration: none; }
.nav-item.on { color: var(--gold); }
body.mh-immersive .bottom-nav { display: none; }
body.mh-immersive .screen { padding-bottom: 0; }

/* Cuando está embebido en un iframe de device, el nav absoluto queda dentro */
.device .screen { min-height: 812px; }

/* ---------- Bottom sheet reutilizable ---------- */
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 18px; }
.bsheet-scrim {
    position: fixed; inset: 0; z-index: 60;
    background: linear-gradient(0deg, rgba(8,9,11,0.94) 25%, rgba(8,9,11,0.5));
    display: flex; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.bsheet-scrim.open { opacity: 1; pointer-events: auto; }
.bsheet {
    width: 100%; max-width: 440px; margin: 0 auto; background: var(--surface);
    border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl);
    border-top: 1px solid var(--hairline-2); padding: 12px 20px 30px; box-shadow: var(--shadow);
    transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
}
.bsheet-scrim.open .bsheet { transform: none; }
.bsheet h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.bsheet .bs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.bsheet .bs-date { color: var(--text-3); font-size: 12.5px; }

/* Lista de pilares dentro del sheet (día del calendario) */
.day-list { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.day-item { display: flex; align-items: center; gap: 13px; padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
.day-item:last-child { border-bottom: none; }
.day-item .di-ico { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
    background: var(--surface-3); color: var(--text-2); border: 1px solid var(--hairline); }
.day-item.done .di-ico { background: var(--gold-soft); color: var(--gold-bright); border-color: rgba(212,168,83,0.3); }
.day-item .di-name { flex: 1; font-size: 14.5px; font-weight: 500; }
.day-item.miss .di-name { color: var(--text-3); }
.day-item .di-state { width: 24px; height: 24px; border-radius: var(--r-full); display: grid; place-items: center; flex: none; }
.day-item.done .di-state { background: var(--gold); color: var(--text-on-gold); }
.day-item.miss .di-state { border: 1.5px solid var(--hairline-2); color: var(--text-3); }

/* ---------- Tabs (segmented) ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; margin: 6px 20px 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); }
.tab { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.tab.on { background: var(--surface-3); color: var(--gold-bright); }
.tab-panel { display: none; } .tab-panel.on { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Logros ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 20px 0; }
.ach { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 16px 8px; text-align: center; }
.ach .ab { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center;
    background: var(--surface-3); color: var(--text-3); border: 1px solid var(--hairline); }
.ach.on .ab { background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); color: var(--text-on-gold); box-shadow: var(--shadow-gold); }
.ach .an { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.2; }
.ach.on .an { color: var(--text); }
.ach .ad { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.ach.locked { opacity: .55; }

/* ---------- Filas de ajustes (Perfil) ---------- */
.settings { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px; }
.set-group { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.set-row:last-child { border-bottom: none; }
.set-row .s-ico { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--hairline); }
.set-row .s-body { flex: 1; min-width: 0; }
.set-row .s-title { font-size: 14.5px; font-weight: 500; }
.set-row .s-val { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.set-row .s-val b { color: var(--gold); font-weight: 600; }
.set-row .chev { color: var(--text-3); }
.set-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 20px 20px 8px; }

/* Segmented inline (tipo de meditación) */
.seg { display: flex; gap: 6px; background: var(--surface-3); border-radius: 10px; padding: 4px; }
.seg .opt-seg { flex: 1; text-align: center; padding: 9px 6px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg .opt-seg.on { background: var(--gold); color: var(--text-on-gold); }

/* Toggle switch */
.switch { width: 44px; height: 26px; border-radius: var(--r-full); background: var(--surface-3); border: 1px solid var(--hairline-2); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: var(--r-full); background: var(--text-2); transition: transform .2s, background .2s; }
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on::after { transform: translateX(18px); background: var(--text-on-gold); }

/* ---------- Utilidades ---------- */
.stack { display: flex; flex-direction: column; }
.grow { flex: 1; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.p-20 { padding: 20px; }
